From 8a3883e8321c4dcbd03e857ea2134438a882d990 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Thu, 27 Oct 2022 16:43:54 -0700 Subject: [PATCH 001/240] [Internal] Client Telemetry: Fixes tests leaking environment variables (#3517) * Adding log lines * More logs * Debugging further * Removing other builds * And more debugging * Wrong build parameters * Wrong category * Removing noise * Fixing test * Adding utils * Adding test with client telemetry enabled * Fixing leak in Client Telemetry Tests * Reenabling test * cpu monitor initialization * Adding name details * Undo another file --- .../ClientTelemetryTests.cs | 27 ++++----- .../PartitionKeyRangeCacheTests.cs | 14 ++++- .../SynchronizationContextTests.cs | 22 ++++++-- .../Utils/Util.cs | 56 +++++++++++++++++++ 4 files changed, 97 insertions(+), 22 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs index 93e0cd8837..961c5d25d1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs @@ -30,7 +30,6 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests [TestClass] public class ClientTelemetryTests : BaseCosmosClientHelper { - private const string telemetryEndpointUrl = "http://dummy.telemetry.endpoint/"; private const int scheduledInSeconds = 1; private static readonly object jsonObject = JsonConvert.DeserializeObject("{\"compute\":{\"azEnvironment\":\"AzurePublicCloud\",\"customData\":\"\",\"isHostCompatibilityLayerVm\":\"false\",\"licenseType\":\"\",\"location\":\"eastus\",\"name\":\"sourabh-testing\",\"offer\":\"UbuntuServer\",\"osProfile\":{\"adminUsername\":\"azureuser\",\"computerName\":\"sourabh-testing\"},\"osType\":\"Linux\",\"placementGroupId\":\"\",\"plan\":{\"name\":\"\",\"product\":\"\",\"publisher\":\"\"},\"platformFaultDomain\":\"0\",\"platformUpdateDomain\":\"0\",\"provider\":\"Microsoft.Compute\",\"publicKeys\":[{\"keyData\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC5uCeOAm3ehmhI+2PbMoMl17Eo\r\nqfHKCycSaBJsv9qxlmBOuFheSJc1XknJleXUSsuTO016/d1PyWpevnqOZNRksWoa\r\nJvQ23sDTxcK+X2OP3QlCUeX4cMjPXqlL8z1UYzU4Bx3fFvf8fs67G3N72sxWBw5P\r\nZyuXyhBm0NCe/2NYMKgEDT4ma8XszO0ikbhoPKbMbgHAQk/ktWQHNcqYOPQKEWqp\r\nEK1R0rjS2nmtovfScP/ZGXcvOpJ1/NDBo4dh1K+OxOGM/4PSH/F448J5Zy4eAyEk\r\nscys+IpeIOTOlRUy/703SNIX0LEWlnYqbyL9c1ypcYLQqF76fKkDfzzFI/OWVlGw\r\nhj/S9uP8iMsR+fhGIbn6MAa7O4DWPWLuedSp7KDYyjY09gqNJsfuaAJN4LiC6bPy\r\nhknm0PVLK3ux7EUOt+cZrHCdIFWbdOtxiPNIl1tkv9kV5aE5Aj2gJm4MeB9uXYhS\r\nOuksboBc0wyUGrl9+XZJ1+NlZOf7IjVi86CieK8= generated-by-azure\r\n\",\"path\":\"/home/azureuser/.ssh/authorized_keys\"}],\"publisher\":\"Canonical\",\"resourceGroupName\":\"sourabh-telemetry-sdk\",\"resourceId\":\"/subscriptions/8fba6d4f-7c37-4d13-9063-fd58ad2b86e2/resourceGroups/sourabh-telemetry-sdk/providers/Microsoft.Compute/virtualMachines/sourabh-testing\",\"securityProfile\":{\"secureBootEnabled\":\"false\",\"virtualTpmEnabled\":\"false\"},\"sku\":\"18.04-LTS\",\"storageProfile\":{\"dataDisks\":[],\"imageReference\":{\"id\":\"\",\"offer\":\"UbuntuServer\",\"publisher\":\"Canonical\",\"sku\":\"18.04-LTS\",\"version\":\"latest\"},\"osDisk\":{\"caching\":\"ReadWrite\",\"createOption\":\"FromImage\",\"diffDiskSettings\":{\"option\":\"\"},\"diskSizeGB\":\"30\",\"encryptionSettings\":{\"enabled\":\"false\"},\"image\":{\"uri\":\"\"},\"managedDisk\":{\"id\":\"/subscriptions/8fba6d4f-7c37-4d13-9063-fd58ad2b86e2/resourceGroups/sourabh-telemetry-sdk/providers/Microsoft.Compute/disks/sourabh-testing_OsDisk_1_9a54abfc5ba149c6a106bd9e5b558c2a\",\"storageAccountType\":\"Premium_LRS\"},\"name\":\"sourabh-testing_OsDisk_1_9a54abfc5ba149c6a106bd9e5b558c2a\",\"osType\":\"Linux\",\"vhd\":{\"uri\":\"\"},\"writeAcceleratorEnabled\":\"false\"}},\"subscriptionId\":\"8fba6d4f-7c37-4d13-9063-fd58ad2b86e2\",\"tags\":\"azsecpack:nonprod;platformsettings.host_environment.service.platform_optedin_for_rootcerts:true\",\"tagsList\":[{\"name\":\"azsecpack\",\"value\":\"nonprod\"},{\"name\":\"platformsettings.host_environment.service.platform_optedin_for_rootcerts\",\"value\":\"true\"}],\"version\":\"18.04.202103250\",\"vmId\":\"d0cb93eb-214b-4c2b-bd3d-cc93e90d9efd\",\"vmScaleSetName\":\"\",\"vmSize\":\"Standard_D2s_v3\",\"zone\":\"1\"},\"network\":{\"interface\":[{\"ipv4\":{\"ipAddress\":[{\"privateIpAddress\":\"10.0.7.5\",\"publicIpAddress\":\"\"}],\"subnet\":[{\"address\":\"10.0.7.0\",\"prefix\":\"24\"}]},\"ipv6\":{\"ipAddress\":[]},\"macAddress\":\"000D3A8F8BA0\"}]}}"); @@ -46,12 +45,8 @@ public class ClientTelemetryTests : BaseCosmosClientHelper private HttpClientHandlerHelper httpHandlerForNonAzureInstance; [ClassInitialize] - public static void ClassInitialize(TestContext context) + public static void ClassInitialize(TestContext _) { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, "true"); - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, "1"); - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, telemetryEndpointUrl); - SystemUsageMonitor oldSystemUsageMonitor = (SystemUsageMonitor)typeof(DiagnosticsHandlerHelper) .GetField("systemUsageMonitor", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(DiagnosticsHandlerHelper.Instance); oldSystemUsageMonitor.Stop(); @@ -62,6 +57,8 @@ public static void ClassInitialize(TestContext context) [TestInitialize] public void TestInitialize() { + Util.EnableClientTelemetryEnvironmentVariables(); + this.actualInfo = new List(); this.httpHandler = new HttpClientHandlerHelper @@ -134,16 +131,6 @@ public void TestInitialize() .WithApplicationPreferredRegions(this.preferredRegionList); } - [ClassCleanup] - public static void FinalCleanup() - { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, null); - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, null); - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, null); - - ClientTelemetryTests.ResetSystemUsageMonitor(false); - } - private static void ResetSystemUsageMonitor(bool isTelemetryEnabled) { ClientTelemetryTests.systemUsageMonitor?.Stop(); @@ -186,6 +173,14 @@ public async Task Cleanup() azMetadataField.SetValue(null, null); await base.TestCleanup(); + + Util.DisableClientTelemetryEnvironmentVariables(); + } + + [ClassCleanup] + public static void FinalCleanup() + { + ClientTelemetryTests.ResetSystemUsageMonitor(false); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/PartitionKeyRangeCacheTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/PartitionKeyRangeCacheTests.cs index 504f06467f..1b7d554772 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/PartitionKeyRangeCacheTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/PartitionKeyRangeCacheTests.cs @@ -19,11 +19,21 @@ public class PartitionKeyRangeCacheTests { private bool loopBackgroundOperaitons = false; - [TestMethod] - public async Task VerifyPkRangeCacheRefreshOnSplitWithErrorsAsync() + [TestInitialize] + public void TestInitialize() + { + this.loopBackgroundOperaitons = false; + } + + [TestCleanup] + public void TestCleanup() { this.loopBackgroundOperaitons = false; + } + [TestMethod] + public async Task VerifyPkRangeCacheRefreshOnSplitWithErrorsAsync() + { int throwOnPkRefreshCount = 3; int pkRangeCalls = 0; bool causeSplitExceptionInRntbdCall = false; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SynchronizationContextTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SynchronizationContextTests.cs index 7721c41e7b..a8ae6ce1a4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SynchronizationContextTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SynchronizationContextTests.cs @@ -13,10 +13,17 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests [TestClass] public class SynchronizationContextTests { - [TestMethod] + [DataTestMethod] + [DataRow(false, DisplayName = "SynchronizationContextTests - Client Telemetry disabled")] + [DataRow(true, DisplayName = "SynchronizationContextTests - Client Telemetry enabled")] [Timeout(30000)] - public void VerifySynchronizationContextDoesNotLock() + public void VerifySynchronizationContextDoesNotLock(bool withClientTelemetry) { + if (withClientTelemetry) + { + Util.EnableClientTelemetryEnvironmentVariables(); + } + string databaseId = Guid.NewGuid().ToString(); SynchronizationContext prevContext = SynchronizationContext.Current; try @@ -29,7 +36,6 @@ public void VerifySynchronizationContextDoesNotLock() { Cosmos.Database database = client.CreateDatabaseAsync(databaseId).GetAwaiter().GetResult(); database = client.CreateDatabaseIfNotExistsAsync(databaseId).GetAwaiter().GetResult(); - database.ReadStreamAsync().ConfigureAwait(false).GetAwaiter().GetResult(); database.ReadAsync().ConfigureAwait(false).GetAwaiter().GetResult(); @@ -118,7 +124,7 @@ public void VerifySynchronizationContextDoesNotLock() double cost = container.GetItemLinqQueryable( allowSynchronousQueryExecution: true).Select(x => x.cost).Sum(); - + ItemResponse deleteResponse = container.DeleteItemAsync(partitionKey: new Cosmos.PartitionKey(testItem.pk), id: testItem.id).ConfigureAwait(false).GetAwaiter().GetResult(); Assert.IsNotNull(deleteResponse); } @@ -127,13 +133,21 @@ public void VerifySynchronizationContextDoesNotLock() finally { SynchronizationContext.SetSynchronizationContext(prevContext); + using (CosmosClient client = TestCommon.CreateCosmosClient()) { client.GetDatabase(databaseId).DeleteAsync().GetAwaiter().GetResult(); } + + if (withClientTelemetry) + { + Util.DisableClientTelemetryEnvironmentVariables(); + } } } + + public class TestSynchronizationContext : SynchronizationContext { private object locker = new object(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs index b17a575223..4533b2b562 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs @@ -5,11 +5,15 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests { using System; using System.Collections.Generic; + using System.Diagnostics; using System.Globalization; + using System.IO; using System.Linq; using System.Net; + using System.Text; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Services.Management.Tests; + using Microsoft.Azure.Cosmos.Telemetry; using Microsoft.Azure.Documents; using Microsoft.Azure.Documents.Client; using Microsoft.Azure.Documents.Collections; @@ -514,5 +518,57 @@ internal static void LogRequestOptions(RequestOptions options, bool shouldLogOff options.OfferType, options.OfferThroughput); } + + internal static void EnableClientTelemetryEnvironmentVariables() + { + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, "true"); + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, "1"); + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, "http://dummy.telemetry.endpoint/"); + } + + internal static void DisableClientTelemetryEnvironmentVariables() + { + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, null); + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, null); + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, null); + } + + /// + /// Enables traces for local debugging + /// + internal static void EnableTracesForDebugging() + { + Type defaultTrace = Type.GetType("Microsoft.Azure.Cosmos.Core.Trace.DefaultTrace,Microsoft.Azure.Cosmos.Direct"); + TraceSource traceSource = (TraceSource)defaultTrace.GetProperty("TraceSource").GetValue(null); + traceSource.Switch.Level = SourceLevels.All; + traceSource.Listeners.Clear(); + traceSource.Listeners.Add(new DirectToConsoleTraceListener()); + } + + public class DirectToConsoleTraceListener : TextWriterTraceListener + { + public DirectToConsoleTraceListener() : base(new DirectToConsoleTextWriter()) + { + } + + public override void Close() + { + } + } + + public class DirectToConsoleTextWriter : TextWriter + { + public override Encoding Encoding => Console.Out.Encoding; + + public override void Write(string value) + { + Logger.LogLine(value); + } + + public override void WriteLine(string value) + { + Logger.LogLine(value); + } + } } } From 543294cd7e49c9322661422ea602bc911c434972 Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Sat, 29 Oct 2022 14:08:48 -0700 Subject: [PATCH 002/240] Updated change log and bumped up the version. (#3526) --- Directory.Build.props | 6 +- .../contracts/API_3.31.1-preview.txt | 1526 +++++++++++++++++ .../contracts/API_3.31.1.txt | 1476 ++++++++++++++++ changelog.md | 6 + 4 files changed, 3011 insertions(+), 3 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.31.1-preview.txt create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.31.1.txt diff --git a/Directory.Build.props b/Directory.Build.props index a8ce493c15..d95c118656 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,10 +1,10 @@ - 3.31.0 - 3.31.0 + 3.31.1 + 3.31.1 preview - 3.29.2 + 3.29.4 2.0.0 2.0.0 preview diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.31.1-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.31.1-preview.txt new file mode 100644 index 0000000000..e299887d03 --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.31.1-preview.txt @@ -0,0 +1,1526 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode FullFidelity { get; } + public static ChangeFeedMode Incremental { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsPrimitive(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.31.1.txt b/Microsoft.Azure.Cosmos/contracts/API_3.31.1.txt new file mode 100644 index 0000000000..9227774985 --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.31.1.txt @@ -0,0 +1,1476 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsPrimitive(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/changelog.md b/changelog.md index 4d8bce7541..186c764c81 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,12 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [3.31.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.31.1) - 2022-10-29 +### [3.31.1-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.31.1-preview) - 2022-10-29 + +#### Fixed +- Connection: Fixes health check to identify broken connections earlier. + ### [3.31.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.31.0) - 2022-10-03 ### [3.31.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.31.0-preview) - 2022-10-03 From abf3d93f88894aa495c70fcc7b4ca0c9d55c7e89 Mon Sep 17 00:00:00 2001 From: neildsh <35383880+neildsh@users.noreply.github.com> Date: Mon, 31 Oct 2022 14:12:32 -0700 Subject: [PATCH 003/240] Query: Fixes performance regression on target partition on some ORDER BY queries with continuation (#3525) * Revert performance regression caused by https://github.com/Azure/azure-cosmos-dotnet-v3/pull/1289/ * Remove irrelevant comment * Add a test for validating formatted filters for the target partition --- ...OrderByCrossPartitionQueryPipelineStage.cs | 4 +- ...ByCrossPartitionQueryPipelineStageTests.cs | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs index a660f29d0b..bbd3d7be4e 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs @@ -1027,9 +1027,7 @@ private static (string leftFilter, string targetFilter, string rightFilter) GetF } } - // For the target filter we can make an optimization to just return "true", - // since we already have the backend continuation token to resume with. - return (left.ToString(), TrueFilter, right.ToString()); + return (left.ToString(), target.ToString(), right.ToString()); } private static async Task monadicQueryByPage)>> FilterNextAsync( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/OrderByCrossPartitionQueryPipelineStageTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/OrderByCrossPartitionQueryPipelineStageTests.cs index 448f63f02c..52062c8afb 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/OrderByCrossPartitionQueryPipelineStageTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/OrderByCrossPartitionQueryPipelineStageTests.cs @@ -278,6 +278,63 @@ public void MonadicCreate_MultipleOrderByContinuationToken() } } + [TestMethod] + public async Task TestFormattedFiltersForTargetPartitionWithContinuationTokenAsync() + { + QueryPage emptyPage = new QueryPage( + documents: new List(), + requestCharge: 0, + activityId: string.Empty, + responseLengthInBytes: 0, + cosmosQueryExecutionInfo: default, + disallowContinuationTokenMessage: default, + additionalHeaders: default, + state: default); + + string expectedQuerySpec = "SELECT * FROM c WHERE ( c._ts >= 1665482200 OR IS_STRING(c._ts) OR IS_ARRAY(c._ts) OR IS_OBJECT(c._ts) ) ORDER BY c._ts"; + Mock mockContainer = new Mock(MockBehavior.Strict); + mockContainer + .Setup( + c => c.MonadicQueryAsync( + It.Is(sqlQuerySpec => expectedQuerySpec.Equals(sqlQuerySpec.QueryText)), + It.IsAny>(), + It.IsAny(), + NoOpTrace.Singleton, + default)) + .ReturnsAsync(TryCatch.FromResult(emptyPage)); + + string continuationToken = @"[{""compositeToken"":{""token"":null,""range"":{""min"":""A"",""max"":""B""}},""orderByItems"":[{""item"":1665482200}],""rid"":""64kUAPYyHHk6XgIAAADACQ=="",""skipCount"":1,""filter"":""( c._ts >= 1665482198 OR IS_STRING(c._ts) OR IS_ARRAY(c._ts) OR IS_OBJECT(c._ts) )""}]"; + + IReadOnlyList targetRanges = new List() + { + new FeedRangeEpk(new Range(min: "A", max: "B", isMinInclusive: true, isMaxInclusive: false)), + new FeedRangeEpk(new Range(min: "B", max: "C", isMinInclusive: true, isMaxInclusive: false)) + }; + + TryCatch monadicCreate = OrderByCrossPartitionQueryPipelineStage.MonadicCreate( + documentContainer: mockContainer.Object, + sqlQuerySpec: new SqlQuerySpec("SELECT * FROM c WHERE {documentdb-formattableorderbyquery-filter} ORDER BY c._ts"), + targetRanges: targetRanges, + partitionKey: null, + orderByColumns: new List() + { + new OrderByColumn("c._ts", SortOrder.Ascending) + }, + queryPaginationOptions: new QueryPaginationOptions(pageSizeHint: 1), + maxConcurrency: 0, + cancellationToken: default, + continuationToken: CosmosElement.Parse(continuationToken)); + Assert.IsTrue(monadicCreate.Succeeded); + + IQueryPipelineStage queryPipelineStage = monadicCreate.Result; + for (int i = 0; i < targetRanges.Count; ++i) + { + Assert.IsTrue(await queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton)); + } + + Assert.IsFalse(await queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton)); + } + [TestMethod] public async Task TestDrainFully_StartFromBeginingAsync_NoDocuments() { From 84ef54516b5e14db1c1302b84d69fe325456205e Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Wed, 2 Nov 2022 19:44:30 +0530 Subject: [PATCH 004/240] [Internal] AI Integration: Adds SubStatusCode Information in attributes (#3533) * wip * regenerated baseline * add test * fix test Co-authored-by: Sourabh Jain --- .../CosmosExceptions/CosmosException.cs | 1 + .../OpenTelemetryAttributeKeys.cs | 1 + .../OpenTelemetry/OpenTelemetryAttributes.cs | 5 + .../OpenTelemetryCoreRecorder.cs | 1 + .../OpenTelemetry/OpenTelemetryResponse.cs | 12 +- .../OpenTelemetry/OpenTelemetryResponse{T}.cs | 10 +- ...iterBaselineTests.BatchOperationsAsync.xml | 2 +- ...riterBaselineTests.BulkOperationsAsync.xml | 202 +++++++++--------- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 46 ++-- ...eWriterBaselineTests.MiscellanousAsync.xml | 8 +- ...neTests.PointOperationsExceptionsAsync.xml | 14 +- ...EndTraceWriterBaselineTests.QueryAsync.xml | 56 ++--- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 32 +-- ...TraceWriterBaselineTests.ReadManyAsync.xml | 14 +- ...selineTests.StreamPointOperationsAsync.xml | 8 +- ...aselineTests.TypedPointOperationsAsync.xml | 8 +- .../Tracing/OpenTelemetryListener.cs | 44 +++- 17 files changed, 259 insertions(+), 205 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosException.cs b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosException.cs index d789c97b03..f6544e3545 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosException.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosException.cs @@ -290,6 +290,7 @@ private string ToStringHelper( internal static void RecordOtelAttributes(CosmosException exception, DiagnosticScope scope) { scope.AddAttribute(OpenTelemetryAttributeKeys.StatusCode, exception.StatusCode); + scope.AddAttribute(OpenTelemetryAttributeKeys.SubStatusCode, exception.SubStatusCode); scope.AddAttribute(OpenTelemetryAttributeKeys.RequestCharge, exception.RequestCharge); scope.AddAttribute(OpenTelemetryAttributeKeys.Region, ClientTelemetryHelper.GetContactedRegions(exception.Diagnostics?.GetContactedRegions())); diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs index 2ea3fb1cdc..033a8744b6 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs @@ -29,6 +29,7 @@ internal sealed class OpenTelemetryAttributeKeys public const string RequestContentLength = "db.cosmosdb.request_content_length_bytes"; public const string ResponseContentLength = "db.cosmosdb.response_content_length_bytes"; public const string StatusCode = "db.cosmosdb.status_code"; + public const string SubStatusCode = "db.cosmosdb.sub_status_code"; public const string RequestCharge = "db.cosmosdb.request_charge"; public const string Region = "db.cosmosdb.regions_contacted"; public const string RetryCount = "db.cosmosdb.retry_count"; diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs index 26760f8de4..636ccd5714 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs @@ -70,5 +70,10 @@ internal OpenTelemetryAttributes(RequestMessage requestMessage, string container /// OperationType /// internal string OperationType { get; set; } + + /// + /// SubStatusCode + /// + internal int SubStatusCode { get; set; } } } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs index f825fbf3b7..c70b14a550 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs @@ -82,6 +82,7 @@ public void Record(OpenTelemetryAttributes response) this.scope.AddAttribute(OpenTelemetryAttributeKeys.RequestContentLength, response.RequestContentLength); this.scope.AddAttribute(OpenTelemetryAttributeKeys.ResponseContentLength, response.ResponseContentLength); this.scope.AddAttribute(OpenTelemetryAttributeKeys.StatusCode, response.StatusCode); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.SubStatusCode, response.SubStatusCode); this.scope.AddAttribute(OpenTelemetryAttributeKeys.RequestCharge, response.RequestCharge); this.scope.AddAttribute(OpenTelemetryAttributeKeys.ItemCount, response.ItemCount); this.scope.AddAttribute(OpenTelemetryAttributeKeys.OperationType, response.OperationType); diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs index 6df9b774cc..0547fda4bd 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs @@ -19,7 +19,8 @@ internal OpenTelemetryResponse(TransactionalBatchResponse responseMessage, strin itemCount: responseMessage.Headers?.ItemCount, databaseName: databaseName, containerName: containerName, - requestMessage: null) + requestMessage: null, + subStatusCode: (int)responseMessage.Headers?.SubStatusCode) { } @@ -32,7 +33,8 @@ internal OpenTelemetryResponse(ResponseMessage responseMessage, string container itemCount: responseMessage.Headers?.ItemCount, databaseName: databaseName, containerName: containerName, - requestMessage: responseMessage.RequestMessage) + requestMessage: responseMessage.RequestMessage, + subStatusCode: (int)responseMessage.Headers?.SubStatusCode) { } @@ -44,14 +46,16 @@ private OpenTelemetryResponse( string itemCount, string databaseName, string containerName, - RequestMessage requestMessage) + RequestMessage requestMessage, + int subStatusCode) : base(requestMessage, containerName, databaseName) { this.StatusCode = statusCode; this.RequestCharge = requestCharge; this.ResponseContentLength = responseContentLength ?? OpenTelemetryAttributes.NotAvailable; this.Diagnostics = diagnostics; - this.ItemCount = itemCount ?? OpenTelemetryAttributes.NotAvailable; + this.ItemCount = itemCount ?? OpenTelemetryAttributes.NotAvailable; + this.SubStatusCode = subStatusCode; } private static string GetPayloadSize(ResponseMessage response) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs index 6f0ab85081..68301f4f4e 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs @@ -18,7 +18,8 @@ internal OpenTelemetryResponse(FeedResponse responseMessage, string container itemCount: responseMessage.Headers?.ItemCount, databaseName: databaseName, containerName: containerName, - requestMessage: responseMessage.RequestMessage) + requestMessage: responseMessage.RequestMessage, + subStatusCode: (int)responseMessage.Headers?.SubStatusCode) { } @@ -31,7 +32,8 @@ internal OpenTelemetryResponse(Response responseMessage, string containerName itemCount: responseMessage.Headers?.ItemCount, databaseName: databaseName, containerName: containerName, - requestMessage: responseMessage.RequestMessage) + requestMessage: responseMessage.RequestMessage, + subStatusCode: (int)responseMessage.Headers?.SubStatusCode) { } @@ -43,7 +45,8 @@ private OpenTelemetryResponse( string itemCount, string databaseName, string containerName, - RequestMessage requestMessage) + RequestMessage requestMessage, + int subStatusCode) : base(requestMessage, containerName, databaseName) { this.StatusCode = statusCode; @@ -51,6 +54,7 @@ private OpenTelemetryResponse( this.ResponseContentLength = responseContentLength ?? OpenTelemetryAttributes.NotAvailable; this.Diagnostics = diagnostics; this.ItemCount = itemCount ?? OpenTelemetryAttributes.NotAvailable; + this.SubStatusCode = subStatusCode; } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index 2c5242bbda..f2df88ec68 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -150,7 +150,7 @@ } ] }]]> - Cosmos.ExecuteAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.ExecuteAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index bb65e30393..41d8aca522 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -159,16 +159,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -342,16 +342,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -525,16 +525,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -708,16 +708,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -891,16 +891,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1074,16 +1074,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1257,16 +1257,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1440,16 +1440,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1623,16 +1623,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1806,16 +1806,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2699,7 +2699,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml index 1ca6744db1..0d9f75e0a8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml @@ -1201,11 +1201,11 @@ } ] }]]> - Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1977,11 +1977,11 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2726,11 +2726,11 @@ } ] }]]> - Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3503,11 +3503,11 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3837,9 +3837,9 @@ } ] }]]> - Cosmos.Change Feed Estimator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.ReadAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Change Feed Estimator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.ReadAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml index 8a4cf2f12f..98ac9c485a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml @@ -126,8 +126,8 @@ } ] }]]> - Cosmos.DeleteAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateDatabaseAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.DeleteAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateDatabaseAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -241,8 +241,8 @@ } ] }]]> - Cosmos.DeleteAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateDatabaseAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.DeleteAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateDatabaseAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml index dad3787a12..7fc2fa5639 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml @@ -173,7 +173,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -459,7 +459,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -715,7 +715,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1009,7 +1009,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1379,7 +1379,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1558,9 +1558,9 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml index 8bd3e5f26d..c217c523a3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml @@ -709,10 +709,10 @@ } ] }]]> - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1458,10 +1458,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2180,10 +2180,10 @@ } ] }]]> - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2930,10 +2930,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3759,10 +3759,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -4492,10 +4492,10 @@ } ] }]]> - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -5253,10 +5253,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml index 836e4aa4ab..6d05d3ce0e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml @@ -671,10 +671,10 @@ } ] }]]> - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1382,10 +1382,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2066,10 +2066,10 @@ } ] }]]> - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2778,10 +2778,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml index 7afb14c5e7..20203e0664 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml @@ -681,12 +681,12 @@ } ] }]]> - Cosmos.ReadManyItemsStreamAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.ReadManyItemsStreamAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1396,7 +1396,7 @@ } ] }]]> - Cosmos.ReadManyItemsAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.ReadManyItemsAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml index 371cf51a53..b2d281b020 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml @@ -102,7 +102,7 @@ } ] }]]> - Cosmos.CreateItemStreamAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemStreamAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -204,7 +204,7 @@ } ] }]]> - Cosmos.ReadItemStreamAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.ReadItemStreamAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -314,7 +314,7 @@ } ] }]]> - Cosmos.ReplaceItemStreamAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.ReplaceItemStreamAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -419,7 +419,7 @@ } ] }]]> - Cosmos.DeleteItemStreamAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.DeleteItemStreamAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml index fb4bcb22c0..4e64df5dae 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml @@ -130,7 +130,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -239,7 +239,7 @@ } ] }]]> - Cosmos.ReadItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.ReadItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -363,7 +363,7 @@ } ] }]]> - Cosmos.ReplaceItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.ReplaceItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -474,7 +474,7 @@ } ] }]]> - Cosmos.DeleteItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.DeleteItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/OpenTelemetryListener.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/OpenTelemetryListener.cs index e8e53b6ff1..fd50cd7365 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/OpenTelemetryListener.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/OpenTelemetryListener.cs @@ -136,10 +136,10 @@ private void RecordAttributes(string name, IEnumerable"); + OpenTelemetryListener.AssertData(name, tags); + foreach (KeyValuePair tag in tags) { - this.ValidateData(name, tag); - builder .Append("") .Append(tag.Key) @@ -149,7 +149,45 @@ private void RecordAttributes(string name, IEnumerable tag) + private static void AssertData(string name, IEnumerable> tags) + { + IList allowedAttributes = new List + { + "az.namespace", + "kind", + "db.system", + "db.name", + "db.operation", + "net.peer.name", + "db.cosmosdb.client_id", + "db.cosmosdb.hashed_machine_id", + "db.cosmosdb.user_agent", + "db.cosmosdb.connection_mode", + "db.cosmosdb.operation_type", + "db.cosmosdb.container", + "db.cosmosdb.request_content_length_bytes", + "db.cosmosdb.response_content_length_bytes", + "db.cosmosdb.status_code", + "db.cosmosdb.sub_status_code", + "db.cosmosdb.request_charge", + "db.cosmosdb.regions_contacted", + "db.cosmosdb.retry_count", + "db.cosmosdb.item_count", + "db.cosmosdb.request_diagnostics", + "exception.type", + "exception.message", + "exception.stacktrace" + }; + + foreach (KeyValuePair tag in tags) + { + Assert.IsTrue(allowedAttributes.Contains(tag.Key), $"{tag.Key} is not allowed for {name}"); + + OpenTelemetryListener.AssertDatabaseAndContainerName(name, tag); + } + } + + private static void AssertDatabaseAndContainerName(string name, KeyValuePair tag) { IList exceptionsForContainerAttribute = new List { From 68b980523bd89fa4b298b1589e6d7d5148df3748 Mon Sep 17 00:00:00 2001 From: aavasthy <113193425+aavasthy@users.noreply.github.com> Date: Wed, 2 Nov 2022 13:39:44 -0400 Subject: [PATCH 005/240] Diagnostics: Removes unused properties and reduces size (#3519) * Remove starttime and id from diagnostics string * Remove starttime and id from diagnostics string * Update xml files for trace baseline tests * Update xml files for trace baseline tests * Update xml files for trace baseline tests * Whitespaces update * Changed starttime position based on code review Co-authored-by: Matias Quaranta --- .../Tracing/TraceWriter.TraceJsonWriter.cs | 12 +- ...iterBaselineTests.BatchOperationsAsync.xml | 21 - ...riterBaselineTests.BulkOperationsAsync.xml | 411 -------- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 771 -------------- ...eWriterBaselineTests.MiscellanousAsync.xml | 34 - ...neTests.PointOperationsExceptionsAsync.xml | 210 ---- ...EndTraceWriterBaselineTests.QueryAsync.xml | 993 ------------------ ...TraceWriterBaselineTests.ReadFeedAsync.xml | 556 ---------- ...TraceWriterBaselineTests.ReadManyAsync.xml | 284 ----- ...selineTests.StreamPointOperationsAsync.xml | 52 - ...aselineTests.TypedPointOperationsAsync.xml | 68 -- ...raceWriterBaselineTests.ScenariosAsync.xml | 473 --------- ...TraceWriterBaselineTests.Serialization.xml | 33 - .../TraceWriterBaselineTests.TraceData.xml | 7 - 14 files changed, 5 insertions(+), 3920 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs b/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs index b38c5a948a..a190f2e5e2 100644 --- a/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs @@ -41,16 +41,14 @@ public static void WriteTrace( SummaryDiagnostics summaryDiagnostics = new SummaryDiagnostics(trace); summaryDiagnostics.WriteSummaryDiagnostics(writer); } - writer.WriteFieldName("name"); writer.WriteStringValue(trace.Name); - writer.WriteFieldName("id"); - writer.WriteStringValue(trace.Id.ToString()); - - writer.WriteFieldName("start time"); - writer.WriteStringValue(trace.StartTime.ToString("hh:mm:ss:fff")); - + if (isRootTrace) + { + writer.WriteFieldName("start time"); + writer.WriteStringValue(trace.StartTime.ToString("hh:mm:ss:fff")); + } writer.WriteFieldName("duration in milliseconds"); writer.WriteNumber64Value(trace.Duration.TotalMilliseconds); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index f2df88ec68..49f8d13a83 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -61,7 +61,6 @@ @@ -72,7 +71,6 @@ Date: Wed, 2 Nov 2022 15:24:30 -0700 Subject: [PATCH 006/240] [Internal] docs: Add address caches conceptual flow (#3534) * Rough draft * Some more changes * Adding a new section * Some more refinement * Some changes Lets get the feedback * Some MISC changes --- docs/SdkDesign.md | 68 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/docs/SdkDesign.md b/docs/SdkDesign.md index e1be7d282a..f277661544 100644 --- a/docs/SdkDesign.md +++ b/docs/SdkDesign.md @@ -17,6 +17,74 @@ flowchart LR TransportClient <--> Service[(Cosmos DB Service)] ``` +## Address caches conceptual model + +![image](https://user-images.githubusercontent.com/6880899/199167007-bcc054c3-ecb1-4469-ba7d-eae52362e9cd.png) + + +- CollectionCache: Dictionary +- CollectionRoutingMap: Single collection PartitionKeyRanges map +- PartitionKeyRangeCache: Dictionary +- GlobalPartitionEndpointManager: Per partition override state. Every reqeust will flow throgh + - Today GlobalEndpointManager is at region scope only and doesn't look at the partition + - Ideal abstraction is to fold it into GlobalEndpointManager --> extra hash computation + - Posible to refactor direct code and flow HashedValue down stream (more contract work with direct package) +- AddressResolver: It does use IAddressCache (Above diagram missing it) + + +```mermaid +flowchart LR + subgraph CDB_account + subgraph CDB_Account_Endpoint + CDB_EP[[CosmosDB-Account/Endpoint]] + end + + subgraph CDB_Account_Region1 + CDBR1_GW[[CosmosDB-Account/Gateway/Region1]] + CDBR1_BE[[CosmosDB-Account/Backend/Region1]] + end + subgraph CDB_Account_RegionN + CDBRN_GW[[CosmosDB-Account/Gateway/Region1]] + CDBRN_BE[[CosmosDB-Account/Backend/RegionN]] + end + end + subgraph AddressCaches + GAC1[GatewayAddressCache/R1] + GACN[GatewayAddressCache/RN] + + GAC1 --> |NonBlockingAsyncCache| CDBR1_GW + GAC1 -.-> CDBR1_BE + GACN --> |NonBlockingAsyncCache| CDBRN_GW + GACN -.-> CDBRN_BE + end +``` + +### Sequence of interaction + +```mermaid +sequenceDiagram + GlobalAddressResolver->>GlobalEndpointManager: ResolveServiceEndpoint(DocumentServiceRequest) + GlobalEndpointManager-->>GlobalAddressResolver: URI (ServingRegion) + GlobalAddressResolver->>GlobalAddressResolver: GetEndpointCache(ServingRegion).AddressResolver + + critical RegularAddressResolution(Implicit contract of dsr.RequestContext.ResolvedPartitionKeyRange population) + GlobalAddressResolver->>AddressResolver: ResolveAsync(DocumentServiceRequest) + AddressResolver-->>GlobalAddressResolver: PartitionAddressInformation + end + + critical AnyPerpartitionOverrides + GlobalAddressResolver->>GlobalPartitionEndpointManager: TryAddPartitionLevelLocationOverride(DocumentServiceRequest) + GlobalPartitionEndpointManager-->>GlobalAddressResolver: (bool, DSR.RequestContext.RouteToLocation) + + option YES + GlobalAddressResolver->>GlobalEndpointManager: ResolveServiceEndpoint(DocumentServiceRequest) + GlobalEndpointManager-->>GlobalAddressResolver: URI (ServingRegion) + end + GlobalAddressResolver->>GlobalAddressResolver: GetEndpointCache(ServingRegion) + GlobalAddressResolver->>AddressResolver: ResolveAsync(DocumentServiceRequest) + AddressResolver-->>GlobalAddressResolver: PartitionAddressInformation +``` + ## Handler pipeline The handler pipeline processes the RequestMessage and each handler can choose to augment it in different ways, as shown in our [handler samples](../Microsoft.Azure.Cosmos.Samples/Usage/Handlers/) and also handle certain error conditions and retry, like our own [RetryHandler](../Microsoft.Azure.Cosmos/src/Handler/RetryHandler.cs). The RetryHandler will handle any failures from the [Transport layer](#transport) that should be [handled as regional failovers](#cross-region-retries). From 6762e07ed50757954043c79624f0d3e9a185e9d1 Mon Sep 17 00:00:00 2001 From: neildsh <35383880+neildsh@users.noreply.github.com> Date: Thu, 3 Nov 2022 13:47:15 -0700 Subject: [PATCH 007/240] Release: Adds SDK version and changelog for 3.31.2 (#3546) * Bumped SDK version and changelog * Added contracts file for 3.31.2 --- Directory.Build.props | 4 +- .../contracts/API_3.31.2.txt | 1476 +++++++++++++++++ changelog.md | 6 + 3 files changed, 1484 insertions(+), 2 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.31.2.txt diff --git a/Directory.Build.props b/Directory.Build.props index d95c118656..651e1f89e5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,8 +1,8 @@ - 3.31.1 - 3.31.1 + 3.31.2 + 3.31.2 preview 3.29.4 2.0.0 diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.31.2.txt b/Microsoft.Azure.Cosmos/contracts/API_3.31.2.txt new file mode 100644 index 0000000000..9227774985 --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.31.2.txt @@ -0,0 +1,1476 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsPrimitive(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/changelog.md b/changelog.md index 186c764c81..add5a1de66 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,12 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [3.31.2](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.31.2) - 2022-11-03 +### [3.31.2-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.31.2-preview) - 2022-11-03 + +#### Fixed +- [#3525](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3525) Query: Fixes performance regression on target partition on some ORDER BY queries with continuation + ### [3.31.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.31.1) - 2022-10-29 ### [3.31.1-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.31.1-preview) - 2022-10-29 From ef7339ec793eb9b91ea566cf7f1e12a7ec934c7c Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Fri, 4 Nov 2022 10:52:54 -0700 Subject: [PATCH 008/240] [Internal] Documentation: Removes invalid comment from ReadThroughputAsync (#3516) --- Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs b/Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs index a13f5224a4..a59dcb8be9 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs @@ -124,9 +124,6 @@ public abstract Task DeleteAsync( /// /// The provisioned throughput for this database. /// - /// - /// Null value indicates a database with no throughput provisioned. - /// /// Request Units /// Set throughput on a database /// From 825595a431a641368ea75b0401b56278d99be6fb Mon Sep 17 00:00:00 2001 From: Kiran Kumar Kolli Date: Mon, 7 Nov 2022 10:53:55 -0800 Subject: [PATCH 009/240] [Internal] nugetconfig: Removes specific overrides (#3551) --- Microsoft.Azure.Cosmos.Samples/Usage/NuGet.config | 6 ------ NuGet.config | 6 ------ 2 files changed, 12 deletions(-) delete mode 100644 Microsoft.Azure.Cosmos.Samples/Usage/NuGet.config delete mode 100644 NuGet.config diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/NuGet.config b/Microsoft.Azure.Cosmos.Samples/Usage/NuGet.config deleted file mode 100644 index cbb81b2617..0000000000 --- a/Microsoft.Azure.Cosmos.Samples/Usage/NuGet.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/NuGet.config b/NuGet.config deleted file mode 100644 index cbb81b2617..0000000000 --- a/NuGet.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - From 4746a6fecc19c5b7e7f6ee602b3970298aa68e25 Mon Sep 17 00:00:00 2001 From: Aditya Date: Tue, 8 Nov 2022 18:28:44 -0800 Subject: [PATCH 010/240] Query: Fixes partition range evaluation for spatial queries (#3495) * Initial commit * Update. * Pull/Rebase * Addressed comments. * Build fix --- .../CosmosQueryExecutionContextFactory.cs | 1 + .../QueryClient/ContainerQueryProperties.cs | 5 +- .../Core/QueryClient/CosmosQueryClient.cs | 1 + .../Core/QueryPlan/QueryPartitionProvider.cs | 12 +- .../Query/Core/QueryPlan/QueryPlanHandler.cs | 6 + .../Core/QueryPlan/QueryPlanRetriever.cs | 2 + .../DefaultDocumentQueryExecutionContext.cs | 1 + .../DocumentQueryExecutionContextBase.cs | 2 + .../DocumentQueryExecutionContextFactory.cs | 1 + .../Query/v3Query/CosmosQueryClientCore.cs | 7 +- .../Resource/Container/ContainerCore.Items.cs | 2 + .../Resource/Container/ContainerInternal.cs | 1 + .../src/Routing/PartitionRoutingHelper.cs | 4 +- .../CosmosItemTests.cs | 3 +- .../FeedToken/QueryFeedTokenTests.cs | 3 +- .../Query/PartitioningQueryTests.cs | 85 +++ .../Query/QueryTestsBase.cs | 75 ++- .../Query/SanityQueryTests.cs | 9 +- .../Utils/NonPartitionedContainerHelper.cs | 10 +- .../Query/ParsingBenchmark.cs | 3 +- .../QueryPlanBaselineTests.Spatial.xml | 548 ++++++++++++++++++ .../Microsoft.Azure.Cosmos.Tests.csproj | 3 + ...misticDirectExecutionQueryBaselineTests.cs | 5 +- .../Query/Pipeline/FullPipelineTests.cs | 3 +- .../Query/QueryPartitionProviderTests.cs | 6 +- .../Query/QueryPlanBaselineTests.cs | 48 +- .../Query/QueryPlanRetrieverTests.cs | 4 + .../Routing/PartitionRoutingHelperTest.cs | 1 + .../Tracing/TraceWriterBaselineTests.cs | 3 +- 29 files changed, 805 insertions(+), 49 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/QueryPlanBaselineTests.Spatial.xml diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs index 21b512166e..fec5fa4d4a 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs @@ -248,6 +248,7 @@ private static async Task> TryCreateCoreContextAsy cosmosQueryContext.ResourceTypeEnum, partitionKeyDefinition, inputParameters.PartitionKey != null, + containerQueryProperties.GeospatialType, cosmosQueryContext.UseSystemPrefix, createQueryPipelineTrace, cancellationToken); diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/ContainerQueryProperties.cs b/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/ContainerQueryProperties.cs index 4d80412388..0baaceb9c6 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/ContainerQueryProperties.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/ContainerQueryProperties.cs @@ -11,15 +11,18 @@ internal readonly struct ContainerQueryProperties public ContainerQueryProperties( string resourceId, string effectivePartitionKeyString, - PartitionKeyDefinition partitionKeyDefinition) + PartitionKeyDefinition partitionKeyDefinition, + Cosmos.GeospatialType geospatialType) { this.ResourceId = resourceId; this.EffectivePartitionKeyString = effectivePartitionKeyString; this.PartitionKeyDefinition = partitionKeyDefinition; + this.GeospatialType = geospatialType; } public string ResourceId { get; } public string EffectivePartitionKeyString { get; } public PartitionKeyDefinition PartitionKeyDefinition { get; } + public Cosmos.GeospatialType GeospatialType { get; } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs b/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs index e066ec2140..c2bcf91619 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs @@ -47,6 +47,7 @@ public abstract Task> TryGetPartitionedQ bool hasLogicalPartitionKey, bool allowDCount, bool useSystemPrefix, + Cosmos.GeospatialType geospatialType, CancellationToken cancellationToken); public abstract Task> ExecuteItemQueryAsync( diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPartitionProvider.cs b/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPartitionProvider.cs index 8d09a074c9..6e7b0b4a8f 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPartitionProvider.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPartitionProvider.cs @@ -118,7 +118,8 @@ public TryCatch TryGetPartitionedQueryExecutionIn bool allowNonValueAggregateQuery, bool hasLogicalPartitionKey, bool allowDCount, - bool useSystemPrefix) + bool useSystemPrefix, + GeospatialType geospatialType) { TryCatch tryGetInternalQueryInfo = this.TryGetPartitionedQueryExecutionInfoInternal( querySpecJsonString: querySpecJsonString, @@ -128,7 +129,8 @@ public TryCatch TryGetPartitionedQueryExecutionIn allowNonValueAggregateQuery: allowNonValueAggregateQuery, hasLogicalPartitionKey: hasLogicalPartitionKey, allowDCount: allowDCount, - useSystemPrefix: useSystemPrefix); + useSystemPrefix: useSystemPrefix, + geospatialType: geospatialType); if (!tryGetInternalQueryInfo.Succeeded) { return TryCatch.FromException(tryGetInternalQueryInfo.Exception); @@ -169,7 +171,8 @@ internal TryCatch TryGetPartitionedQueryE bool allowNonValueAggregateQuery, bool hasLogicalPartitionKey, bool allowDCount, - bool useSystemPrefix) + bool useSystemPrefix, + GeospatialType geospatialType) { if (querySpecJsonString == null || partitionKeyDefinition == null) { @@ -200,7 +203,6 @@ internal TryCatch TryGetPartitionedQueryE } PartitionKind partitionKind = partitionKeyDefinition.Kind; - GeospatialType defaultGeopatialType = GeospatialType.Geography; this.Initialize(); @@ -219,7 +221,7 @@ internal TryCatch TryGetPartitionedQueryE bIsContinuationExpected = Convert.ToInt32(isContinuationExpected), bRequireFormattableOrderByQuery = Convert.ToInt32(requireFormattableOrderByQuery), bUseSystemPrefix = Convert.ToInt32(useSystemPrefix), - eGeospatialType = Convert.ToInt32(defaultGeopatialType), + eGeospatialType = Convert.ToInt32(geospatialType), ePartitionKind = Convert.ToInt32(partitionKind) }; diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPlanHandler.cs b/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPlanHandler.cs index e6f8ec06bf..30be0a4903 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPlanHandler.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPlanHandler.cs @@ -29,6 +29,7 @@ public async Task> TryGetQueryPlanAsync( QueryFeatures supportedQueryFeatures, bool hasLogicalPartitionKey, bool useSystemPrefix, + GeospatialType geospatialType, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); @@ -49,6 +50,7 @@ public async Task> TryGetQueryPlanAsync( partitionKeyDefinition, hasLogicalPartitionKey, useSystemPrefix, + geospatialType, cancellationToken); if (!tryGetQueryInfo.Succeeded) { @@ -76,6 +78,7 @@ public async Task> TryGetQueryPlanAsync( PartitionKeyDefinition partitionKeyDefinition, bool hasLogicalPartitionKey, bool useSystemPrefix, + GeospatialType geospatialType, CancellationToken cancellationToken = default) { if (sqlQuerySpec == null) @@ -96,6 +99,7 @@ public async Task> TryGetQueryPlanAsync( partitionKeyDefinition, hasLogicalPartitionKey, useSystemPrefix, + geospatialType, cancellationToken); if (tryGetQueryInfo.Failed) { @@ -114,6 +118,7 @@ private Task> TryGetQueryInfoAsync( PartitionKeyDefinition partitionKeyDefinition, bool hasLogicalPartitionKey, bool useSystemPrefix, + Cosmos.GeospatialType geospatialType, CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); @@ -128,6 +133,7 @@ private Task> TryGetQueryInfoAsync( hasLogicalPartitionKey: hasLogicalPartitionKey, allowDCount: true, useSystemPrefix: useSystemPrefix, + geospatialType: geospatialType, cancellationToken: cancellationToken); } diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPlanRetriever.cs b/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPlanRetriever.cs index 6a6d7d5777..32e061dfd8 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPlanRetriever.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPlanRetriever.cs @@ -38,6 +38,7 @@ public static async Task GetQueryPlanWithServiceI Documents.ResourceType resourceType, PartitionKeyDefinition partitionKeyDefinition, bool hasLogicalPartitionKey, + GeospatialType geospatialType, bool useSystemPrefix, ITrace trace, CancellationToken cancellationToken = default) @@ -70,6 +71,7 @@ public static async Task GetQueryPlanWithServiceI QueryPlanRetriever.SupportedQueryFeatures, hasLogicalPartitionKey, useSystemPrefix, + geospatialType, cancellationToken); if (!tryGetQueryPlan.Succeeded) diff --git a/Microsoft.Azure.Cosmos/src/Query/v2Query/DefaultDocumentQueryExecutionContext.cs b/Microsoft.Azure.Cosmos/src/Query/v2Query/DefaultDocumentQueryExecutionContext.cs index e3425f3199..b53c3c5c71 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v2Query/DefaultDocumentQueryExecutionContext.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v2Query/DefaultDocumentQueryExecutionContext.cs @@ -319,6 +319,7 @@ private static bool ServiceInteropAvailable() partitionKeyDefinition: partitionKeyDefinition, queryPartitionProvider: queryPartitionProvider, clientApiVersion: version, + geospatialType: collection.GeospatialConfig.GeospatialType, out QueryInfo _); } else if (request.Properties != null && request.Properties.TryGetValue( diff --git a/Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextBase.cs b/Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextBase.cs index 52458f35f1..ec4e6d9185 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextBase.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextBase.cs @@ -160,6 +160,7 @@ public async Task GetPartitionedQueryExecutionInf bool allowNonValueAggregateQuery, bool hasLogicalPartitionKey, bool allowDCount, + Cosmos.GeospatialType geospatialType, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); @@ -174,6 +175,7 @@ public async Task GetPartitionedQueryExecutionInf allowNonValueAggregateQuery: allowNonValueAggregateQuery, hasLogicalPartitionKey: hasLogicalPartitionKey, allowDCount: allowDCount, + geospatialType: geospatialType, useSystemPrefix: false); if (!tryGetPartitionedQueryExecutionInfo.Succeeded) { diff --git a/Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextFactory.cs index 63f17406c5..f7861f5a2c 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextFactory.cs @@ -104,6 +104,7 @@ public static async Task CreateDocumentQueryExec allowNonValueAggregateQuery: true, hasLogicalPartitionKey: feedOptions.PartitionKey != null, allowDCount: true, + geospatialType: collection.GeospatialConfig.GeospatialType, cancellationToken: token); if (DocumentQueryExecutionContextFactory.ShouldCreateSpecializedDocumentQueryExecutionContext( diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs index e541f51774..138f32c593 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs @@ -74,7 +74,8 @@ public override async Task GetCachedContainerQueryProp return new ContainerQueryProperties( containerProperties.ResourceId, effectivePartitionKeyString, - containerProperties.PartitionKey); + containerProperties.PartitionKey, + containerProperties.GeospatialConfig.GeospatialType); } public override async Task> TryGetPartitionedQueryExecutionInfoAsync( @@ -87,6 +88,7 @@ public override async Task> TryGetPartit bool hasLogicalPartitionKey, bool allowDCount, bool useSystemPrefix, + Cosmos.GeospatialType geospatialType, CancellationToken cancellationToken) { string queryString = null; @@ -109,7 +111,8 @@ public override async Task> TryGetPartit allowNonValueAggregateQuery: allowNonValueAggregateQuery, hasLogicalPartitionKey: hasLogicalPartitionKey, allowDCount: allowDCount, - useSystemPrefix: useSystemPrefix); + useSystemPrefix: useSystemPrefix, + geospatialType: geospatialType); } public override async Task> ExecuteItemQueryAsync( diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs index 60b8db6776..0018eca9b7 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs @@ -351,6 +351,7 @@ public override async Task TryExecuteQueryAsync( string continuationToken, FeedRangeInternal feedRangeInternal, QueryRequestOptions requestOptions, + GeospatialType geospatialType, CancellationToken cancellationToken = default) { if (queryDefinition == null) @@ -418,6 +419,7 @@ public override async Task TryExecuteQueryAsync( partitionKeyDefinition, requestOptions.PartitionKey.HasValue, useSystemPrefix: QueryIterator.IsSystemPrefixExpected(requestOptions), + geospatialType: geospatialType, cancellationToken); if (tryGetQueryInfoAndIfSupported.Failed) diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInternal.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInternal.cs index e6d21ba01a..920fc5d694 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInternal.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInternal.cs @@ -71,6 +71,7 @@ public abstract Task TryExecuteQueryAsync( string continuationToken, FeedRangeInternal feedRangeInternal, QueryRequestOptions requestOptions, + GeospatialType geospatialType, CancellationToken cancellationToken = default); public abstract FeedIterator GetStandByFeedIterator( diff --git a/Microsoft.Azure.Cosmos/src/Routing/PartitionRoutingHelper.cs b/Microsoft.Azure.Cosmos/src/Routing/PartitionRoutingHelper.cs index a91c1dba5f..68f6214f17 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/PartitionRoutingHelper.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/PartitionRoutingHelper.cs @@ -37,6 +37,7 @@ public static IReadOnlyList> GetProvidedPartitionKeyRanges( PartitionKeyDefinition partitionKeyDefinition, QueryPartitionProvider queryPartitionProvider, string clientApiVersion, + Cosmos.GeospatialType geospatialType, out QueryInfo queryInfo) { if (querySpecJsonString == null) @@ -62,7 +63,8 @@ public static IReadOnlyList> GetProvidedPartitionKeyRanges( allowNonValueAggregateQuery: allowNonValueAggregates, hasLogicalPartitionKey: hasLogicalPartitionKey, allowDCount: allowDCount, - useSystemPrefix: useSystemPrefix); + useSystemPrefix: useSystemPrefix, + geospatialType: geospatialType); if (!tryGetPartitionQueryExecutionInfo.Succeeded) { throw new BadRequestException(tryGetPartitionQueryExecutionInfo.Exception); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs index ca6f1495f5..da6d79c333 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs @@ -1589,7 +1589,8 @@ public async Task ItemEpkQuerySingleKeyRangeValidation() ContainerQueryProperties containerQueryProperties = new ContainerQueryProperties( containerResponse.Resource.ResourceId, null, - containerResponse.Resource.PartitionKey); + containerResponse.Resource.PartitionKey, + containerResponse.Resource.GeospatialConfig.GeospatialType); // There should only be one range since the EPK option is set. List partitionKeyRanges = await CosmosQueryExecutionContextFactory.GetTargetPartitionKeyRangesAsync( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/QueryFeedTokenTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/QueryFeedTokenTests.cs index 8e36c206f1..1e26ef0738 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/QueryFeedTokenTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/QueryFeedTokenTests.cs @@ -55,7 +55,8 @@ public async Task GetTargetPartitionKeyRangesAsyncWithFeedRange() ContainerQueryProperties containerQueryProperties = new ContainerQueryProperties( containerResponse.Resource.ResourceId, null, - containerResponse.Resource.PartitionKey); + containerResponse.Resource.PartitionKey, + containerResponse.Resource.GeospatialConfig.GeospatialType); IReadOnlyList feedTokens = await container.GetFeedRangesAsync(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/PartitioningQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/PartitioningQueryTests.cs index c925c95d67..ed61b8fc8e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/PartitioningQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/PartitioningQueryTests.cs @@ -489,5 +489,90 @@ async Task ImplementationAsync( Assert.IsTrue(actualPartitionKeyValues.SetEquals(args.ExpectedPartitionKeyValues)); } } + + [TestMethod] + public async Task TestGeospatial() + { + string[] inputDocs = new[] + { + @"{""id"":""documentId1"",""key"":""A"",""prop"":3,""shortArray"":[{""a"":5}]}", + @"{""id"":""documentId2"",""key"":""A"",""prop"":2,""shortArray"":[{""a"":6}]}", + @"{""id"":""documentId3"",""key"":""A"",""prop"":1,""shortArray"":[{""a"":7}]}", + @"{""id"":""documentId4"",""key"":5,""prop"":3,""shortArray"":[{""a"":5}]}", + @"{""id"":""documentId5"",""key"":5,""prop"":2,""shortArray"":[{""a"":6}]}", + @"{""id"":""documentId6"",""key"":5,""prop"":1,""shortArray"":[{""a"":7}]}", + @"{""id"":""documentId10"",""prop"":3,""shortArray"":[{""a"":5}]}", + @"{""id"":""documentId11"",""prop"":2,""shortArray"":[{""a"":6}]}", + @"{""id"":""documentId12"",""prop"":1,""shortArray"":[{""a"":7}]}", + }; + + string All = "documentId4,documentId5,documentId6,documentId10,documentId11,documentId12,documentId1,documentId2,documentId3"; + string None = string.Empty; + var testVariations = new[] + { + new + { + Query = "SELECT c.id FROM c WHERE ST_DISTANCE({'type': 'Polygon', 'coordinates': [[[35, 10], [45, 45], [15, 40], [10, 20], [35, 10]], [[20, 30], [35, 35], [30, 20], [20, 30]]]}, {'type': 'Point', 'coordinates': [30, 10]}) > 66408.034483", + Expected = new Dictionary + { + { Cosmos.GeospatialType.Geography, All }, + { Cosmos.GeospatialType.Geometry, None }, + } + }, + new + { + Query = "SELECT c.id FROM c WHERE ST_ISVALID({'type': 'Polygon', 'coordinates': [[[-1000, 1000], [1000, 1000], [1000, 4000], [-1000, 4000], [-1000, 1000]]]})", + Expected = new Dictionary + { + { Cosmos.GeospatialType.Geography, None }, + { Cosmos.GeospatialType.Geometry, All }, + } + }, + new + { + Query = "SELECT * FROM c WHERE NOT ST_WITHIN({'type': 'Point', 'coordinates': [0, 40]}, {'type':'Polygon','coordinates':[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]})", + Expected = new Dictionary + { + { Cosmos.GeospatialType.Geography, All }, + { Cosmos.GeospatialType.Geometry, None }, + } + }, + }; + + foreach (Cosmos.GeospatialType geospatialType in new[] { Cosmos.GeospatialType.Geography, Cosmos.GeospatialType.Geometry }) + { + await this.CreateIngestQueryDeleteAsync( + ConnectionModes.Direct, + CollectionTypes.MultiPartition, + inputDocs, + ImplementationAsync, + "/key", + geospatialType: geospatialType); + + async Task ImplementationAsync(Container container, IReadOnlyList documents) + { + foreach (var testVariation in testVariations) + { + string expectedResult = string.Join(",", testVariation.Expected[geospatialType]); + + FeedIterator resultSetIterator = container.GetItemQueryIterator( + queryText: testVariation.Query, + requestOptions: new QueryRequestOptions()); + + List result = new List(); + while (resultSetIterator.HasMoreResults) + { + result.AddRange(await resultSetIterator.ReadNextAsync()); + } + + string resultDocIds = string.Join(",", result.Select(doc => doc.Id)); + Assert.AreEqual( + expectedResult, + resultDocIds, + $"{Environment.NewLine}Query failed for geospatial type '{geospatialType}'{Environment.NewLine}{testVariation.Query}"); + } + } + } + } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/QueryTestsBase.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/QueryTestsBase.cs index f40015473a..269e8448bd 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/QueryTestsBase.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/QueryTestsBase.cs @@ -113,12 +113,14 @@ private async Task> GetPartitionKeyRanges(Conta private async Task CreateMultiPartitionContainer( string partitionKey = "/id", - Microsoft.Azure.Cosmos.IndexingPolicy indexingPolicy = null) + Microsoft.Azure.Cosmos.IndexingPolicy indexingPolicy = null, + Cosmos.GeospatialType geospatialType = Cosmos.GeospatialType.Geography) { ContainerResponse containerResponse = await this.CreatePartitionedContainer( throughput: 25000, partitionKey: partitionKey, - indexingPolicy: indexingPolicy); + indexingPolicy: indexingPolicy, + geospatialType); IReadOnlyList ranges = await this.GetPartitionKeyRanges(containerResponse); Assert.IsTrue( @@ -130,12 +132,14 @@ private async Task CreateMultiPartitionContainer( private async Task CreateSinglePartitionContainer( string partitionKey = "/id", - Microsoft.Azure.Cosmos.IndexingPolicy indexingPolicy = null) + Microsoft.Azure.Cosmos.IndexingPolicy indexingPolicy = null, + Cosmos.GeospatialType geospatialType = Cosmos.GeospatialType.Geography) { ContainerResponse containerResponse = await this.CreatePartitionedContainer( throughput: 4000, partitionKey: partitionKey, - indexingPolicy: indexingPolicy); + indexingPolicy: indexingPolicy, + geospatialType: geospatialType); Assert.IsNotNull(containerResponse); Assert.AreEqual(HttpStatusCode.Created, containerResponse.StatusCode); @@ -149,13 +153,15 @@ private async Task CreateSinglePartitionContainer( } private async Task CreateNonPartitionedContainerAsync( - Microsoft.Azure.Cosmos.IndexingPolicy indexingPolicy = null) + Microsoft.Azure.Cosmos.IndexingPolicy indexingPolicy = null, + Cosmos.GeospatialType geospatialType = Cosmos.GeospatialType.Geography) { string containerName = Guid.NewGuid().ToString() + "container"; await NonPartitionedContainerHelper.CreateNonPartitionedContainer( this.database, containerName, - indexingPolicy == null ? null : JsonConvert.SerializeObject(indexingPolicy)); + indexingPolicy == null ? null : JsonConvert.SerializeObject(indexingPolicy), + geospatialType); return this.database.GetContainer(containerName); } @@ -163,7 +169,8 @@ await NonPartitionedContainerHelper.CreateNonPartitionedContainer( private async Task CreatePartitionedContainer( int throughput, string partitionKey = "/id", - Microsoft.Azure.Cosmos.IndexingPolicy indexingPolicy = null) + Microsoft.Azure.Cosmos.IndexingPolicy indexingPolicy = null, + Cosmos.GeospatialType geospatialType = Cosmos.GeospatialType.Geography) { // Assert that database exists (race deletes are possible when used concurrently) ResponseMessage responseMessage = await this.database.ReadStreamAsync(); @@ -192,7 +199,8 @@ private async Task CreatePartitionedContainer( { Paths = new Collection { partitionKey }, Kind = PartitionKind.Hash - } + }, + GeospatialConfig = new Cosmos.GeospatialConfig(geospatialType) }, // This throughput needs to be about half the max with multi master // otherwise it will create about twice as many partitions. @@ -208,50 +216,57 @@ private async Task CreatePartitionedContainer( private Task<(Container, IReadOnlyList)> CreateNonPartitionedContainerAndIngestDocumentsAsync( IEnumerable documents, - Cosmos.IndexingPolicy indexingPolicy = null) + Cosmos.IndexingPolicy indexingPolicy = null, + Cosmos.GeospatialType geospatialType = Cosmos.GeospatialType.Geography) { return this.CreateContainerAndIngestDocumentsAsync( CollectionTypes.NonPartitioned, documents, partitionKey: null, - indexingPolicy: indexingPolicy); + indexingPolicy: indexingPolicy, + geospatialType: geospatialType); } private Task<(Container, IReadOnlyList)> CreateSinglePartitionContainerAndIngestDocumentsAsync( IEnumerable documents, string partitionKey = "/id", - Cosmos.IndexingPolicy indexingPolicy = null) + Cosmos.IndexingPolicy indexingPolicy = null, + Cosmos.GeospatialType geospatialType = Cosmos.GeospatialType.Geography) { return this.CreateContainerAndIngestDocumentsAsync( CollectionTypes.SinglePartition, documents, partitionKey, - indexingPolicy); + indexingPolicy, + geospatialType); } private Task<(Container, IReadOnlyList)> CreateMultiPartitionContainerAndIngestDocumentsAsync( IEnumerable documents, string partitionKey = "/id", - Cosmos.IndexingPolicy indexingPolicy = null) + Cosmos.IndexingPolicy indexingPolicy = null, + Cosmos.GeospatialType geospatialType = Cosmos.GeospatialType.Geography) { return this.CreateContainerAndIngestDocumentsAsync( CollectionTypes.MultiPartition, documents, partitionKey, - indexingPolicy); + indexingPolicy, + geospatialType); } private async Task<(Container, IReadOnlyList)> CreateContainerAndIngestDocumentsAsync( CollectionTypes collectionType, IEnumerable documents, string partitionKey = "/id", - Cosmos.IndexingPolicy indexingPolicy = null) + Cosmos.IndexingPolicy indexingPolicy = null, + Cosmos.GeospatialType geospatialType = Cosmos.GeospatialType.Geography) { Container container = collectionType switch { - CollectionTypes.NonPartitioned => await this.CreateNonPartitionedContainerAsync(indexingPolicy), - CollectionTypes.SinglePartition => await this.CreateSinglePartitionContainer(partitionKey, indexingPolicy), - CollectionTypes.MultiPartition => await this.CreateMultiPartitionContainer(partitionKey, indexingPolicy), + CollectionTypes.NonPartitioned => await this.CreateNonPartitionedContainerAsync(indexingPolicy, geospatialType), + CollectionTypes.SinglePartition => await this.CreateSinglePartitionContainer(partitionKey, indexingPolicy, geospatialType), + CollectionTypes.MultiPartition => await this.CreateMultiPartitionContainer(partitionKey, indexingPolicy, geospatialType), _ => throw new ArgumentException($"Unknown {nameof(CollectionTypes)} : {collectionType}"), }; List insertedDocuments = new List(); @@ -369,7 +384,8 @@ internal Task CreateIngestQueryDeleteAsync( Query query, string partitionKey = "/id", Cosmos.IndexingPolicy indexingPolicy = null, - CosmosClientFactory cosmosClientFactory = null) + CosmosClientFactory cosmosClientFactory = null, + Cosmos.GeospatialType geospatialType = Cosmos.GeospatialType.Geography) { Task queryWrapper(Container container, IReadOnlyList inputDocuments, object throwaway) { @@ -384,7 +400,8 @@ Task queryWrapper(Container container, IReadOnlyList inputDocument null, partitionKey, indexingPolicy, - cosmosClientFactory); + cosmosClientFactory, + geospatialType); } internal Task CreateIngestQueryDeleteAsync( @@ -395,7 +412,8 @@ internal Task CreateIngestQueryDeleteAsync( T testArgs, string partitionKey = "/id", Cosmos.IndexingPolicy indexingPolicy = null, - CosmosClientFactory cosmosClientFactory = null) + CosmosClientFactory cosmosClientFactory = null, + Cosmos.GeospatialType geospatialType = Cosmos.GeospatialType.Geography) { return this.CreateIngestQueryDeleteAsync( connectionModes, @@ -405,7 +423,8 @@ internal Task CreateIngestQueryDeleteAsync( cosmosClientFactory ?? this.CreateDefaultCosmosClient, testArgs, partitionKey, - indexingPolicy); + indexingPolicy, + geospatialType); } /// @@ -434,7 +453,8 @@ internal async Task CreateIngestQueryDeleteAsync( CosmosClientFactory cosmosClientFactory, T testArgs, string partitionKey = "/id", - Cosmos.IndexingPolicy indexingPolicy = null) + Cosmos.IndexingPolicy indexingPolicy = null, + Cosmos.GeospatialType geospatialType = Cosmos.GeospatialType.Geography) { try { @@ -450,15 +470,18 @@ internal async Task CreateIngestQueryDeleteAsync( { CollectionTypes.NonPartitioned => this.CreateNonPartitionedContainerAndIngestDocumentsAsync( documents, - indexingPolicy), + indexingPolicy, + geospatialType), CollectionTypes.SinglePartition => this.CreateSinglePartitionContainerAndIngestDocumentsAsync( documents, partitionKey, - indexingPolicy), + indexingPolicy, + geospatialType), CollectionTypes.MultiPartition => this.CreateMultiPartitionContainerAndIngestDocumentsAsync( documents, partitionKey, - indexingPolicy), + indexingPolicy, + geospatialType), _ => throw new ArgumentException($"Unknown {nameof(CollectionTypes)} : {collectionType}"), }; collectionsAndDocuments.Add(await createContainerTask); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SanityQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SanityQueryTests.cs index bc04ba6ebe..60ab6f9fe4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SanityQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SanityQueryTests.cs @@ -604,7 +604,8 @@ private async Task TestTryExecuteQueryHelper( MaxItemCount = maxItemCount, }, feedRangeInternal: null, - continuationToken: continuationToken); + continuationToken: continuationToken, + geospatialType: Cosmos.GeospatialType.Geography); if (canSupportExpected) { @@ -637,7 +638,8 @@ private async Task TestTryExecuteQueryHelper( MaxItemCount = 1, }, feedRangeInternal: null, - continuationToken: null); + continuationToken: null, + geospatialType: Cosmos.GeospatialType.Geography); Assert.IsTrue(tryExecuteQueryResult is ContainerInternal.FailedToGetQueryPlanResult); } @@ -653,7 +655,8 @@ private async Task TestTryExecuteQueryHelper( MaxItemCount = 1, }, feedRangeInternal: new FeedRangePartitionKeyRange("0"), // filtering on a PkRangeId. - continuationToken: null); + continuationToken: null, + geospatialType: Cosmos.GeospatialType.Geography); Assert.IsTrue(tryExecuteQueryResult is ContainerInternal.QueryPlanIsSupportedResult); ContainerInternal.QueryPlanIsSupportedResult queryPlanIsSupportedResult = (ContainerInternal.QueryPlanIsSupportedResult)tryExecuteQueryResult; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/NonPartitionedContainerHelper.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/NonPartitionedContainerHelper.cs index 8748360c9a..0482695ec2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/NonPartitionedContainerHelper.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/NonPartitionedContainerHelper.cs @@ -18,7 +18,8 @@ internal static class NonPartitionedContainerHelper internal static async Task CreateNonPartitionedContainer( Cosmos.Database database, string containerId, - string indexingPolicy = null) + string indexingPolicy = null, + Cosmos.GeospatialType geospatialType = Cosmos.GeospatialType.Geography) { DocumentCollection documentCollection = new DocumentCollection() { @@ -30,6 +31,13 @@ internal static async Task CreateNonPartitionedContainer( documentCollection.IndexingPolicy = JsonConvert.DeserializeObject(indexingPolicy); } + documentCollection.GeospatialConfig = geospatialType switch + { + Cosmos.GeospatialType.Geography => new GeospatialConfig(GeospatialType.Geography), + Cosmos.GeospatialType.Geometry => new GeospatialConfig(GeospatialType.Geometry), + _ => throw new InvalidOperationException($"Unsupported geospatialType {geospatialType}") + }; + await NonPartitionedContainerHelper.CreateNonPartitionedContainer( database, documentCollection); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Query/ParsingBenchmark.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Query/ParsingBenchmark.cs index 9ac18a7068..2a17267604 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Query/ParsingBenchmark.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Query/ParsingBenchmark.cs @@ -126,7 +126,8 @@ private static void ParseUsingNativeParser(SqlQuerySpec sqlQuerySpec) allowNonValueAggregateQuery: true, hasLogicalPartitionKey: false, allowDCount: true, - useSystemPrefix: false); + useSystemPrefix: false, + geospatialType: Cosmos.GeospatialType.Geography); tryGetQueryPlan.ThrowIfFailed(); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/QueryPlanBaselineTests.Spatial.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/QueryPlanBaselineTests.Spatial.xml new file mode 100644 index 0000000000..1d67b08708 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/QueryPlanBaselineTests.Spatial.xml @@ -0,0 +1,548 @@ + + + + ST_DISTANCE Constant Foldable Geography + SELECT * FROM c WHERE ST_DISTANCE({'type': 'Polygon', 'coordinates': [[[35, 10], [45, 45], [15, 40], [10, 20], [35, 10]], [[20, 30], [35, 35], [30, 20], [20, 30]]]}, {'type': 'Point', 'coordinates': [30, 10]}) > 66408.034483 + + /key + + Hash + Geography + + + + + None + + + + + + + + + + False + + + + [[],"Infinity") + + + + + + + + + ST_DISTANCE Constant Foldable Geometry + SELECT * FROM c WHERE ST_DISTANCE({'type': 'Polygon', 'coordinates': [[[35, 10], [45, 45], [15, 40], [10, 20], [35, 10]], [[20, 30], [35, 35], [30, 20], [20, 30]]]}, {'type': 'Point', 'coordinates': [30, 10]}) > 66408.034483 + + /key + + Hash + Geometry + + + + + None + + + + + + + + + + False + + + + [[],[]] + + + + + + + + + ST_DISTANCE Geography + SELECT * FROM c WHERE ST_DISTANCE({'type': 'Polygon', 'coordinates': [[[35, 10], [45, 45], [15, 40], [10, 20], [35, 10]], [[20, 30], [35, 35], [30, 20], [20, 30]]]}, c.geojson) > 66408.034483 + + /key + + Hash + Geography + + + + + None + + + + + + + + + + False + + + + [[],"Infinity") + + + + + + + + + ST_DISTANCE Geometry + SELECT * FROM c WHERE ST_DISTANCE({'type': 'Polygon', 'coordinates': [[[35, 10], [45, 45], [15, 40], [10, 20], [35, 10]], [[20, 30], [35, 35], [30, 20], [20, 30]]]}, c.geojson) > 66408.034483 + + /key + + Hash + Geometry + + + + + None + + + + + + + + + + False + + + + [[],"Infinity") + + + + + + + + + ST_INTERSECTS Constant Foldable Geography + SELECT * FROM c WHERE ST_INTERSECTS({'type':'LineString', 'coordinates':[ [ 0, 0 ], [ 0, 40 ] ]}, {'type':'Polygon',"coordinates":[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]}) + + /key + + Hash + Geography + + + + + None + + + + + + + + + + False + + + + [[],[]] + + + + + + + + + ST_INTERSECTS Constant Foldable Geometry + SELECT * FROM c WHERE ST_INTERSECTS({'type':'LineString', 'coordinates':[ [ 0, 0 ], [ 0, 40 ] ]}, {'type':'Polygon',"coordinates":[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]}) + + /key + + Hash + Geometry + + + + + None + + + + + + + + + + False + + + + [[],"Infinity") + + + + + + + + + ST_INTERSECTS Geography + SELECT * FROM c WHERE ST_INTERSECTS(c.geojson, {'type':'Polygon',"coordinates":[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]}) + + /key + + Hash + Geography + + + + + None + + + + + + + + + + False + + + + [[],"Infinity") + + + + + + + + + ST_INTERSECTS Geometry + SELECT * FROM c WHERE ST_INTERSECTS(c.geojson, {'type':'Polygon',"coordinates":[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]}) + + /key + + Hash + Geometry + + + + + None + + + + + + + + + + False + + + + [[],"Infinity") + + + + + + + + + ST_ISVALID Constant Foldable Geography + SELECT * FROM c WHERE ST_ISVALID({'type': 'Polygon', 'coordinates': [[[-1000, 1000], [1000, 1000], [1000, 4000], [-1000, 4000], [-1000, 1000]]]}) + + /key + + Hash + Geography + + + + + None + + + + + + + + + + False + + + + [[],[]] + + + + + + + + + ST_ISVALID Constant Foldable Geometry + SELECT * FROM c WHERE ST_ISVALID({'type': 'Polygon', 'coordinates': [[[-1000, 1000], [1000, 1000], [1000, 4000], [-1000, 4000], [-1000, 1000]]]}) + + /key + + Hash + Geometry + + + + + None + + + + + + + + + + False + + + + [[],"Infinity") + + + + + + + + + ST_ISVALID Geography + SELECT * FROM c WHERE ST_ISVALID(c.geojson) + + /key + + Hash + Geography + + + + + None + + + + + + + + + + False + + + + [[],"Infinity") + + + + + + + + + ST_ISVALID Geometry + SELECT * FROM c WHERE ST_ISVALID(c.geojson) + + /key + + Hash + Geometry + + + + + None + + + + + + + + + + False + + + + [[],"Infinity") + + + + + + + + + ST_WITHIN Constant Foldable Geography + SELECT * FROM c WHERE NOT ST_WITHIN({'type': 'Point', 'coordinates': [0, 40]}, {'type':'Polygon','coordinates':[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]}) + + /key + + Hash + Geography + + + + + None + + + + + + + + + + False + + + + [[],"Infinity") + + + + + + + + + ST_WITHIN Constant Foldable Geometry + SELECT * FROM c WHERE NOT ST_WITHIN({'type': 'Point', 'coordinates': [0, 40]}, {'type':'Polygon','coordinates':[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]}) + + /key + + Hash + Geometry + + + + + None + + + + + + + + + + False + + + + [[],[]] + + + + + + + + + ST_WITHIN Geography + SELECT * FROM c WHERE NOT ST_WITHIN(c.geojson, + {'type':'Polygon','coordinates':[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]}) + + /key + + Hash + Geography + + + + + None + + + + + + + + + + False + + + + [[],"Infinity") + + + + + + + + + ST_WITHIN Geometry + SELECT * FROM c WHERE NOT ST_WITHIN(c.geojson, + {'type':'Polygon','coordinates':[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]}) + + /key + + Hash + Geometry + + + + + None + + + + + + + + + + False + + + + [[],"Infinity") + + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj index 2fe8b7feec..ef7e193dbf 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj @@ -222,6 +222,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs index c2ac15064d..960235dcae 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs @@ -388,7 +388,8 @@ private static PartitionedQueryExecutionInfo GetPartitionedQueryExecutionInfo(st allowNonValueAggregateQuery: true, hasLogicalPartitionKey: false, allowDCount: true, - useSystemPrefix: false); + useSystemPrefix: false, + geospatialType: Cosmos.GeospatialType.Geography); return tryGetQueryPlan.Result; } @@ -611,7 +612,7 @@ public override Task> TryGetOverlappingRangesAs throw new NotImplementedException(); } - public override Task> TryGetPartitionedQueryExecutionInfoAsync(SqlQuerySpec sqlQuerySpec, ResourceType resourceType, PartitionKeyDefinition partitionKeyDefinition, bool requireFormattableOrderByQuery, bool isContinuationExpected, bool allowNonValueAggregateQuery, bool hasLogicalPartitionKey, bool allowDCount, bool useSystemPrefix, CancellationToken cancellationToken) + public override Task> TryGetPartitionedQueryExecutionInfoAsync(SqlQuerySpec sqlQuerySpec, ResourceType resourceType, PartitionKeyDefinition partitionKeyDefinition, bool requireFormattableOrderByQuery, bool isContinuationExpected, bool allowNonValueAggregateQuery, bool hasLogicalPartitionKey, bool allowDCount, bool useSystemPrefix, Cosmos.GeospatialType geospatialType, CancellationToken cancellationToken) { throw new NotImplementedException(); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/FullPipelineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/FullPipelineTests.cs index e1cc776d4f..0f8f6f2be7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/FullPipelineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/FullPipelineTests.cs @@ -421,7 +421,8 @@ private static QueryInfo GetQueryPlan(string query) allowNonValueAggregateQuery: true, allowDCount: true, hasLogicalPartitionKey: false, - useSystemPrefix: false); + useSystemPrefix: false, + geospatialType: Cosmos.GeospatialType.Geography); info.ThrowIfFailed(); return info.Result.QueryInfo; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPartitionProviderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPartitionProviderTests.cs index ccd7a81dfd..e4e6f48846 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPartitionProviderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPartitionProviderTests.cs @@ -39,7 +39,8 @@ public void TestQueryPartitionProviderUpdate() allowNonValueAggregateQuery: true, hasLogicalPartitionKey: false, allowDCount: true, - useSystemPrefix: false); + useSystemPrefix: false, + geospatialType: Cosmos.GeospatialType.Geography); Assert.IsTrue(tryGetQueryPlan.Failed); Assert.IsTrue(tryGetQueryPlan.Exception.ToString().Contains("The SQL query text exceeded the maximum limit of 5 characters")); @@ -54,7 +55,8 @@ public void TestQueryPartitionProviderUpdate() allowNonValueAggregateQuery: true, hasLogicalPartitionKey: false, allowDCount: true, - useSystemPrefix: false); + useSystemPrefix: false, + geospatialType: Cosmos.GeospatialType.Geography); Assert.IsTrue(tryGetQueryPlan.Succeeded); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPlanBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPlanBaselineTests.cs index dbdace2923..79d674d7b9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPlanBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPlanBaselineTests.cs @@ -15,6 +15,7 @@ using System.Linq; using Microsoft.Azure.Cosmos.Query.Core.Pipeline.Aggregate; using Microsoft.Azure.Cosmos.Query.Core.Pipeline.CrossPartition.OrderBy; + using Microsoft.Azure.Cosmos.Serialization.HybridRow.Schemas; /// /// Tests for . @@ -1292,6 +1293,44 @@ public void SystemFunctions() this.ExecuteTestSuite(testVariations); } + [TestMethod] + [Owner("adityasa")] + public void Spatial() + { + var variations = new[] + { + // ST_DISTANCE + new { Description = @"ST_DISTANCE Constant Foldable", Query = @"SELECT * FROM c WHERE ST_DISTANCE({'type': 'Polygon', 'coordinates': [[[35, 10], [45, 45], [15, 40], [10, 20], [35, 10]], [[20, 30], [35, 35], [30, 20], [20, 30]]]}, {'type': 'Point', 'coordinates': [30, 10]}) > 66408.034483" }, + new { Description = @"ST_DISTANCE", Query = @"SELECT * FROM c WHERE ST_DISTANCE({'type': 'Polygon', 'coordinates': [[[35, 10], [45, 45], [15, 40], [10, 20], [35, 10]], [[20, 30], [35, 35], [30, 20], [20, 30]]]}, c.geojson) > 66408.034483" }, + + // ST_INTERSECTS + new { Description = @"ST_INTERSECTS Constant Foldable", Query = @"SELECT * FROM c WHERE ST_INTERSECTS({'type':'LineString', 'coordinates':[ [ 0, 0 ], [ 0, 40 ] ]}, {'type':'Polygon',""coordinates"":[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]})" }, + new { Description = @"ST_INTERSECTS", Query = @"SELECT * FROM c WHERE ST_INTERSECTS(c.geojson, {'type':'Polygon',""coordinates"":[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]})" }, + + // ST_ISVALID + new { Description = @"ST_ISVALID Constant Foldable", Query = @"SELECT * FROM c WHERE ST_ISVALID({'type': 'Polygon', 'coordinates': [[[-1000, 1000], [1000, 1000], [1000, 4000], [-1000, 4000], [-1000, 1000]]]})" }, + new { Description = @"ST_ISVALID", Query = @"SELECT * FROM c WHERE ST_ISVALID(c.geojson)" }, + + // ST_WITHIN + new { Description = @"ST_WITHIN Constant Foldable", Query = @"SELECT * FROM c WHERE NOT ST_WITHIN({'type': 'Point', 'coordinates': [0, 40]}, {'type':'Polygon','coordinates':[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]})" }, + new { Description = @"ST_WITHIN", Query = @"SELECT * FROM c WHERE NOT ST_WITHIN(c.geojson, {'type':'Polygon','coordinates':[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]})" }, + }; + + List testVariations = variations + .SelectMany(variation => + { + PartitionKeyDefinition pkDefinitions = CreateHashPartitionKey("/key"); + return new List + { + new QueryPlanBaselineTestInput($"{variation.Description} Geography", pkDefinitions, new SqlQuerySpec(variation.Query)) { GeospatialType = Cosmos.GeospatialType.Geography }, + new QueryPlanBaselineTestInput($"{variation.Description} Geometry", pkDefinitions, new SqlQuerySpec(variation.Query)) { GeospatialType = Cosmos.GeospatialType.Geometry } + }; + }) + .ToList(); + + this.ExecuteTestSuite(testVariations); + } + private static PartitionKeyDefinition CreateHashPartitionKey( params string[] partitionKeys) => new PartitionKeyDefinition() { @@ -1386,7 +1425,8 @@ public override QueryPlanBaselineTestOutput ExecuteTest(QueryPlanBaselineTestInp allowNonValueAggregateQuery: true, hasLogicalPartitionKey: false, allowDCount: true, - useSystemPrefix: false); + useSystemPrefix: false, + geospatialType: input.GeospatialType ?? Cosmos.GeospatialType.Geography); if (info.Failed) { @@ -1401,6 +1441,7 @@ public sealed class QueryPlanBaselineTestInput : BaselineTestInput { internal PartitionKeyDefinition PartitionKeyDefinition { get; set; } internal SqlQuerySpec SqlQuerySpec { get; set; } + internal Cosmos.GeospatialType? GeospatialType { get; set; } internal QueryPlanBaselineTestInput( string description, @@ -1434,6 +1475,11 @@ public override void SerializeAsXml(XmlWriter xmlWriter) this.PartitionKeyDefinition.Kind == PartitionKind.MultiHash ? "MultiHash" : "Range")); } + if (this.GeospatialType != null) + { + xmlWriter.WriteElementString("GeospatialType", this.GeospatialType.Value.ToString()); + } + if (this.SqlQuerySpec.ShouldSerializeParameters()) { xmlWriter.WriteStartElement("QueryParameters"); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPlanRetrieverTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPlanRetrieverTests.cs index ffad405d08..47a681eb1a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPlanRetrieverTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPlanRetrieverTests.cs @@ -38,6 +38,7 @@ public async Task ServiceInterop_BadRequestContainsInnerException() It.IsAny(), It.IsAny(), It.IsAny(), + It.IsAny(), It.IsAny())).ReturnsAsync(TryCatch.FromException(innerException)); Mock trace = new Mock(); @@ -47,6 +48,7 @@ public async Task ServiceInterop_BadRequestContainsInnerException() ResourceType.Document, new Documents.PartitionKeyDefinition() { Paths = new Collection() { "/id" } }, hasLogicalPartitionKey: false, + geospatialType: Cosmos.GeospatialType.Geography, useSystemPrefix: false, trace.Object, default)); @@ -73,6 +75,7 @@ public async Task ServiceInterop_BadRequestContainsOriginalCosmosException() It.IsAny(), It.IsAny(), It.IsAny(), + It.IsAny(), It.IsAny())).ReturnsAsync(TryCatch.FromException(expectedException)); Mock trace = new Mock(); @@ -82,6 +85,7 @@ public async Task ServiceInterop_BadRequestContainsOriginalCosmosException() ResourceType.Document, new Documents.PartitionKeyDefinition() { Paths = new Collection() { "/id" } }, hasLogicalPartitionKey: false, + geospatialType: Cosmos.GeospatialType.Geography, useSystemPrefix: false, trace.Object, default)); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionRoutingHelperTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionRoutingHelperTest.cs index 0201b92327..35ffaa65bb 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionRoutingHelperTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionRoutingHelperTest.cs @@ -348,6 +348,7 @@ FROM c partitionKeyDefinition: new PartitionKeyDefinition { Paths = new Collection { testcase.PartitionKey }, Kind = PartitionKind.Hash }, queryPartitionProvider: QueryPartitionProviderTestInstance.Object, clientApiVersion: testcase.ClientApiVersion, + geospatialType: Cosmos.GeospatialType.Geography, out QueryInfo info); Assert.Fail(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs index 2421060b65..eace2eb9df 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs @@ -815,7 +815,8 @@ private static QueryInfo GetQueryPlan(string query) allowNonValueAggregateQuery: true, hasLogicalPartitionKey: false, allowDCount: true, - useSystemPrefix: false); + useSystemPrefix: false, + geospatialType: Cosmos.GeospatialType.Geography); info.ThrowIfFailed(); return info.Result.QueryInfo; From acd899e5c0be882c5e962103cc626ee8495a07a8 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Wed, 9 Nov 2022 11:04:47 -0800 Subject: [PATCH 011/240] [Internal] Documentation: Refactors cache content on its own document (#3554) * Add cache file * Moving content away --- docs/SdkDesign.md | 76 ++++------------------------------------------- docs/caches.md | 67 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 70 deletions(-) create mode 100644 docs/caches.md diff --git a/docs/SdkDesign.md b/docs/SdkDesign.md index f277661544..f3f2ec1581 100644 --- a/docs/SdkDesign.md +++ b/docs/SdkDesign.md @@ -17,74 +17,6 @@ flowchart LR TransportClient <--> Service[(Cosmos DB Service)] ``` -## Address caches conceptual model - -![image](https://user-images.githubusercontent.com/6880899/199167007-bcc054c3-ecb1-4469-ba7d-eae52362e9cd.png) - - -- CollectionCache: Dictionary -- CollectionRoutingMap: Single collection PartitionKeyRanges map -- PartitionKeyRangeCache: Dictionary -- GlobalPartitionEndpointManager: Per partition override state. Every reqeust will flow throgh - - Today GlobalEndpointManager is at region scope only and doesn't look at the partition - - Ideal abstraction is to fold it into GlobalEndpointManager --> extra hash computation - - Posible to refactor direct code and flow HashedValue down stream (more contract work with direct package) -- AddressResolver: It does use IAddressCache (Above diagram missing it) - - -```mermaid -flowchart LR - subgraph CDB_account - subgraph CDB_Account_Endpoint - CDB_EP[[CosmosDB-Account/Endpoint]] - end - - subgraph CDB_Account_Region1 - CDBR1_GW[[CosmosDB-Account/Gateway/Region1]] - CDBR1_BE[[CosmosDB-Account/Backend/Region1]] - end - subgraph CDB_Account_RegionN - CDBRN_GW[[CosmosDB-Account/Gateway/Region1]] - CDBRN_BE[[CosmosDB-Account/Backend/RegionN]] - end - end - subgraph AddressCaches - GAC1[GatewayAddressCache/R1] - GACN[GatewayAddressCache/RN] - - GAC1 --> |NonBlockingAsyncCache| CDBR1_GW - GAC1 -.-> CDBR1_BE - GACN --> |NonBlockingAsyncCache| CDBRN_GW - GACN -.-> CDBRN_BE - end -``` - -### Sequence of interaction - -```mermaid -sequenceDiagram - GlobalAddressResolver->>GlobalEndpointManager: ResolveServiceEndpoint(DocumentServiceRequest) - GlobalEndpointManager-->>GlobalAddressResolver: URI (ServingRegion) - GlobalAddressResolver->>GlobalAddressResolver: GetEndpointCache(ServingRegion).AddressResolver - - critical RegularAddressResolution(Implicit contract of dsr.RequestContext.ResolvedPartitionKeyRange population) - GlobalAddressResolver->>AddressResolver: ResolveAsync(DocumentServiceRequest) - AddressResolver-->>GlobalAddressResolver: PartitionAddressInformation - end - - critical AnyPerpartitionOverrides - GlobalAddressResolver->>GlobalPartitionEndpointManager: TryAddPartitionLevelLocationOverride(DocumentServiceRequest) - GlobalPartitionEndpointManager-->>GlobalAddressResolver: (bool, DSR.RequestContext.RouteToLocation) - - option YES - GlobalAddressResolver->>GlobalEndpointManager: ResolveServiceEndpoint(DocumentServiceRequest) - GlobalEndpointManager-->>GlobalAddressResolver: URI (ServingRegion) - end - GlobalAddressResolver->>GlobalAddressResolver: GetEndpointCache(ServingRegion) - GlobalAddressResolver->>AddressResolver: ResolveAsync(DocumentServiceRequest) - AddressResolver-->>GlobalAddressResolver: PartitionAddressInformation -``` - ## Handler pipeline The handler pipeline processes the RequestMessage and each handler can choose to augment it in different ways, as shown in our [handler samples](../Microsoft.Azure.Cosmos.Samples/Usage/Handlers/) and also handle certain error conditions and retry, like our own [RetryHandler](../Microsoft.Azure.Cosmos/src/Handler/RetryHandler.cs). The RetryHandler will handle any failures from the [Transport layer](#transport) that should be [handled as regional failovers](#cross-region-retries). @@ -234,6 +166,12 @@ flowchart ``` +## Direct mode caches + +Per our [connectivity documentation](https://learn.microsoft.com/azure/cosmos-db/nosql/sdk-connection-modes#routing), the SDK will store, in internal caches, critical information to allow for request routing. + +For details on the caches, please see the [cache design documentation](caches.md). + ## Consistency (direct mode) When performing operations through Direct mode, the SDK is involved in checking consistency for Bounded Staleness and Strong accounts. Read requests are handled by the [ConsistencyReader](https://github.com/Azure/azure-cosmos-dotnet-v3/blob/msdata/direct/Microsoft.Azure.Cosmos/src/direct/ConsistencyReader.cs) and write requests are handled by the [ConsistencyWriter](https://github.com/Azure/azure-cosmos-dotnet-v3/blob/msdata/direct/Microsoft.Azure.Cosmos/src/direct/ConsistencyWriter.cs). The `ConsistencyReader` uses the [QuorumReader](https://github.com/Azure/azure-cosmos-dotnet-v3/blob/msdata/direct/Microsoft.Azure.Cosmos/src/direct/QuorumReader.cs) when the consistency is Bounded Staleness or Strong to verify quorum after performing two requests and comparing the LSNs. If quorum cannot be achieved, the SDK starts what is defined as "barrier requests" to the container and waits for it to achieve quorum. The `ConsistencyWriter` also performs a similar LSN check after receiving the response from the write, the `GlobalCommittedLSN` and the item `LSN`. If they don't match, barrier requests are also performed. @@ -248,5 +186,3 @@ flowchart LR ConsistencyWriter --> TCPClient ``` - - diff --git a/docs/caches.md b/docs/caches.md new file mode 100644 index 0000000000..91f5eea16f --- /dev/null +++ b/docs/caches.md @@ -0,0 +1,67 @@ +# Caches conceptual model + +![image](https://user-images.githubusercontent.com/6880899/199167007-bcc054c3-ecb1-4469-ba7d-eae52362e9cd.png) + + +- CollectionCache: Dictionary +- CollectionRoutingMap: Single collection PartitionKeyRanges map +- PartitionKeyRangeCache: Dictionary +- GlobalPartitionEndpointManager: Per partition override state. Every request will flow through + - Today GlobalEndpointManager is at region scope only and doesn't look at the partition + - Ideal abstraction is to fold it into GlobalEndpointManager --> extra hash computation + - Posible to refactor direct code and flow HashedValue down stream (more contract work with direct package) +- AddressResolver: It does use IAddressCache (Above diagram missing it) + + +```mermaid +flowchart LR + subgraph CDB_account + subgraph CDB_Account_Endpoint + CDB_EP[[CosmosDB-Account/Endpoint]] + end + + subgraph CDB_Account_Region1 + CDBR1_GW[[CosmosDB-Account/Gateway/Region1]] + CDBR1_BE[[CosmosDB-Account/Backend/Region1]] + end + subgraph CDB_Account_RegionN + CDBRN_GW[[CosmosDB-Account/Gateway/Region1]] + CDBRN_BE[[CosmosDB-Account/Backend/RegionN]] + end + end + subgraph AddressCaches + GAC1[GatewayAddressCache/R1] + GACN[GatewayAddressCache/RN] + + GAC1 --> |NonBlockingAsyncCache| CDBR1_GW + GAC1 -.-> CDBR1_BE + GACN --> |NonBlockingAsyncCache| CDBRN_GW + GACN -.-> CDBRN_BE + end +``` + +## Sequence of interaction + +```mermaid +sequenceDiagram + GlobalAddressResolver->>GlobalEndpointManager: ResolveServiceEndpoint(DocumentServiceRequest) + GlobalEndpointManager-->>GlobalAddressResolver: URI (ServingRegion) + GlobalAddressResolver->>GlobalAddressResolver: GetEndpointCache(ServingRegion).AddressResolver + + critical RegularAddressResolution(Implicit contract of dsr.RequestContext.ResolvedPartitionKeyRange population) + GlobalAddressResolver->>AddressResolver: ResolveAsync(DocumentServiceRequest) + AddressResolver-->>GlobalAddressResolver: PartitionAddressInformation + end + + critical AnyPerpartitionOverrides + GlobalAddressResolver->>GlobalPartitionEndpointManager: TryAddPartitionLevelLocationOverride(DocumentServiceRequest) + GlobalPartitionEndpointManager-->>GlobalAddressResolver: (bool, DSR.RequestContext.RouteToLocation) + + option YES + GlobalAddressResolver->>GlobalEndpointManager: ResolveServiceEndpoint(DocumentServiceRequest) + GlobalEndpointManager-->>GlobalAddressResolver: URI (ServingRegion) + end + GlobalAddressResolver->>GlobalAddressResolver: GetEndpointCache(ServingRegion) + GlobalAddressResolver->>AddressResolver: ResolveAsync(DocumentServiceRequest) + AddressResolver-->>GlobalAddressResolver: PartitionAddressInformation +``` \ No newline at end of file From 01c1cd447d567f7f1f77daf1d7807e76f5b2face Mon Sep 17 00:00:00 2001 From: Fabian Meiswinkel Date: Thu, 10 Nov 2022 22:29:39 +0000 Subject: [PATCH 012/240] [Internal] Emulator unit tests: Adds IdEncoding unit tests for ComputeGateway (#3556) * Adding IdEncoding unit tests for ComputeGateway * Reacting to code review feedback * Updating md files --- CONTRIBUTING.md | 6 ++ ...ComputeGatewayCosmosItemIdEncodingTests.cs | 16 ++++++ .../CosmosItemIdEncodingTestsBase.cs | 57 +++++++++++++++---- ...outingGatewayCosmosItemIdEncodingTests.cs} | 5 +- .../Utils/BaseCosmosClientHelper.cs | 8 ++- .../Utils/TestCommon.cs | 12 ++-- .../settings.json | 2 + templates/emulator-setup.yml | 2 +- 8 files changed, 87 insertions(+), 21 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputeGatewayCosmosItemIdEncodingTests.cs rename Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/{GatewayCosmosItemIdEncodingTests.cs => RoutingGatewayCosmosItemIdEncodingTests.cs} (63%) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fc1d06f852..e3cb1edc66 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -125,6 +125,12 @@ Or all through `Re-run failed checks` on the top right corner: ![Re-run all failures](docs/images/contributing-rerunall.png) +## Usage of Cosmos DB Emulator for running unit tests + +- - The same version of the emulator used in the CI pipelines can be downloaded [here](https://aka.ms/cosmosdb-emulator) +- More information about how ro use the emulator for development is documented [here](https://github.com/Azure/azure-documentdb-dotnet/blob/master/docs/documentdb-nosql-local-emulator.md) +- You can start the emulator with same parameters as the emulator unit tests in the CI pipeline via `.\CosmosDB.Emulator.exe /DisableRateLimiting /PartitionCount=100 /Consistency=Strong /enableRio /EnablePreview /EnableAadAuthentication /EnableSqlComputeEndpoint` + ## Troubleshooting - [General .NET SDK Troubleshooting](https://docs.microsoft.com/azure/cosmos-db/sql/troubleshoot-dot-net-sdk) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputeGatewayCosmosItemIdEncodingTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputeGatewayCosmosItemIdEncodingTests.cs new file mode 100644 index 0000000000..a3dcb8b52a --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputeGatewayCosmosItemIdEncodingTests.cs @@ -0,0 +1,16 @@ +namespace Microsoft.Azure.Cosmos +{ + using Microsoft.Azure.Cosmos.Fluent; + using Microsoft.Azure.Cosmos.SDK.EmulatorTests; + + [TestClass] + public class ComputeGatewayCosmosItemIdEncodingTests : CosmosItemIdEncodingTestsBase + { + protected override string AccountEndpointOverride => Utils.ConfigurationManager.AppSettings["ComputeGatewayEndpoint"]; + + protected override void ConfigureClientBuilder(CosmosClientBuilder builder) + { + builder.WithConnectionModeGateway(); + } + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemIdEncodingTestsBase.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemIdEncodingTestsBase.cs index 36be8df06d..aef4323045 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemIdEncodingTestsBase.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemIdEncodingTestsBase.cs @@ -19,9 +19,13 @@ public abstract class CosmosItemIdEncodingTestsBase : BaseCosmosClientHelper encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true); + private static readonly int computeGatewayPort = Int32.Parse(Utils.ConfigurationManager.AppSettings["ComputeGatewayPort"]); + private Container Container = null; private ContainerProperties containerSettings = null; + protected virtual String AccountEndpointOverride => null; + protected abstract void ConfigureClientBuilder(CosmosClientBuilder builder); [TestInitialize] @@ -29,7 +33,8 @@ public async Task TestInitialize() { await base.TestInit( validateSinglePartitionKeyRangeCacheCall: true, - customizeClientBuilder: this.ConfigureClientBuilder); + customizeClientBuilder: this.ConfigureClientBuilder, + accountEndpointOverride: this.AccountEndpointOverride); string PartitionKey = "/pk"; this.containerSettings = new ContainerProperties(id: Guid.NewGuid().ToString(), partitionKeyPath: PartitionKey); @@ -483,9 +488,17 @@ public async Task IdWithCarriageReturn() { TransportMode = ConnectionMode.Gateway, ExpectedCreateStatusCode = HttpStatusCode.Created, - ExpectedReadStatusCode = HttpStatusCode.BadRequest,// CGW - HttpStatusCode.OK, - ExpectedReplaceStatusCode = HttpStatusCode.BadRequest,// CGW - HttpStatusCode.OK, - ExpectedDeleteStatusCode = HttpStatusCode.BadRequest,// CGW - HttpStatusCode.NoContent, + ExpectedReadStatusCode = HttpStatusCode.BadRequest, + ExpectedReplaceStatusCode = HttpStatusCode.BadRequest, + ExpectedDeleteStatusCode = HttpStatusCode.BadRequest, + }, + ComputeGateway = new TestScenarioExpectations + { + TransportMode = ConnectionMode.Gateway, + ExpectedCreateStatusCode = HttpStatusCode.Created, + ExpectedReadStatusCode = HttpStatusCode.OK, + ExpectedReplaceStatusCode = HttpStatusCode.OK, + ExpectedDeleteStatusCode = HttpStatusCode.NoContent, }, Direct = new TestScenarioExpectations { @@ -511,9 +524,17 @@ public async Task IdWithTab() { TransportMode = ConnectionMode.Gateway, ExpectedCreateStatusCode = HttpStatusCode.Created, - ExpectedReadStatusCode = HttpStatusCode.BadRequest,// CGW - HttpStatusCode.OK, - ExpectedReplaceStatusCode = HttpStatusCode.BadRequest,// CGW - HttpStatusCode.OK, - ExpectedDeleteStatusCode = HttpStatusCode.BadRequest,// CGW - HttpStatusCode.NoContent, + ExpectedReadStatusCode = HttpStatusCode.BadRequest, + ExpectedReplaceStatusCode = HttpStatusCode.BadRequest, + ExpectedDeleteStatusCode = HttpStatusCode.BadRequest, + }, + ComputeGateway = new TestScenarioExpectations + { + TransportMode = ConnectionMode.Gateway, + ExpectedCreateStatusCode = HttpStatusCode.Created, + ExpectedReadStatusCode = HttpStatusCode.OK, + ExpectedReplaceStatusCode = HttpStatusCode.OK, + ExpectedDeleteStatusCode = HttpStatusCode.NoContent, }, Direct = new TestScenarioExpectations { @@ -539,9 +560,17 @@ public async Task IdWithLineFeed() { TransportMode = ConnectionMode.Gateway, ExpectedCreateStatusCode = HttpStatusCode.Created, - ExpectedReadStatusCode = HttpStatusCode.BadRequest,// CGW - HttpStatusCode.OK, - ExpectedReplaceStatusCode = HttpStatusCode.BadRequest,// CGW - HttpStatusCode.OK, - ExpectedDeleteStatusCode = HttpStatusCode.BadRequest,// CGW - HttpStatusCode.NoContent, + ExpectedReadStatusCode = HttpStatusCode.BadRequest, + ExpectedReplaceStatusCode = HttpStatusCode.BadRequest, + ExpectedDeleteStatusCode = HttpStatusCode.BadRequest, + }, + ComputeGateway = new TestScenarioExpectations + { + TransportMode = ConnectionMode.Gateway, + ExpectedCreateStatusCode = HttpStatusCode.Created, + ExpectedReadStatusCode = HttpStatusCode.OK, + ExpectedReplaceStatusCode = HttpStatusCode.OK, + ExpectedDeleteStatusCode = HttpStatusCode.NoContent, }, Direct = new TestScenarioExpectations { @@ -559,8 +588,10 @@ public async Task IdWithLineFeed() private async Task ExecuteTestCase(TestScenario scenario) { TestScenarioExpectations expected = - this.cosmosClient.ClientOptions.ConnectionMode == ConnectionMode.Gateway ? - scenario.Gateway : scenario.Direct; + this.cosmosClient.ClientOptions.ConnectionMode == ConnectionMode.Direct ? + scenario.Direct : + this.cosmosClient.Endpoint.Port == computeGatewayPort ? + scenario.ComputeGateway ?? scenario.Gateway : scenario.Gateway; Console.WriteLine($"Scenario: {scenario.Name}, Id: \"{scenario.Id}\""); @@ -671,6 +702,8 @@ private class TestScenario public TestScenarioExpectations Gateway { get; set; } + public TestScenarioExpectations ComputeGateway { get; set; } + public TestScenarioExpectations Direct { get; set; } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayCosmosItemIdEncodingTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/RoutingGatewayCosmosItemIdEncodingTests.cs similarity index 63% rename from Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayCosmosItemIdEncodingTests.cs rename to Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/RoutingGatewayCosmosItemIdEncodingTests.cs index 5cd9e53a37..5052e629f5 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayCosmosItemIdEncodingTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/RoutingGatewayCosmosItemIdEncodingTests.cs @@ -4,11 +4,12 @@ using Microsoft.Azure.Cosmos.SDK.EmulatorTests; [TestClass] - public class GatewayCosmosItemIdEncodingTests : CosmosItemIdEncodingTestsBase + public class RoutingGatewayCosmosItemIdEncodingTests : CosmosItemIdEncodingTestsBase { protected override void ConfigureClientBuilder(CosmosClientBuilder builder) { - builder.WithConnectionModeGateway(); + builder + .WithConnectionModeGateway(); } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/BaseCosmosClientHelper.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/BaseCosmosClientHelper.cs index ab4027925a..20f083d85d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/BaseCosmosClientHelper.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/BaseCosmosClientHelper.cs @@ -18,12 +18,16 @@ public abstract class BaseCosmosClientHelper public async Task TestInit( bool validateSinglePartitionKeyRangeCacheCall = false, - Action customizeClientBuilder = null) + Action customizeClientBuilder = null, + string accountEndpointOverride = null) { this.cancellationTokenSource = new CancellationTokenSource(); this.cancellationToken = this.cancellationTokenSource.Token; - this.cosmosClient = TestCommon.CreateCosmosClient(validatePartitionKeyRangeCalls: validateSinglePartitionKeyRangeCacheCall, customizeClientBuilder: customizeClientBuilder); + this.cosmosClient = TestCommon.CreateCosmosClient( + validatePartitionKeyRangeCalls: validateSinglePartitionKeyRangeCacheCall, + customizeClientBuilder: customizeClientBuilder, + accountEndpointOverride: accountEndpointOverride); this.database = await this.cosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString(), cancellationToken: this.cancellationToken); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs index e85f9c565c..265e9542ef 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs @@ -75,10 +75,13 @@ internal static (string endpoint, string authKey) GetAccountInfo() internal static CosmosClientBuilder GetDefaultConfiguration( bool useCustomSeralizer = true, - bool validatePartitionKeyRangeCalls = false) + bool validatePartitionKeyRangeCalls = false, + string accountEndpointOverride = null) { (string endpoint, string authKey) = TestCommon.GetAccountInfo(); - CosmosClientBuilder clientBuilder = new CosmosClientBuilder(accountEndpoint: endpoint, authKeyOrResourceToken: authKey); + CosmosClientBuilder clientBuilder = new CosmosClientBuilder( + accountEndpoint: accountEndpointOverride ?? endpoint, + authKeyOrResourceToken: authKey); if (useCustomSeralizer) { clientBuilder.WithCustomSerializer(new CosmosJsonDotNetSerializer()); @@ -95,9 +98,10 @@ internal static CosmosClientBuilder GetDefaultConfiguration( internal static CosmosClient CreateCosmosClient( Action customizeClientBuilder = null, bool useCustomSeralizer = true, - bool validatePartitionKeyRangeCalls = false) + bool validatePartitionKeyRangeCalls = false, + string accountEndpointOverride = null) { - CosmosClientBuilder cosmosClientBuilder = GetDefaultConfiguration(useCustomSeralizer, validatePartitionKeyRangeCalls); + CosmosClientBuilder cosmosClientBuilder = GetDefaultConfiguration(useCustomSeralizer, validatePartitionKeyRangeCalls, accountEndpointOverride); customizeClientBuilder?.Invoke(cosmosClientBuilder); CosmosClient client = cosmosClientBuilder.Build(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/settings.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/settings.json index 31350d975b..51ecc8a707 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/settings.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/settings.json @@ -1,6 +1,8 @@ { "AppSettings": { "GatewayEndpoint": "https://127.0.0.1:8081/", + "ComputeGatewayEndpoint": "https://localhost:8903/", + "ComputeGatewayPort": "8903", "Location": "South Central US", "Location2": "West US", "GlobalDatabaseAccountId": "globaldb", diff --git a/templates/emulator-setup.yml b/templates/emulator-setup.yml index 533e07a19d..10b5664d82 100644 --- a/templates/emulator-setup.yml +++ b/templates/emulator-setup.yml @@ -11,7 +11,7 @@ steps: mkdir "$env:temp\Azure Cosmos DB Emulator" lessmsi x "$env:temp\azure-cosmosdb-emulator.msi" "$env:temp\Azure Cosmos DB Emulator\" Write-Host "Starting Comsos DB Emulator" -ForegroundColor green - Start-Process "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe" "/NoExplorer /NoUI /DisableRateLimiting /PartitionCount=100 /Consistency=Strong /enableRio /EnablePreview /EnableAadAuthentication" -Verb RunAs + Start-Process "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe" "/NoExplorer /NoUI /DisableRateLimiting /PartitionCount=100 /Consistency=Strong /enableRio /EnablePreview /EnableAadAuthentication /EnableSqlComputeEndpoint" -Verb RunAs Import-Module "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator" Get-Item env:* | Sort-Object -Property Name for ($i=0; $i -lt 10; $i++) { From ab1f249c4074545765e466ece547a8c96fe51095 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Tue, 15 Nov 2022 10:44:55 -0800 Subject: [PATCH 013/240] Change Feed Processor: Adds support for Resource Tokens (#3566) * Adding rid parsing * Test * Removing dead code * Contract update --- .../Utils/CosmosContainerExtensions.cs | 6 +- .../src/Resource/Conflict/ConflictsCore.cs | 6 +- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 2 - .../ChangeFeed/SmokeTests.cs | 59 +++++++++++++++++++ .../ChangeFeedEstimatorIteratorTests.cs | 8 +-- .../ChangeFeedProcessorCoreTests.cs | 4 ++ .../CosmosConflictTests.cs | 18 +++++- 7 files changed, 88 insertions(+), 15 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/Utils/CosmosContainerExtensions.cs b/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/Utils/CosmosContainerExtensions.cs index f88b1e9e5f..d37e8c295c 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/Utils/CosmosContainerExtensions.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/Utils/CosmosContainerExtensions.cs @@ -121,7 +121,11 @@ public static async Task GetMonitoredDatabaseAndContainerRidAsync( forceRefresh: false, NoOpTrace.Singleton, cancellationToken: cancellationToken); - string databaseRid = await ((DatabaseInternal)((ContainerInternal)monitoredContainer).Database).GetRIDAsync(cancellationToken); + + // Extract DbRid from ContainerRid + Documents.ResourceId resourceId = Documents.ResourceId.Parse(containerRid); + string databaseRid = resourceId.DatabaseId.ToString(); + return $"{databaseRid}_{containerRid}"; } diff --git a/Microsoft.Azure.Cosmos/src/Resource/Conflict/ConflictsCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Conflict/ConflictsCore.cs index 0f52956fb6..78f6a46eef 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Conflict/ConflictsCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Conflict/ConflictsCore.cs @@ -144,14 +144,14 @@ public async Task> ReadCurrentAsync( throw new ArgumentNullException(nameof(cosmosConflict)); } - // SourceResourceId is RID based on Conflicts, so we need to obtain the db and container rid - DatabaseInternal databaseCore = (DatabaseInternal)this.container.Database; - string databaseResourceId = await databaseCore.GetRIDAsync(cancellationToken); string containerResourceId = await this.container.GetCachedRIDAsync( forceRefresh: false, trace, cancellationToken: cancellationToken); + ResourceId resourceId = ResourceId.Parse(containerResourceId); + string databaseResourceId = resourceId.DatabaseId.ToString(); + string dbLink = this.ClientContext.CreateLink( parentLink: string.Empty, uriPathSegment: Paths.DatabasesPathSegment, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml index e055a4f178..07da410dcf 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml @@ -3068,8 +3068,6 @@ }]]> Cosmos.Change Feed Estimator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.ReadAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/SmokeTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/SmokeTests.cs index f00d9055d8..b4460b6ad6 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/SmokeTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/SmokeTests.cs @@ -77,6 +77,65 @@ public async Task WritesTriggerDelegate_WithLeaseContainer() CollectionAssert.AreEqual(expectedIds.ToList(), receivedIds); } + [TestMethod] + public async Task WritesTriggerDelegate_WithLeaseContainer_UsingResourceTokens() + { + User user = await this.Container.Database.CreateUserAsync("testUser"); + PermissionResponse monitoredContainerPermissions = await user.CreatePermissionAsync( + new PermissionProperties( + id: "testPermission", + permissionMode: PermissionMode.All, + container: this.Container) + ); + + PermissionResponse leaseContainerPermissions = await user.CreatePermissionAsync( + new PermissionProperties( + id: "testPermission2", + permissionMode: PermissionMode.All, + container: this.LeaseContainer) + ); + + using CosmosClient clientForMonitoredContainer = new CosmosClient(this.Container.Database.Client.Endpoint.ToString(), authKeyOrResourceToken: monitoredContainerPermissions.Resource.Token); + using CosmosClient clientForLeaseContainer = new CosmosClient(this.Container.Database.Client.Endpoint.ToString(), authKeyOrResourceToken: leaseContainerPermissions.Resource.Token); + + ManualResetEvent allDocsProcessed = new ManualResetEvent(false); + IEnumerable expectedIds = Enumerable.Range(0, 100); + List receivedIds = new List(); + ChangeFeedProcessor processor = clientForMonitoredContainer.GetContainer(this.Container.Database.Id, this.Container.Id) + .GetChangeFeedProcessorBuilder("test", (IReadOnlyCollection docs, CancellationToken token) => + { + foreach (TestClass doc in docs) + { + receivedIds.Add(int.Parse(doc.id)); + } + + if (receivedIds.Count == 100) + { + allDocsProcessed.Set(); + } + + return Task.CompletedTask; + }) + .WithInstanceName("random") + .WithLeaseContainer(clientForLeaseContainer.GetContainer(this.LeaseContainer.Database.Id, this.LeaseContainer.Id)).Build(); + + await processor.StartAsync(); + // Letting processor initialize + await Task.Delay(BaseChangeFeedClientHelper.ChangeFeedSetupTime); + // Inserting documents + foreach (int id in expectedIds) + { + await this.Container.CreateItemAsync(new { id = id.ToString() }); + } + + // Waiting on all notifications to finish + bool isStartOk = allDocsProcessed.WaitOne(30 * BaseChangeFeedClientHelper.ChangeFeedCleanupTime); + await processor.StopAsync(); + Assert.IsTrue(isStartOk, "Timed out waiting for docs to process"); + // Verify that we maintain order + CollectionAssert.AreEqual(expectedIds.ToList(), receivedIds); + } + [TestMethod] public async Task ExceptionsRetryBatch() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs index bf33fe06a5..4b9a50c75d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs @@ -350,14 +350,10 @@ static FeedIteratorInternal feedCreator(DocumentServiceLease lease, string conti } }); - string databaseRid = Guid.NewGuid().ToString(); - Mock mockedMonitoredDatabase = new Mock(MockBehavior.Strict); - mockedMonitoredDatabase.Setup(c => c.GetRIDAsync(It.IsAny())).ReturnsAsync(databaseRid); - - string monitoredContainerRid = Guid.NewGuid().ToString(); + string monitoredContainerRid = "V4lVAMl0wuQ="; + string databaseRid = Documents.ResourceId.Parse(monitoredContainerRid).DatabaseId.ToString(); Mock mockedMonitoredContainer = new Mock(MockBehavior.Strict); mockedMonitoredContainer.Setup(c => c.GetCachedRIDAsync(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(monitoredContainerRid); - mockedMonitoredContainer.Setup(c => c.Database).Returns(mockedMonitoredDatabase.Object); mockedMonitoredContainer.Setup(c => c.ClientContext).Returns(mockedContext.Object); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedProcessorCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedProcessorCoreTests.cs index a7ba782230..c5e74fbfd9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedProcessorCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedProcessorCoreTests.cs @@ -7,11 +7,13 @@ namespace Microsoft.Azure.Cosmos.ChangeFeed.Tests using System; using System.Collections.Generic; using System.Linq; + using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.ChangeFeed.Configuration; using Microsoft.Azure.Cosmos.ChangeFeed.FeedProcessing; using Microsoft.Azure.Cosmos.ChangeFeed.LeaseManagement; using Microsoft.Azure.Cosmos.Tests; + using Microsoft.Azure.Cosmos.Tracing; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; @@ -233,6 +235,8 @@ private static ContainerInternal GetMockedContainer(string containerName = null) { Mock mockedContainer = MockCosmosUtil.CreateMockContainer(containerName: containerName); mockedContainer.Setup(c => c.ClientContext).Returns(ChangeFeedProcessorCoreTests.GetMockedClientContext()); + string monitoredContainerRid = "V4lVAMl0wuQ="; + mockedContainer.Setup(c => c.GetCachedRIDAsync(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(monitoredContainerRid); Mock mockedDatabase = MockCosmosUtil.CreateMockDatabase(); mockedContainer.Setup(c => c.Database).Returns(mockedDatabase.Object); return mockedContainer.Object; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosConflictTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosConflictTests.cs index e2361bddf8..2bb48fc75b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosConflictTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosConflictTests.cs @@ -13,6 +13,7 @@ namespace Microsoft.Azure.Cosmos.Tests using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Newtonsoft.Json.Linq; + using Microsoft.Azure.Cosmos.Tracing; [TestClass] public class CosmosConflictTests @@ -38,7 +39,7 @@ public async Task ReadCurrentGetsCorrectRID() const string expectedRID = "something"; Cosmos.PartitionKey partitionKey = new Cosmos.PartitionKey("pk"); // Using "test" as container name because the Mocked DocumentClient has it hardcoded - Uri expectedRequestUri = new Uri($"dbs/conflictsDb/colls/test/docs/{expectedRID}", UriKind.Relative); + Uri expectedRequestUri = new Uri($"dbs/V4lVAA==/colls/V4lVAMl0wuQ=/docs/{expectedRID}", UriKind.Relative); ContainerInternal container = CosmosConflictTests.GetMockedContainer((request, cancellationToken) => { Assert.AreEqual(OperationType.Read, request.OperationType); Assert.AreEqual(ResourceType.Document, request.ResourceType); @@ -74,7 +75,7 @@ public async Task DeleteSendsCorrectPayload() { const string expectedId = "something"; Cosmos.PartitionKey partitionKey = new Cosmos.PartitionKey("pk"); - Uri expectedRequestUri = new Uri($"/dbs/conflictsDb/colls/conflictsColl/conflicts/{expectedId}", UriKind.Relative); + Uri expectedRequestUri = new Uri($"/dbs/myDb/colls/conflictsColl/conflicts/{expectedId}", UriKind.Relative); ContainerInternal container = CosmosConflictTests.GetMockedContainer((request, cancellationToken) => { Assert.AreEqual(OperationType.Delete, request.OperationType); Assert.AreEqual(ResourceType.Conflict, request.ResourceType); @@ -91,7 +92,18 @@ public async Task DeleteSendsCorrectPayload() private static ContainerInternal GetMockedContainer(Func> handlerFunc) { - return new ContainerInlineCore(CosmosConflictTests.GetMockedClientContext(handlerFunc), MockCosmosUtil.CreateMockDatabase("conflictsDb").Object, "conflictsColl"); + CosmosClientContext clientContext = CosmosConflictTests.GetMockedClientContext(handlerFunc); + Mock mockedContainer = MockCosmosUtil.CreateMockContainer(containerName: "conflictsColl"); + DatabaseInternal database = MockCosmosUtil.CreateMockDatabase("conflictsDb").Object; + string monitoredContainerRid = "V4lVAMl0wuQ="; + mockedContainer.Setup(c => c.GetCachedRIDAsync(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(monitoredContainerRid); + mockedContainer.Setup(c => c.Database).Returns(database); + mockedContainer.Setup(c => c.GetReadFeedIterator(It.IsAny(), It.IsAny(), It.IsAny(), It.Is(r => r == ResourceType.Conflict), It.IsAny(), It.IsAny())) + .Returns( + (QueryDefinition qd, QueryRequestOptions o, string link, ResourceType t, string ct, int p) => new ContainerInlineCore(clientContext, database, "conflictsColl").GetReadFeedIterator(qd, o, link, t, ct, p)); + mockedContainer.Setup(c => c.ClientContext).Returns(clientContext); + mockedContainer.Setup(c => c.Conflicts).Returns(new ConflictsInlineCore(clientContext, mockedContainer.Object)); + return mockedContainer.Object; } private static CosmosClientContext GetMockedClientContext( From 9fb3a12de33557ae90f408bea01575172e9d1e98 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Wed, 16 Nov 2022 03:11:07 +0530 Subject: [PATCH 014/240] [Internal] AI integration: Refactor code how container and database name is flowing to opentelemetry module (#3532) * wip * WIP * Revert "WIP" This reverts commit 71275de54b9e67fa54a37e79d450b9597e173934. * Revert "wip" This reverts commit 586fa9865cc3f40dabd7ef90fb3e0cf499a045bc. * wip add containe and database info * redesign how container and database name information flows into opne telemetry data * test fix * fix test * fix tests * fix typos * baseline test fix Co-authored-by: Sourabh Jain --- Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs | 15 +- .../src/ChangeFeed/ChangeFeedIteratorCore.cs | 10 +- ...geFeedPartitionKeyResultSetIteratorCore.cs | 10 +- .../ChangeFeedEstimatorIterator.cs | 11 +- Microsoft.Azure.Cosmos/src/CosmosClient.cs | 164 ++++----- .../src/Resource/ClientContextCore.cs | 35 +- .../ClientEncryptionKeyInlineCore.cs | 22 +- .../Resource/Conflict/ConflictsInlineCore.cs | 6 + .../Resource/Container/ContainerInlineCore.cs | 320 +++++++++++------- .../src/Resource/CosmosClientContext.cs | 3 + .../Resource/Database/DatabaseInlineCore.cs | 228 +++++++------ .../FeedIterators/FeedIteratorInlineCore.cs | 20 +- .../FeedIteratorInlineCore{T}.cs | 21 +- .../Permission/PermissionInlineCore.cs | 31 +- .../src/Resource/Scripts/ScriptsInlineCore.cs | 163 +++++---- .../src/Resource/User/UserInlineCore.cs | 55 +-- .../OpenTelemetry/CosmosDbEventSource.cs | 5 +- .../Filters/DiagnosticsFilterHelper.cs | 3 +- .../OpenTelemetry/OpenTelemetryAttributes.cs | 20 +- .../OpenTelemetryCoreRecorder.cs | 50 ++- .../OpenTelemetryRecorderFactory.cs | 9 +- .../OpenTelemetry/OpenTelemetryResponse.cs | 12 +- .../OpenTelemetry/OpenTelemetryResponse{T}.cs | 12 +- ...iterBaselineTests.BatchOperationsAsync.xml | 2 +- ...riterBaselineTests.BulkOperationsAsync.xml | 202 +++++------ ...aceWriterBaselineTests.ChangeFeedAsync.xml | 44 +-- ...eWriterBaselineTests.MiscellanousAsync.xml | 8 +- ...neTests.PointOperationsExceptionsAsync.xml | 12 +- ...EndTraceWriterBaselineTests.QueryAsync.xml | 56 +-- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 32 +- ...TraceWriterBaselineTests.ReadManyAsync.xml | 14 +- ...selineTests.StreamPointOperationsAsync.xml | 8 +- ...aselineTests.TypedPointOperationsAsync.xml | 8 +- .../QueryPlanBaselineTests.Spatial.xml | 6 +- .../Batch/BatchAsyncBatcherTests.cs | 7 +- .../Batch/BatchAsyncContainerExecutorTests.cs | 7 +- .../Batch/BatchAsyncStreamerTests.cs | 7 +- .../ChangeFeedEstimatorIteratorTests.cs | 19 +- ...dPartitionKeyResultSetIteratorCoreTests.cs | 45 ++- .../CosmosDiagnosticsUnitTests.cs | 18 +- .../CosmosItemUnitTests.cs | 14 +- .../FeedRange/ChangeFeedIteratorCoreTests.cs | 7 +- .../Telemetry/DiagnosticsFilterHelperTest.cs | 4 +- 43 files changed, 1014 insertions(+), 731 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs b/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs index 24975c0d12..e211117d6f 100644 --- a/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs +++ b/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs @@ -219,9 +219,12 @@ public override Task ExecuteAsync( CancellationToken cancellationToken = default) { return this.container.ClientContext.OperationHelperAsync( - nameof(ExecuteAsync), - requestOptions, - (trace) => + operationName: nameof(ExecuteAsync), + containerName: this.container.Id, + databaseName: this.container.Database.Id, + operationType: Documents.OperationType.Replace, + requestOptions: requestOptions, + task: (trace) => { BatchExecutor executor = new BatchExecutor( container: this.container, @@ -232,10 +235,8 @@ public override Task ExecuteAsync( this.operations = new List(); return executor.ExecuteAsync(trace, cancellationToken); }, - (response) => new OpenTelemetryResponse( - responseMessage: response, - containerName: this.container?.Id, - databaseName: this.container?.Database?.Id)); + openTelemetry: (response) => new OpenTelemetryResponse( + responseMessage: response)); } /// diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs index ca1f60ba0b..87b34cca17 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedIteratorCore.cs @@ -13,8 +13,8 @@ namespace Microsoft.Azure.Cosmos.ChangeFeed using Microsoft.Azure.Cosmos.Pagination; using Microsoft.Azure.Cosmos.Query.Core; using Microsoft.Azure.Cosmos.Query.Core.Monads; - using Microsoft.Azure.Cosmos.Routing; using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Documents; internal sealed class ChangeFeedIteratorCore : FeedIteratorInternal { @@ -222,12 +222,12 @@ public ChangeFeedIteratorCore( public override async Task ReadNextAsync(CancellationToken cancellationToken = default) { return await this.clientContext.OperationHelperAsync("Change Feed Iterator Read Next Async", + containerName: this.container?.Id, + databaseName: this.container?.Database?.Id ?? this.databaseName, + operationType: OperationType.ReadFeed, requestOptions: this.changeFeedRequestOptions, task: (trace) => this.ReadNextInternalAsync(trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse( - responseMessage: response, - containerName: this.container?.Id, - databaseName: this.container?.Database?.Id), + openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response), traceComponent: TraceComponent.ChangeFeed, traceLevel: TraceLevel.Info); } diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs index 4c275227bf..4c7b8f34f0 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCore.cs @@ -91,13 +91,15 @@ public override CosmosElement GetCosmosElementContinuationToken() /// A change feed response from cosmos service public override Task ReadNextAsync(CancellationToken cancellationToken = default) { - return this.clientContext.OperationHelperAsync("Change Feed Processor Read Next Async", + return this.clientContext.OperationHelperAsync( + operationName: "Change Feed Processor Read Next Async", + containerName: this.container?.Id, + databaseName: this.container?.Database?.Id ?? this.databaseName, + operationType: Documents.OperationType.ReadFeed, requestOptions: this.changeFeedOptions, task: (trace) => this.ReadNextAsync(trace, cancellationToken), openTelemetry: (response) => new OpenTelemetryResponse( - responseMessage: response, - containerName: this.container?.Id, - databaseName: this.container?.Database?.Id), + responseMessage: response), traceComponent: TraceComponent.ChangeFeed, traceLevel: TraceLevel.Info); } diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/ChangeFeedEstimatorIterator.cs b/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/ChangeFeedEstimatorIterator.cs index d8dca1ef60..47469542de 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/ChangeFeedEstimatorIterator.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/ChangeFeedEstimatorIterator.cs @@ -111,13 +111,14 @@ private ChangeFeedEstimatorIterator( public override Task> ReadNextAsync(CancellationToken cancellationToken = default) { - return this.monitoredContainer.ClientContext.OperationHelperAsync("Change Feed Estimator Read Next Async", + return this.monitoredContainer.ClientContext.OperationHelperAsync( + operationName: "Change Feed Estimator Read Next Async", + containerName: this.monitoredContainer?.Id, + databaseName: this.monitoredContainer?.Database?.Id, + operationType: Documents.OperationType.ReadFeed, requestOptions: null, task: (trace) => this.ReadNextAsync(trace, cancellationToken), - openTelemetry: (response) => new OpenTelemetryResponse( - responseMessage: response, - containerName: this.monitoredContainer?.Id, - databaseName: this.monitoredContainer?.Database?.Id ?? this.databaseName), + openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response), traceComponent: TraceComponent.ChangeFeed, traceLevel: TraceLevel.Info); } diff --git a/Microsoft.Azure.Cosmos/src/CosmosClient.cs b/Microsoft.Azure.Cosmos/src/CosmosClient.cs index c4ab25f4e6..e5ca2d8b53 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClient.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClient.cs @@ -18,8 +18,6 @@ namespace Microsoft.Azure.Cosmos using Microsoft.Azure.Cosmos.Handlers; using Microsoft.Azure.Cosmos.Query.Core.Monads; using Microsoft.Azure.Cosmos.Query.Core.QueryPlan; - using Microsoft.Azure.Cosmos.Routing; - using Microsoft.Azure.Cosmos.Telemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; using Microsoft.Azure.Documents; @@ -629,9 +627,12 @@ internal CosmosClient( public virtual Task ReadAccountAsync() { return this.ClientContext.OperationHelperAsync( - nameof(ReadAccountAsync), - null, - (trace) => ((IDocumentClientInternal)this.DocumentClient).GetDatabaseAccountInternalAsync(this.Endpoint)); + operationName: nameof(ReadAccountAsync), + containerName: null, + databaseName: null, + operationType: OperationType.Read, + requestOptions: null, + task: (trace) => ((IDocumentClientInternal)this.DocumentClient).GetDatabaseAccountInternalAsync(this.Endpoint)); } /// @@ -715,9 +716,12 @@ public virtual Task CreateDatabaseAsync( } return this.ClientContext.OperationHelperAsync( - nameof(CreateDatabaseAsync), - requestOptions, - (trace) => + operationName: nameof(CreateDatabaseAsync), + containerName: null, + databaseName: id, + operationType: OperationType.Create, + requestOptions: requestOptions, + task: (trace) => { DatabaseProperties databaseProperties = this.PrepareDatabaseProperties(id); ThroughputProperties throughputProperties = ThroughputProperties.CreateManualThroughput(throughput); @@ -729,10 +733,7 @@ public virtual Task CreateDatabaseAsync( trace: trace, cancellationToken: cancellationToken); }, - (response) => new OpenTelemetryResponse( - responseMessage: response, - containerName: null, - databaseName: response.Resource?.Id)); + openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); } /// @@ -765,9 +766,12 @@ public virtual Task CreateDatabaseAsync( } return this.ClientContext.OperationHelperAsync( - nameof(CreateDatabaseAsync), - requestOptions, - (trace) => + operationName: nameof(CreateDatabaseAsync), + containerName: null, + databaseName: id, + operationType: OperationType.Create, + requestOptions: requestOptions, + task: (trace) => { DatabaseProperties databaseProperties = this.PrepareDatabaseProperties(id); return this.CreateDatabaseInternalAsync( @@ -777,10 +781,7 @@ public virtual Task CreateDatabaseAsync( trace: trace, cancellationToken: cancellationToken); }, - (response) => new OpenTelemetryResponse( - responseMessage: response, - containerName: null, - databaseName: response.Resource?.Id)); + openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); } /// @@ -824,59 +825,60 @@ public virtual Task CreateDatabaseIfNotExistsAsync( return string.IsNullOrEmpty(id) ? throw new ArgumentNullException(nameof(id)) : this.ClientContext.OperationHelperAsync( - nameof(CreateDatabaseIfNotExistsAsync), - requestOptions, - async (trace) => - { - double totalRequestCharge = 0; - // Doing a Read before Create will give us better latency for existing databases - DatabaseProperties databaseProperties = this.PrepareDatabaseProperties(id); - DatabaseCore database = (DatabaseCore)this.GetDatabase(id); - using (ResponseMessage readResponse = await database.ReadStreamAsync( + operationName: nameof(CreateDatabaseIfNotExistsAsync), + containerName: null, + databaseName: id, + operationType: OperationType.Create, requestOptions: requestOptions, - trace: trace, - cancellationToken: cancellationToken)) - { - totalRequestCharge = readResponse.Headers.RequestCharge; - if (readResponse.StatusCode != HttpStatusCode.NotFound) + task: async (trace) => { - return this.ClientContext.ResponseFactory.CreateDatabaseResponse(database, readResponse); - } - } - - using (ResponseMessage createResponse = await this.CreateDatabaseStreamInternalAsync( - databaseProperties, - throughputProperties, - requestOptions, - trace, - cancellationToken)) - { - totalRequestCharge += createResponse.Headers.RequestCharge; - createResponse.Headers.RequestCharge = totalRequestCharge; - - if (createResponse.StatusCode != HttpStatusCode.Conflict) - { - return this.ClientContext.ResponseFactory.CreateDatabaseResponse(this.GetDatabase(databaseProperties.Id), createResponse); - } - } - - // This second Read is to handle the race condition when 2 or more threads have Read the database and only one succeeds with Create - // so for the remaining ones we should do a Read instead of throwing Conflict exception - using (ResponseMessage readResponseAfterConflict = await database.ReadStreamAsync( - requestOptions: requestOptions, - trace: trace, - cancellationToken: cancellationToken)) - { - totalRequestCharge += readResponseAfterConflict.Headers.RequestCharge; - readResponseAfterConflict.Headers.RequestCharge = totalRequestCharge; - - return this.ClientContext.ResponseFactory.CreateDatabaseResponse(this.GetDatabase(databaseProperties.Id), readResponseAfterConflict); - } - }, - (response) => new OpenTelemetryResponse( - responseMessage: response, - containerName: null, - databaseName: response.Resource?.Id)); + double totalRequestCharge = 0; + // Doing a Read before Create will give us better latency for existing databases + DatabaseProperties databaseProperties = this.PrepareDatabaseProperties(id); + DatabaseCore database = (DatabaseCore)this.GetDatabase(id); + using (ResponseMessage readResponse = await database.ReadStreamAsync( + requestOptions: requestOptions, + trace: trace, + cancellationToken: cancellationToken)) + { + totalRequestCharge = readResponse.Headers.RequestCharge; + if (readResponse.StatusCode != HttpStatusCode.NotFound) + { + return this.ClientContext.ResponseFactory.CreateDatabaseResponse(database, readResponse); + } + } + + using (ResponseMessage createResponse = await this.CreateDatabaseStreamInternalAsync( + databaseProperties, + throughputProperties, + requestOptions, + trace, + cancellationToken)) + { + totalRequestCharge += createResponse.Headers.RequestCharge; + createResponse.Headers.RequestCharge = totalRequestCharge; + + if (createResponse.StatusCode != HttpStatusCode.Conflict) + { + return this.ClientContext.ResponseFactory.CreateDatabaseResponse(this.GetDatabase(databaseProperties.Id), createResponse); + } + } + + // This second Read is to handle the race condition when 2 or more threads have Read the database and only one succeeds with Create + // so for the remaining ones we should do a Read instead of throwing Conflict exception + using (ResponseMessage readResponseAfterConflict = await database.ReadStreamAsync( + requestOptions: requestOptions, + trace: trace, + cancellationToken: cancellationToken)) + { + totalRequestCharge += readResponseAfterConflict.Headers.RequestCharge; + readResponseAfterConflict.Headers.RequestCharge = totalRequestCharge; + + return this.ClientContext.ResponseFactory.CreateDatabaseResponse(this.GetDatabase(databaseProperties.Id), readResponseAfterConflict); + } + }, + openTelemetry: (response) => new OpenTelemetryResponse( + responseMessage: response)); } /// @@ -1165,9 +1167,12 @@ public virtual Task CreateDatabaseStreamAsync( } return this.ClientContext.OperationHelperAsync( - nameof(CreateDatabaseStreamAsync), - requestOptions, - (trace) => + operationName: nameof(CreateDatabaseStreamAsync), + containerName: null, + databaseName: databaseProperties.Id, + operationType: OperationType.Create, + requestOptions: requestOptions, + task: (trace) => { this.ClientContext.ValidateResource(databaseProperties.Id); return this.CreateDatabaseStreamInternalAsync( @@ -1177,7 +1182,7 @@ public virtual Task CreateDatabaseStreamAsync( trace, cancellationToken); }, - (response) => new OpenTelemetryResponse(response)); + openTelemetry: (response) => new OpenTelemetryResponse(response)); } /// @@ -1260,9 +1265,12 @@ internal virtual Task CreateDatabaseStreamAsync( } return this.ClientContext.OperationHelperAsync( - nameof(CreateDatabaseIfNotExistsAsync), - requestOptions, - (trace) => + operationName: nameof(CreateDatabaseIfNotExistsAsync), + containerName: null, + databaseName: databaseProperties.Id, + operationType: OperationType.Create, + requestOptions: requestOptions, + task: (trace) => { this.ClientContext.ValidateResource(databaseProperties.Id); return this.CreateDatabaseStreamInternalAsync( @@ -1272,7 +1280,7 @@ internal virtual Task CreateDatabaseStreamAsync( trace, cancellationToken); }, - (response) => new OpenTelemetryResponse(response)); + openTelemetry: (response) => new OpenTelemetryResponse(response)); } private async Task CreateDatabaseInternalAsync( diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index 7bbb6c639b..191399943f 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -194,6 +194,9 @@ internal override void ValidateResource(string resourceId) internal override Task OperationHelperAsync( string operationName, + string containerName, + string databaseName, + OperationType operationType, RequestOptions requestOptions, Func> task, Func openTelemetry, @@ -201,13 +204,20 @@ internal override Task Tracing.TraceLevel traceLevel = Tracing.TraceLevel.Info) { return SynchronizationContext.Current == null ? - this.OperationHelperWithRootTraceAsync(operationName, + this.OperationHelperWithRootTraceAsync(operationName, + containerName, + databaseName, + operationType, requestOptions, task, openTelemetry, traceComponent, traceLevel) : - this.OperationHelperWithRootTraceWithSynchronizationContextAsync(operationName, + this.OperationHelperWithRootTraceWithSynchronizationContextAsync( + operationName, + containerName, + databaseName, + operationType, requestOptions, task, openTelemetry, @@ -217,6 +227,9 @@ internal override Task private async Task OperationHelperWithRootTraceAsync( string operationName, + string containerName, + string databaseName, + OperationType operationType, RequestOptions requestOptions, Func> task, Func openTelemetry, @@ -230,6 +243,9 @@ private async Task OperationHelperWithRootTraceAsync( trace.AddDatum("Client Configuration", this.client.ClientConfigurationTraceDatum); return await this.RunWithDiagnosticsHelperAsync( + containerName, + databaseName, + operationType, trace, task, openTelemetry, @@ -240,6 +256,9 @@ private async Task OperationHelperWithRootTraceAsync( private Task OperationHelperWithRootTraceWithSynchronizationContextAsync( string operationName, + string containerName, + string databaseName, + OperationType operationType, RequestOptions requestOptions, Func> task, Func openTelemetry, @@ -260,6 +279,9 @@ private Task OperationHelperWithRootTraceWithSynchronizationContextAsyn trace.AddDatum("Synchronization Context", syncContextVirtualAddress); return await this.RunWithDiagnosticsHelperAsync( + containerName, + databaseName, + operationType, trace, task, openTelemetry, @@ -449,6 +471,9 @@ protected virtual void Dispose(bool disposing) } private async Task RunWithDiagnosticsHelperAsync( + string containerName, + string databaseName, + OperationType operationType, ITrace trace, Func> task, Func openTelemetry, @@ -458,15 +483,15 @@ private async Task RunWithDiagnosticsHelperAsync( using (OpenTelemetryCoreRecorder recorder = OpenTelemetryRecorderFactory.CreateRecorder( operationName: operationName, + containerName: containerName, + databaseName: databaseName, + operationType: operationType, requestOptions: requestOptions, clientContext: this.isDisposed ? null : this)) using (new ActivityScope(Guid.NewGuid())) { try { - // Record Operation Name - recorder.Record(OpenTelemetryAttributeKeys.DbOperation, operationName); - TResult result = await task(trace).ConfigureAwait(false); if (openTelemetry != null && recorder.IsEnabled) { diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientEncryptionKey/ClientEncryptionKeyInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientEncryptionKey/ClientEncryptionKeyInlineCore.cs index 74f17b62c0..6d6305e30b 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientEncryptionKey/ClientEncryptionKeyInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientEncryptionKey/ClientEncryptionKeyInlineCore.cs @@ -29,10 +29,13 @@ public override Task ReadAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadAsync), - requestOptions, - (trace) => base.ReadAsync(requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReadAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Read, + requestOptions: requestOptions, + task: (trace) => base.ReadAsync(requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReplaceAsync( @@ -41,10 +44,13 @@ public override Task ReplaceAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReplaceAsync), - requestOptions, - (trace) => base.ReplaceAsync(clientEncryptionKeyProperties, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReplaceAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Replace, + requestOptions: requestOptions, + task: (trace) => base.ReplaceAsync(clientEncryptionKeyProperties, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Resource/Conflict/ConflictsInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Conflict/ConflictsInlineCore.cs index 6c691f1eff..17caba406e 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Conflict/ConflictsInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Conflict/ConflictsInlineCore.cs @@ -26,6 +26,9 @@ public override Task DeleteAsync( { return this.ClientContext.OperationHelperAsync( operationName: nameof(DeleteAsync), + containerName: null, + databaseName: null, + operationType: Documents.OperationType.Delete, requestOptions: null, task: (trace) => base.DeleteAsync(conflict, partitionKey, trace, cancellationToken), openTelemetry: (response) => new OpenTelemetryResponse(response)); @@ -86,6 +89,9 @@ public override Task> ReadCurrentAsync( { return this.ClientContext.OperationHelperAsync( operationName: nameof(ReadCurrentAsync), + containerName: null, + databaseName: null, + operationType: Documents.OperationType.Read, requestOptions: null, task: (trace) => base.ReadCurrentAsync(cosmosConflict, partitionKey, trace, cancellationToken), openTelemetry: (response) => new OpenTelemetryResponse(response)); diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs index 6cabc1a069..8e6e4495aa 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs @@ -37,10 +37,13 @@ public override Task ReadContainerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadContainerAsync), - requestOptions, - (trace) => base.ReadContainerAsync(trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReadContainerAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Read, + requestOptions: requestOptions, + task: (trace) => base.ReadContainerAsync(trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReadContainerStreamAsync( @@ -48,10 +51,13 @@ public override Task ReadContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadContainerStreamAsync), - requestOptions, - (trace) => base.ReadContainerStreamAsync(trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReadContainerStreamAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Read, + requestOptions: requestOptions, + task: (trace) => base.ReadContainerStreamAsync(trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReplaceContainerAsync( @@ -60,10 +66,13 @@ public override Task ReplaceContainerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReplaceContainerAsync), - requestOptions, - (trace) => base.ReplaceContainerAsync(containerProperties, trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReplaceContainerAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Replace, + requestOptions: requestOptions, + task: (trace) => base.ReplaceContainerAsync(containerProperties, trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReplaceContainerStreamAsync( @@ -72,10 +81,13 @@ public override Task ReplaceContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReplaceContainerStreamAsync), - requestOptions, - (trace) => base.ReplaceContainerStreamAsync(containerProperties, trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReplaceContainerStreamAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Replace, + requestOptions: requestOptions, + task: (trace) => base.ReplaceContainerStreamAsync(containerProperties, trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task DeleteContainerAsync( @@ -83,10 +95,13 @@ public override Task DeleteContainerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(DeleteContainerAsync), - requestOptions, - (trace) => base.DeleteContainerAsync(trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(DeleteContainerAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Delete, + requestOptions: requestOptions, + task: (trace) => base.DeleteContainerAsync(trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task DeleteContainerStreamAsync( @@ -94,18 +109,24 @@ public override Task DeleteContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(DeleteContainerStreamAsync), - requestOptions, - (trace) => base.DeleteContainerStreamAsync(trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(DeleteContainerStreamAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Delete, + requestOptions: requestOptions, + task: (trace) => base.DeleteContainerStreamAsync(trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReadThroughputAsync(CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadThroughputAsync), - null, - (trace) => base.ReadThroughputAsync(trace, cancellationToken)); + operationName: nameof(ReadThroughputAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Read, + requestOptions: null, + task: (trace) => base.ReadThroughputAsync(trace, cancellationToken)); } public override Task ReadThroughputAsync( @@ -113,10 +134,13 @@ public override Task ReadThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadThroughputAsync), - requestOptions, - (trace) => base.ReadThroughputAsync(requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReadThroughputAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Read, + requestOptions: requestOptions, + task: (trace) => base.ReadThroughputAsync(requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReplaceThroughputAsync( @@ -125,10 +149,13 @@ public override Task ReplaceThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReplaceThroughputAsync), - requestOptions, - (trace) => base.ReplaceThroughputAsync(throughput, trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReplaceThroughputAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Replace, + requestOptions: requestOptions, + task: (trace) => base.ReplaceThroughputAsync(throughput, trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReplaceThroughputAsync( @@ -137,28 +164,37 @@ public override Task ReplaceThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReplaceThroughputAsync), - requestOptions, - (trace) => base.ReplaceThroughputAsync(throughputProperties, trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReplaceThroughputAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Replace, + requestOptions: requestOptions, + task: (trace) => base.ReplaceThroughputAsync(throughputProperties, trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReadThroughputIfExistsAsync(RequestOptions requestOptions, CancellationToken cancellationToken) { return this.ClientContext.OperationHelperAsync( - nameof(ReadThroughputIfExistsAsync), - requestOptions, - (trace) => base.ReadThroughputIfExistsAsync(requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReadThroughputIfExistsAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Read, + requestOptions: requestOptions, + task: (trace) => base.ReadThroughputIfExistsAsync(requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReplaceThroughputIfExistsAsync(ThroughputProperties throughput, RequestOptions requestOptions, CancellationToken cancellationToken) { return this.ClientContext.OperationHelperAsync( - nameof(ReplaceThroughputIfExistsAsync), - requestOptions, - (trace) => base.ReplaceThroughputIfExistsAsync(throughput, trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReplaceThroughputIfExistsAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Replace, + requestOptions: requestOptions, + task: (trace) => base.ReplaceThroughputIfExistsAsync(throughput, trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task CreateItemStreamAsync( @@ -178,10 +214,13 @@ Task func(ITrace trace) } return this.ClientContext.OperationHelperAsync( - nameof(CreateItemStreamAsync), - requestOptions, - func, - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(CreateItemStreamAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Create, + requestOptions: requestOptions, + task: func, + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task> CreateItemAsync(T item, @@ -190,10 +229,13 @@ public override Task> CreateItemAsync(T item, CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(CreateItemAsync), - requestOptions, - (trace) => base.CreateItemAsync(item, trace, partitionKey, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(CreateItemAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Create, + requestOptions: requestOptions, + task: (trace) => base.CreateItemAsync(item, trace, partitionKey, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReadItemStreamAsync( @@ -203,10 +245,13 @@ public override Task ReadItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadItemStreamAsync), - requestOptions, - (trace) => base.ReadItemStreamAsync(id, partitionKey, trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReadItemStreamAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Read, + requestOptions: requestOptions, + task: (trace) => base.ReadItemStreamAsync(id, partitionKey, trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task> ReadItemAsync( @@ -217,6 +262,9 @@ public override Task> ReadItemAsync( { return this.ClientContext.OperationHelperAsync( nameof(ReadItemAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Read, requestOptions, (trace) => base.ReadItemAsync(id, partitionKey, trace, requestOptions, cancellationToken), (response) => new OpenTelemetryResponse(response)); @@ -229,10 +277,13 @@ public override Task UpsertItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(UpsertItemStreamAsync), - requestOptions, - (trace) => base.UpsertItemStreamAsync(streamPayload, partitionKey, trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(UpsertItemStreamAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Upsert, + requestOptions: requestOptions, + task: (trace) => base.UpsertItemStreamAsync(streamPayload, partitionKey, trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task> UpsertItemAsync( @@ -242,10 +293,13 @@ public override Task> UpsertItemAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(UpsertItemAsync), - requestOptions, - (trace) => base.UpsertItemAsync(item, trace, partitionKey, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(UpsertItemAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Upsert, + requestOptions: requestOptions, + task: (trace) => base.UpsertItemAsync(item, trace, partitionKey, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReplaceItemStreamAsync( @@ -256,10 +310,13 @@ public override Task ReplaceItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReplaceItemStreamAsync), - requestOptions, - (trace) => base.ReplaceItemStreamAsync(streamPayload, id, partitionKey, trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReplaceItemStreamAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Replace, + requestOptions: requestOptions, + task: (trace) => base.ReplaceItemStreamAsync(streamPayload, id, partitionKey, trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task> ReplaceItemAsync( @@ -270,10 +327,13 @@ public override Task> ReplaceItemAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReplaceItemAsync), - requestOptions, - (trace) => base.ReplaceItemAsync(item, id, trace, partitionKey, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReplaceItemAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Replace, + requestOptions: requestOptions, + task: (trace) => base.ReplaceItemAsync(item, id, trace, partitionKey, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task DeleteItemStreamAsync( @@ -283,10 +343,13 @@ public override Task DeleteItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(DeleteItemStreamAsync), - requestOptions, - (trace) => base.DeleteItemStreamAsync(id, partitionKey, trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(DeleteItemStreamAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Delete, + requestOptions: requestOptions, + task: (trace) => base.DeleteItemStreamAsync(id, partitionKey, trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task> DeleteItemAsync( @@ -296,10 +359,13 @@ public override Task> DeleteItemAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(DeleteItemAsync), - requestOptions, - (trace) => base.DeleteItemAsync(id, partitionKey, trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(DeleteItemAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Delete, + requestOptions: requestOptions, + task: (trace) => base.DeleteItemAsync(id, partitionKey, trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task PatchItemStreamAsync( @@ -310,10 +376,13 @@ public override Task PatchItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(PatchItemStreamAsync), - requestOptions, - (trace) => base.PatchItemStreamAsync(id, partitionKey, patchOperations, trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(PatchItemStreamAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Patch, + requestOptions: requestOptions, + task: (trace) => base.PatchItemStreamAsync(id, partitionKey, patchOperations, trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task PatchItemStreamAsync( @@ -324,10 +393,13 @@ public override Task PatchItemStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(PatchItemStreamAsync), - requestOptions, - (trace) => base.PatchItemStreamAsync(id, partitionKey, streamPayload, trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(PatchItemStreamAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Patch, + requestOptions: requestOptions, + task: (trace) => base.PatchItemStreamAsync(id, partitionKey, streamPayload, trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task> PatchItemAsync( @@ -338,10 +410,13 @@ public override Task> PatchItemAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(PatchItemAsync), - requestOptions, - (trace) => base.PatchItemAsync(id, partitionKey, patchOperations, trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(PatchItemAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Patch, + requestOptions: requestOptions, + task: (trace) => base.PatchItemAsync(id, partitionKey, patchOperations, trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReadManyItemsStreamAsync( @@ -350,13 +425,13 @@ public override Task ReadManyItemsStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadManyItemsStreamAsync), - null, - (trace) => base.ReadManyItemsStreamAsync(items, trace, readManyRequestOptions, cancellationToken), - (response) => new OpenTelemetryResponse( - responseMessage: response, - containerName: this.Id, - databaseName: this.Database?.Id)); + operationName: nameof(ReadManyItemsStreamAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Read, + requestOptions: null, + task: (trace) => base.ReadManyItemsStreamAsync(items, trace, readManyRequestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); } public override Task> ReadManyItemsAsync( @@ -366,12 +441,12 @@ public override Task> ReadManyItemsAsync( { return this.ClientContext.OperationHelperAsync( nameof(ReadManyItemsAsync), - null, - (trace) => base.ReadManyItemsAsync(items, trace, readManyRequestOptions, cancellationToken), - (response) => new OpenTelemetryResponse( - responseMessage: response, - containerName: this.Id, - databaseName: this.Database?.Id)); + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Read, + requestOptions: null, + task: (trace) => base.ReadManyItemsAsync(items, trace, readManyRequestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); } public override FeedIterator GetItemQueryStreamIterator( @@ -490,9 +565,12 @@ public override TransactionalBatch CreateTransactionalBatch(PartitionKey partiti public override Task> GetFeedRangesAsync(CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(GetFeedRangesAsync), - null, - (trace) => base.GetFeedRangesAsync(trace, cancellationToken)); + operationName: nameof(GetFeedRangesAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.ReadFeed, + requestOptions: null, + task: (trace) => base.GetFeedRangesAsync(trace, cancellationToken)); } public override FeedIterator GetChangeFeedStreamIterator( @@ -519,9 +597,12 @@ public override Task> GetPartitionKeyRangesAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(GetPartitionKeyRangesAsync), - null, - (trace) => base.GetPartitionKeyRangesAsync(feedRange, trace, cancellationToken)); + operationName: nameof(GetPartitionKeyRangesAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Read, + requestOptions: null, + task: (trace) => base.GetPartitionKeyRangesAsync(feedRange, trace, cancellationToken)); } public override FeedIterator GetItemQueryStreamIterator( @@ -572,10 +653,13 @@ public override Task DeleteAllItemsByPartitionKeyStreamAsync( CancellationToken cancellationToken = default(CancellationToken)) { return this.ClientContext.OperationHelperAsync( - nameof(DeleteAllItemsByPartitionKeyStreamAsync), - requestOptions, - (trace) => base.DeleteAllItemsByPartitionKeyStreamAsync(partitionKey, trace, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(DeleteAllItemsByPartitionKeyStreamAsync), + containerName: this.Id, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Delete, + requestOptions: requestOptions, + task: (trace) => base.DeleteAllItemsByPartitionKeyStreamAsync(partitionKey, trace, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Resource/CosmosClientContext.cs b/Microsoft.Azure.Cosmos/src/Resource/CosmosClientContext.cs index ef3aa09643..5bd2cc1848 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/CosmosClientContext.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/CosmosClientContext.cs @@ -60,6 +60,9 @@ internal abstract Task GetCachedContainerPropertiesAsync( internal abstract Task OperationHelperAsync( string operationName, + string containerName, + string databaseName, + OperationType operationType, RequestOptions requestOptions, Func> task, Func openTelemetry = null, diff --git a/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs index 4b5073289a..fb25ef4190 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseInlineCore.cs @@ -27,13 +27,13 @@ public override Task CreateContainerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(CreateContainerAsync), - requestOptions, - (trace) => base.CreateContainerAsync(containerProperties, throughput, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse( - responseMessage: response, - containerName: response.Resource?.Id, - databaseName: this.Id)); + operationName: nameof(CreateContainerAsync), + containerName: containerProperties.Id, + databaseName: this.Id, + operationType: Documents.OperationType.Create, + requestOptions: requestOptions, + task: (trace) => base.CreateContainerAsync(containerProperties, throughput, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); } public override Task CreateContainerAsync(string id, @@ -43,13 +43,13 @@ public override Task CreateContainerAsync(string id, CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(CreateContainerAsync), - requestOptions, - (trace) => base.CreateContainerAsync(id, partitionKeyPath, throughput, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse( - responseMessage: response, - containerName: response.Resource?.Id, - databaseName: this.Id)); + operationName: nameof(CreateContainerAsync), + containerName: id, + databaseName: this.Id, + operationType: Documents.OperationType.Create, + requestOptions: requestOptions, + task: (trace) => base.CreateContainerAsync(id, partitionKeyPath, throughput, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); } public override Task CreateContainerIfNotExistsAsync( @@ -59,13 +59,13 @@ public override Task CreateContainerIfNotExistsAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(CreateContainerIfNotExistsAsync), - requestOptions, - (trace) => base.CreateContainerIfNotExistsAsync(containerProperties, throughput, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse( - responseMessage: response, - containerName: response.Resource?.Id, - databaseName: this.Id)); + operationName: nameof(CreateContainerIfNotExistsAsync), + containerName: containerProperties.Id, + databaseName: this.Id, + operationType: Documents.OperationType.Create, + requestOptions: requestOptions, + task: (trace) => base.CreateContainerIfNotExistsAsync(containerProperties, throughput, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); } public override Task CreateContainerIfNotExistsAsync( @@ -76,13 +76,13 @@ public override Task CreateContainerIfNotExistsAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(CreateContainerIfNotExistsAsync), - requestOptions, - (trace) => base.CreateContainerIfNotExistsAsync(id, partitionKeyPath, throughput, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse( - responseMessage: response, - containerName: response.Resource?.Id, - databaseName: this.Id)); + operationName: nameof(CreateContainerIfNotExistsAsync), + containerName: id, + databaseName: this.Id, + operationType: Documents.OperationType.Create, + requestOptions: requestOptions, + task: (trace) => base.CreateContainerIfNotExistsAsync(id, partitionKeyPath, throughput, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); } public override Task CreateContainerStreamAsync( @@ -92,10 +92,13 @@ public override Task CreateContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(CreateContainerStreamAsync), - requestOptions, - (trace) => base.CreateContainerStreamAsync(containerProperties, throughput, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(CreateContainerStreamAsync), + containerName: containerProperties.Id, + databaseName: this.Id, + operationType: Documents.OperationType.Create, + requestOptions: requestOptions, + task: (trace) => base.CreateContainerStreamAsync(containerProperties, throughput, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task CreateUserAsync(string id, @@ -103,10 +106,13 @@ public override Task CreateUserAsync(string id, CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(CreateUserAsync), - requestOptions, - (trace) => base.CreateUserAsync(id, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(CreateUserAsync), + containerName: id, + databaseName: this.Id, + operationType: Documents.OperationType.Create, + requestOptions: requestOptions, + task: (trace) => base.CreateUserAsync(id, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override ContainerBuilder DefineContainer( @@ -121,13 +127,13 @@ public override Task DeleteAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(DeleteAsync), - requestOptions, - (trace) => base.DeleteAsync(requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse( - responseMessage: response, - containerName: null, - databaseName: response.Resource?.Id)); + operationName: nameof(DeleteAsync), + containerName: null, + databaseName: this.Id, + operationType: Documents.OperationType.Delete, + requestOptions: requestOptions, + task: (trace) => base.DeleteAsync(requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); } public override Task DeleteStreamAsync( @@ -135,10 +141,13 @@ public override Task DeleteStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(DeleteStreamAsync), - requestOptions, - (trace) => base.DeleteStreamAsync(requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(DeleteStreamAsync), + containerName: null, + databaseName: this.Id, + operationType: Documents.OperationType.Delete, + requestOptions: requestOptions, + task: (trace) => base.DeleteStreamAsync(requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Container GetContainer(string id) @@ -226,13 +235,13 @@ public override Task ReadAsync(RequestOptions requestOptions = CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadAsync), - requestOptions, - (trace) => base.ReadAsync(requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse( - responseMessage: response, - containerName: null, - databaseName: response.Resource?.Id)); + operationName: nameof(ReadAsync), + containerName: null, + databaseName: this.Id, + operationType: Documents.OperationType.Read, + requestOptions: requestOptions, + task: (trace) => base.ReadAsync(requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); } public override Task ReadStreamAsync( @@ -240,18 +249,24 @@ public override Task ReadStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadStreamAsync), - requestOptions, - (trace) => base.ReadStreamAsync(requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReadStreamAsync), + containerName: null, + databaseName: this.Id, + operationType: Documents.OperationType.Read, + requestOptions: requestOptions, + task: (trace) => base.ReadStreamAsync(requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReadThroughputAsync(CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadThroughputAsync), - null, - (trace) => base.ReadThroughputAsync(trace, cancellationToken)); + operationName: nameof(ReadThroughputAsync), + containerName: null, + databaseName: this.Id, + operationType: Documents.OperationType.Read, + requestOptions: null, + task: (trace) => base.ReadThroughputAsync(trace, cancellationToken)); } public override Task ReadThroughputAsync( @@ -259,10 +274,13 @@ public override Task ReadThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadThroughputAsync), - requestOptions, - (trace) => base.ReadThroughputAsync(requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReadThroughputAsync), + containerName: null, + databaseName: this.Id, + operationType: Documents.OperationType.Read, + requestOptions: requestOptions, + task: (trace) => base.ReadThroughputAsync(requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReplaceThroughputAsync( @@ -271,10 +289,13 @@ public override Task ReplaceThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReplaceThroughputAsync), - requestOptions, - (trace) => base.ReplaceThroughputAsync(throughput, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReplaceThroughputAsync), + containerName: null, + databaseName: this.Id, + operationType: Documents.OperationType.Replace, + requestOptions: requestOptions, + task: (trace) => base.ReplaceThroughputAsync(throughput, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReplaceThroughputAsync( @@ -283,10 +304,13 @@ public override Task ReplaceThroughputAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReplaceThroughputAsync), - requestOptions, - (trace) => base.ReplaceThroughputAsync(throughputProperties, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReplaceThroughputAsync), + containerName: null, + databaseName: this.Id, + operationType: Documents.OperationType.Replace, + requestOptions: requestOptions, + task: (trace) => base.ReplaceThroughputAsync(throughputProperties, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task CreateContainerAsync( @@ -296,13 +320,13 @@ public override Task CreateContainerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(CreateContainerAsync), - requestOptions, - (trace) => base.CreateContainerAsync(containerProperties, throughputProperties, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse( - responseMessage: response, - containerName: response.Resource?.Id, - databaseName: this.Id)); + operationName: nameof(CreateContainerAsync), + containerName: containerProperties.Id, + databaseName: this.Id, + operationType: Documents.OperationType.Create, + requestOptions: requestOptions, + task: (trace) => base.CreateContainerAsync(containerProperties, throughputProperties, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); } public override Task CreateContainerIfNotExistsAsync( @@ -312,10 +336,13 @@ public override Task CreateContainerIfNotExistsAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(CreateContainerIfNotExistsAsync), - requestOptions, - (trace) => base.CreateContainerIfNotExistsAsync(containerProperties, throughputProperties, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response, response.Resource?.Id, this.Id)); + operationName: nameof(CreateContainerIfNotExistsAsync), + containerName: containerProperties.Id, + databaseName: this.Id, + operationType: Documents.OperationType.Create, + requestOptions: requestOptions, + task: (trace) => base.CreateContainerIfNotExistsAsync(containerProperties, throughputProperties, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task CreateContainerStreamAsync( @@ -325,10 +352,13 @@ public override Task CreateContainerStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(CreateContainerStreamAsync), - requestOptions, - (trace) => base.CreateContainerStreamAsync(containerProperties, throughputProperties, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(CreateContainerStreamAsync), + containerName: null, + databaseName: this.Id, + operationType: Documents.OperationType.Create, + requestOptions: requestOptions, + task: (trace) => base.CreateContainerStreamAsync(containerProperties, throughputProperties, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task UpsertUserAsync( @@ -337,10 +367,13 @@ public override Task UpsertUserAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(UpsertUserAsync), - requestOptions, - (trace) => base.UpsertUserAsync(id, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(UpsertUserAsync), + containerName: null, + databaseName: this.Id, + operationType: Documents.OperationType.Upsert, + requestOptions: requestOptions, + task: (trace) => base.UpsertUserAsync(id, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override ClientEncryptionKey GetClientEncryptionKey(string id) @@ -362,10 +395,13 @@ public override Task CreateClientEncryptionKeyAsync CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(CreateClientEncryptionKeyAsync), - requestOptions, - (trace) => base.CreateClientEncryptionKeyAsync(trace, clientEncryptionKeyProperties, requestOptions, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(CreateClientEncryptionKeyAsync), + containerName: null, + databaseName: this.Id, + operationType: Documents.OperationType.Create, + requestOptions: requestOptions, + task: (trace) => base.CreateClientEncryptionKeyAsync(trace, clientEncryptionKeyProperties, requestOptions, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } } } diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs index bf19fa7743..e1d18b72af 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore.cs @@ -51,22 +51,14 @@ public override CosmosElement GetCosmosElementContinuationToken() public override Task ReadNextAsync(CancellationToken cancellationToken = default) { - return this.clientContext.OperationHelperAsync("FeedIterator Read Next Async", + return this.clientContext.OperationHelperAsync( + operationName: "FeedIterator Read Next Async", + containerName: this.container?.Id, + databaseName: this.container?.Database?.Id ?? this.databaseName, + operationType: Documents.OperationType.ReadFeed, requestOptions: null, task: (trace) => this.feedIteratorInternal.ReadNextAsync(trace, cancellationToken), - openTelemetry: (response) => - { - if (this.container == null) - { - return new OpenTelemetryResponse( - responseMessage: response, - containerName: null, - databaseName: this.databaseName); - } - return new OpenTelemetryResponse(responseMessage: response, - containerName: this.container?.Id, - databaseName: this.container?.Database?.Id ?? this.databaseName); - }); + openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); } public override Task ReadNextAsync(ITrace trace, CancellationToken cancellationToken = default) diff --git a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs index d115dcd175..cebfadb4c4 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FeedIterators/FeedIteratorInlineCore{T}.cs @@ -46,23 +46,14 @@ internal FeedIteratorInlineCore( public override Task> ReadNextAsync(CancellationToken cancellationToken = default) { - return this.clientContext.OperationHelperAsync("Typed FeedIterator ReadNextAsync", + return this.clientContext.OperationHelperAsync( + operationName: "Typed FeedIterator ReadNextAsync", + containerName: this.container?.Id, + databaseName: this.container?.Database.Id ?? this.databaseName, + operationType: Documents.OperationType.ReadFeed, requestOptions: null, task: trace => this.feedIteratorInternal.ReadNextAsync(trace, cancellationToken), - openTelemetry: (response) => - { - if (this.container == null) - { - return new OpenTelemetryResponse( - responseMessage: response, - containerName: null, - databaseName: this.databaseName); - } - return new OpenTelemetryResponse( - responseMessage: response, - containerName: this.container?.Id, - databaseName: this.container?.Database?.Id ?? this.databaseName); - }); + openTelemetry: (response) => new OpenTelemetryResponse(responseMessage: response)); } public override Task> ReadNextAsync(ITrace trace, CancellationToken cancellationToken) diff --git a/Microsoft.Azure.Cosmos/src/Resource/Permission/PermissionInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Permission/PermissionInlineCore.cs index 121e0c245a..ecf8e36d95 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Permission/PermissionInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Permission/PermissionInlineCore.cs @@ -27,10 +27,13 @@ public override Task ReadAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadAsync), - requestOptions, - (trace) => base.ReadAsync(tokenExpiryInSeconds, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReadAsync), + containerName: null, + databaseName: this.Id, + operationType: Documents.OperationType.Read, + requestOptions: requestOptions, + task: (trace) => base.ReadAsync(tokenExpiryInSeconds, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReplaceAsync( @@ -40,10 +43,13 @@ public override Task ReplaceAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReplaceAsync), - requestOptions, - (trace) => base.ReplaceAsync(permissionProperties, tokenExpiryInSeconds, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReplaceAsync), + containerName: null, + databaseName: this.Id, + operationType: Documents.OperationType.Replace, + requestOptions: requestOptions, + task: (trace) => base.ReplaceAsync(permissionProperties, tokenExpiryInSeconds, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task DeleteAsync( @@ -51,10 +57,13 @@ public override Task DeleteAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(DeleteAsync), + operationName: nameof(DeleteAsync), + containerName: null, + databaseName: this.Id, + operationType: Documents.OperationType.Delete, requestOptions, - (trace) => base.DeleteAsync(requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + task: (trace) => base.DeleteAsync(requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } } } diff --git a/Microsoft.Azure.Cosmos/src/Resource/Scripts/ScriptsInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Scripts/ScriptsInlineCore.cs index 0eae93212c..15059c1def 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Scripts/ScriptsInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Scripts/ScriptsInlineCore.cs @@ -27,10 +27,13 @@ public override Task CreateStoredProcedureAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(CreateStoredProcedureAsync), - requestOptions, - (trace) => base.CreateStoredProcedureAsync(storedProcedureProperties, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(CreateStoredProcedureAsync), + containerName: this.container.Id, + databaseName: this.container.Database.Id, + operationType: Documents.OperationType.Create, + requestOptions: requestOptions, + task: (trace) => base.CreateStoredProcedureAsync(storedProcedureProperties, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override FeedIterator GetStoredProcedureQueryIterator( @@ -87,10 +90,13 @@ public override Task ReadStoredProcedureAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadStoredProcedureAsync), - requestOptions, - (trace) => base.ReadStoredProcedureAsync(id, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReadStoredProcedureAsync), + containerName: this.container.Id, + databaseName: this.container.Database.Id, + operationType: Documents.OperationType.Read, + requestOptions: requestOptions, + task: (trace) => base.ReadStoredProcedureAsync(id, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReplaceStoredProcedureAsync( @@ -99,10 +105,13 @@ public override Task ReplaceStoredProcedureAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReplaceStoredProcedureAsync), + operationName: nameof(ReplaceStoredProcedureAsync), + containerName: this.container.Id, + databaseName: this.container.Database.Id, + operationType: Documents.OperationType.Replace, requestOptions, - (trace) => base.ReplaceStoredProcedureAsync(storedProcedureProperties, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + task: (trace) => base.ReplaceStoredProcedureAsync(storedProcedureProperties, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task DeleteStoredProcedureAsync( @@ -111,10 +120,13 @@ public override Task DeleteStoredProcedureAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(DeleteStoredProcedureAsync), - requestOptions, - (trace) => base.DeleteStoredProcedureAsync(id, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(DeleteStoredProcedureAsync), + containerName: this.container.Id, + databaseName: this.container.Database.Id, + operationType: Documents.OperationType.Delete, + requestOptions: requestOptions, + task: (trace) => base.DeleteStoredProcedureAsync(id, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task> ExecuteStoredProcedureAsync( @@ -125,10 +137,13 @@ public override Task> ExecuteStoredProce CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ExecuteStoredProcedureAsync), - requestOptions, - (trace) => base.ExecuteStoredProcedureAsync(storedProcedureId, partitionKey, parameters, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ExecuteStoredProcedureAsync), + containerName: this.container.Id, + databaseName: this.container.Database.Id, + operationType: Documents.OperationType.Execute, + requestOptions: requestOptions, + task: (trace) => base.ExecuteStoredProcedureAsync(storedProcedureId, partitionKey, parameters, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ExecuteStoredProcedureStreamAsync( @@ -139,10 +154,13 @@ public override Task ExecuteStoredProcedureStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ExecuteStoredProcedureStreamAsync), - requestOptions, - (trace) => base.ExecuteStoredProcedureStreamAsync(storedProcedureId, partitionKey, parameters, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ExecuteStoredProcedureStreamAsync), + containerName: this.container.Id, + databaseName: this.container.Database.Id, + operationType: Documents.OperationType.Execute, + requestOptions: requestOptions, + task: (trace) => base.ExecuteStoredProcedureStreamAsync(storedProcedureId, partitionKey, parameters, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ExecuteStoredProcedureStreamAsync( @@ -153,10 +171,13 @@ public override Task ExecuteStoredProcedureStreamAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ExecuteStoredProcedureStreamAsync), - requestOptions, - (trace) => base.ExecuteStoredProcedureStreamAsync(storedProcedureId, streamPayload, partitionKey, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ExecuteStoredProcedureStreamAsync), + containerName: this.container.Id, + databaseName: this.container.Database.Id, + operationType: Documents.OperationType.Execute, + requestOptions: requestOptions, + task: (trace) => base.ExecuteStoredProcedureStreamAsync(storedProcedureId, streamPayload, partitionKey, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task CreateTriggerAsync( @@ -165,10 +186,13 @@ public override Task CreateTriggerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(CreateTriggerAsync), - requestOptions, - (trace) => base.CreateTriggerAsync(triggerProperties, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(CreateTriggerAsync), + containerName: this.container.Id, + databaseName: this.container.Database.Id, + operationType: Documents.OperationType.Create, + requestOptions: requestOptions, + task: (trace) => base.CreateTriggerAsync(triggerProperties, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override FeedIterator GetTriggerQueryIterator( @@ -225,10 +249,13 @@ public override Task ReadTriggerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadTriggerAsync), - requestOptions, - (trace) => base.ReadTriggerAsync(id, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReadTriggerAsync), + containerName: this.container.Id, + databaseName: this.container.Database.Id, + operationType: Documents.OperationType.Read, + requestOptions: requestOptions, + task: (trace) => base.ReadTriggerAsync(id, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReplaceTriggerAsync( @@ -237,10 +264,13 @@ public override Task ReplaceTriggerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReplaceTriggerAsync), - requestOptions, - (trace) => base.ReplaceTriggerAsync(triggerProperties, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReplaceTriggerAsync), + containerName: this.container.Id, + databaseName: this.container.Database.Id, + operationType: Documents.OperationType.Replace, + requestOptions: requestOptions, + task: (trace) => base.ReplaceTriggerAsync(triggerProperties, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task DeleteTriggerAsync( @@ -249,10 +279,13 @@ public override Task DeleteTriggerAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(DeleteTriggerAsync), - requestOptions, - (trace) => base.DeleteTriggerAsync(id, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(DeleteTriggerAsync), + containerName: this.container.Id, + databaseName: this.container.Database.Id, + operationType: Documents.OperationType.Delete, + requestOptions: requestOptions, + task: (trace) => base.DeleteTriggerAsync(id, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task CreateUserDefinedFunctionAsync( @@ -261,10 +294,13 @@ public override Task CreateUserDefinedFunctionAsync CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(CreateUserDefinedFunctionAsync), - requestOptions, - (trace) => base.CreateUserDefinedFunctionAsync(userDefinedFunctionProperties, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(CreateUserDefinedFunctionAsync), + containerName: this.container.Id, + databaseName: this.container.Database.Id, + operationType: Documents.OperationType.Create, + requestOptions: requestOptions, + task: (trace) => base.CreateUserDefinedFunctionAsync(userDefinedFunctionProperties, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override FeedIterator GetUserDefinedFunctionQueryIterator( @@ -321,10 +357,13 @@ public override Task ReadUserDefinedFunctionAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadUserDefinedFunctionAsync), - requestOptions, - (trace) => base.ReadUserDefinedFunctionAsync(id, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReadUserDefinedFunctionAsync), + containerName: this.container.Id, + databaseName: this.container.Database.Id, + operationType: Documents.OperationType.Read, + requestOptions: requestOptions, + task: (trace) => base.ReadUserDefinedFunctionAsync(id, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReplaceUserDefinedFunctionAsync( @@ -333,10 +372,13 @@ public override Task ReplaceUserDefinedFunctionAsyn CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReplaceUserDefinedFunctionAsync), - requestOptions, - (trace) => base.ReplaceUserDefinedFunctionAsync(userDefinedFunctionProperties, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReplaceUserDefinedFunctionAsync), + containerName: this.container.Id, + databaseName: this.container.Database.Id, + operationType: Documents.OperationType.Replace, + requestOptions: requestOptions, + task: (trace) => base.ReplaceUserDefinedFunctionAsync(userDefinedFunctionProperties, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task DeleteUserDefinedFunctionAsync( @@ -345,10 +387,13 @@ public override Task DeleteUserDefinedFunctionAsync CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(DeleteUserDefinedFunctionAsync), - requestOptions, - (trace) => base.DeleteUserDefinedFunctionAsync(id, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(DeleteUserDefinedFunctionAsync), + containerName: this.container.Id, + databaseName: this.container.Database.Id, + operationType: Documents.OperationType.Delete, + requestOptions: requestOptions, + task: (trace) => base.DeleteUserDefinedFunctionAsync(id, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } } } diff --git a/Microsoft.Azure.Cosmos/src/Resource/User/UserInlineCore.cs b/Microsoft.Azure.Cosmos/src/Resource/User/UserInlineCore.cs index 6969e67d3e..c50ab7ff22 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/User/UserInlineCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/User/UserInlineCore.cs @@ -26,10 +26,13 @@ public override Task ReadAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReadAsync), - requestOptions, - (trace) => base.ReadAsync(requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReadAsync), + containerName: null, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Read, + requestOptions: requestOptions, + task: (trace) => base.ReadAsync(requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task ReplaceAsync( @@ -38,10 +41,13 @@ public override Task ReplaceAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(ReplaceAsync), - requestOptions, - (trace) => base.ReplaceAsync(userProperties, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(ReplaceAsync), + containerName: null, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Replace, + requestOptions: requestOptions, + task: (trace) => base.ReplaceAsync(userProperties, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task DeleteAsync( @@ -49,10 +55,13 @@ public override Task DeleteAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(DeleteAsync), - requestOptions, - (trace) => base.DeleteAsync(requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(DeleteAsync), + containerName: null, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Delete, + requestOptions: requestOptions, + task: (trace) => base.DeleteAsync(requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Permission GetPermission(string id) @@ -67,10 +76,13 @@ public override Task CreatePermissionAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(CreatePermissionAsync), - requestOptions, - (trace) => base.CreatePermissionAsync(permissionProperties, tokenExpiryInSeconds, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(CreatePermissionAsync), + containerName: null, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Create, + requestOptions: requestOptions, + task: (trace) => base.CreatePermissionAsync(permissionProperties, tokenExpiryInSeconds, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override Task UpsertPermissionAsync( @@ -80,10 +92,13 @@ public override Task UpsertPermissionAsync( CancellationToken cancellationToken = default) { return this.ClientContext.OperationHelperAsync( - nameof(UpsertPermissionAsync), - requestOptions, - (trace) => base.UpsertPermissionAsync(permissionProperties, tokenExpiryInSeconds, requestOptions, trace, cancellationToken), - (response) => new OpenTelemetryResponse(response)); + operationName: nameof(UpsertPermissionAsync), + containerName: null, + databaseName: this.Database.Id, + operationType: Documents.OperationType.Upsert, + requestOptions: requestOptions, + task: (trace) => base.UpsertPermissionAsync(permissionProperties, tokenExpiryInSeconds, requestOptions, trace, cancellationToken), + openTelemetry: (response) => new OpenTelemetryResponse(response)); } public override FeedIterator GetPermissionQueryIterator( diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs index d53dab1e50..41ae6e1e77 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs @@ -26,7 +26,9 @@ public static bool IsEnabled(EventLevel level) } [NonEvent] - public static void RecordDiagnosticsForRequests(DistributedTracingOptions config, + public static void RecordDiagnosticsForRequests( + DistributedTracingOptions config, + Documents.OperationType operationType, OpenTelemetryAttributes response) { if (CosmosDbEventSource.IsEnabled(EventLevel.Informational)) @@ -37,6 +39,7 @@ public static void RecordDiagnosticsForRequests(DistributedTracingOptions config { if (DiagnosticsFilterHelper.IsTracingNeeded( config: config, + operationType: operationType, response: response) && CosmosDbEventSource.IsEnabled(EventLevel.Warning)) { CosmosDbEventSource.Singleton.WriteWarningEvent(response.Diagnostics.ToString()); diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs index 56a4abd648..e4db97bc3f 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs @@ -17,6 +17,7 @@ internal static class DiagnosticsFilterHelper /// true or false public static bool IsTracingNeeded( DistributedTracingOptions config, + OperationType operationType, OpenTelemetryAttributes response) { TimeSpan latencyThreshold; @@ -27,7 +28,7 @@ public static bool IsTracingNeeded( } else { - latencyThreshold = response.OperationType == OperationType.Query.ToOperationTypeString() ? DistributedTracingOptions.DefaultQueryTimeoutThreshold : DistributedTracingOptions.DefaultCrudLatencyThreshold; + latencyThreshold = operationType == OperationType.Query ? DistributedTracingOptions.DefaultQueryTimeoutThreshold : DistributedTracingOptions.DefaultCrudLatencyThreshold; } return response.Diagnostics.GetClientElapsedTime() > latencyThreshold || !response.StatusCode.IsSuccess(); diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs index 636ccd5714..3d9ee4afbb 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs @@ -18,12 +18,9 @@ internal OpenTelemetryAttributes() { } - internal OpenTelemetryAttributes(RequestMessage requestMessage, string containerName, string databaseName) + internal OpenTelemetryAttributes(RequestMessage requestMessage) { this.RequestContentLength = requestMessage?.Headers?.ContentLength ?? OpenTelemetryAttributes.NotAvailable; - this.OperationType = requestMessage?.OperationType.ToOperationTypeString() ?? OpenTelemetryAttributes.NotAvailable; - this.DatabaseName = requestMessage?.DatabaseId ?? databaseName ?? OpenTelemetryAttributes.NotAvailable; - this.ContainerName = requestMessage?.ContainerId ?? containerName ?? OpenTelemetryAttributes.NotAvailable; } /// @@ -46,16 +43,6 @@ internal OpenTelemetryAttributes(RequestMessage requestMessage, string container /// internal string ResponseContentLength { get; set; } - /// - /// DatabaseName - /// - internal string DatabaseName { get; set; } - - /// - /// ContainerName - /// - internal string ContainerName { get; set; } - /// /// ItemCount /// @@ -66,11 +53,6 @@ internal OpenTelemetryAttributes(RequestMessage requestMessage, string container /// internal CosmosDiagnostics Diagnostics { get; set; } - /// - /// OperationType - /// - internal string OperationType { get; set; } - /// /// SubStatusCode /// diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs index c70b14a550..b8be214392 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs @@ -7,7 +7,9 @@ namespace Microsoft.Azure.Cosmos.Telemetry using System; using System.Collections.Generic; using Diagnostics; + using global::Azure; using global::Azure.Core.Pipeline; + using HdrHistogram; internal struct OpenTelemetryCoreRecorder : IDisposable { @@ -16,6 +18,8 @@ internal struct OpenTelemetryCoreRecorder : IDisposable private readonly DiagnosticScope scope; private readonly DistributedTracingOptions config; + private readonly Documents.OperationType operationType; + internal static IDictionary> OTelCompatibleExceptions = new Dictionary>() { { typeof(CosmosNullReferenceException), (exception, scope) => CosmosNullReferenceException.RecordOtelAttributes((CosmosNullReferenceException)exception, scope)}, @@ -25,16 +29,28 @@ internal struct OpenTelemetryCoreRecorder : IDisposable { typeof(ChangeFeedProcessorUserException), (exception, scope) => ChangeFeedProcessorUserException.RecordOtelAttributes((ChangeFeedProcessorUserException)exception, scope)} }; - public OpenTelemetryCoreRecorder(DiagnosticScope scope, CosmosClientContext clientContext, DistributedTracingOptions config) + public OpenTelemetryCoreRecorder( + DiagnosticScope scope, + string operationName, + string containerName, + string databaseName, + Documents.OperationType operationType, + CosmosClientContext clientContext, DistributedTracingOptions config) { this.scope = scope; this.config = config; - + this.operationType = operationType; + if (this.IsEnabled) { this.scope.Start(); - this.Record(clientContext); + this.Record( + operationName: operationName, + containerName: containerName, + databaseName: databaseName, + operationType: operationType, + clientContext: clientContext); } } @@ -47,15 +63,29 @@ public void Record(string key, string value) this.scope.AddAttribute(key, value); } } - + /// - /// System Level and Client level attributes + /// Recording information /// + /// + /// + /// + /// /// - public void Record(CosmosClientContext clientContext) + public void Record( + string operationName, + string containerName, + string databaseName, + Documents.OperationType operationType, + CosmosClientContext clientContext) { if (this.IsEnabled) { + this.scope.AddAttribute(OpenTelemetryAttributeKeys.DbOperation, operationName); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.DbName, databaseName); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.ContainerName, containerName); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.OperationType, operationType); + // Other information this.scope.AddAttribute(OpenTelemetryAttributeKeys.DbSystemName, OpenTelemetryCoreRecorder.CosmosDb); this.scope.AddAttribute(OpenTelemetryAttributeKeys.MachineId, VmMetadataApiHandler.GetMachineId()); @@ -76,21 +106,17 @@ public void Record(OpenTelemetryAttributes response) { if (this.IsEnabled) { - this.scope.AddAttribute(OpenTelemetryAttributeKeys.DbName, response.DatabaseName); - - this.scope.AddAttribute(OpenTelemetryAttributeKeys.ContainerName, response.ContainerName); this.scope.AddAttribute(OpenTelemetryAttributeKeys.RequestContentLength, response.RequestContentLength); this.scope.AddAttribute(OpenTelemetryAttributeKeys.ResponseContentLength, response.ResponseContentLength); this.scope.AddAttribute(OpenTelemetryAttributeKeys.StatusCode, response.StatusCode); this.scope.AddAttribute(OpenTelemetryAttributeKeys.SubStatusCode, response.SubStatusCode); this.scope.AddAttribute(OpenTelemetryAttributeKeys.RequestCharge, response.RequestCharge); this.scope.AddAttribute(OpenTelemetryAttributeKeys.ItemCount, response.ItemCount); - this.scope.AddAttribute(OpenTelemetryAttributeKeys.OperationType, response.OperationType); - + if (response.Diagnostics != null) { this.scope.AddAttribute(OpenTelemetryAttributeKeys.Region, ClientTelemetryHelper.GetContactedRegions(response.Diagnostics.GetContactedRegions()) ?? OpenTelemetryAttributes.NotAvailable); - CosmosDbEventSource.RecordDiagnosticsForRequests(this.config, response); + CosmosDbEventSource.RecordDiagnosticsForRequests(this.config, this.operationType, response); } else { diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs index f72954045b..c66339e51e 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs @@ -10,7 +10,10 @@ internal static class OpenTelemetryRecorderFactory { private static DiagnosticScopeFactory ScopeFactory { get; set; } - public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, + public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, + string containerName, + string databaseName, + Documents.OperationType operationType, RequestOptions requestOptions, CosmosClientContext clientContext) { @@ -27,6 +30,10 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, { return new OpenTelemetryCoreRecorder( scope: scope, + operationName: operationName, + containerName: containerName, + databaseName: databaseName, + operationType: operationType, clientContext: clientContext, config: requestOptions?.DistributedTracingOptions ?? clientContext.ClientOptions?.DistributedTracingOptions); } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs index 0547fda4bd..7bb1fdc12e 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs @@ -10,29 +10,25 @@ namespace Microsoft.Azure.Cosmos internal sealed class OpenTelemetryResponse : OpenTelemetryAttributes { - internal OpenTelemetryResponse(TransactionalBatchResponse responseMessage, string containerName = null, string databaseName = null) + internal OpenTelemetryResponse(TransactionalBatchResponse responseMessage) : this( statusCode: responseMessage.StatusCode, requestCharge: responseMessage.Headers?.RequestCharge, responseContentLength: null, diagnostics: responseMessage.Diagnostics, itemCount: responseMessage.Headers?.ItemCount, - databaseName: databaseName, - containerName: containerName, requestMessage: null, subStatusCode: (int)responseMessage.Headers?.SubStatusCode) { } - internal OpenTelemetryResponse(ResponseMessage responseMessage, string containerName = null, string databaseName = null) + internal OpenTelemetryResponse(ResponseMessage responseMessage) : this( statusCode: responseMessage.StatusCode, requestCharge: responseMessage.Headers?.RequestCharge, responseContentLength: OpenTelemetryResponse.GetPayloadSize(responseMessage), diagnostics: responseMessage.Diagnostics, itemCount: responseMessage.Headers?.ItemCount, - databaseName: databaseName, - containerName: containerName, requestMessage: responseMessage.RequestMessage, subStatusCode: (int)responseMessage.Headers?.SubStatusCode) { @@ -44,11 +40,9 @@ private OpenTelemetryResponse( string responseContentLength, CosmosDiagnostics diagnostics, string itemCount, - string databaseName, - string containerName, RequestMessage requestMessage, int subStatusCode) - : base(requestMessage, containerName, databaseName) + : base(requestMessage) { this.StatusCode = statusCode; this.RequestCharge = requestCharge; diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs index 68301f4f4e..3d7359da75 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs @@ -9,29 +9,25 @@ namespace Microsoft.Azure.Cosmos internal sealed class OpenTelemetryResponse : OpenTelemetryAttributes { - internal OpenTelemetryResponse(FeedResponse responseMessage, string containerName = null, string databaseName = null) + internal OpenTelemetryResponse(FeedResponse responseMessage) : this( statusCode: responseMessage.StatusCode, requestCharge: responseMessage.Headers?.RequestCharge, responseContentLength: responseMessage?.Headers?.ContentLength, diagnostics: responseMessage.Diagnostics, itemCount: responseMessage.Headers?.ItemCount, - databaseName: databaseName, - containerName: containerName, requestMessage: responseMessage.RequestMessage, subStatusCode: (int)responseMessage.Headers?.SubStatusCode) { } - internal OpenTelemetryResponse(Response responseMessage, string containerName = null, string databaseName = null) + internal OpenTelemetryResponse(Response responseMessage) : this( statusCode: responseMessage.StatusCode, requestCharge: responseMessage.Headers?.RequestCharge, responseContentLength: responseMessage?.Headers?.ContentLength, diagnostics: responseMessage.Diagnostics, itemCount: responseMessage.Headers?.ItemCount, - databaseName: databaseName, - containerName: containerName, requestMessage: responseMessage.RequestMessage, subStatusCode: (int)responseMessage.Headers?.SubStatusCode) { @@ -43,11 +39,9 @@ private OpenTelemetryResponse( string responseContentLength, CosmosDiagnostics diagnostics, string itemCount, - string databaseName, - string containerName, RequestMessage requestMessage, int subStatusCode) - : base(requestMessage, containerName, databaseName) + : base(requestMessage) { this.StatusCode = statusCode; this.RequestCharge = requestCharge; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index 49f8d13a83..15d67f3483 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -129,7 +129,7 @@ } ] }]]> - Cosmos.ExecuteAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.ExecuteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index 41dca40b1e..bc0240518f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -134,16 +134,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -292,16 +292,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -450,16 +450,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -608,16 +608,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -766,16 +766,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -924,16 +924,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1082,16 +1082,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1240,16 +1240,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1398,16 +1398,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1556,16 +1556,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2288,7 +2288,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml index 07da410dcf..1a1f0b40ee 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml @@ -952,11 +952,11 @@ } ] }]]> - Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1569,11 +1569,11 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2167,11 +2167,11 @@ } ] }]]> - Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2785,11 +2785,11 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3066,8 +3066,8 @@ } ] }]]> - Cosmos.Change Feed Estimator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Change Feed Estimator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml index a011bb4d54..bffa1a103a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml @@ -107,8 +107,8 @@ } ] }]]> - Cosmos.DeleteAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateDatabaseAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.DeleteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateDatabaseAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -207,8 +207,8 @@ } ] }]]> - Cosmos.DeleteAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateDatabaseAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.DeleteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateDatabaseAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml index 3d7eb4ca65..d87ec949cd 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml @@ -148,7 +148,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -391,7 +391,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -616,7 +616,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -873,7 +873,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1194,7 +1194,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1348,7 +1348,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml index 5909fa5328..5368aad0e7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml @@ -574,10 +574,10 @@ } ] }]]> - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1180,10 +1180,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1767,10 +1767,10 @@ } ] }]]> - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2374,10 +2374,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3048,10 +3048,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3644,10 +3644,10 @@ } ] }]]> - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -4260,10 +4260,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml index b5ed674d20..8860741fc2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml @@ -536,10 +536,10 @@ } ] }]]> - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1104,10 +1104,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1653,10 +1653,10 @@ } ] }]]> - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2222,10 +2222,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml index 4aec783e49..5cc059c7a7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml @@ -542,12 +542,12 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.ReadManyItemsStreamAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.ReadManyItemsStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1112,7 +1112,7 @@ } ] }]]> - Cosmos.ReadManyItemsAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.ReadManyItemsAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml index 59937f5675..665f74396c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml @@ -89,7 +89,7 @@ } ] }]]> - Cosmos.CreateItemStreamAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -178,7 +178,7 @@ } ] }]]> - Cosmos.ReadItemStreamAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.ReadItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -275,7 +275,7 @@ } ] }]]> - Cosmos.ReplaceItemStreamAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.ReplaceItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -367,7 +367,7 @@ } ] }]]> - Cosmos.DeleteItemStreamAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.DeleteItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml index 8eb9eebaea..8042b6e21d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml @@ -109,7 +109,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -203,7 +203,7 @@ } ] }]]> - Cosmos.ReadItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.ReadItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -310,7 +310,7 @@ } ] }]]> - Cosmos.ReplaceItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.ReplaceItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -406,7 +406,7 @@ } ] }]]> - Cosmos.DeleteItemAsynckindaz.namespacedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.operation_typedb.cosmosdb.regions_contacted + Cosmos.DeleteItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/QueryPlanBaselineTests.Spatial.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/QueryPlanBaselineTests.Spatial.xml index 1d67b08708..cff22b3e76 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/QueryPlanBaselineTests.Spatial.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/QueryPlanBaselineTests.Spatial.xml @@ -478,8 +478,7 @@ ST_WITHIN Geography - SELECT * FROM c WHERE NOT ST_WITHIN(c.geojson, - {'type':'Polygon','coordinates':[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]}) + SELECT * FROM c WHERE NOT ST_WITHIN(c.geojson, {'type':'Polygon','coordinates':[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]}) /key @@ -513,8 +512,7 @@ ST_WITHIN Geometry - SELECT * FROM c WHERE NOT ST_WITHIN(c.geojson, - {'type':'Polygon','coordinates':[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]}) + SELECT * FROM c WHERE NOT ST_WITHIN(c.geojson, {'type':'Polygon','coordinates':[[[-60,20], [70,20], [70,70], [-60,70], [-60,20]]]}) /key diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs index 28913390ec..044a735734 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncBatcherTests.cs @@ -757,13 +757,16 @@ private static CosmosClientContext MockClientContext() Mock mockContext = new Mock(); mockContext.Setup(x => x.OperationHelperAsync( It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny>>(), It.IsAny>(), It.IsAny(), It.IsAny())) - .Returns>, Func, TraceComponent, TraceLevel>( - (operationName, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); + .Returns>, Func, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType,requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); return mockContext.Object; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs index a51ff0ef3a..993afa449b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncContainerExecutorTests.cs @@ -345,13 +345,16 @@ private Mock MockClientContext() Mock mockContext = new Mock(); mockContext.Setup(x => x.OperationHelperAsync( It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny>>(), It.IsAny>(), It.IsAny(), It.IsAny())) - .Returns>, Func, TraceComponent, TraceLevel>( - (operationName, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); + .Returns>, Func, TraceComponent, TraceLevel>( + (operationName,containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); mockContext.Setup(x => x.Client).Returns(MockCosmosUtil.CreateMockCosmosClient()); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs index 9e72ada29b..896eb0fade 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Batch/BatchAsyncStreamerTests.cs @@ -201,13 +201,16 @@ private CosmosClientContext GetMockClientContext() Mock mockContext = new Mock(); mockContext.Setup(x => x.OperationHelperAsync( It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny>>(), It.IsAny>(), It.IsAny(), It.IsAny())) - .Returns>, Func, TraceComponent, TraceLevel>( - (operationName, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); + .Returns>, Func, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); return mockContext.Object; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs index 4b9a50c75d..4cc722528b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedEstimatorIteratorTests.cs @@ -336,13 +336,16 @@ static FeedIteratorInternal feedCreator(DocumentServiceLease lease, string conti mockedContext.Setup(c => c.Client).Returns(MockCosmosUtil.CreateMockCosmosClient()); mockedContext.Setup(x => x.OperationHelperAsync>( It.Is(str => str.Contains("Change Feed Estimator")), + It.IsAny(), + It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny>>>(), It.IsAny, OpenTelemetryAttributes>>(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>>, Func, OpenTelemetryAttributes>, TraceComponent, TraceLevel>( - (operationName, requestOptions, func, oTelFunc, comp, level) => + .Returns>>, Func, OpenTelemetryAttributes>, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) { @@ -355,7 +358,7 @@ static FeedIteratorInternal feedCreator(DocumentServiceLease lease, string conti Mock mockedMonitoredContainer = new Mock(MockBehavior.Strict); mockedMonitoredContainer.Setup(c => c.GetCachedRIDAsync(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(monitoredContainerRid); mockedMonitoredContainer.Setup(c => c.ClientContext).Returns(mockedContext.Object); - + mockedMonitoredContainer.Setup(c => c.Id).Returns("containerId"); Mock leaseFeedIterator = new Mock(); leaseFeedIterator.Setup(i => i.HasMoreResults).Returns(false); @@ -425,15 +428,21 @@ private static ContainerInternal GetMockedContainer() Mock mockContext = new Mock(MockBehavior.Strict); mockContext.Setup(x => x.Client).Returns(mockClient.Object); containerMock.Setup(c => c.ClientContext).Returns(mockContext.Object); + containerMock.Setup(c => c.Id).Returns("containerId"); + containerMock.Setup(c => c.Database.Id).Returns("databaseId"); + mockContext.Setup(x => x.OperationHelperAsync>( It.Is(str => str.Contains("Change Feed Estimator")), + It.IsAny(), + It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny>>>(), It.IsAny, OpenTelemetryAttributes>>(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>>, Func, OpenTelemetryAttributes>, TraceComponent, TraceLevel>( - (operationName, requestOptions, func, oTelFunc, comp, level) => + .Returns>>, Func, OpenTelemetryAttributes>, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs index 42de6190f4..ebbb837943 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedPartitionKeyResultSetIteratorCoreTests.cs @@ -41,13 +41,16 @@ public async Task EtagPassesContinuation() Mock mockContext = new Mock(); mockContext.Setup(x => x.OperationHelperAsync( It.Is(str => str.Contains("Change Feed Processor")), + It.IsAny(), + It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny>>(), It.IsAny>(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>,Func, TraceComponent, TraceLevel>( - (operationName, requestOptions, func, oTelFunc, comp, level) => + .Returns>,Func, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) { @@ -70,7 +73,9 @@ public async Task EtagPassesContinuation() ).ReturnsAsync(responseMessage); containerMock.Setup(c => c.ClientContext).Returns(mockContext.Object); containerMock.Setup(c => c.LinkUri).Returns("http://localhot"); - + containerMock.Setup(c => c.Id).Returns("containerId"); + containerMock.Setup(c => c.Database.Id).Returns("databaseId"); + ChangeFeedPartitionKeyResultSetIteratorCore iterator = ChangeFeedPartitionKeyResultSetIteratorCore.Create( lease: documentServiceLeaseCore, continuationToken: null, @@ -115,13 +120,16 @@ public async Task NextReadHasUpdatedContinuation() Mock mockContext = new Mock(); mockContext.Setup(x => x.OperationHelperAsync( It.Is(str => str.Contains("Change Feed Processor")), + It.IsAny(), + It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny>>(), It.IsAny>(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>, Func, TraceComponent, TraceLevel>( - (operationName, requestOptions, func, oTelFunc, comp, level) => + .Returns>, Func, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) { @@ -146,7 +154,9 @@ public async Task NextReadHasUpdatedContinuation() .ReturnsAsync(secondResponse); containerMock.Setup(c => c.ClientContext).Returns(mockContext.Object); containerMock.Setup(c => c.LinkUri).Returns("http://localhot"); - + containerMock.Setup(c => c.Id).Returns("containerId"); + containerMock.Setup(c => c.Database.Id).Returns("databaseId"); + ChangeFeedPartitionKeyResultSetIteratorCore iterator = ChangeFeedPartitionKeyResultSetIteratorCore.Create( lease: documentServiceLeaseCore, continuationToken: null, @@ -179,13 +189,16 @@ public async Task ShouldSetFeedRangePartitionKeyRange() Mock mockContext = new Mock(); mockContext.Setup(x => x.OperationHelperAsync( It.Is(str => str.Contains("Change Feed Processor")), + It.IsAny(), + It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny>>(), It.IsAny>(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>, Func, TraceComponent, TraceLevel>( - (operationName, requestOptions, func, oTelFunc, comp, level) => + .Returns>, Func, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) { @@ -208,7 +221,9 @@ public async Task ShouldSetFeedRangePartitionKeyRange() ).ReturnsAsync(new ResponseMessage(System.Net.HttpStatusCode.OK)); containerMock.Setup(c => c.ClientContext).Returns(mockContext.Object); containerMock.Setup(c => c.LinkUri).Returns("http://localhot"); - + containerMock.Setup(c => c.Id).Returns("containerId"); + containerMock.Setup(c => c.Database.Id).Returns("databaseId"); + ChangeFeedPartitionKeyResultSetIteratorCore iterator = ChangeFeedPartitionKeyResultSetIteratorCore.Create( lease: documentServiceLeaseCore, continuationToken: null, @@ -255,13 +270,16 @@ public async Task ShouldUseFeedRangeEpk() Mock mockContext = new Mock(); mockContext.Setup(x => x.OperationHelperAsync( It.Is(str => str.Contains("Change Feed Processor")), + It.IsAny(), + It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny>>(), It.IsAny>(), It.Is(tc => tc == TraceComponent.ChangeFeed), It.IsAny())) - .Returns>, Func, TraceComponent, TraceLevel>( - (operationName, requestOptions, func, oTelFunc, comp, level) => + .Returns>, Func, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => { using (ITrace trace = Trace.GetRootTrace(operationName, comp, level)) { @@ -283,7 +301,10 @@ public async Task ShouldUseFeedRangeEpk() ) ).ReturnsAsync(new ResponseMessage(System.Net.HttpStatusCode.OK)); containerMock.Setup(c => c.ClientContext).Returns(mockContext.Object); - containerMock.Setup(c => c.LinkUri).Returns("http://localhot"); + containerMock.Setup(c => c.LinkUri).Returns("http://localhost"); + containerMock.Setup(c => c.Id).Returns("containerId"); + containerMock.Setup(c => c.Database.Id).Returns("databaseId"); + MockDocumentClient mockDocumentClient = new MockDocumentClient(); mockContext.Setup(c => c.DocumentClient).Returns(mockDocumentClient); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosDiagnosticsUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosDiagnosticsUnitTests.cs index 905fbd8757..404955997d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosDiagnosticsUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosDiagnosticsUnitTests.cs @@ -93,9 +93,12 @@ public async Task ValidateActivityId() new CosmosClientOptions()); Guid result = await clientContext.OperationHelperAsync( - nameof(ValidateActivityId), - new RequestOptions(), - (trace) => this.ValidateActivityIdHelper()); + operationName: nameof(ValidateActivityId), + containerName: null, + databaseName: null, + operationType: Documents.OperationType.Replace, + requestOptions: new RequestOptions(), + task: (trace) => this.ValidateActivityIdHelper()); Assert.AreEqual(Guid.Empty, System.Diagnostics.Trace.CorrelationManager.ActivityId, "ActivityScope was not disposed of"); } @@ -119,9 +122,12 @@ public async Task ValidateActivityIdWithSynchronizationContext() SynchronizationContext.SetSynchronizationContext(mockSynchronizationContext.Object); Guid result = await clientContext.OperationHelperAsync( - nameof(ValidateActivityIdWithSynchronizationContext), - new RequestOptions(), - (trace) => this.ValidateActivityIdHelper()); + operationName: nameof(ValidateActivityIdWithSynchronizationContext), + containerName: null, + databaseName: null, + operationType: Documents.OperationType.Replace, + requestOptions: new RequestOptions(), + task: (trace) => this.ValidateActivityIdHelper()); Assert.AreEqual(Guid.Empty, System.Diagnostics.Trace.CorrelationManager.ActivityId, "ActivityScope was not disposed of"); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosItemUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosItemUnitTests.cs index 589ad47efc..5f9b3d3dad 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosItemUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosItemUnitTests.cs @@ -711,23 +711,29 @@ public async Task TestMultipleNestedPartitionKeyValueFromStreamAsync() mockContext.Setup(x => x.OperationHelperAsync( It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny>>(), It.IsAny>(), It.IsAny(), It.IsAny())) - .Returns>, Func, TraceComponent, TraceLevel>( - (operationName, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); + .Returns>, Func, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); mockContext.Setup(x => x.OperationHelperAsync>( It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny>>>(), It.IsAny, OpenTelemetryAttributes>>(), It.IsAny(), It.IsAny())) - .Returns>>, Func, OpenTelemetryAttributes>, TraceComponent, TraceLevel>( - (operationName, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); + .Returns>>, Func, OpenTelemetryAttributes>, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); mockContext.Setup(x => x.ProcessResourceOperationStreamAsync( It.IsAny(), diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/FeedRange/ChangeFeedIteratorCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/FeedRange/ChangeFeedIteratorCoreTests.cs index 32bbc1173f..6594bd926e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/FeedRange/ChangeFeedIteratorCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/FeedRange/ChangeFeedIteratorCoreTests.cs @@ -477,13 +477,16 @@ private CosmosClientContext MockClientContext() Mock mockContext = new Mock(); mockContext.Setup(x => x.OperationHelperAsync( It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), It.IsAny(), It.IsAny>>(), It.IsAny>(), It.IsAny(), It.IsAny())) - .Returns>, Func, TraceComponent, TraceLevel>( - (operationName, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); + .Returns>, Func, TraceComponent, TraceLevel>( + (operationName, containerName, databaseName, operationType, requestOptions, func, oTelFunc, comp, level) => func(NoOpTrace.Singleton)); return mockContext.Object; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs index b86883c451..9474239569 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs @@ -49,7 +49,7 @@ public void CheckReturnFalseOnSuccessAndLowerLatencyThanConfiguredConfig() Assert.IsFalse( DiagnosticsFilterHelper - .IsTracingNeeded(distributedTracingOptions, response), + .IsTracingNeeded(distributedTracingOptions, OperationType.Read, response), $" Response time is {response.Diagnostics.GetClientElapsedTime().Milliseconds}ms " + $"and Configured threshold value is {distributedTracingOptions.DiagnosticsLatencyThreshold.Value.Milliseconds}ms " + $"and Is response Success : {response.StatusCode.IsSuccess()}" ); @@ -74,7 +74,7 @@ public void CheckReturnTrueOnFailedStatusCode() Assert.IsTrue( DiagnosticsFilterHelper - .IsTracingNeeded(distributedTracingOptions, response), + .IsTracingNeeded(distributedTracingOptions, OperationType.Read, response), $" Response time is {response.Diagnostics.GetClientElapsedTime().Milliseconds}ms " + $"and Configured threshold value is {distributedTracingOptions.DiagnosticsLatencyThreshold.Value.Milliseconds}ms " + $"and Is response Success : {response.StatusCode.IsSuccess()}"); From 9c2015bb47f53e92cdc78fd0c105896aefe9d859 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Wed, 16 Nov 2022 20:11:55 +0530 Subject: [PATCH 015/240] [Internal] AI Integration: Adds a new flag in DistributedTracingOptions (#3562) * add flag in diagnostic options * test fixes * rename variable * test fix * add validation * fix baseline * test fix Co-authored-by: Sourabh Jain --- .../OpenTelemetry/CosmosDbEventSource.cs | 2 +- .../DistributedTracingOptions.cs | 33 ++++++++++++++++++- ...riterBaselineTests.BulkOperationsAsync.xml | 2 +- ...neTests.PointOperationsExceptionsAsync.xml | 2 +- .../EndToEndTraceWriterBaselineTests.cs | 13 ++++---- .../ChangeFeedEstimatorIteratorTests.cs | 1 + .../CosmosClientOptionsUnitTests.cs | 19 +++++++++++ .../Telemetry/DiagnosticsFilterHelperTest.cs | 4 +-- 8 files changed, 63 insertions(+), 13 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs index 41ae6e1e77..f0ac635d81 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs @@ -31,7 +31,7 @@ public static void RecordDiagnosticsForRequests( Documents.OperationType operationType, OpenTelemetryAttributes response) { - if (CosmosDbEventSource.IsEnabled(EventLevel.Informational)) + if (config.EnableDiagnosticsTraceForAllRequests) { CosmosDbEventSource.Singleton.WriteInfoEvent(response.Diagnostics.ToString()); } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/DistributedTracingOptions.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/DistributedTracingOptions.cs index 34c7ae69dc..078a554980 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/DistributedTracingOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/DistributedTracingOptions.cs @@ -21,12 +21,43 @@ internal sealed class DistributedTracingOptions /// Default Latency threshold for QUERY operation /// internal static readonly TimeSpan DefaultQueryTimeoutThreshold = TimeSpan.FromMilliseconds(500); + private bool enableDiagnosticsTraceForAllRequests; + private TimeSpan? diagnosticsLatencyThreshold; /// /// Latency Threshold to generate () with Request diagnostics in distributing Tracing.

/// If it is not set then by default it will generate () for query operation which are taking more than 500 ms and non-query operations taking more than 100 ms. ///
- public TimeSpan? DiagnosticsLatencyThreshold { get; set; } + public TimeSpan? DiagnosticsLatencyThreshold + { + get => this.diagnosticsLatencyThreshold; + set + { + if (this.EnableDiagnosticsTraceForAllRequests) + { + throw new ArgumentException("EnableDiagnosticsTraceForAllRequests can not be true along with DiagnosticsLatencyThreshold."); + } + + this.diagnosticsLatencyThreshold = value; + } + } + /// + /// Set this flag as true if you want to generate () containing request diagnostics string for all the operations. + /// If this flag is true then, it won't honour value to generate diagnostic traces. + /// + public bool EnableDiagnosticsTraceForAllRequests + { + get => this.enableDiagnosticsTraceForAllRequests; + set + { + if (value && this.DiagnosticsLatencyThreshold != null) + { + throw new ArgumentException("EnableDiagnosticsTraceForAllRequests can not be true along with DiagnosticsLatencyThreshold."); + } + + this.enableDiagnosticsTraceForAllRequests = value; + } + } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index bc0240518f..a31ad6433d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -1602,7 +1602,7 @@ throttleClient.ClientOptions.EnableDistributedTracing = true; throttleClient.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() { - DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(DiagnosticsLatencyThresholdValue) + EnableDiagnosticsTraceForAllRequests = true }; ItemRequestOptions requestOptions = new ItemRequestOptions(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml index d87ec949cd..019adb993e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml @@ -175,7 +175,7 @@ throttleClient.ClientOptions.EnableDistributedTracing = true; throttleClient.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() { - DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(DiagnosticsLatencyThresholdValue) + EnableDiagnosticsTraceForAllRequests = true }; ItemRequestOptions requestOptions = new ItemRequestOptions(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs index 855bea096d..aea21c9655 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs @@ -37,8 +37,7 @@ public sealed class EndToEndTraceWriterBaselineTests : BaselineTests mockedMonitoredContainer = new Mock(MockBehavior.Strict); mockedMonitoredContainer.Setup(c => c.GetCachedRIDAsync(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(monitoredContainerRid); mockedMonitoredContainer.Setup(c => c.ClientContext).Returns(mockedContext.Object); + mockedMonitoredContainer.Setup(c => c.Database.Id).Returns("databaseId"); mockedMonitoredContainer.Setup(c => c.Id).Returns("containerId"); Mock leaseFeedIterator = new Mock(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs index e39bb8d0f3..6078570d96 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs @@ -186,6 +186,25 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() Assert.AreEqual(portReuseMode, policy.PortReuseMode); Assert.IsTrue(policy.EnableTcpConnectionEndpointRediscovery); CollectionAssert.AreEqual(preferredLocations.ToArray(), policy.PreferredLocations.ToArray()); + + // Verify DiagnosticsLatencyThreshold + cosmosClientBuilder = new CosmosClientBuilder( + accountEndpoint: endpoint, + authKeyOrResourceToken: key); + var exception = Assert.ThrowsException(() => cosmosClientBuilder.WithConnectionModeDirect( + idleTcpConnectionTimeout, + openTcpConnectionTimeout, + maxRequestsPerTcpConnection, + maxTcpConnectionsPerEndpoint, + portReuseMode, + enableTcpConnectionEndpointRediscovery) + .WithApplicationPreferredRegions(preferredLocations) + .WithDistributingTracing(new DistributedTracingOptions + { + DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(100), + EnableDiagnosticsTraceForAllRequests = true + })); + Assert.AreEqual("EnableDiagnosticsTraceForAllRequests can not be true along with DiagnosticsLatencyThreshold.", exception.Message); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs index 9474239569..98f4d62954 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs @@ -38,7 +38,7 @@ public void CheckReturnFalseOnSuccessAndLowerLatencyThanConfiguredConfig() DistributedTracingOptions distributedTracingOptions = new DistributedTracingOptions { - DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(20) + DiagnosticsLatencyThreshold = this.rootTrace.Duration.Add(TimeSpan.FromSeconds(1)) }; OpenTelemetryAttributes response = new OpenTelemetryAttributes @@ -63,7 +63,7 @@ public void CheckReturnTrueOnFailedStatusCode() DistributedTracingOptions distributedTracingOptions = new DistributedTracingOptions { - DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(20) + DiagnosticsLatencyThreshold = this.rootTrace.Duration.Add(TimeSpan.FromSeconds(1)) }; OpenTelemetryAttributes response = new OpenTelemetryAttributes From c38346dd8d029bf32dc523c678b6df95e8c1b9b9 Mon Sep 17 00:00:00 2001 From: neildsh <35383880+neildsh@users.noreply.github.com> Date: Wed, 16 Nov 2022 17:05:16 -0800 Subject: [PATCH 016/240] Query: Fixes default to BadRequestException in case of internal errors in ServiceInterop (#3399) * Don't default to BadRequestException in case of errors in ServiceInterop * Incorporate code review feedback * Fix build error * fix up failing test --- .../Query/Core/ExceptionToCosmosException.cs | 32 +++++++-------- .../Core/QueryPlan/QueryPlanRetriever.cs | 16 +++----- .../Query/QueryPlanRetrieverTests.cs | 39 +++++++++++++++++-- 3 files changed, 56 insertions(+), 31 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ExceptionToCosmosException.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ExceptionToCosmosException.cs index 966c603f5d..02c1882e26 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/ExceptionToCosmosException.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ExceptionToCosmosException.cs @@ -76,32 +76,28 @@ private static bool TryCreateFromExceptionWithStackTrace( ITrace trace, out CosmosException cosmosException) { - // Use the original stack trace from the inner exception. - if (exceptionWithStackTrace.InnerException is Microsoft.Azure.Documents.DocumentClientException - || exceptionWithStackTrace.InnerException is CosmosException) - { - return ExceptionToCosmosException.TryCreateFromException( - exceptionWithStackTrace.InnerException, - trace, - out cosmosException); - } + Exception innerException = ExceptionWithStackTraceException.UnWrapMonadExcepion(exceptionWithStackTrace, trace); if (!ExceptionToCosmosException.TryCreateFromException( - exceptionWithStackTrace.InnerException, + innerException, trace, out cosmosException)) { return false; } - cosmosException = CosmosExceptionFactory.Create( - cosmosException.StatusCode, - cosmosException.Message, - exceptionWithStackTrace.StackTrace, - headers: cosmosException.Headers, - cosmosException.Trace, - cosmosException.Error, - cosmosException.InnerException); + if (innerException is not CosmosException && innerException is not Documents.DocumentClientException) + { + cosmosException = CosmosExceptionFactory.Create( + cosmosException.StatusCode, + cosmosException.Message, + exceptionWithStackTrace.StackTrace, + headers: cosmosException.Headers, + cosmosException.Trace, + cosmosException.Error, + cosmosException.InnerException); + } + return true; } diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPlanRetriever.cs b/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPlanRetriever.cs index 32e061dfd8..09ad98f395 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPlanRetriever.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPlanRetriever.cs @@ -76,18 +76,14 @@ public static async Task GetQueryPlanWithServiceI if (!tryGetQueryPlan.Succeeded) { - Exception originalException = ExceptionWithStackTraceException.UnWrapMonadExcepion(tryGetQueryPlan.Exception, serviceInteropTrace); - if (originalException is CosmosException) + if (ExceptionToCosmosException.TryCreateFromException(tryGetQueryPlan.Exception, serviceInteropTrace, out CosmosException cosmosException)) { - throw originalException; + throw cosmosException; + } + else + { + throw ExceptionWithStackTraceException.UnWrapMonadExcepion(tryGetQueryPlan.Exception, serviceInteropTrace); } - - throw CosmosExceptionFactory.CreateBadRequestException( - message: originalException.Message, - headers: new Headers(), - stackTrace: tryGetQueryPlan.Exception.StackTrace, - innerException: originalException, - trace: trace); } return tryGetQueryPlan.Result; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPlanRetrieverTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPlanRetrieverTests.cs index 47a681eb1a..c1dc2fc3ae 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPlanRetrieverTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/QueryPlanRetrieverTests.cs @@ -41,7 +41,6 @@ public async Task ServiceInterop_BadRequestContainsInnerException() It.IsAny(), It.IsAny())).ReturnsAsync(TryCatch.FromException(innerException)); - Mock trace = new Mock(); CosmosException cosmosException = await Assert.ThrowsExceptionAsync(() => QueryPlanRetriever.GetQueryPlanWithServiceInteropAsync( queryClient.Object, new SqlQuerySpec("selectttttt * from c"), @@ -50,8 +49,7 @@ public async Task ServiceInterop_BadRequestContainsInnerException() hasLogicalPartitionKey: false, geospatialType: Cosmos.GeospatialType.Geography, useSystemPrefix: false, - trace.Object, - default)); + NoOpTrace.Singleton)); Assert.AreEqual(HttpStatusCode.BadRequest, cosmosException.StatusCode); Assert.AreEqual(innerException, cosmosException.InnerException); @@ -92,5 +90,40 @@ public async Task ServiceInterop_BadRequestContainsOriginalCosmosException() Assert.AreEqual(expectedException, cosmosException); } + + [TestMethod] + public async Task ServiceInterop_E_UNEXPECTED() + { + UnexpectedQueryPartitionProviderException innerException = new UnexpectedQueryPartitionProviderException("E_UNEXPECTED"); + Mock queryClient = new Mock(); + + queryClient.Setup(c => c.TryGetPartitionedQueryExecutionInfoAsync( + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny())).ReturnsAsync(TryCatch.FromException(innerException)); + + CosmosException cosmosException = await Assert.ThrowsExceptionAsync(() => QueryPlanRetriever.GetQueryPlanWithServiceInteropAsync( + queryClient.Object, + new SqlQuerySpec("Super secret query that triggers bug"), + ResourceType.Document, + new Documents.PartitionKeyDefinition() { Paths = new Collection() { "/id" } }, + hasLogicalPartitionKey: false, + geospatialType: Cosmos.GeospatialType.Geography, + useSystemPrefix: false, + NoOpTrace.Singleton)); + + Assert.AreEqual(HttpStatusCode.InternalServerError, cosmosException.StatusCode); + Assert.AreEqual(innerException, cosmosException.InnerException); + Assert.IsNotNull(cosmosException.Trace); + Assert.IsNotNull(cosmosException.Diagnostics); + } } } From 9cafaa85c651761fe9eb099e996afb6e1f2dd149 Mon Sep 17 00:00:00 2001 From: akotalwar <94020786+akotalwar@users.noreply.github.com> Date: Thu, 17 Nov 2022 12:18:45 -0800 Subject: [PATCH 017/240] [Internal] Query: Adds unit tests for Merge/Split implementation with OptimisticDirectExecution pipeline (#3510) * Added tests to test different aspects of merge/split support with OptimisticDirectExecution pipeline. Tests check for gone exception handling, pipeline switching etc. * Added gone exception simulation tests. * Added new tests and improved test infra * Removed ParalleContEvocation test. Fixed comments * Removed CreateParallelCrossPartitionPipelineStateAsync() as it is not being used anymore * Removed while loop in CreateDocumentContainerAsync() * Fixed comments. * Updated ExecuteGoneExceptionOnODEPipeline() * Added type Assert for ExecuteGoneExceptionOnODEPipeline() * Updated OptimisticDirectExecution pipeline abbreviation * Updated TestBaseline folder with new xml --- .../CosmosQueryExecutionContextFactory.cs | 4 +- ...ositiveOptimisticDirectExecutionOutput.xml | 12 +- ...misticDirectExecutionQueryBaselineTests.cs | 478 +++++++++--------- 3 files changed, 260 insertions(+), 234 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs index fec5fa4d4a..4e6bacb145 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs @@ -266,7 +266,7 @@ private static async Task> TryCreateCoreContextAsy } } - public static async Task> TryCreateFromPartitionedQueryExecutionInfoAsync( + private static async Task> TryCreateFromPartitionedQueryExecutionInfoAsync( DocumentContainer documentContainer, PartitionedQueryExecutionInfo partitionedQueryExecutionInfo, ContainerQueryProperties containerQueryProperties, @@ -537,7 +537,7 @@ private static TryCatch TryCreateSpecializedDocumentQueryEx return targetRanges; } - public static void SetTestInjectionPipelineType(InputParameters inputParameters, string pipelineType) + private static void SetTestInjectionPipelineType(InputParameters inputParameters, string pipelineType) { TestInjections.ResponseStats responseStats = inputParameters?.TestInjections?.Stats; if (responseStats != null) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml index 950947ff5a..7d4f7ce18d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml @@ -1,8 +1,8 @@  - Partition Key + Value and Distinct - SELECT DISTINCT c.key FROM c + Single Partition Key and Distinct + SELECT DISTINCT c.age FROM c /pk @@ -14,8 +14,8 @@ - Partition Key + Value and Min Aggregate - SELECT VALUE MIN(c.key) FROM c + Single Partition Key and Min Aggregate + SELECT VALUE MIN(c.age) FROM c /pk @@ -27,8 +27,8 @@ - Partition Key + Value Fields - SELECT c.key FROM c + Single Partition Key and Value Field + SELECT c.age FROM c /pk diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs index 960235dcae..f849a04913 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs @@ -29,58 +29,110 @@ using System.IO; using Microsoft.Azure.Cosmos.Query.Core.Pipeline.OptimisticDirectExecutionQuery; using Microsoft.Azure.Cosmos.Query.Core.Pipeline.CrossPartition.Parallel; + using Microsoft.IdentityModel.Tokens; [TestClass] public class OptimisticDirectExecutionQueryBaselineTests : BaselineTests { [TestMethod] [Owner("akotalwar")] - public void TestPipelineNullContinuationToken() + public void PositiveOptimisticDirectExecutionOutput() { - Mock mockDocumentContainer = new Mock(); + List testVariations = new List + { + CreateInput( + description: @"Single Partition Key and Distinct", + query: "SELECT DISTINCT c.age FROM c", + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: @"value"), - TryCatch monadicCreate = OptimisticDirectExecutionQueryPipelineStage.MonadicCreate( - documentContainer: mockDocumentContainer.Object, - sqlQuerySpec: new SqlQuerySpec("SELECT VALUE COUNT(1) FROM c"), - targetRange: FeedRangeEpk.FullRange, - queryPaginationOptions: new QueryPaginationOptions(pageSizeHint: 10), - partitionKey: null, - cancellationToken: default, - continuationToken: null); - Assert.IsTrue(monadicCreate.Succeeded); + CreateInput( + description: @"Single Partition Key and Min Aggregate", + query: "SELECT VALUE MIN(c.age) FROM c", + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: @"value"), + + CreateInput( + description: @"Single Partition Key and Value Field", + query: "SELECT c.age FROM c", + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: @"value"), + }; + this.ExecuteTestSuite(testVariations); } [TestMethod] [Owner("akotalwar")] - public void TestPipelineSingleContinuationToken() + public void NegativeOptimisticDirectExecutionOutput() { - Mock mockDocumentContainer = new Mock(); + List testVariations = new List + { + CreateInput( + description: @"Null Partition Key Value", + query: "SELECT * FROM c", + expectedOptimisticDirectExecution: false, + partitionKeyPath: @"/pk", + partitionKeyValue: Cosmos.PartitionKey.Null), - ParallelContinuationToken parallelContinuationToken = new ParallelContinuationToken( - token: "asdf", - range: new Documents.Routing.Range("A", "B", true, false)); + CreateInput( + description: @"None Partition Key Value", + query: "SELECT * FROM c", + expectedOptimisticDirectExecution: false, + partitionKeyPath: @"/pk", + partitionKeyValue: Cosmos.PartitionKey.None), - OptimisticDirectExecutionContinuationToken token = new OptimisticDirectExecutionContinuationToken(parallelContinuationToken); - CosmosElement cosmosElementContinuationToken = OptimisticDirectExecutionContinuationToken.ToCosmosElement(token); + CreateInput( + description: @"C# Null Partition Key Value", + query: "SELECT * FROM c", + expectedOptimisticDirectExecution: false, + partitionKeyPath: @"/pk", + partitionKeyValue: null), + }; + this.ExecuteTestSuite(testVariations); + } - TryCatch monadicCreate = OptimisticDirectExecutionQueryPipelineStage.MonadicCreate( - documentContainer: mockDocumentContainer.Object, - sqlQuerySpec: new SqlQuerySpec("SELECT * FROM c"), - targetRange: new FeedRangeEpk(new Documents.Routing.Range(min: "A", max: "B", isMinInclusive: true, isMaxInclusive: false)), - queryPaginationOptions: new QueryPaginationOptions(pageSizeHint: 10), - partitionKey: null, - cancellationToken: default, - continuationToken: cosmosElementContinuationToken); - Assert.IsTrue(monadicCreate.Succeeded); + // This test confirms that TestInjection.EnableOptimisticDirectExection is set to false from default. + // Check test "TestPipelineForDistributedQueryAsync" to understand why this is done + [TestMethod] + public async Task TestDefaultTestInjectionSettings() + { + TestInjections testInjection = new TestInjections(simulate429s: false, simulateEmptyPages: false); + + Assert.AreEqual(testInjection.EnableOptimisticDirectExecution, false); } - // test checks that the pipeline can take a query to the backend and returns its associated document(s). [TestMethod] - public async Task TestPipelineForBackendDocumentsAsync() + [Owner("akotalwar")] + public async Task TestMonadicCreateOdePipeline() { int numItems = 10; + bool multiPartition = false; + string query = "SELECT * FROM c"; + + // null continuation token + Assert.IsTrue(await TryMonadicCreate(numItems, multiPartition, query, targetRange: FeedRangeEpk.FullRange, continuationToken: null)); + + CosmosElement cosmosElementContinuationToken = CosmosElement.Parse( + "{\"OptimisticDirectExecutionToken\":{\"token\":\"{\\\"resourceId\\\":\\\"AQAAAMmFOw8LAAAAAAAAAA==\\\",\\\"skipCount\\\":1}\"," + + "\"range\":{\"min\":\"\",\"max\":\"FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF\"}}}"); + Range range = new Documents.Routing.Range("", "FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF", isMinInclusive: true, isMaxInclusive: false); + + // single continuation token + Assert.IsTrue(await TryMonadicCreate(numItems, multiPartition, query, targetRange: new FeedRangeEpk(range), continuationToken: cosmosElementContinuationToken)); + + //TODO: Add non Ode continuation token case + } + + // test checks that the pipeline can take a query to the backend and returns its associated document(s). + [TestMethod] + public async Task TestPipelineForBackendDocumentsOnSinglePartitionAsync() + { + int numItems = 100; string query = "SELECT VALUE COUNT(1) FROM c"; - IDocumentContainer inMemoryCollection = await CreateDocumentContainerAsync(numItems); + DocumentContainer inMemoryCollection = await CreateDocumentContainerAsync(numItems, multiPartition: false); IQueryPipelineStage queryPipelineStage = await CreateOptimisticDirectExecutionPipelineStateAsync(inMemoryCollection, query, continuationToken: null); int documentCountInSinglePartition = 0; @@ -92,17 +144,94 @@ public async Task TestPipelineForBackendDocumentsAsync() documentCountInSinglePartition += Int32.Parse(tryGetPage.Result.Documents[0].ToString()); } - Assert.AreEqual(documentCountInSinglePartition, 4); + Assert.AreEqual(100, documentCountInSinglePartition); } // test checks that the pipeline can take a query to the backend and returns its associated document(s) + continuation token. [TestMethod] - public async Task TestPipelineForContinuationTokenAsync() + public async Task TestPipelineForContinuationTokenOnSinglePartitionAsync() { int numItems = 100; - string query = "SELECT * FROM c"; - IDocumentContainer inMemoryCollection = await CreateDocumentContainerAsync(numItems); + int result = await this.CreateOptimisticPipelineAndDrainAsync( + numItems: numItems, + isMultiPartition: false, + query: "SELECT * FROM c", + expectedContinuationTokenCount: 10); + + Assert.AreEqual(numItems, result); + } + + // test to check if pipeline handles a 410 exception properly and returns all the documents. + [TestMethod] + public async Task TestPipelineForGoneExceptionOnSingleAndMultiplePartitionAsync() + { + Assert.IsTrue(await ExecuteGoneExceptionOnOdePipeline(isMultiPartition: false)); + + Assert.IsTrue(await ExecuteGoneExceptionOnOdePipeline(isMultiPartition: true)); + } + + // The reason we have the below test is to show the missing capabilities of the OptimisticDirectExecution pipeline. + // Currently this pipeline cannot handle distributed queries as it does not have the logic to sum up the values it gets from the backend in partial results. + // This functionality is available for other pipelines such as the ParallelCrossPartitionQueryPipelineStage. + [TestMethod] + public async Task TestPipelineForDistributedQueryAsync() + { + int numItems = 100; + int result = await this.CreateOptimisticPipelineAndDrainAsync( + numItems: numItems, + isMultiPartition: false, + query: "SELECT AVG(c) FROM c", + expectedContinuationTokenCount: 0); + + //TODO: Add validation for actual value of average + Assert.AreEqual(1, result); + } + + private static async Task TryMonadicCreate(int numItems, bool multiPartition, string query, FeedRangeEpk targetRange, CosmosElement continuationToken) + { + DocumentContainer inMemoryCollection = await CreateDocumentContainerAsync(numItems, multiPartition); + + TryCatch monadicQueryPipelineStage = OptimisticDirectExecutionQueryPipelineStage.MonadicCreate( + documentContainer: inMemoryCollection, + sqlQuerySpec: new SqlQuerySpec(query), + targetRange: targetRange, + queryPaginationOptions: new QueryPaginationOptions(pageSizeHint: 10), + partitionKey: null, + cancellationToken: default, + continuationToken: continuationToken); + + return monadicQueryPipelineStage.Succeeded; + } + + private static async Task CreateOptimisticDirectExecutionPipelineStateAsync(DocumentContainer documentContainer, string query, CosmosElement continuationToken) + { + List targetRanges = await documentContainer.GetFeedRangesAsync( + trace: NoOpTrace.Singleton, + cancellationToken: default); + + // only one range is taken because Ode pipeline can only accept one range + FeedRangeEpk firstRange = targetRanges[0]; + + TryCatch monadicQueryPipelineStage = OptimisticDirectExecutionQueryPipelineStage.MonadicCreate( + documentContainer: documentContainer, + sqlQuerySpec: new SqlQuerySpec(query), + targetRange: firstRange, + queryPaginationOptions: new QueryPaginationOptions(pageSizeHint: 10), + partitionKey: null, + continuationToken: continuationToken, + cancellationToken: default); + + Assert.IsTrue(monadicQueryPipelineStage.Succeeded); + IQueryPipelineStage queryPipelineStage = monadicQueryPipelineStage.Result; + + return queryPipelineStage; + } + + private async Task CreateOptimisticPipelineAndDrainAsync(int numItems, bool isMultiPartition, string query, int expectedContinuationTokenCount) + { + DocumentContainer inMemoryCollection = await CreateDocumentContainerAsync(numItems, multiPartition: isMultiPartition); IQueryPipelineStage queryPipelineStage = await CreateOptimisticDirectExecutionPipelineStateAsync(inMemoryCollection, query, continuationToken: null); + List documents = new List(); int continuationTokenCount = 0; @@ -125,126 +254,66 @@ public async Task TestPipelineForContinuationTokenAsync() continuationTokenCount++; } - Assert.AreEqual(continuationTokenCount, 2); - Assert.AreEqual(documents.Count, 17); + Assert.AreEqual(expectedContinuationTokenCount, continuationTokenCount); + return documents.Count; } - // This test confirms that TestInjection.EnableOptimisticDirectExection is set to false from default. - // Check test "TestPipelineForDistributedQueryAsync" to understand why this is done - [TestMethod] - public async Task TestDefaultTestInjectionSettings() - { - TestInjections testInjection = new TestInjections(simulate429s: false, simulateEmptyPages: false); - - Assert.AreEqual(testInjection.EnableOptimisticDirectExecution, false); - } - - // The reason we have the below test is to show the missing capabilities of the OptimisticDirectExecution pipeline. - // Currently this pipeline cannot handle distributed queries as it does not have the logic to sum up the values it gets from the backend in partial results. - // This functionality is available for other pipelines such as the ParallelCrossPartitionQueryPipelineStage as evident below - [TestMethod] - public async Task TestPipelineForDistributedQueryAsync() + // it creates a gone exception after the first MoveNexyAsync() call. This allows for the pipeline to return some documents before failing + // TODO: With the addition of the merge/split support, this queryPipelineStage should be able to return all documents regardless of a gone exception happening + private static async Task ExecuteGoneExceptionOnOdePipeline(bool isMultiPartition) { int numItems = 100; - string query = "SELECT VALUE COUNT(1) FROM c"; - IDocumentContainer inMemoryCollection = await CreateDocumentContainerAsync(numItems); - IQueryPipelineStage optimisticDirectExecutionQueryPipelineStage = await CreateOptimisticDirectExecutionPipelineStateAsync(inMemoryCollection, query, continuationToken: null); - IQueryPipelineStage parallelQueryPipelineStage = await CreateParallelCrossPartitionPipelineStateAsync(inMemoryCollection, query, continuationToken: null); - int documentCountOptimisticPipeline = 0; - int documentCountParallelPipeline = 0; - - List queryPipelineStages = new List - { - optimisticDirectExecutionQueryPipelineStage, - parallelQueryPipelineStage - }; - - List documentPipelinesCount = new List - { - documentCountOptimisticPipeline, - documentCountParallelPipeline - }; + string query = "SELECT * FROM c"; + List documents = new List(); + string goneExceptionMessage = $"Epk Range: Partition does not exist at the given range."; + CosmosException goneException = new CosmosException( + message: goneExceptionMessage, + statusCode: System.Net.HttpStatusCode.Gone, + subStatusCode: (int)SubStatusCodes.PartitionKeyRangeGone, + activityId: "0f8fad5b-d9cb-469f-a165-70867728950e", + requestCharge: default); + + int moveNextAsyncCounter = 0; + bool caughtGoneException = false; + DocumentContainer inMemoryCollection = await CreateDocumentContainerAsync( + numItems, + multiPartition: isMultiPartition, + failureConfigs: new FlakyDocumentContainer.FailureConfigs( + inject429s: false, + injectEmptyPages: false, + shouldReturnFailure: () => Task.FromResult(moveNextAsyncCounter == 1 ? goneException : null))); - for (int i = 0; i < queryPipelineStages.Count(); i++) + IQueryPipelineStage queryPipelineStage = await CreateOptimisticDirectExecutionPipelineStateAsync(inMemoryCollection, query, continuationToken: null); + while (await queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton)) { - while (await queryPipelineStages[i].MoveNextAsync(NoOpTrace.Singleton)) - { - TryCatch tryGetPage = queryPipelineStages[i].Current; - tryGetPage.ThrowIfFailed(); + moveNextAsyncCounter++; + TryCatch tryGetPage = queryPipelineStage.Current; - documentPipelinesCount[i] += Int32.Parse(tryGetPage.Result.Documents[0].ToString()); + if (tryGetPage.Failed == true) + { + string errorRecieved = tryGetPage.Exception.InnerException.Message; + Assert.AreEqual(goneException.GetType(), tryGetPage.Exception.InnerException.GetType()); - if (tryGetPage.Result.State == null) + if (errorRecieved.Equals(goneExceptionMessage)) { + caughtGoneException = true; break; } - else - { - queryPipelineStages[i] = queryPipelineStages[i].Equals(optimisticDirectExecutionQueryPipelineStage) - ? await CreateOptimisticDirectExecutionPipelineStateAsync(inMemoryCollection, query, continuationToken: tryGetPage.Result.State.Value) - : await CreateParallelCrossPartitionPipelineStateAsync(inMemoryCollection, query, continuationToken: tryGetPage.Result.State.Value); - } } - } - - documentCountOptimisticPipeline = documentPipelinesCount[0]; - documentCountParallelPipeline = documentPipelinesCount[1]; - int countDifference = documentCountParallelPipeline - documentCountOptimisticPipeline; - - Assert.AreNotEqual(documentCountOptimisticPipeline, documentCountParallelPipeline, countDifference.ToString()); - Assert.AreEqual(documentCountOptimisticPipeline, 17); - Assert.AreEqual(documentCountParallelPipeline, 100); - Assert.AreEqual(countDifference, 83); - Assert.AreEqual(documentCountParallelPipeline, numItems); - } - - private static async Task CreateOptimisticDirectExecutionPipelineStateAsync(IDocumentContainer documentContainer, string query, CosmosElement continuationToken) - { - List targetRanges = await documentContainer.GetFeedRangesAsync( - trace: NoOpTrace.Singleton, - cancellationToken: default); - FeedRangeEpk firstRange = targetRanges[0]; - - TryCatch monadicQueryPipelineStage = OptimisticDirectExecutionQueryPipelineStage.MonadicCreate( - documentContainer: documentContainer, - sqlQuerySpec: new SqlQuerySpec(query), - targetRange: firstRange, - queryPaginationOptions: new QueryPaginationOptions(pageSizeHint: 10), - partitionKey: null, - cancellationToken: default, - continuationToken: continuationToken); - - Assert.IsTrue(monadicQueryPipelineStage.Succeeded); - IQueryPipelineStage queryPipelineStage = monadicQueryPipelineStage.Result; - - return queryPipelineStage; - } - private static async Task CreateParallelCrossPartitionPipelineStateAsync(IDocumentContainer documentContainer, string query, CosmosElement continuationToken) - { - List targetRanges = await documentContainer.GetFeedRangesAsync( - trace: NoOpTrace.Singleton, - cancellationToken: default); - - TryCatch monadicQueryPipelineStage = ParallelCrossPartitionQueryPipelineStage.MonadicCreate( - documentContainer: documentContainer, - sqlQuerySpec: new SqlQuerySpec(query), - targetRanges: targetRanges, - queryPaginationOptions: new QueryPaginationOptions(pageSizeHint: 10), - partitionKey: null, - maxConcurrency: 10, - prefetchPolicy: PrefetchPolicy.PrefetchSinglePage, - cancellationToken: default, - continuationToken: continuationToken); + documents.AddRange(tryGetPage.Result.Documents); + } - Assert.IsTrue(monadicQueryPipelineStage.Succeeded); - IQueryPipelineStage queryPipelineStage = monadicQueryPipelineStage.Result; + // Once fallback plan is implemented, this test should be able to return all 100 documents + Assert.AreEqual(10, documents.Count); + Assert.IsTrue(caughtGoneException); - return queryPipelineStage; + return true; } - private static async Task CreateDocumentContainerAsync( + private static async Task CreateDocumentContainerAsync( int numItems, + bool multiPartition, FlakyDocumentContainer.FailureConfigs failureConfigs = null) { PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition() @@ -265,107 +334,59 @@ private static async Task CreateDocumentContainerAsync( DocumentContainer documentContainer = new DocumentContainer(monadicDocumentContainer); - for (int i = 0; i < 3; i++) + // a value of 2 would lead to 4 partitions (2 * 2). 4 partitions are used because they're easy to manage + demonstrates multi partition use case + int exponentPartitionKeyRanges = 2; + + IReadOnlyList ranges; + + for (int i = 0; i < exponentPartitionKeyRanges; i++) { - IReadOnlyList ranges = await documentContainer.GetFeedRangesAsync( + ranges = await documentContainer.GetFeedRangesAsync( trace: NoOpTrace.Singleton, cancellationToken: default); - foreach (FeedRangeInternal range in ranges) + + if (multiPartition) { - await documentContainer.SplitAsync(range, cancellationToken: default); + foreach (FeedRangeInternal range in ranges) + { + await documentContainer.SplitAsync(range, cancellationToken: default); + } } await documentContainer.RefreshProviderAsync(NoOpTrace.Singleton, cancellationToken: default); } + ranges = await documentContainer.GetFeedRangesAsync( + trace: NoOpTrace.Singleton, + cancellationToken: default); + + int rangeCount = multiPartition ? 4 : 1; + + Assert.AreEqual(rangeCount, ranges.Count); + for (int i = 0; i < numItems; i++) { // Insert an item CosmosObject item = CosmosObject.Parse($"{{\"pk\" : {i} }}"); - while (true) - { - TryCatch monadicCreateRecord = await documentContainer.MonadicCreateItemAsync(item, cancellationToken: default); - if (monadicCreateRecord.Succeeded) - { - break; - } - } + TryCatch monadicCreateRecord = await documentContainer.MonadicCreateItemAsync(item, cancellationToken: default); + Assert.IsTrue(monadicCreateRecord.Succeeded); } return documentContainer; } - [TestMethod] - [Owner("akotalwar")] - public void PositiveOptimisticDirectExecutionOutput() - { - List testVariations = new List - { - CreateInput( - @"Partition Key + Value and Distinct", - "SELECT DISTINCT c.key FROM c", - true, - @"/pk", - @"/value"), - - CreateInput( - @"Partition Key + Value and Min Aggregate", - "SELECT VALUE MIN(c.key) FROM c", - true, - @"/pk", - @"/value"), - - CreateInput( - @"Partition Key + Value Fields", - "SELECT c.key FROM c", - true, - @"/pk", - @"/value"), - }; - this.ExecuteTestSuite(testVariations); - } - - [TestMethod] - [Owner("akotalwar")] - public void NegativeOptimisticDirectExecutionOutput() - { - List testVariations = new List - { - CreateInput( - @"Null Partition Key Value", - "SELECT * FROM c", - false, - @"/pk", - Cosmos.PartitionKey.Null), - - CreateInput( - @"None Partition Key Value", - "SELECT * FROM c", - false, - @"/pk", - Cosmos.PartitionKey.None), - - CreateInput( - @"C# Null Partition Key Value", - "SELECT * FROM c", - false, - @"/pk", - null), - }; - this.ExecuteTestSuite(testVariations); - } - private static OptimisticDirectExecutionTestInput CreateInput( string description, string query, bool expectedOptimisticDirectExecution, string partitionKeyPath, - string partitionKeyValue) + string partitionKeyValue, + CosmosElement continuationToken = null) { PartitionKeyBuilder pkBuilder = new PartitionKeyBuilder(); pkBuilder.Add(partitionKeyValue); - return CreateInput(description, query, expectedOptimisticDirectExecution, partitionKeyPath, pkBuilder.Build()); + return CreateInput(description, query, expectedOptimisticDirectExecution, partitionKeyPath, pkBuilder.Build(), continuationToken); } private static OptimisticDirectExecutionTestInput CreateInput( @@ -373,18 +394,19 @@ private static OptimisticDirectExecutionTestInput CreateInput( string query, bool expectedOptimisticDirectExecution, string partitionKeyPath, - Cosmos.PartitionKey partitionKeyValue) + Cosmos.PartitionKey partitionKeyValue, + CosmosElement continuationToken = null) { - return new OptimisticDirectExecutionTestInput(description, query, new SqlQuerySpec(query), expectedOptimisticDirectExecution, partitionKeyPath, partitionKeyValue); + return new OptimisticDirectExecutionTestInput(description, query, new SqlQuerySpec(query), expectedOptimisticDirectExecution, partitionKeyPath, partitionKeyValue, continuationToken); } - + private static PartitionedQueryExecutionInfo GetPartitionedQueryExecutionInfo(string querySpecJsonString, PartitionKeyDefinition pkDefinition) { TryCatch tryGetQueryPlan = QueryPartitionProviderTestInstance.Object.TryGetPartitionedQueryExecutionInfo( querySpecJsonString: querySpecJsonString, partitionKeyDefinition: pkDefinition, requireFormattableOrderByQuery: true, - isContinuationExpected: false, + isContinuationExpected: true, allowNonValueAggregateQuery: true, hasLogicalPartitionKey: false, allowDCount: true, @@ -404,14 +426,14 @@ public override OptimisticDirectExecutionTestOutput ExecuteTest(OptimisticDirect // gets query context string databaseId = "db1234"; - string resourceLink = string.Format("dbs/{0}/colls", databaseId); + string resourceLink = $"dbs/{databaseId}/colls"; CosmosQueryContextCore cosmosQueryContextCore = new CosmosQueryContextCore( client: new TestCosmosQueryClient(), resourceTypeEnum: Documents.ResourceType.Document, operationType: Documents.OperationType.Query, resourceType: typeof(QueryResponseCore), resourceLink: resourceLink, - isContinuationExpected: false, + isContinuationExpected: true, allowNonValueAggregateQuery: true, useSystemPrefix: false, correlatedActivityId: Guid.NewGuid()); @@ -419,7 +441,6 @@ public override OptimisticDirectExecutionTestOutput ExecuteTest(OptimisticDirect // gets input parameters QueryRequestOptions queryRequestOptions = new QueryRequestOptions { - MaxBufferedItemCount = 7000, TestSettings = new TestInjections(simulate429s: true, simulateEmptyPages: false, enableOptimisticDirectExecution: true, new TestInjections.ResponseStats()) }; @@ -435,7 +456,7 @@ public override OptimisticDirectExecutionTestOutput ExecuteTest(OptimisticDirect CosmosQueryExecutionContextFactory.InputParameters inputParameters = new CosmosQueryExecutionContextFactory.InputParameters( sqlQuerySpec: sqlQuerySpec, - initialUserContinuationToken: null, + initialUserContinuationToken: input.ContinuationToken, initialFeedRange: null, maxConcurrency: queryRequestOptions.MaxConcurrency, maxItemCount: queryRequestOptions.MaxItemCount, @@ -447,25 +468,27 @@ public override OptimisticDirectExecutionTestOutput ExecuteTest(OptimisticDirect returnResultsInDeterministicOrder: null, forcePassthrough: true, testInjections: queryRequestOptions.TestSettings); - + IQueryPipelineStage queryPipelineStage = CosmosQueryExecutionContextFactory.Create( documentContainer, cosmosQueryContextCore, inputParameters, NoOpTrace.Singleton); + bool result = queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton).Result; if (input.ExpectedOptimisticDirectExecution) { Assert.AreEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); } - else { + else + { Assert.AreNotEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); } - + Assert.IsNotNull(queryPipelineStage); Assert.IsTrue(result); - + return new OptimisticDirectExecutionTestOutput(input.ExpectedOptimisticDirectExecution); } } @@ -495,6 +518,7 @@ public sealed class OptimisticDirectExecutionTestInput : BaselineTestInput internal bool ExpectedOptimisticDirectExecution { get; set; } internal PartitionKeyRangeIdentity PartitionKeyRangeId { get; set; } internal string Query { get; set; } + internal CosmosElement ContinuationToken { get; set; } internal OptimisticDirectExecutionTestInput( string description, @@ -502,7 +526,8 @@ internal OptimisticDirectExecutionTestInput( SqlQuerySpec sqlQuerySpec, bool expectedOptimisticDirectExecution, string partitionKeyPath, - Cosmos.PartitionKey partitionKeyValue) + Cosmos.PartitionKey partitionKeyValue, + CosmosElement continuationToken) : base(description) { this.PartitionKeyDefinition = new PartitionKeyDefinition() @@ -518,6 +543,7 @@ internal OptimisticDirectExecutionTestInput( this.ExpectedOptimisticDirectExecution = expectedOptimisticDirectExecution; this.Query = query; this.PartitionKeyValue = partitionKeyValue; + this.ContinuationToken = continuationToken; } public override void SerializeAsXml(XmlWriter xmlWriter) @@ -533,7 +559,7 @@ public override void SerializeAsXml(XmlWriter xmlWriter) } } - xmlWriter.WriteEndElement(); + xmlWriter.WriteEndElement(); if (this.PartitionKeyDefinition != null) { xmlWriter.WriteElementString( @@ -596,8 +622,8 @@ public override Task> GetTargetPartitionKeyRangesAsync(s { return Task.FromResult(new List{new PartitionKeyRange() { - MinInclusive = PartitionKeyHash.V2.Hash("abc").ToString(), - MaxExclusive = PartitionKeyHash.V2.Hash("def").ToString() + MinInclusive = PartitionKeyInternal.MinimumInclusiveEffectivePartitionKey, + MaxExclusive = PartitionKeyInternal.MaximumExclusiveEffectivePartitionKey } }); } From 2681be80b9674fc8a09f1a7552894ef8741b23e2 Mon Sep 17 00:00:00 2001 From: Nalu Tripician Date: Fri, 18 Nov 2022 11:06:27 -0500 Subject: [PATCH 018/240] Client Retry Policy: Adds HTTP timeouts with request-level cross-region retry (#3555) * Fixes to ReadThroughputAsync for databases with no provisioned throughput and null as request options * fixed failure to ReadReplaceThroughputResponseTests * Added Stream Method * Ran UpdateContract.ps1 * Encryption implemtation * Fixed spelling error * Update Microsoft.Azure.Cosmos.Encryption/src/EncryptionDatabase.cs Co-authored-by: Matias Quaranta * Variable name change * Update Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs Co-authored-by: Matias Quaranta * Suggested Changes and fixes * Removed manufactured ResponseMessage + nits * Simplified PR * nits * nits * initial changes TODO: Update tests * updated tests * nits' * Ran UpdateContracts.ps1 * nits + requested changes * Delete NuGet.Config * Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs Co-authored-by: Matias Quaranta * Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs Co-authored-by: Matias Quaranta * Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs Co-authored-by: Matias Quaranta * Update Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs Co-authored-by: Matias Quaranta * Use Cosmos Exception Factory, Simplified Tests * removed unused code * nits: removed unused code * removed unused code Co-authored-by: Matias Quaranta Co-authored-by: Nalu Tripician --- .../src/HttpClient/CosmosHttpClientCore.cs | 13 ++++ .../src/HttpClient/HttpTimeoutPolicy.cs | 26 +++++++- .../HttpTimeoutPolicyControlPlaneRead.cs | 2 + ...meoutPolicyControlPlaneRetriableHotPath.cs | 9 ++- .../HttpClient/HttpTimeoutPolicyDefault.cs | 9 ++- .../CosmosExceptionFactory.cs | 18 ++++++ .../CosmosHttpClientCoreTests.cs | 63 ++++++++++++++++++- .../GatewayAccountReaderTests.cs | 2 +- .../GatewayStoreModelTest.cs | 2 +- 9 files changed, 136 insertions(+), 8 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs b/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs index fa8463e64b..f86bd6b183 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs @@ -296,6 +296,19 @@ private async Task SendHttpHelperAsync( string message = $"GatewayStoreClient Request Timeout. Start Time UTC:{startDateTimeUtc}; Total Duration:{(DateTime.UtcNow - startDateTimeUtc).TotalMilliseconds} Ms; Request Timeout {requestTimeout.TotalMilliseconds} Ms; Http Client Timeout:{this.httpClient.Timeout.TotalMilliseconds} Ms; Activity id: {System.Diagnostics.Trace.CorrelationManager.ActivityId};"; e.Data.Add("Message", message); + + if (timeoutPolicy.ShouldThrow503OnTimeout) + { + throw CosmosExceptionFactory.CreateServiceUnavailableException( + message: message, + headers: new Headers() + { + ActivityId = System.Diagnostics.Trace.CorrelationManager.ActivityId.ToString(), + SubStatusCode = SubStatusCodes.TransportGenerated503 + }, + innerException: e); + } + throw; } diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs index 413205cdba..a3fc51dd91 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs @@ -18,21 +18,45 @@ internal abstract class HttpTimeoutPolicy public abstract bool ShouldRetryBasedOnResponse(HttpMethod requestHttpMethod, HttpResponseMessage responseMessage); + public virtual bool ShouldThrow503OnTimeout => false; + public static HttpTimeoutPolicy GetTimeoutPolicy( DocumentServiceRequest documentServiceRequest) { + //Query Plan Requests if (documentServiceRequest.ResourceType == ResourceType.Document && documentServiceRequest.OperationType == OperationType.QueryPlan) { - return HttpTimeoutPolicyControlPlaneRetriableHotPath.Instance; + return HttpTimeoutPolicyControlPlaneRetriableHotPath.InstanceShouldThrow503OnTimeout; } + //Partition Key Requests if (documentServiceRequest.ResourceType == ResourceType.PartitionKeyRange) { return HttpTimeoutPolicyControlPlaneRetriableHotPath.Instance; } + //Data Plane Read & Write + if (!HttpTimeoutPolicy.IsMetaData(documentServiceRequest)) + { + return HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout; + } + + //Meta Data Read + if (HttpTimeoutPolicy.IsMetaData(documentServiceRequest) && documentServiceRequest.IsReadOnlyRequest) + { + return HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout; + } + + //Default behavior return HttpTimeoutPolicyDefault.Instance; } + + private static bool IsMetaData(DocumentServiceRequest request) + { + return (request.OperationType != Documents.OperationType.ExecuteJavaScript && request.ResourceType == ResourceType.StoredProcedure) || + request.ResourceType != ResourceType.Document; + + } } } diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRead.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRead.cs index 56c55901bb..757134a576 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRead.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRead.cs @@ -44,5 +44,7 @@ public override bool ShouldRetryBasedOnResponse(HttpMethod requestHttpMethod, Ht { return false; } + + public override bool ShouldThrow503OnTimeout => true; } } diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRetriableHotPath.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRetriableHotPath.cs index c8b8dbfb50..8dbb8a2a44 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRetriableHotPath.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRetriableHotPath.cs @@ -10,11 +10,14 @@ namespace Microsoft.Azure.Cosmos internal sealed class HttpTimeoutPolicyControlPlaneRetriableHotPath : HttpTimeoutPolicy { - public static readonly HttpTimeoutPolicy Instance = new HttpTimeoutPolicyControlPlaneRetriableHotPath(); + public static readonly HttpTimeoutPolicy Instance = new HttpTimeoutPolicyControlPlaneRetriableHotPath(false); + public static readonly HttpTimeoutPolicy InstanceShouldThrow503OnTimeout = new HttpTimeoutPolicyControlPlaneRetriableHotPath(true); + public bool shouldThrow503OnTimeout; private static readonly string Name = nameof(HttpTimeoutPolicyControlPlaneRetriableHotPath); - private HttpTimeoutPolicyControlPlaneRetriableHotPath() + private HttpTimeoutPolicyControlPlaneRetriableHotPath(bool shouldThrow503OnTimeout) { + this.shouldThrow503OnTimeout = shouldThrow503OnTimeout; } private readonly IReadOnlyList<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> TimeoutsAndDelays = new List<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)>() @@ -61,5 +64,7 @@ public override bool ShouldRetryBasedOnResponse(HttpMethod requestHttpMethod, Ht return true; } + + public override bool ShouldThrow503OnTimeout => this.shouldThrow503OnTimeout; } } diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyDefault.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyDefault.cs index 949afc0513..974509c70c 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyDefault.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyDefault.cs @@ -10,11 +10,14 @@ namespace Microsoft.Azure.Cosmos internal sealed class HttpTimeoutPolicyDefault : HttpTimeoutPolicy { - public static readonly HttpTimeoutPolicy Instance = new HttpTimeoutPolicyDefault(); + public static readonly HttpTimeoutPolicy Instance = new HttpTimeoutPolicyDefault(false); + public static readonly HttpTimeoutPolicy InstanceShouldThrow503OnTimeout = new HttpTimeoutPolicyDefault(true); + public bool shouldThrow503OnTimeout; private static readonly string Name = nameof(HttpTimeoutPolicyDefault); - private HttpTimeoutPolicyDefault() + private HttpTimeoutPolicyDefault(bool shouldThrow503OnTimeout) { + this.shouldThrow503OnTimeout = shouldThrow503OnTimeout; } private readonly IReadOnlyList<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> TimeoutsAndDelays = new List<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)>() @@ -46,5 +49,7 @@ public override bool ShouldRetryBasedOnResponse(HttpMethod requestHttpMethod, Ht { return false; } + + public override bool ShouldThrow503OnTimeout => this.shouldThrow503OnTimeout; } } diff --git a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosExceptionFactory.cs b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosExceptionFactory.cs index fff41258b2..0648aecbc3 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosExceptionFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosExceptionFactory.cs @@ -283,6 +283,24 @@ internal static CosmosException CreateBadRequestException( innerException); } + internal static CosmosException CreateServiceUnavailableException( + string message, + Headers headers, + string stackTrace = default, + ITrace trace = default, + Error error = default, + Exception innerException = default) + { + return CosmosExceptionFactory.Create( + HttpStatusCode.ServiceUnavailable, + message, + stackTrace, + headers, + trace, + error, + innerException); + } + internal static CosmosException CreateUnauthorizedException( string message, Headers headers, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs index 00d156e8b7..67c653498b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs @@ -259,6 +259,67 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio Assert.AreEqual(3, count, "Should retry 3 times"); } + [TestMethod] + public async Task HttpTimeoutThrow503TestAsync() + { + + async Task TestScenarioAsync(HttpMethod method, ResourceType resourceType, HttpTimeoutPolicy timeoutPolicy, Type expectedException, int expectedNumberOfRetrys) + { + int count = 0; + async Task sendFunc(HttpRequestMessage request, CancellationToken cancellationToken) + { + count++; + + throw new OperationCanceledException("API with exception"); + + } + + DocumentClientEventSource eventSource = DocumentClientEventSource.Instance; + HttpMessageHandler messageHandler = new MockMessageHandler(sendFunc); + using CosmosHttpClient cosmoshttpClient = MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(messageHandler)); + + try + { + + HttpResponseMessage responseMessage1 = await cosmoshttpClient.SendHttpAsync(() => + new ValueTask( + result: new HttpRequestMessage(method, new Uri("http://localhost"))), + resourceType: resourceType, + timeoutPolicy: timeoutPolicy, + clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), + cancellationToken: default); + } + catch (Exception e) + { + Assert.AreEqual(expectedNumberOfRetrys, count, "Should retry 3 times for read methods, for writes should only be tried once"); + Assert.AreEqual(e.GetType(), expectedException); + + if (e.GetType() == typeof(CosmosException)) + { + CosmosException cosmosException = (CosmosException)e; + Assert.AreEqual(cosmosException.StatusCode, System.Net.HttpStatusCode.ServiceUnavailable); + Assert.AreEqual((int)cosmosException.SubStatusCode,(int)SubStatusCodes.TransportGenerated503); + } + } + + } + + //Data plane read + await TestScenarioAsync(HttpMethod.Get, ResourceType.Document, HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, typeof(CosmosException), 3); + + //Data plane write + await TestScenarioAsync(HttpMethod.Post, ResourceType.Document, HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, typeof(CosmosException), 1); + + //Meta data read + await TestScenarioAsync(HttpMethod.Get, ResourceType.Database, HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, typeof(CosmosException), 3); + + //Query plan read (note all query plan operations are reads). + await TestScenarioAsync(HttpMethod.Get, ResourceType.Document, HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, typeof(CosmosException), 3); + + //Metadata Write (Should throw a 408 OperationCanceledException rather than a 503) + await TestScenarioAsync(HttpMethod.Post, ResourceType.Document, HttpTimeoutPolicyDefault.Instance, typeof(TaskCanceledException), 1); + } + [TestMethod] public async Task NoRetryOnNoRetryPolicyTestAsync() { @@ -309,7 +370,7 @@ public async Task RetryTransientIssuesForQueryPlanTestAsync() new Documents.Collections.RequestNameValueCollection()); HttpTimeoutPolicy retryPolicy = HttpTimeoutPolicy.GetTimeoutPolicy(documentServiceRequest); - Assert.AreEqual(HttpTimeoutPolicyControlPlaneRetriableHotPath.Instance, retryPolicy); + Assert.AreEqual(HttpTimeoutPolicyControlPlaneRetriableHotPath.InstanceShouldThrow503OnTimeout, retryPolicy); int count = 0; IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> retry = retryPolicy.GetTimeoutEnumerator(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAccountReaderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAccountReaderTests.cs index e1cfeb5f40..2fc8359f68 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAccountReaderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAccountReaderTests.cs @@ -61,7 +61,7 @@ public async Task DocumentClient_BuildHttpClientFactory_WithHandler() uri: new Uri("https://localhost"), additionalHeaders: new RequestNameValueCollection(), resourceType: ResourceType.Document, - timeoutPolicy: HttpTimeoutPolicyDefault.Instance, + timeoutPolicy: HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), cancellationToken: default); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs index fe4287484c..43078d1866 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs @@ -808,7 +808,7 @@ public async Task GatewayStatsDurationTest() await cosmosHttpClient.SendHttpAsync(() => new ValueTask(new HttpRequestMessage(HttpMethod.Get, "http://someuri.com")), ResourceType.Document, - HttpTimeoutPolicyDefault.Instance, + HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, clientSideRequestStatistics, CancellationToken.None); From 010e4ba7198b62cb13b680baf4f6b2d6f9538cef Mon Sep 17 00:00:00 2001 From: Pramod Valavala <43602528+PramodValavala-MSFT@users.noreply.github.com> Date: Mon, 21 Nov 2022 17:56:48 -0500 Subject: [PATCH 019/240] Documentation: Fixes EUAP in Comments (#3579) --- Microsoft.Azure.Cosmos/src/Regions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Regions.cs b/Microsoft.Azure.Cosmos/src/Regions.cs index 64729bd21a..f08bbf4c91 100644 --- a/Microsoft.Azure.Cosmos/src/Regions.cs +++ b/Microsoft.Azure.Cosmos/src/Regions.cs @@ -186,12 +186,12 @@ public static class Regions public const string USGovVirginia = "USGov Virginia"; /// - /// Name of the Azure East US 2 EUAP region in the Azure Cosmos DB service. + /// Name of the Azure East US 2 Early Updates Access Program (EUAP) region in the Azure Cosmos DB service. /// public const string EastUS2EUAP = "East US 2 EUAP"; /// - /// Name of the Azure Central US EUAP region in the Azure Cosmos DB service. + /// Name of the Azure Central US Early Updates Access Program (EUAP) region in the Azure Cosmos DB service. /// public const string CentralUSEUAP = "Central US EUAP"; From b24eeb96babef246d8deb2305e08accb7ceffc7d Mon Sep 17 00:00:00 2001 From: neildsh <35383880+neildsh@users.noreply.github.com> Date: Wed, 23 Nov 2022 10:28:19 -0800 Subject: [PATCH 020/240] Query: Fixes incorrect FeedResponse.Count when result contains undefined elements (#3574) * Do not maintain an independent count on QueryResponse that can go out of sync * Add more test coverage for QueryResponse.Count * Output the correct count from CosmosElementSerializer when the input contains CosmosUndefined * Add untyped tests for CosmosUndefined * Remove commented code --- .../src/Query/v3Query/QueryResponse.cs | 8 +-- .../src/Serializer/CosmosElementSerializer.cs | 7 +- .../Query/CosmosUndefinedQueryTests.cs | 65 +++++++++++++++++++ .../Query/QueryTestsBase.cs | 24 +++++++ 4 files changed, 98 insertions(+), 6 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryResponse.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryResponse.cs index e9d0b5856b..6c7777ebff 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryResponse.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryResponse.cs @@ -163,6 +163,7 @@ class QueryResponse : FeedResponse { private readonly CosmosSerializerCore serializerCore; private readonly CosmosSerializationFormatOptions serializationOptions; + private readonly IReadOnlyList resource; private QueryResponse( HttpStatusCode httpStatusCode, @@ -178,8 +179,7 @@ private QueryResponse( this.serializerCore = serializerCore; this.serializationOptions = serializationOptions; this.StatusCode = httpStatusCode; - this.Count = cosmosElements.Count; - this.Resource = CosmosElementSerializer.GetResources( + this.resource = CosmosElementSerializer.GetResources( cosmosArray: cosmosElements, serializerCore: serializerCore); @@ -197,7 +197,7 @@ private QueryResponse( public override CosmosDiagnostics Diagnostics { get; } - public override int Count { get; } + public override int Count => this.resource.Count; internal CosmosQueryResponseMessageHeaders QueryHeaders { get; } @@ -210,7 +210,7 @@ public override IEnumerator GetEnumerator() return this.Resource.GetEnumerator(); } - public override IEnumerable Resource { get; } + public override IEnumerable Resource => this.resource; internal override RequestMessage RequestMessage { get; } diff --git a/Microsoft.Azure.Cosmos/src/Serializer/CosmosElementSerializer.cs b/Microsoft.Azure.Cosmos/src/Serializer/CosmosElementSerializer.cs index 1c4cb96a24..0564727b0c 100644 --- a/Microsoft.Azure.Cosmos/src/Serializer/CosmosElementSerializer.cs +++ b/Microsoft.Azure.Cosmos/src/Serializer/CosmosElementSerializer.cs @@ -74,8 +74,11 @@ internal static MemoryStream ToStream( jsonWriter.WriteArrayStart(); foreach (CosmosElement element in cosmosElements) { - count++; - element.WriteTo(jsonWriter); + if (element is not CosmosUndefined) + { + count++; + element.WriteTo(jsonWriter); + } } jsonWriter.WriteArrayEnd(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/CosmosUndefinedQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/CosmosUndefinedQueryTests.cs index 42cb70fe16..3945169330 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/CosmosUndefinedQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/CosmosUndefinedQueryTests.cs @@ -5,6 +5,7 @@ namespace Microsoft.Azure.Cosmos.EmulatorTests.Query using System.Collections.ObjectModel; using System.Linq; using System.Threading.Tasks; + using Azure; using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.CosmosElements.Numbers; using Microsoft.Azure.Cosmos.Json; @@ -50,6 +51,70 @@ private static async Task RunTests(Container container, IReadOnlyList results = RunSimpleQueryAsync( + container, + testCase.Query, + new QueryRequestOptions { MaxItemCount = pageSize }); + + long actualCount = 0; + await foreach (ResponseMessage responseMessage in results) + { + Assert.IsTrue(responseMessage.IsSuccessStatusCode); + + string content = responseMessage.Content.ReadAsString(); + IJsonNavigator navigator = JsonNavigator.Create(System.Text.Encoding.UTF8.GetBytes(content)); + IJsonNavigatorNode rootNode = navigator.GetRootNode(); + Assert.IsTrue(navigator.TryGetObjectProperty(rootNode, "_count", out ObjectProperty countProperty)); + + long count = Number64.ToLong(navigator.GetNumber64Value(countProperty.ValueNode)); + actualCount += count; + + Assert.IsTrue(navigator.TryGetObjectProperty(rootNode, "Documents", out ObjectProperty documentsProperty)); + int documentCount = navigator.GetArrayItemCount(documentsProperty.ValueNode); + Assert.AreEqual(count, documentCount); + + for (int index= 0; index < documentCount; ++index) + { + IJsonNavigatorNode documentNode = navigator.GetArrayItemAt(documentsProperty.ValueNode, index); + int propertyCount = navigator.GetObjectPropertyCount(documentNode); + Assert.AreEqual(0, propertyCount); + } + } + + Assert.AreEqual(testCase.ExpectedResultCount, actualCount); + } + } } private static async Task OrderByTests(Container container) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/QueryTestsBase.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/QueryTestsBase.cs index 269e8448bd..4775716efa 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/QueryTestsBase.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/QueryTestsBase.cs @@ -645,6 +645,7 @@ internal static async Task> QueryWithContinuationTokensAsync( } List resultsFromContinuationToken = new List(); + int resultCount = 0; string continuationToken = null; do { @@ -668,6 +669,7 @@ internal static async Task> QueryWithContinuationTokensAsync( } resultsFromContinuationToken.AddRange(cosmosQueryResponse); + resultCount += cosmosQueryResponse.Count; continuationToken = cosmosQueryResponse.ContinuationToken; break; } @@ -687,6 +689,7 @@ internal static async Task> QueryWithContinuationTokensAsync( } } while (continuationToken != null); + Assert.AreEqual(resultsFromContinuationToken.Count, resultCount); return resultsFromContinuationToken; } @@ -700,6 +703,7 @@ internal static async Task> QueryWithoutContinuationTokensAsync( queryRequestOptions = new QueryRequestOptions(); } + int resultCount = 0; List results = new List(); FeedIterator itemQuery = container.GetItemQueryIterator( queryText: query, @@ -713,6 +717,7 @@ internal static async Task> QueryWithoutContinuationTokensAsync( { FeedResponse page = await itemQuery.ReadNextAsync(); results.AddRange(page); + resultCount += page.Count; if (queryRequestOptions.MaxItemCount.HasValue) { @@ -746,6 +751,7 @@ internal static async Task> QueryWithoutContinuationTokensAsync( { // The query failed and we don't have a save point, so just restart the whole thing. results = new List(); + resultCount = 0; } } } @@ -755,6 +761,7 @@ internal static async Task> QueryWithoutContinuationTokensAsync( itemQuery.Dispose(); } + Assert.AreEqual(results.Count, resultCount); return results; } @@ -907,6 +914,23 @@ internal static async IAsyncEnumerable> RunSimpleQueryWithNewIte } } + internal static async IAsyncEnumerable RunSimpleQueryAsync( + Container container, + string query, + QueryRequestOptions requestOptions = null) + { + using FeedIterator resultSetIterator = container.GetItemQueryStreamIterator( + query, + null, + requestOptions: requestOptions); + + while (resultSetIterator.HasMoreResults) + { + ResponseMessage response = await resultSetIterator.ReadNextAsync(); + yield return response; + } + } + internal async Task> RunSinglePartitionQuery( Container container, string query, From 9734ec5ed0d462aff0b312aee8999ffe3968fb68 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Thu, 24 Nov 2022 07:36:37 +0530 Subject: [PATCH 021/240] removed allr eference (#3581) Co-authored-by: Sourabh Jain --- .../OpenTelemetry/CosmosDbEventSource.cs | 17 +++------- .../DistributedTracingOptions.cs | 34 +------------------ ...riterBaselineTests.BulkOperationsAsync.xml | 2 +- ...neTests.PointOperationsExceptionsAsync.xml | 2 +- .../EndToEndTraceWriterBaselineTests.cs | 10 +++--- .../CosmosClientOptionsUnitTests.cs | 19 ----------- 6 files changed, 13 insertions(+), 71 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs index f0ac635d81..6700697914 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs @@ -31,19 +31,12 @@ public static void RecordDiagnosticsForRequests( Documents.OperationType operationType, OpenTelemetryAttributes response) { - if (config.EnableDiagnosticsTraceForAllRequests) + if (DiagnosticsFilterHelper.IsTracingNeeded( + config: config, + operationType: operationType, + response: response) && CosmosDbEventSource.IsEnabled(EventLevel.Warning)) { - CosmosDbEventSource.Singleton.WriteInfoEvent(response.Diagnostics.ToString()); - } - else - { - if (DiagnosticsFilterHelper.IsTracingNeeded( - config: config, - operationType: operationType, - response: response) && CosmosDbEventSource.IsEnabled(EventLevel.Warning)) - { - CosmosDbEventSource.Singleton.WriteWarningEvent(response.Diagnostics.ToString()); - } + CosmosDbEventSource.Singleton.WriteWarningEvent(response.Diagnostics.ToString()); } } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/DistributedTracingOptions.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/DistributedTracingOptions.cs index 078a554980..652b6b9e3f 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/DistributedTracingOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/DistributedTracingOptions.cs @@ -21,43 +21,11 @@ internal sealed class DistributedTracingOptions /// Default Latency threshold for QUERY operation /// internal static readonly TimeSpan DefaultQueryTimeoutThreshold = TimeSpan.FromMilliseconds(500); - private bool enableDiagnosticsTraceForAllRequests; - private TimeSpan? diagnosticsLatencyThreshold; /// /// Latency Threshold to generate () with Request diagnostics in distributing Tracing.

/// If it is not set then by default it will generate () for query operation which are taking more than 500 ms and non-query operations taking more than 100 ms. ///
- public TimeSpan? DiagnosticsLatencyThreshold - { - get => this.diagnosticsLatencyThreshold; - set - { - if (this.EnableDiagnosticsTraceForAllRequests) - { - throw new ArgumentException("EnableDiagnosticsTraceForAllRequests can not be true along with DiagnosticsLatencyThreshold."); - } - - this.diagnosticsLatencyThreshold = value; - } - } - - /// - /// Set this flag as true if you want to generate () containing request diagnostics string for all the operations. - /// If this flag is true then, it won't honour value to generate diagnostic traces. - /// - public bool EnableDiagnosticsTraceForAllRequests - { - get => this.enableDiagnosticsTraceForAllRequests; - set - { - if (value && this.DiagnosticsLatencyThreshold != null) - { - throw new ArgumentException("EnableDiagnosticsTraceForAllRequests can not be true along with DiagnosticsLatencyThreshold."); - } - - this.enableDiagnosticsTraceForAllRequests = value; - } - } + public TimeSpan? DiagnosticsLatencyThreshold { get; set; } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index a31ad6433d..3eb9468e57 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -1602,7 +1602,7 @@ throttleClient.ClientOptions.EnableDistributedTracing = true; throttleClient.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() { - EnableDiagnosticsTraceForAllRequests = true + DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(0) }; ItemRequestOptions requestOptions = new ItemRequestOptions(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml index 019adb993e..d074dbb221 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml @@ -175,7 +175,7 @@ throttleClient.ClientOptions.EnableDistributedTracing = true; throttleClient.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() { - EnableDiagnosticsTraceForAllRequests = true + DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(0) }; ItemRequestOptions requestOptions = new ItemRequestOptions(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs index aea21c9655..f64d289cfe 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs @@ -57,17 +57,17 @@ public static async Task ClassInitAsync(TestContext context) client.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() { - EnableDiagnosticsTraceForAllRequests = true + DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(0) }; bulkClient.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() { - EnableDiagnosticsTraceForAllRequests = true + DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(0) }; miscCosmosClient.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() { - EnableDiagnosticsTraceForAllRequests = true + DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(0) }; EndToEndTraceWriterBaselineTests.database = await client.CreateDatabaseAsync( @@ -984,7 +984,7 @@ public async Task PointOperationsExceptionsAsync() throttleClient.ClientOptions.EnableDistributedTracing = true; throttleClient.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() { - EnableDiagnosticsTraceForAllRequests = true + DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(0) }; ItemRequestOptions requestOptions = new ItemRequestOptions(); @@ -1271,7 +1271,7 @@ public async Task BulkOperationsAsync() throttleClient.ClientOptions.EnableDistributedTracing = true; throttleClient.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() { - EnableDiagnosticsTraceForAllRequests = true + DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(0) }; ItemRequestOptions requestOptions = new ItemRequestOptions(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs index 6078570d96..e39bb8d0f3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs @@ -186,25 +186,6 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() Assert.AreEqual(portReuseMode, policy.PortReuseMode); Assert.IsTrue(policy.EnableTcpConnectionEndpointRediscovery); CollectionAssert.AreEqual(preferredLocations.ToArray(), policy.PreferredLocations.ToArray()); - - // Verify DiagnosticsLatencyThreshold - cosmosClientBuilder = new CosmosClientBuilder( - accountEndpoint: endpoint, - authKeyOrResourceToken: key); - var exception = Assert.ThrowsException(() => cosmosClientBuilder.WithConnectionModeDirect( - idleTcpConnectionTimeout, - openTcpConnectionTimeout, - maxRequestsPerTcpConnection, - maxTcpConnectionsPerEndpoint, - portReuseMode, - enableTcpConnectionEndpointRediscovery) - .WithApplicationPreferredRegions(preferredLocations) - .WithDistributingTracing(new DistributedTracingOptions - { - DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(100), - EnableDiagnosticsTraceForAllRequests = true - })); - Assert.AreEqual("EnableDiagnosticsTraceForAllRequests can not be true along with DiagnosticsLatencyThreshold.", exception.Message); } [TestMethod] From 6632168410079b849aa5d6f31f9bdd6f1ef52da1 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Kolli Date: Wed, 23 Nov 2022 18:11:55 -0800 Subject: [PATCH 022/240] Trace: Fixes Tracing/diagnostics hour-times to 24Hours (#3577) * Trace: Fixes Tracing/diagnostics hour-times to 24Hours * fixing baseline tests Co-authored-by: Matias Quaranta --- .../Tracing/TraceWriter.TraceJsonWriter.cs | 2 +- .../Tracing/TraceWriter.TraceTextWriter.cs | 22 +- ...raceWriterBaselineTests.ScenariosAsync.xml | 482 +++++++++--------- ...TraceWriterBaselineTests.Serialization.xml | 54 +- .../TraceWriterBaselineTests.TraceData.xml | 54 +- 5 files changed, 308 insertions(+), 306 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs b/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs index a190f2e5e2..4710f00a2e 100644 --- a/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs @@ -47,7 +47,7 @@ public static void WriteTrace( if (isRootTrace) { writer.WriteFieldName("start time"); - writer.WriteStringValue(trace.StartTime.ToString("hh:mm:ss:fff")); + writer.WriteStringValue(trace.StartTime.ToString(TraceWriter.HourTimeFormatString)); } writer.WriteFieldName("duration in milliseconds"); writer.WriteNumber64Value(trace.Duration.TotalMilliseconds); diff --git a/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceTextWriter.cs b/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceTextWriter.cs index a55860655c..f77307b359 100644 --- a/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceTextWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceTextWriter.cs @@ -17,6 +17,8 @@ namespace Microsoft.Azure.Cosmos.Tracing internal static partial class TraceWriter { + internal static readonly string HourTimeFormatString = "HH:mm:ss:fff"; + private static class TraceTextWriter { private const string space = " "; @@ -97,8 +99,8 @@ private static class Headers private static class HeaderLengths { - public static readonly int StartTime = Math.Max(Headers.StartTime.Length, DateTime.MaxValue.ToString("hh:mm:ss:fff", CultureInfo.InvariantCulture).Length); - public static readonly int EndTime = Math.Max(Headers.EndTime.Length, DateTime.MaxValue.ToString("hh:mm:ss:fff", CultureInfo.InvariantCulture).Length); + public static readonly int StartTime = Math.Max(Headers.StartTime.Length, DateTime.MaxValue.ToString(TraceWriter.HourTimeFormatString, CultureInfo.InvariantCulture).Length); + public static readonly int EndTime = Math.Max(Headers.EndTime.Length, DateTime.MaxValue.ToString(TraceWriter.HourTimeFormatString, CultureInfo.InvariantCulture).Length); public static readonly int Endpoint = 80 - (StartTime + EndTime); } @@ -177,7 +179,7 @@ private static void WriteTraceRecursive( writer.Write("Component"); writer.Write(space); - writer.Write(trace.StartTime.ToString("hh:mm:ss:fff", CultureInfo.InvariantCulture)); + writer.Write(trace.StartTime.ToString(TraceWriter.HourTimeFormatString, CultureInfo.InvariantCulture)); writer.Write(space); writer.Write(trace.Duration.TotalMilliseconds.ToString("0.00")); @@ -316,7 +318,7 @@ public void Visit(PointOperationStatisticsTraceDatum pointOperationStatisticsTra StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine($"Activity ID: {pointOperationStatisticsTraceDatum.ActivityId ?? ""}"); stringBuilder.AppendLine($"Status Code: {pointOperationStatisticsTraceDatum.StatusCode}/{pointOperationStatisticsTraceDatum.SubStatusCode}"); - stringBuilder.AppendLine($"Response Time: {pointOperationStatisticsTraceDatum.ResponseTimeUtc.ToString("hh:mm:ss:fff", CultureInfo.InvariantCulture)}"); + stringBuilder.AppendLine($"Response Time: {pointOperationStatisticsTraceDatum.ResponseTimeUtc.ToString(TraceWriter.HourTimeFormatString, CultureInfo.InvariantCulture)}"); stringBuilder.AppendLine($"Request Charge: {pointOperationStatisticsTraceDatum.RequestCharge}"); stringBuilder.AppendLine($"Request URI: {pointOperationStatisticsTraceDatum.RequestUri ?? ""}"); stringBuilder.AppendLine($"Session Tokens: {pointOperationStatisticsTraceDatum.RequestSessionToken ?? ""} / {pointOperationStatisticsTraceDatum.ResponseSessionToken ?? ""}"); @@ -331,10 +333,10 @@ public void Visit(PointOperationStatisticsTraceDatum pointOperationStatisticsTra public void Visit(ClientSideRequestStatisticsTraceDatum clientSideRequestStatisticsTraceDatum) { StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.AppendLine($"Start Time: {clientSideRequestStatisticsTraceDatum.RequestStartTimeUtc.ToString("hh:mm:ss:fff", CultureInfo.InvariantCulture)}"); + stringBuilder.AppendLine($"Start Time: {clientSideRequestStatisticsTraceDatum.RequestStartTimeUtc.ToString(TraceWriter.HourTimeFormatString, CultureInfo.InvariantCulture)}"); if (clientSideRequestStatisticsTraceDatum.RequestEndTimeUtc.HasValue) { - stringBuilder.AppendLine($"End Time: {clientSideRequestStatisticsTraceDatum.RequestEndTimeUtc.Value.ToString("hh:mm:ss:fff", CultureInfo.InvariantCulture)}"); + stringBuilder.AppendLine($"End Time: {clientSideRequestStatisticsTraceDatum.RequestEndTimeUtc.Value.ToString(TraceWriter.HourTimeFormatString, CultureInfo.InvariantCulture)}"); } stringBuilder.AppendLine("Contacted Replicas"); @@ -378,8 +380,8 @@ public void Visit(ClientSideRequestStatisticsTraceDatum clientSideRequestStatist foreach (KeyValuePair stat in clientSideRequestStatisticsTraceDatum.EndpointToAddressResolutionStatistics) { string row = AddressResolutionStatisticsTextTable.Singleton.GetRow( - stat.Value.StartTime.ToString("hh:mm:ss:fff", CultureInfo.InvariantCulture), - stat.Value.EndTime.HasValue ? stat.Value.EndTime.Value.ToString("hh:mm:ss:fff", CultureInfo.InvariantCulture) : "NO END TIME", + stat.Value.StartTime.ToString(TraceWriter.HourTimeFormatString, CultureInfo.InvariantCulture), + stat.Value.EndTime.HasValue ? stat.Value.EndTime.Value.ToString(TraceWriter.HourTimeFormatString, CultureInfo.InvariantCulture) : "NO END TIME", stat.Value.TargetEndpoint); stringBuilder.AppendLine(row); } @@ -391,14 +393,14 @@ public void Visit(ClientSideRequestStatisticsTraceDatum clientSideRequestStatist { if (stat.RequestStartTime.HasValue) { - stringBuilder.AppendLine($"{space}Start Time: {stat.RequestStartTime.Value.ToString("hh:mm:ss:fff", CultureInfo.InvariantCulture)}"); + stringBuilder.AppendLine($"{space}Start Time: {stat.RequestStartTime.Value.ToString(TraceWriter.HourTimeFormatString, CultureInfo.InvariantCulture)}"); } else { stringBuilder.AppendLine("{space}Start Time Not Found"); } - stringBuilder.AppendLine($"{space}End Time: {stat.RequestResponseTime.ToString("hh:mm:ss:fff", CultureInfo.InvariantCulture)}"); + stringBuilder.AppendLine($"{space}End Time: {stat.RequestResponseTime.ToString(TraceWriter.HourTimeFormatString, CultureInfo.InvariantCulture)}"); stringBuilder.AppendLine($"{space}Resource Type: {stat.RequestResourceType}"); stringBuilder.AppendLine($"{space}Operation Type: {stat.RequestOperationType}"); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.ScenariosAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.ScenariosAsync.xml index 92d4a7344c..eecc33b72f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.ScenariosAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.ScenariosAsync.xml @@ -26,108 +26,108 @@ @@ -34,7 +34,7 @@ Status Code: 0/Unknown - Response Time: 12:00:00:000 + Response Time: 00:00:00:000 Request Charge: 0 Request URI: Session Tokens: / @@ -97,7 +97,7 @@ @@ -484,12 +484,12 @@ ┌────────────────┬──────────────┬──────────────────────────────────────────────────┐ │Start Time (utc)│End Time (utc)│Endpoint │ ├────────────────┼──────────────┼──────────────────────────────────────────────────┤ - │ 12:00:00:000│ NO END TIME│ │ - │ 12:00:00:000│ NO END TIME│ │ + │ 00:00:00:000│ NO END TIME│ │ + │ 00:00:00:000│ NO END TIME│ │ └────────────────┴──────────────┴──────────────────────────────────────────────────┘ Store Response Statistics {space}Start Time Not Found - End Time: 12:00:00:000 + End Time: 00:00:00:000 Resource Type: Database Operation Type: Create Store Result @@ -518,7 +518,7 @@ "RegionsContacted": 1 }, "name": "Trace For Baseline Testing", - "start time": "12:00:00:000", + "start time": "00:00:00:000", "duration in milliseconds": 0, "data": { "Client Side Request Stats Default": { @@ -662,11 +662,11 @@ Date: Sat, 26 Nov 2022 07:14:25 +0530 Subject: [PATCH 023/240] AI Integration: Adds cosmetic fixes (#3576) * wip * status code int and internal and client kind activity * remove unused imports * update baselines * fix test * fixed baseline tests * fix tests * update base tetss Co-authored-by: Sourabh Jain --- .../CosmosExceptions/CosmosException.cs | 4 +- .../OpenTelemetryAttributeKeys.cs | 2 +- .../OpenTelemetry/OpenTelemetryAttributes.cs | 5 +- .../OpenTelemetryCoreRecorder.cs | 18 +- .../OpenTelemetryRecorderFactory.cs | 3 +- .../OpenTelemetry/OpenTelemetryResponse.cs | 6 +- .../OpenTelemetry/OpenTelemetryResponse{T}.cs | 4 +- ...iterBaselineTests.BatchOperationsAsync.xml | 26 +- ...riterBaselineTests.BulkOperationsAsync.xml | 646 +++++----- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 830 ++++++------- ...eWriterBaselineTests.MiscellanousAsync.xml | 48 +- ...neTests.PointOperationsExceptionsAsync.xml | 240 ++-- ...EndTraceWriterBaselineTests.QueryAsync.xml | 1070 ++++++++--------- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 600 ++++----- ...TraceWriterBaselineTests.ReadManyAsync.xml | 304 ++--- ...selineTests.StreamPointOperationsAsync.xml | 72 +- ...aselineTests.TypedPointOperationsAsync.xml | 88 +- .../Tracing/OpenTelemetryListener.cs | 17 +- 18 files changed, 1984 insertions(+), 1999 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosException.cs b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosException.cs index f6544e3545..12db379f0c 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosException.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosException.cs @@ -289,8 +289,8 @@ private string ToStringHelper( /// internal static void RecordOtelAttributes(CosmosException exception, DiagnosticScope scope) { - scope.AddAttribute(OpenTelemetryAttributeKeys.StatusCode, exception.StatusCode); - scope.AddAttribute(OpenTelemetryAttributeKeys.SubStatusCode, exception.SubStatusCode); + scope.AddAttribute(OpenTelemetryAttributeKeys.StatusCode, (int)exception.StatusCode); + scope.AddAttribute(OpenTelemetryAttributeKeys.SubStatusCode, (int)exception.SubStatusCode); scope.AddAttribute(OpenTelemetryAttributeKeys.RequestCharge, exception.RequestCharge); scope.AddAttribute(OpenTelemetryAttributeKeys.Region, ClientTelemetryHelper.GetContactedRegions(exception.Diagnostics?.GetContactedRegions())); diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs index 033a8744b6..801824b791 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs @@ -19,7 +19,7 @@ internal sealed class OpenTelemetryAttributeKeys // Cosmos Db Specific public const string ClientId = "db.cosmosdb.client_id"; - public const string MachineId = "db.cosmosdb.hashed_machine_id"; + public const string MachineId = "db.cosmosdb.machine_id"; public const string UserAgent = "db.cosmosdb.user_agent"; public const string ConnectionMode = "db.cosmosdb.connection_mode"; public const string OperationType = "db.cosmosdb.operation_type"; diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs index 3d9ee4afbb..7e9c798f9d 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs @@ -5,12 +5,9 @@ namespace Microsoft.Azure.Cosmos.Telemetry { using System.Net; - using Microsoft.Azure.Documents; internal class OpenTelemetryAttributes { - internal const string NotAvailable = "information not available"; - /// /// For testing purpose only, to make initialization of this class easy /// @@ -20,7 +17,7 @@ internal OpenTelemetryAttributes() internal OpenTelemetryAttributes(RequestMessage requestMessage) { - this.RequestContentLength = requestMessage?.Headers?.ContentLength ?? OpenTelemetryAttributes.NotAvailable; + this.RequestContentLength = requestMessage?.Headers?.ContentLength; } /// diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs index b8be214392..e0b47e744f 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs @@ -6,10 +6,7 @@ namespace Microsoft.Azure.Cosmos.Telemetry { using System; using System.Collections.Generic; - using Diagnostics; - using global::Azure; using global::Azure.Core.Pipeline; - using HdrHistogram; internal struct OpenTelemetryCoreRecorder : IDisposable { @@ -92,8 +89,8 @@ public void Record( this.scope.AddAttribute(OpenTelemetryAttributeKeys.NetPeerName, clientContext.Client?.Endpoint?.Host); // Client Information - this.scope.AddAttribute(OpenTelemetryAttributeKeys.ClientId, clientContext?.Client?.Id ?? OpenTelemetryAttributes.NotAvailable); - this.scope.AddAttribute(OpenTelemetryAttributeKeys.UserAgent, clientContext.UserAgent ?? OpenTelemetryAttributes.NotAvailable); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.ClientId, clientContext?.Client?.Id); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.UserAgent, clientContext.UserAgent); this.scope.AddAttribute(OpenTelemetryAttributeKeys.ConnectionMode, clientContext.ClientOptions.ConnectionMode); } } @@ -108,21 +105,16 @@ public void Record(OpenTelemetryAttributes response) { this.scope.AddAttribute(OpenTelemetryAttributeKeys.RequestContentLength, response.RequestContentLength); this.scope.AddAttribute(OpenTelemetryAttributeKeys.ResponseContentLength, response.ResponseContentLength); - this.scope.AddAttribute(OpenTelemetryAttributeKeys.StatusCode, response.StatusCode); - this.scope.AddAttribute(OpenTelemetryAttributeKeys.SubStatusCode, response.SubStatusCode); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.StatusCode, (int)response.StatusCode); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.SubStatusCode, (int)response.SubStatusCode); this.scope.AddAttribute(OpenTelemetryAttributeKeys.RequestCharge, response.RequestCharge); this.scope.AddAttribute(OpenTelemetryAttributeKeys.ItemCount, response.ItemCount); if (response.Diagnostics != null) { - this.scope.AddAttribute(OpenTelemetryAttributeKeys.Region, ClientTelemetryHelper.GetContactedRegions(response.Diagnostics.GetContactedRegions()) ?? OpenTelemetryAttributes.NotAvailable); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.Region, ClientTelemetryHelper.GetContactedRegions(response.Diagnostics.GetContactedRegions())); CosmosDbEventSource.RecordDiagnosticsForRequests(this.config, this.operationType, response); } - else - { - this.scope.AddAttribute(OpenTelemetryAttributeKeys.Region, OpenTelemetryAttributes.NotAvailable); - this.scope.AddAttribute(OpenTelemetryAttributeKeys.RequestDiagnostics, OpenTelemetryAttributes.NotAvailable); - } } } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs index c66339e51e..88f149d608 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs @@ -24,7 +24,8 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, isActivityEnabled: true); DiagnosticScope scope = OpenTelemetryRecorderFactory .ScopeFactory - .CreateScope($"{OpenTelemetryAttributeKeys.OperationPrefix}.{operationName}"); + .CreateScope(name: $"{OpenTelemetryAttributeKeys.OperationPrefix}.{operationName}", + kind: clientContext.ClientOptions.ConnectionMode == ConnectionMode.Gateway ? DiagnosticScope.ActivityKind.Internal : DiagnosticScope.ActivityKind.Client); if (scope.IsEnabled) { diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs index 7bb1fdc12e..98c1bfab8d 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs @@ -46,9 +46,9 @@ private OpenTelemetryResponse( { this.StatusCode = statusCode; this.RequestCharge = requestCharge; - this.ResponseContentLength = responseContentLength ?? OpenTelemetryAttributes.NotAvailable; + this.ResponseContentLength = responseContentLength; this.Diagnostics = diagnostics; - this.ItemCount = itemCount ?? OpenTelemetryAttributes.NotAvailable; + this.ItemCount = itemCount; this.SubStatusCode = subStatusCode; } @@ -60,7 +60,7 @@ private static string GetPayloadSize(ResponseMessage response) { return response.Content.Length.ToString(); } - return response?.Headers?.ContentLength ?? OpenTelemetryAttributes.NotAvailable; + return response?.Headers?.ContentLength; } } } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs index 3d7359da75..71ca5cfba2 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs @@ -45,9 +45,9 @@ private OpenTelemetryResponse( { this.StatusCode = statusCode; this.RequestCharge = requestCharge; - this.ResponseContentLength = responseContentLength ?? OpenTelemetryAttributes.NotAvailable; + this.ResponseContentLength = responseContentLength; this.Diagnostics = diagnostics; - this.ItemCount = itemCount ?? OpenTelemetryAttributes.NotAvailable; + this.ItemCount = itemCount; this.SubStatusCode = subStatusCode; } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index 15d67f3483..ffce1a6bf4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -34,34 +34,34 @@ - Cosmos.ExecuteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.ExecuteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index 3eb9468e57..e999759bd3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -31,36 +31,36 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -189,36 +189,36 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -347,36 +347,36 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -505,36 +505,36 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -663,36 +663,36 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -821,36 +821,36 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -979,36 +979,36 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1137,36 +1137,36 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1295,36 +1295,36 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1453,36 +1453,36 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1629,176 +1629,176 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml index 1a1f0b40ee..2d747e9e45 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml @@ -25,220 +25,220 @@ - Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -992,139 +992,139 @@ - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1610,135 +1610,135 @@ - Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2208,139 +2208,139 @@ - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2821,65 +2821,65 @@ - Cosmos.Change Feed Estimator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.Change Feed Estimator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml index bffa1a103a..5b29ba3737 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml @@ -16,35 +16,35 @@ - Cosmos.DeleteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateDatabaseAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.DeleteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateDatabaseAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -128,33 +128,33 @@ - Cosmos.DeleteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateDatabaseAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.DeleteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateDatabaseAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml index d074dbb221..7dea567de8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml @@ -33,42 +33,42 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -201,61 +201,61 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -469,30 +469,30 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -694,30 +694,30 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -951,30 +951,30 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1233,42 +1233,42 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml index 5368aad0e7..937daa7a49 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml @@ -19,151 +19,151 @@ - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -605,155 +605,155 @@ - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1212,151 +1212,151 @@ - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1799,155 +1799,155 @@ - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2409,175 +2409,175 @@ - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3082,152 +3082,152 @@ - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3678,156 +3678,156 @@ - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml index 8860741fc2..ee1302e06e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml @@ -19,118 +19,118 @@ - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -567,131 +567,131 @@ - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1136,118 +1136,118 @@ - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1685,131 +1685,131 @@ - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml index 5cc059c7a7..9558168b76 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml @@ -12,133 +12,133 @@ - Cosmos.ReadManyItemsStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.ReadManyItemsStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -567,136 +567,136 @@ - Cosmos.ReadManyItemsAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.ReadManyItemsAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml index 665f74396c..a1b5ceb966 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml @@ -18,21 +18,21 @@ - Cosmos.CreateItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.CreateItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -107,21 +107,21 @@ - Cosmos.ReadItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.ReadItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -204,21 +204,21 @@ - Cosmos.ReplaceItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.ReplaceItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -296,21 +296,21 @@ - Cosmos.DeleteItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.DeleteItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml index 8042b6e21d..dfe617f632 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml @@ -16,34 +16,34 @@ - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -127,31 +127,31 @@ - Cosmos.ReadItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.ReadItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -229,32 +229,32 @@ - Cosmos.ReplaceItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.ReplaceItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -330,31 +330,31 @@ - Cosmos.DeleteItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.hashed_machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Cosmos.DeleteItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/OpenTelemetryListener.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/OpenTelemetryListener.cs index fd50cd7365..05763f0bdb 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/OpenTelemetryListener.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/OpenTelemetryListener.cs @@ -160,7 +160,7 @@ private static void AssertData(string name, IEnumerable exceptionsForDbNameAttribute = new List - { - "Cosmos.DeleteAsync", - "Cosmos.ExecuteAsync", "Cosmos.DeleteStreamAsync" }; if ((tag.Key == OpenTelemetryAttributeKeys.ContainerName && !exceptionsForContainerAttribute.Contains(name)) || - (tag.Key == OpenTelemetryAttributeKeys.DbName && !exceptionsForDbNameAttribute.Contains(name))) + (tag.Key == OpenTelemetryAttributeKeys.DbName)) { Assert.IsNotNull(tag.Value, $"{tag.Key} is 'null' for {name} operation"); - Assert.AreNotEqual(OpenTelemetryAttributes.NotAvailable, tag.Value, $"{tag.Key} is {OpenTelemetryAttributes.NotAvailable} for {name} operation"); + } + else if (tag.Key == OpenTelemetryAttributeKeys.ContainerName && exceptionsForContainerAttribute.Contains(name)) + { + Assert.IsNull(tag.Value, $"{tag.Key} is '{tag.Value}' for {name} operation"); } } From 2f047e1cf3c0d94d9fb13f66739952acf7467e9d Mon Sep 17 00:00:00 2001 From: Ezra Haleva <115735172+ezrahaleva-msft@users.noreply.github.com> Date: Mon, 28 Nov 2022 09:45:40 -0800 Subject: [PATCH 024/240] Query: Adds ALL Scalar Expression (#3509) * Add SqlAllScalarExpression to v3 DOM * updated generated parser files * Parsing for ALL * Added tests for ALL and baselines * Added more tests * added new test, cleanup * cleaning & fix typos * fixed typo * Added new baseline test file names to csproj file * renamed AggregateAll to AggregateSubquery to accomodate FIRST and LAST later * Added keywords for 'left' and 'right' and respective function calls * fixed bug from last commit * cleaning * replace tabs with spaces * cleaning --- .../src/Query/Core/Parser/CstToAstVisitor.cs | 59 +- .../src/Query/Core/Parser/IsqlListener.cs | 116 +- .../src/Query/Core/Parser/IsqlVisitor.cs | 61 +- .../src/Query/Core/Parser/sql.g4 | 235 +-- .../src/Query/Core/Parser/sqlBaseListener.cs | 122 +- .../src/Query/Core/Parser/sqlBaseVisitor.cs | 73 +- .../src/Query/Core/Parser/sqlLexer.cs | 919 ++++----- .../src/Query/Core/Parser/sqlParser.cs | 1640 ++++++++++------- .../CosmosQueryExecutionContextFactory.cs | 6 + .../src/SqlObjects/SqlAllScalarExpression.cs | 40 + .../Visitors/SqlObjectEqualityVisitor.cs | 15 + .../SqlObjects/Visitors/SqlObjectHasher.cs | 8 + .../Visitors/SqlObjectObfuscator.cs | 5 + .../Visitors/SqlObjectTextSerializer.cs | 8 + .../SqlObjects/Visitors/SqlObjectVisitor.cs | 1 + .../SqlObjectVisitor{TArg,TOutput}.cs | 1 + .../Visitors/SqlObjectVisitor{TResult}.cs | 1 + .../Visitors/SqlScalarExpressionVisitor.cs | 1 + ...qlScalarExpressionVisitor{TArg,TOutput}.cs | 1 + .../SqlScalarExpressionVisitor{TResult}.cs | 1 + ...gateSubquerySqlParserBaselineTests.All.xml | 92 + ...arExpressionSqlParserBaselineTests.All.xml | 47 + .../Microsoft.Azure.Cosmos.Tests.csproj | 8 +- .../AggregateProjectionDector.cs | 6 + .../AggregateProjectionTransformer.cs | 6 + .../ScalarExpressionEvaluator.cs | 48 + .../Query/OfflineEngine/SqlInterpreter.cs | 5 + ...AggregateSubquerySqlParserBaselineTests.cs | 68 + .../ScalarExpressionSqlParserBaselineTests.cs | 32 + 29 files changed, 2218 insertions(+), 1407 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/src/SqlObjects/SqlAllScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/AggregateSubquerySqlParserBaselineTests.All.xml create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ScalarExpressionSqlParserBaselineTests.All.xml create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/AggregateSubquerySqlParserBaselineTests.cs diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/CstToAstVisitor.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/CstToAstVisitor.cs index 6b1de2883e..448b8f4ca6 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/CstToAstVisitor.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/CstToAstVisitor.cs @@ -183,9 +183,9 @@ public override SqlObject VisitSelect_item([NotNull] sqlParser.Select_itemContex SqlScalarExpression sqlScalarExpression = (SqlScalarExpression)this.Visit(context.scalar_expression()); SqlIdentifier alias; - if (context.IDENTIFIER() != null) + if (context.identifier() != null) { - alias = SqlIdentifier.Create(context.IDENTIFIER().GetText()); + alias = SqlIdentifier.Create(context.identifier().GetText()); } else { @@ -233,9 +233,9 @@ public override SqlObject VisitAliasedCollectionExpression([NotNull] sqlParser.A SqlCollection sqlCollection = (SqlCollection)this.Visit(context.collection()); SqlIdentifier alias; - if (context.IDENTIFIER() != null) + if (context.identifier() != null) { - alias = SqlIdentifier.Create(context.IDENTIFIER().GetText()); + alias = SqlIdentifier.Create(context.identifier().GetText()); } else { @@ -250,7 +250,7 @@ public override SqlObject VisitArrayIteratorCollectionExpression([NotNull] sqlPa Contract.Requires(context != null); SqlCollection sqlCollection = (SqlCollection)this.Visit(context.collection()); - SqlIdentifier identifier = SqlIdentifier.Create(context.IDENTIFIER().GetText()); + SqlIdentifier identifier = SqlIdentifier.Create(context.identifier().GetText()); return SqlArrayIteratorCollectionExpression.Create(identifier, sqlCollection); } @@ -269,7 +269,7 @@ public override SqlObject VisitInputPathCollection([NotNull] sqlParser.InputPath { Contract.Requires(context != null); - SqlIdentifier identifier = SqlIdentifier.Create(context.IDENTIFIER().GetText()); + SqlIdentifier identifier = SqlIdentifier.Create(context.identifier().GetText()); SqlPathExpression pathExpression; if (context.path_expression() != null) { @@ -302,7 +302,7 @@ public override SqlObject VisitIdentifierPathExpression([NotNull] sqlParser.Iden Contract.Requires(context != null); SqlPathExpression pathExpression = (SqlPathExpression)this.Visit(context.path_expression()); - SqlIdentifier identifier = SqlIdentifier.Create(context.IDENTIFIER().GetText()); + SqlIdentifier identifier = SqlIdentifier.Create(context.identifier().GetText()); return SqlIdentifierPathExpression.Create(parentPath: pathExpression, value: identifier); } @@ -458,6 +458,15 @@ public override SqlObject VisitLimit_count([NotNull] sqlParser.Limit_countContex #endregion #region ScalarExpressions + public override SqlObject VisitAllScalarExpression([NotNull] sqlParser.AllScalarExpressionContext context) + { + Contract.Requires(context != null); + // K_ALL '(' sql_query ')' + Contract.Requires(context.ChildCount == 4); + + SqlQuery subquery = (SqlQuery)this.Visit(context.children[2]); + return SqlAllScalarExpression.Create(subquery); + } public override SqlObject VisitArrayCreateScalarExpression([NotNull] sqlParser.ArrayCreateScalarExpressionContext context) { Contract.Requires(context != null); @@ -562,10 +571,34 @@ public override SqlObject VisitExistsScalarExpression([NotNull] sqlParser.Exists public override SqlObject VisitFunctionCallScalarExpression([NotNull] sqlParser.FunctionCallScalarExpressionContext context) { Contract.Requires(context != null); - // (K_UDF '.')? IDENTIFIER '(' scalar_expression_list? ')' + // function_call_scalar_expression + + return this.Visit(context.function_call_scalar_expression()); + } + + public override SqlObject VisitFunction_call_scalar_expression([NotNull] sqlParser.Function_call_scalar_expressionContext context) + { + Contract.Requires(context != null); + // : (K_UDF '.')? identifier '(' scalar_expression_list ? ')' + // | K_LEFT '(' scalar_expression_list ? ')' + // | K_RIGHT '(' scalar_expression_list ? ')' bool udf = context.K_UDF() != null; - SqlIdentifier identifier = SqlIdentifier.Create(context.IDENTIFIER().GetText()); + SqlIdentifier identifier; + + if (context.identifier() != null) + { + identifier = SqlIdentifier.Create(context.identifier().GetText()); + } + else if (context.K_LEFT() != null) + { + identifier = SqlIdentifier.Create(context.K_LEFT().GetText()); + } + else + { + identifier = SqlIdentifier.Create(context.K_RIGHT().GetText()); + } + List arguments = new List(); if (context.scalar_expression_list() != null) { @@ -719,20 +752,20 @@ public override SqlObject VisitParameterRefScalarExpression([NotNull] sqlParser. public override SqlObject VisitPropertyRefScalarExpressionBase([NotNull] sqlParser.PropertyRefScalarExpressionBaseContext context) { Contract.Requires(context != null); - // IDENTIFIER + // identifier return SqlPropertyRefScalarExpression.Create( member: null, - SqlIdentifier.Create(context.IDENTIFIER().GetText())); + SqlIdentifier.Create(context.identifier().GetText())); } public override SqlObject VisitPropertyRefScalarExpressionRecursive([NotNull] sqlParser.PropertyRefScalarExpressionRecursiveContext context) { Contract.Requires(context != null); - // primary_expression '.' IDENTIFIER + // primary_expression '.' identifier SqlScalarExpression memberExpression = (SqlScalarExpression)this.Visit(context.primary_expression()); - SqlIdentifier indentifier = SqlIdentifier.Create(context.IDENTIFIER().GetText()); + SqlIdentifier indentifier = SqlIdentifier.Create(context.identifier().GetText()); return SqlPropertyRefScalarExpression.Create(memberExpression, indentifier); } diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/IsqlListener.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/IsqlListener.cs index ed0eb42e76..24a4a0694a 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/IsqlListener.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/IsqlListener.cs @@ -526,101 +526,125 @@ internal interface IsqlListener : IParseTreeListener { /// The parse tree. void ExitUnary_operator([NotNull] sqlParser.Unary_operatorContext context); /// - /// Enter a parse tree produced by the SubqueryScalarExpression + /// Enter a parse tree produced by the AllScalarExpression /// labeled alternative in . /// /// The parse tree. - void EnterSubqueryScalarExpression([NotNull] sqlParser.SubqueryScalarExpressionContext context); + void EnterAllScalarExpression([NotNull] sqlParser.AllScalarExpressionContext context); /// - /// Exit a parse tree produced by the SubqueryScalarExpression + /// Exit a parse tree produced by the AllScalarExpression /// labeled alternative in . /// /// The parse tree. - void ExitSubqueryScalarExpression([NotNull] sqlParser.SubqueryScalarExpressionContext context); + void ExitAllScalarExpression([NotNull] sqlParser.AllScalarExpressionContext context); /// - /// Enter a parse tree produced by the PropertyRefScalarExpressionBase + /// Enter a parse tree produced by the LiteralScalarExpression /// labeled alternative in . /// /// The parse tree. - void EnterPropertyRefScalarExpressionBase([NotNull] sqlParser.PropertyRefScalarExpressionBaseContext context); + void EnterLiteralScalarExpression([NotNull] sqlParser.LiteralScalarExpressionContext context); /// - /// Exit a parse tree produced by the PropertyRefScalarExpressionBase + /// Exit a parse tree produced by the LiteralScalarExpression /// labeled alternative in . /// /// The parse tree. - void ExitPropertyRefScalarExpressionBase([NotNull] sqlParser.PropertyRefScalarExpressionBaseContext context); + void ExitLiteralScalarExpression([NotNull] sqlParser.LiteralScalarExpressionContext context); /// - /// Enter a parse tree produced by the FunctionCallScalarExpression + /// Enter a parse tree produced by the ObjectCreateScalarExpression /// labeled alternative in . /// /// The parse tree. - void EnterFunctionCallScalarExpression([NotNull] sqlParser.FunctionCallScalarExpressionContext context); + void EnterObjectCreateScalarExpression([NotNull] sqlParser.ObjectCreateScalarExpressionContext context); /// - /// Exit a parse tree produced by the FunctionCallScalarExpression + /// Exit a parse tree produced by the ObjectCreateScalarExpression /// labeled alternative in . /// /// The parse tree. - void ExitFunctionCallScalarExpression([NotNull] sqlParser.FunctionCallScalarExpressionContext context); + void ExitObjectCreateScalarExpression([NotNull] sqlParser.ObjectCreateScalarExpressionContext context); /// - /// Enter a parse tree produced by the LiteralScalarExpression + /// Enter a parse tree produced by the ArrayCreateScalarExpression /// labeled alternative in . /// /// The parse tree. - void EnterLiteralScalarExpression([NotNull] sqlParser.LiteralScalarExpressionContext context); + void EnterArrayCreateScalarExpression([NotNull] sqlParser.ArrayCreateScalarExpressionContext context); /// - /// Exit a parse tree produced by the LiteralScalarExpression + /// Exit a parse tree produced by the ArrayCreateScalarExpression /// labeled alternative in . /// /// The parse tree. - void ExitLiteralScalarExpression([NotNull] sqlParser.LiteralScalarExpressionContext context); + void ExitArrayCreateScalarExpression([NotNull] sqlParser.ArrayCreateScalarExpressionContext context); /// - /// Enter a parse tree produced by the ObjectCreateScalarExpression + /// Enter a parse tree produced by the MemberIndexerScalarExpression /// labeled alternative in . /// /// The parse tree. - void EnterObjectCreateScalarExpression([NotNull] sqlParser.ObjectCreateScalarExpressionContext context); + void EnterMemberIndexerScalarExpression([NotNull] sqlParser.MemberIndexerScalarExpressionContext context); /// - /// Exit a parse tree produced by the ObjectCreateScalarExpression + /// Exit a parse tree produced by the MemberIndexerScalarExpression /// labeled alternative in . /// /// The parse tree. - void ExitObjectCreateScalarExpression([NotNull] sqlParser.ObjectCreateScalarExpressionContext context); + void ExitMemberIndexerScalarExpression([NotNull] sqlParser.MemberIndexerScalarExpressionContext context); /// - /// Enter a parse tree produced by the ParenthesizedScalarExperession + /// Enter a parse tree produced by the SubqueryScalarExpression /// labeled alternative in . /// /// The parse tree. - void EnterParenthesizedScalarExperession([NotNull] sqlParser.ParenthesizedScalarExperessionContext context); + void EnterSubqueryScalarExpression([NotNull] sqlParser.SubqueryScalarExpressionContext context); /// - /// Exit a parse tree produced by the ParenthesizedScalarExperession + /// Exit a parse tree produced by the SubqueryScalarExpression /// labeled alternative in . /// /// The parse tree. - void ExitParenthesizedScalarExperession([NotNull] sqlParser.ParenthesizedScalarExperessionContext context); + void ExitSubqueryScalarExpression([NotNull] sqlParser.SubqueryScalarExpressionContext context); /// - /// Enter a parse tree produced by the ParameterRefScalarExpression + /// Enter a parse tree produced by the PropertyRefScalarExpressionBase /// labeled alternative in . /// /// The parse tree. - void EnterParameterRefScalarExpression([NotNull] sqlParser.ParameterRefScalarExpressionContext context); + void EnterPropertyRefScalarExpressionBase([NotNull] sqlParser.PropertyRefScalarExpressionBaseContext context); /// - /// Exit a parse tree produced by the ParameterRefScalarExpression + /// Exit a parse tree produced by the PropertyRefScalarExpressionBase /// labeled alternative in . /// /// The parse tree. - void ExitParameterRefScalarExpression([NotNull] sqlParser.ParameterRefScalarExpressionContext context); + void ExitPropertyRefScalarExpressionBase([NotNull] sqlParser.PropertyRefScalarExpressionBaseContext context); /// - /// Enter a parse tree produced by the ArrayCreateScalarExpression + /// Enter a parse tree produced by the FunctionCallScalarExpression /// labeled alternative in . /// /// The parse tree. - void EnterArrayCreateScalarExpression([NotNull] sqlParser.ArrayCreateScalarExpressionContext context); + void EnterFunctionCallScalarExpression([NotNull] sqlParser.FunctionCallScalarExpressionContext context); /// - /// Exit a parse tree produced by the ArrayCreateScalarExpression + /// Exit a parse tree produced by the FunctionCallScalarExpression /// labeled alternative in . /// /// The parse tree. - void ExitArrayCreateScalarExpression([NotNull] sqlParser.ArrayCreateScalarExpressionContext context); + void ExitFunctionCallScalarExpression([NotNull] sqlParser.FunctionCallScalarExpressionContext context); + /// + /// Enter a parse tree produced by the ParenthesizedScalarExperession + /// labeled alternative in . + /// + /// The parse tree. + void EnterParenthesizedScalarExperession([NotNull] sqlParser.ParenthesizedScalarExperessionContext context); + /// + /// Exit a parse tree produced by the ParenthesizedScalarExperession + /// labeled alternative in . + /// + /// The parse tree. + void ExitParenthesizedScalarExperession([NotNull] sqlParser.ParenthesizedScalarExperessionContext context); + /// + /// Enter a parse tree produced by the ParameterRefScalarExpression + /// labeled alternative in . + /// + /// The parse tree. + void EnterParameterRefScalarExpression([NotNull] sqlParser.ParameterRefScalarExpressionContext context); + /// + /// Exit a parse tree produced by the ParameterRefScalarExpression + /// labeled alternative in . + /// + /// The parse tree. + void ExitParameterRefScalarExpression([NotNull] sqlParser.ParameterRefScalarExpressionContext context); /// /// Enter a parse tree produced by the ExistsScalarExpression /// labeled alternative in . @@ -646,29 +670,27 @@ internal interface IsqlListener : IParseTreeListener { /// The parse tree. void ExitArrayScalarExpression([NotNull] sqlParser.ArrayScalarExpressionContext context); /// - /// Enter a parse tree produced by the MemberIndexerScalarExpression + /// Enter a parse tree produced by the PropertyRefScalarExpressionRecursive /// labeled alternative in . /// /// The parse tree. - void EnterMemberIndexerScalarExpression([NotNull] sqlParser.MemberIndexerScalarExpressionContext context); + void EnterPropertyRefScalarExpressionRecursive([NotNull] sqlParser.PropertyRefScalarExpressionRecursiveContext context); /// - /// Exit a parse tree produced by the MemberIndexerScalarExpression + /// Exit a parse tree produced by the PropertyRefScalarExpressionRecursive /// labeled alternative in . /// /// The parse tree. - void ExitMemberIndexerScalarExpression([NotNull] sqlParser.MemberIndexerScalarExpressionContext context); + void ExitPropertyRefScalarExpressionRecursive([NotNull] sqlParser.PropertyRefScalarExpressionRecursiveContext context); /// - /// Enter a parse tree produced by the PropertyRefScalarExpressionRecursive - /// labeled alternative in . + /// Enter a parse tree produced by . /// /// The parse tree. - void EnterPropertyRefScalarExpressionRecursive([NotNull] sqlParser.PropertyRefScalarExpressionRecursiveContext context); + void EnterFunction_call_scalar_expression([NotNull] sqlParser.Function_call_scalar_expressionContext context); /// - /// Exit a parse tree produced by the PropertyRefScalarExpressionRecursive - /// labeled alternative in . + /// Exit a parse tree produced by . /// /// The parse tree. - void ExitPropertyRefScalarExpressionRecursive([NotNull] sqlParser.PropertyRefScalarExpressionRecursiveContext context); + void ExitFunction_call_scalar_expression([NotNull] sqlParser.Function_call_scalar_expressionContext context); /// /// Enter a parse tree produced by . /// @@ -700,6 +722,16 @@ internal interface IsqlListener : IParseTreeListener { /// The parse tree. void ExitObject_property([NotNull] sqlParser.Object_propertyContext context); /// + /// Enter a parse tree produced by . + /// + /// The parse tree. + void EnterIdentifier([NotNull] sqlParser.IdentifierContext context); + /// + /// Exit a parse tree produced by . + /// + /// The parse tree. + void ExitIdentifier([NotNull] sqlParser.IdentifierContext context); + /// /// Enter a parse tree produced by . /// /// The parse tree. diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/IsqlVisitor.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/IsqlVisitor.cs index 2e96892783..e22a9d4218 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/IsqlVisitor.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/IsqlVisitor.cs @@ -326,61 +326,75 @@ internal interface IsqlVisitor : IParseTreeVisitor { /// The visitor result. Result VisitUnary_operator([NotNull] sqlParser.Unary_operatorContext context); /// - /// Visit a parse tree produced by the SubqueryScalarExpression + /// Visit a parse tree produced by the AllScalarExpression /// labeled alternative in . /// /// The parse tree. /// The visitor result. - Result VisitSubqueryScalarExpression([NotNull] sqlParser.SubqueryScalarExpressionContext context); + Result VisitAllScalarExpression([NotNull] sqlParser.AllScalarExpressionContext context); /// - /// Visit a parse tree produced by the PropertyRefScalarExpressionBase + /// Visit a parse tree produced by the LiteralScalarExpression /// labeled alternative in . /// /// The parse tree. /// The visitor result. - Result VisitPropertyRefScalarExpressionBase([NotNull] sqlParser.PropertyRefScalarExpressionBaseContext context); + Result VisitLiteralScalarExpression([NotNull] sqlParser.LiteralScalarExpressionContext context); /// - /// Visit a parse tree produced by the FunctionCallScalarExpression + /// Visit a parse tree produced by the ObjectCreateScalarExpression /// labeled alternative in . /// /// The parse tree. /// The visitor result. - Result VisitFunctionCallScalarExpression([NotNull] sqlParser.FunctionCallScalarExpressionContext context); + Result VisitObjectCreateScalarExpression([NotNull] sqlParser.ObjectCreateScalarExpressionContext context); /// - /// Visit a parse tree produced by the LiteralScalarExpression + /// Visit a parse tree produced by the ArrayCreateScalarExpression /// labeled alternative in . /// /// The parse tree. /// The visitor result. - Result VisitLiteralScalarExpression([NotNull] sqlParser.LiteralScalarExpressionContext context); + Result VisitArrayCreateScalarExpression([NotNull] sqlParser.ArrayCreateScalarExpressionContext context); /// - /// Visit a parse tree produced by the ObjectCreateScalarExpression + /// Visit a parse tree produced by the MemberIndexerScalarExpression /// labeled alternative in . /// /// The parse tree. /// The visitor result. - Result VisitObjectCreateScalarExpression([NotNull] sqlParser.ObjectCreateScalarExpressionContext context); + Result VisitMemberIndexerScalarExpression([NotNull] sqlParser.MemberIndexerScalarExpressionContext context); /// - /// Visit a parse tree produced by the ParenthesizedScalarExperession + /// Visit a parse tree produced by the SubqueryScalarExpression /// labeled alternative in . /// /// The parse tree. /// The visitor result. - Result VisitParenthesizedScalarExperession([NotNull] sqlParser.ParenthesizedScalarExperessionContext context); + Result VisitSubqueryScalarExpression([NotNull] sqlParser.SubqueryScalarExpressionContext context); /// - /// Visit a parse tree produced by the ParameterRefScalarExpression + /// Visit a parse tree produced by the PropertyRefScalarExpressionBase /// labeled alternative in . /// /// The parse tree. /// The visitor result. - Result VisitParameterRefScalarExpression([NotNull] sqlParser.ParameterRefScalarExpressionContext context); + Result VisitPropertyRefScalarExpressionBase([NotNull] sqlParser.PropertyRefScalarExpressionBaseContext context); /// - /// Visit a parse tree produced by the ArrayCreateScalarExpression + /// Visit a parse tree produced by the FunctionCallScalarExpression /// labeled alternative in . /// /// The parse tree. /// The visitor result. - Result VisitArrayCreateScalarExpression([NotNull] sqlParser.ArrayCreateScalarExpressionContext context); + Result VisitFunctionCallScalarExpression([NotNull] sqlParser.FunctionCallScalarExpressionContext context); + /// + /// Visit a parse tree produced by the ParenthesizedScalarExperession + /// labeled alternative in . + /// + /// The parse tree. + /// The visitor result. + Result VisitParenthesizedScalarExperession([NotNull] sqlParser.ParenthesizedScalarExperessionContext context); + /// + /// Visit a parse tree produced by the ParameterRefScalarExpression + /// labeled alternative in . + /// + /// The parse tree. + /// The visitor result. + Result VisitParameterRefScalarExpression([NotNull] sqlParser.ParameterRefScalarExpressionContext context); /// /// Visit a parse tree produced by the ExistsScalarExpression /// labeled alternative in . @@ -396,19 +410,18 @@ internal interface IsqlVisitor : IParseTreeVisitor { /// The visitor result. Result VisitArrayScalarExpression([NotNull] sqlParser.ArrayScalarExpressionContext context); /// - /// Visit a parse tree produced by the MemberIndexerScalarExpression + /// Visit a parse tree produced by the PropertyRefScalarExpressionRecursive /// labeled alternative in . /// /// The parse tree. /// The visitor result. - Result VisitMemberIndexerScalarExpression([NotNull] sqlParser.MemberIndexerScalarExpressionContext context); + Result VisitPropertyRefScalarExpressionRecursive([NotNull] sqlParser.PropertyRefScalarExpressionRecursiveContext context); /// - /// Visit a parse tree produced by the PropertyRefScalarExpressionRecursive - /// labeled alternative in . + /// Visit a parse tree produced by . /// /// The parse tree. /// The visitor result. - Result VisitPropertyRefScalarExpressionRecursive([NotNull] sqlParser.PropertyRefScalarExpressionRecursiveContext context); + Result VisitFunction_call_scalar_expression([NotNull] sqlParser.Function_call_scalar_expressionContext context); /// /// Visit a parse tree produced by . /// @@ -428,6 +441,12 @@ internal interface IsqlVisitor : IParseTreeVisitor { /// The visitor result. Result VisitObject_property([NotNull] sqlParser.Object_propertyContext context); /// + /// Visit a parse tree produced by . + /// + /// The parse tree. + /// The visitor result. + Result VisitIdentifier([NotNull] sqlParser.IdentifierContext context); + /// /// Visit a parse tree produced by . /// /// The parse tree. diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sql.g4 b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sql.g4 index ef9361f67b..42ac229557 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sql.g4 +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sql.g4 @@ -1,8 +1,8 @@ grammar sql; program - : sql_query EOF - ; + : sql_query EOF + ; sql_query : select_clause from_clause? where_clause? group_by_clause? order_by_clause? offset_limit_clause? ; @@ -12,14 +12,14 @@ sql_query : select_clause from_clause? where_clause? group_by_clause? order_by_c select_clause : K_SELECT K_DISTINCT? top_spec? selection ; top_spec : K_TOP (NUMERIC_LITERAL | PARAMETER); selection - : select_star_spec - | select_value_spec - | select_list_spec - ; + : select_star_spec + | select_value_spec + | select_list_spec + ; select_star_spec : '*' ; select_value_spec : K_VALUE scalar_expression ; select_list_spec : select_item ( ',' select_item )* ; -select_item : scalar_expression (K_AS IDENTIFIER)? ; +select_item : scalar_expression (K_AS identifier)? ; /*--------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------*/ @@ -27,20 +27,20 @@ select_item : scalar_expression (K_AS IDENTIFIER)? ; /*--------------------------------------------------------------------------------*/ from_clause : K_FROM collection_expression ; collection_expression - : collection (K_AS? IDENTIFIER)? #AliasedCollectionExpression - | IDENTIFIER K_IN collection #ArrayIteratorCollectionExpression - | collection_expression K_JOIN collection_expression #JoinCollectionExpression - ; + : collection (K_AS? identifier)? #AliasedCollectionExpression + | identifier K_IN collection #ArrayIteratorCollectionExpression + | collection_expression K_JOIN collection_expression #JoinCollectionExpression + ; collection - : IDENTIFIER path_expression? #InputPathCollection - | '(' sql_query ')' #SubqueryCollection - ; + : identifier path_expression? #InputPathCollection + | '(' sql_query ')' #SubqueryCollection + ; path_expression - : path_expression'.'IDENTIFIER #IdentifierPathExpression - | path_expression'[' NUMERIC_LITERAL ']' #NumberPathExpression - | path_expression'[' STRING_LITERAL ']' #StringPathExpression - | /*epsilon*/ #EpsilonPathExpression - ; + : path_expression'.'identifier #IdentifierPathExpression + | path_expression'[' NUMERIC_LITERAL ']' #NumberPathExpression + | path_expression'[' STRING_LITERAL ']' #StringPathExpression + | /*epsilon*/ #EpsilonPathExpression + ; /*--------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------*/ @@ -62,9 +62,9 @@ order_by_clause : K_ORDER K_BY order_by_items ; order_by_items : order_by_item (',' order_by_item)* ; order_by_item : scalar_expression sort_order? ; sort_order - : K_ASC - | K_DESC - ; + : K_ASC + | K_DESC + ; /*--------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------*/ @@ -79,66 +79,66 @@ limit_count : NUMERIC_LITERAL | PARAMETER; /* SCALAR EXPRESSIONs */ /*--------------------------------------------------------------------------------*/ scalar_expression - : scalar_expression '?' scalar_expression ':' scalar_expression #ConditionalScalarExpression - | scalar_expression '??' scalar_expression #CoalesceScalarExpression - | logical_scalar_expression #LogicalScalarExpression - | binary_scalar_expression K_NOT? K_BETWEEN binary_scalar_expression K_AND binary_scalar_expression #BetweenScalarExpression - ; + : scalar_expression '?' scalar_expression ':' scalar_expression #ConditionalScalarExpression + | scalar_expression '??' scalar_expression #CoalesceScalarExpression + | logical_scalar_expression #LogicalScalarExpression + | binary_scalar_expression K_NOT? K_BETWEEN binary_scalar_expression K_AND binary_scalar_expression #BetweenScalarExpression + ; logical_scalar_expression - : binary_scalar_expression - | in_scalar_expression - | like_scalar_expression - | logical_scalar_expression K_AND logical_scalar_expression - | logical_scalar_expression K_OR logical_scalar_expression - ; + : binary_scalar_expression + | in_scalar_expression + | like_scalar_expression + | logical_scalar_expression K_AND logical_scalar_expression + | logical_scalar_expression K_OR logical_scalar_expression + ; in_scalar_expression - : binary_scalar_expression K_NOT? K_IN '(' scalar_expression_list ')' - ; + : binary_scalar_expression K_NOT? K_IN '(' scalar_expression_list ')' + ; like_scalar_expression - : binary_scalar_expression K_NOT? K_LIKE binary_scalar_expression escape_expression? - ; + : binary_scalar_expression K_NOT? K_LIKE binary_scalar_expression escape_expression? + ; escape_expression - : K_ESCAPE STRING_LITERAL - ; + : K_ESCAPE STRING_LITERAL + ; binary_scalar_expression - : unary_scalar_expression - | binary_scalar_expression multiplicative_operator binary_scalar_expression - | binary_scalar_expression additive_operator binary_scalar_expression - | binary_scalar_expression relational_operator binary_scalar_expression - | binary_scalar_expression equality_operator binary_scalar_expression - | binary_scalar_expression bitwise_and_operator binary_scalar_expression - | binary_scalar_expression bitwise_exclusive_or_operator binary_scalar_expression - | binary_scalar_expression bitwise_inclusive_or_operator binary_scalar_expression - | binary_scalar_expression string_concat_operator binary_scalar_expression - ; + : unary_scalar_expression + | binary_scalar_expression multiplicative_operator binary_scalar_expression + | binary_scalar_expression additive_operator binary_scalar_expression + | binary_scalar_expression relational_operator binary_scalar_expression + | binary_scalar_expression equality_operator binary_scalar_expression + | binary_scalar_expression bitwise_and_operator binary_scalar_expression + | binary_scalar_expression bitwise_exclusive_or_operator binary_scalar_expression + | binary_scalar_expression bitwise_inclusive_or_operator binary_scalar_expression + | binary_scalar_expression string_concat_operator binary_scalar_expression + ; multiplicative_operator - : '*' - | '/' - | '%' - ; + : '*' + | '/' + | '%' + ; additive_operator - : '+' - | '-' - ; + : '+' + | '-' + ; relational_operator - : '<' - | '>' - | '>=' - | '<=' - ; + : '<' + | '>' + | '>=' + | '<=' + ; equality_operator - : '=' - | '!=' - ; + : '=' + | '!=' + ; bitwise_and_operator : '&' ; @@ -149,42 +149,55 @@ bitwise_inclusive_or_operator : '|'; string_concat_operator : '||'; unary_scalar_expression - : primary_expression - | unary_operator unary_scalar_expression - ; + : primary_expression + | unary_operator unary_scalar_expression + ; unary_operator - : '-' - | '+' - | '~' - | K_NOT - ; + : '-' + | '+' + | '~' + | K_NOT + ; primary_expression - : IDENTIFIER #PropertyRefScalarExpressionBase - | PARAMETER #ParameterRefScalarExpression - | literal #LiteralScalarExpression - | '[' scalar_expression_list? ']' #ArrayCreateScalarExpression - | '{' object_property_list? '}' #ObjectCreateScalarExpression - | (K_UDF '.')? IDENTIFIER '(' scalar_expression_list? ')' #FunctionCallScalarExpression - | '(' scalar_expression ')' #ParenthesizedScalarExperession - | '(' sql_query ')' #SubqueryScalarExpression - | primary_expression '.' IDENTIFIER #PropertyRefScalarExpressionRecursive - | primary_expression '[' scalar_expression ']' #MemberIndexerScalarExpression - | K_EXISTS '(' sql_query ')' #ExistsScalarExpression - | K_ARRAY '(' sql_query ')' #ArrayScalarExpression - ; + : identifier #PropertyRefScalarExpressionBase + | PARAMETER #ParameterRefScalarExpression + | literal #LiteralScalarExpression + | '[' scalar_expression_list? ']' #ArrayCreateScalarExpression + | '{' object_property_list? '}' #ObjectCreateScalarExpression + | '(' scalar_expression ')' #ParenthesizedScalarExperession + | '(' sql_query ')' #SubqueryScalarExpression + | primary_expression '.' identifier #PropertyRefScalarExpressionRecursive + | primary_expression '[' scalar_expression ']' #MemberIndexerScalarExpression + | K_EXISTS '(' sql_query ')' #ExistsScalarExpression + | K_ARRAY '(' sql_query ')' #ArrayScalarExpression + | K_ALL '(' sql_query ')' #AllScalarExpression + | function_call_scalar_expression #FunctionCallScalarExpression + ; + +function_call_scalar_expression + : (K_UDF '.')? identifier '(' scalar_expression_list? ')' + | K_LEFT '(' scalar_expression_list? ')' + | K_RIGHT '(' scalar_expression_list? ')' + ; scalar_expression_list : scalar_expression (',' scalar_expression)*; object_property_list : object_property (',' object_property)* ; object_property : STRING_LITERAL ':' scalar_expression ; + +identifier + : LEX_IDENTIFIER + | K_ALL + ; /*--------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------*/ /* KEYWORDS */ /*--------------------------------------------------------------------------------*/ +K_ALL : A L L; K_AND : A N D; K_ARRAY : A R R A Y; K_AS : A S; @@ -200,6 +213,7 @@ K_FROM : F R O M; K_GROUP : G R O U P; K_IN : I N ; K_JOIN : J O I N; +K_LEFT : L E F T; K_LIKE : L I K E; K_LIMIT : L I M I T; K_NOT : N O T; @@ -207,6 +221,7 @@ K_NULL : 'null'; K_OFFSET : O F F S E T; K_OR : O R; K_ORDER : O R D E R; +K_RIGHT : R I G H T; K_SELECT : S E L E C T; K_TOP : T O P; K_TRUE : 'true'; @@ -224,27 +239,27 @@ WS /* LITERALS */ /*--------------------------------------------------------------------------------*/ literal - : STRING_LITERAL - | NUMERIC_LITERAL - | K_TRUE - | K_FALSE - | K_NULL - | K_UNDEFINED - ; + : STRING_LITERAL + | NUMERIC_LITERAL + | K_TRUE + | K_FALSE + | K_NULL + | K_UNDEFINED + ; NUMERIC_LITERAL - : ( '+' | '-' )? DIGIT+ ( '.' DIGIT* )? ( E [-+]? DIGIT+ )? - | ( '+' | '-' )? '.' DIGIT+ ( E [-+]? DIGIT+ )? - ; + : ( '+' | '-' )? DIGIT+ ( '.' DIGIT* )? ( E [-+]? DIGIT+ )? + | ( '+' | '-' )? '.' DIGIT+ ( E [-+]? DIGIT+ )? + ; STRING_LITERAL - : '"' (ESC | SAFECODEPOINTWITHDOUBLEQUOTATION)* '"' - | '\'' (ESC | SAFECODEPOINTWITHSINGLEQUOTATION)* '\'' - ; + : '"' (ESC | SAFECODEPOINTWITHDOUBLEQUOTATION)* '"' + | '\'' (ESC | SAFECODEPOINTWITHSINGLEQUOTATION)* '\'' + ; fragment ESC - : '\\' (["\\/bfnrt] | UNICODE) - ; + : '\\' (["\\/bfnrt] | UNICODE) + ; fragment UNICODE : 'u' HEX HEX HEX HEX @@ -255,21 +270,21 @@ fragment HEX ; fragment SAFECODEPOINTWITHSINGLEQUOTATION - : ~ ['\\\u0000-\u001F] - ; + : ~ ['\\\u0000-\u001F] + ; fragment SAFECODEPOINTWITHDOUBLEQUOTATION - : ~ ["\\\u0000-\u001F] - ; + : ~ ["\\\u0000-\u001F] + ; -IDENTIFIER - : - | [a-zA-Z_]([a-zA-Z_]|DIGIT)* - ; +LEX_IDENTIFIER + : + | [a-zA-Z_]([a-zA-Z_]|DIGIT)* + ; PARAMETER - : '@'IDENTIFIER - ; + : '@'LEX_IDENTIFIER + ; /*--------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------*/ diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlBaseListener.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlBaseListener.cs index 5a52445735..18003391b1 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlBaseListener.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlBaseListener.cs @@ -624,117 +624,145 @@ public virtual void EnterUnary_operator([NotNull] sqlParser.Unary_operatorContex /// The parse tree. public virtual void ExitUnary_operator([NotNull] sqlParser.Unary_operatorContext context) { } /// - /// Enter a parse tree produced by the SubqueryScalarExpression + /// Enter a parse tree produced by the AllScalarExpression /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void EnterSubqueryScalarExpression([NotNull] sqlParser.SubqueryScalarExpressionContext context) { } + public virtual void EnterAllScalarExpression([NotNull] sqlParser.AllScalarExpressionContext context) { } /// - /// Exit a parse tree produced by the SubqueryScalarExpression + /// Exit a parse tree produced by the AllScalarExpression /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void ExitSubqueryScalarExpression([NotNull] sqlParser.SubqueryScalarExpressionContext context) { } + public virtual void ExitAllScalarExpression([NotNull] sqlParser.AllScalarExpressionContext context) { } /// - /// Enter a parse tree produced by the PropertyRefScalarExpressionBase + /// Enter a parse tree produced by the LiteralScalarExpression /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void EnterPropertyRefScalarExpressionBase([NotNull] sqlParser.PropertyRefScalarExpressionBaseContext context) { } + public virtual void EnterLiteralScalarExpression([NotNull] sqlParser.LiteralScalarExpressionContext context) { } /// - /// Exit a parse tree produced by the PropertyRefScalarExpressionBase + /// Exit a parse tree produced by the LiteralScalarExpression /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void ExitPropertyRefScalarExpressionBase([NotNull] sqlParser.PropertyRefScalarExpressionBaseContext context) { } + public virtual void ExitLiteralScalarExpression([NotNull] sqlParser.LiteralScalarExpressionContext context) { } /// - /// Enter a parse tree produced by the FunctionCallScalarExpression + /// Enter a parse tree produced by the ObjectCreateScalarExpression /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void EnterFunctionCallScalarExpression([NotNull] sqlParser.FunctionCallScalarExpressionContext context) { } + public virtual void EnterObjectCreateScalarExpression([NotNull] sqlParser.ObjectCreateScalarExpressionContext context) { } /// - /// Exit a parse tree produced by the FunctionCallScalarExpression + /// Exit a parse tree produced by the ObjectCreateScalarExpression /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void ExitFunctionCallScalarExpression([NotNull] sqlParser.FunctionCallScalarExpressionContext context) { } + public virtual void ExitObjectCreateScalarExpression([NotNull] sqlParser.ObjectCreateScalarExpressionContext context) { } /// - /// Enter a parse tree produced by the LiteralScalarExpression + /// Enter a parse tree produced by the ArrayCreateScalarExpression /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void EnterLiteralScalarExpression([NotNull] sqlParser.LiteralScalarExpressionContext context) { } + public virtual void EnterArrayCreateScalarExpression([NotNull] sqlParser.ArrayCreateScalarExpressionContext context) { } /// - /// Exit a parse tree produced by the LiteralScalarExpression + /// Exit a parse tree produced by the ArrayCreateScalarExpression /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void ExitLiteralScalarExpression([NotNull] sqlParser.LiteralScalarExpressionContext context) { } + public virtual void ExitArrayCreateScalarExpression([NotNull] sqlParser.ArrayCreateScalarExpressionContext context) { } /// - /// Enter a parse tree produced by the ObjectCreateScalarExpression + /// Enter a parse tree produced by the MemberIndexerScalarExpression /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void EnterObjectCreateScalarExpression([NotNull] sqlParser.ObjectCreateScalarExpressionContext context) { } + public virtual void EnterMemberIndexerScalarExpression([NotNull] sqlParser.MemberIndexerScalarExpressionContext context) { } /// - /// Exit a parse tree produced by the ObjectCreateScalarExpression + /// Exit a parse tree produced by the MemberIndexerScalarExpression /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void ExitObjectCreateScalarExpression([NotNull] sqlParser.ObjectCreateScalarExpressionContext context) { } + public virtual void ExitMemberIndexerScalarExpression([NotNull] sqlParser.MemberIndexerScalarExpressionContext context) { } /// - /// Enter a parse tree produced by the ParenthesizedScalarExperession + /// Enter a parse tree produced by the SubqueryScalarExpression /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void EnterParenthesizedScalarExperession([NotNull] sqlParser.ParenthesizedScalarExperessionContext context) { } + public virtual void EnterSubqueryScalarExpression([NotNull] sqlParser.SubqueryScalarExpressionContext context) { } /// - /// Exit a parse tree produced by the ParenthesizedScalarExperession + /// Exit a parse tree produced by the SubqueryScalarExpression /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void ExitParenthesizedScalarExperession([NotNull] sqlParser.ParenthesizedScalarExperessionContext context) { } + public virtual void ExitSubqueryScalarExpression([NotNull] sqlParser.SubqueryScalarExpressionContext context) { } /// - /// Enter a parse tree produced by the ParameterRefScalarExpression + /// Enter a parse tree produced by the PropertyRefScalarExpressionBase /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void EnterParameterRefScalarExpression([NotNull] sqlParser.ParameterRefScalarExpressionContext context) { } + public virtual void EnterPropertyRefScalarExpressionBase([NotNull] sqlParser.PropertyRefScalarExpressionBaseContext context) { } /// - /// Exit a parse tree produced by the ParameterRefScalarExpression + /// Exit a parse tree produced by the PropertyRefScalarExpressionBase /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void ExitParameterRefScalarExpression([NotNull] sqlParser.ParameterRefScalarExpressionContext context) { } + public virtual void ExitPropertyRefScalarExpressionBase([NotNull] sqlParser.PropertyRefScalarExpressionBaseContext context) { } /// - /// Enter a parse tree produced by the ArrayCreateScalarExpression + /// Enter a parse tree produced by the FunctionCallScalarExpression /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void EnterArrayCreateScalarExpression([NotNull] sqlParser.ArrayCreateScalarExpressionContext context) { } + public virtual void EnterFunctionCallScalarExpression([NotNull] sqlParser.FunctionCallScalarExpressionContext context) { } /// - /// Exit a parse tree produced by the ArrayCreateScalarExpression + /// Exit a parse tree produced by the FunctionCallScalarExpression /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void ExitArrayCreateScalarExpression([NotNull] sqlParser.ArrayCreateScalarExpressionContext context) { } + public virtual void ExitFunctionCallScalarExpression([NotNull] sqlParser.FunctionCallScalarExpressionContext context) { } + /// + /// Enter a parse tree produced by the ParenthesizedScalarExperession + /// labeled alternative in . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterParenthesizedScalarExperession([NotNull] sqlParser.ParenthesizedScalarExperessionContext context) { } + /// + /// Exit a parse tree produced by the ParenthesizedScalarExperession + /// labeled alternative in . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitParenthesizedScalarExperession([NotNull] sqlParser.ParenthesizedScalarExperessionContext context) { } + /// + /// Enter a parse tree produced by the ParameterRefScalarExpression + /// labeled alternative in . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterParameterRefScalarExpression([NotNull] sqlParser.ParameterRefScalarExpressionContext context) { } + /// + /// Exit a parse tree produced by the ParameterRefScalarExpression + /// labeled alternative in . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitParameterRefScalarExpression([NotNull] sqlParser.ParameterRefScalarExpressionContext context) { } /// /// Enter a parse tree produced by the ExistsScalarExpression /// labeled alternative in . @@ -764,33 +792,31 @@ public virtual void EnterArrayScalarExpression([NotNull] sqlParser.ArrayScalarEx /// The parse tree. public virtual void ExitArrayScalarExpression([NotNull] sqlParser.ArrayScalarExpressionContext context) { } /// - /// Enter a parse tree produced by the MemberIndexerScalarExpression + /// Enter a parse tree produced by the PropertyRefScalarExpressionRecursive /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void EnterMemberIndexerScalarExpression([NotNull] sqlParser.MemberIndexerScalarExpressionContext context) { } + public virtual void EnterPropertyRefScalarExpressionRecursive([NotNull] sqlParser.PropertyRefScalarExpressionRecursiveContext context) { } /// - /// Exit a parse tree produced by the MemberIndexerScalarExpression + /// Exit a parse tree produced by the PropertyRefScalarExpressionRecursive /// labeled alternative in . /// The default implementation does nothing. /// /// The parse tree. - public virtual void ExitMemberIndexerScalarExpression([NotNull] sqlParser.MemberIndexerScalarExpressionContext context) { } + public virtual void ExitPropertyRefScalarExpressionRecursive([NotNull] sqlParser.PropertyRefScalarExpressionRecursiveContext context) { } /// - /// Enter a parse tree produced by the PropertyRefScalarExpressionRecursive - /// labeled alternative in . + /// Enter a parse tree produced by . /// The default implementation does nothing. /// /// The parse tree. - public virtual void EnterPropertyRefScalarExpressionRecursive([NotNull] sqlParser.PropertyRefScalarExpressionRecursiveContext context) { } + public virtual void EnterFunction_call_scalar_expression([NotNull] sqlParser.Function_call_scalar_expressionContext context) { } /// - /// Exit a parse tree produced by the PropertyRefScalarExpressionRecursive - /// labeled alternative in . + /// Exit a parse tree produced by . /// The default implementation does nothing. /// /// The parse tree. - public virtual void ExitPropertyRefScalarExpressionRecursive([NotNull] sqlParser.PropertyRefScalarExpressionRecursiveContext context) { } + public virtual void ExitFunction_call_scalar_expression([NotNull] sqlParser.Function_call_scalar_expressionContext context) { } /// /// Enter a parse tree produced by . /// The default implementation does nothing. @@ -828,6 +854,18 @@ public virtual void EnterObject_property([NotNull] sqlParser.Object_propertyCont /// The parse tree. public virtual void ExitObject_property([NotNull] sqlParser.Object_propertyContext context) { } /// + /// Enter a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterIdentifier([NotNull] sqlParser.IdentifierContext context) { } + /// + /// Exit a parse tree produced by . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitIdentifier([NotNull] sqlParser.IdentifierContext context) { } + /// /// Enter a parse tree produced by . /// The default implementation does nothing. /// diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlBaseVisitor.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlBaseVisitor.cs index 287851e115..bb3b86379d 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlBaseVisitor.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlBaseVisitor.cs @@ -516,7 +516,7 @@ internal partial class sqlBaseVisitor : AbstractParseTreeVisitor /// The visitor result. public virtual Result VisitUnary_operator([NotNull] sqlParser.Unary_operatorContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by the SubqueryScalarExpression + /// Visit a parse tree produced by the AllScalarExpression /// labeled alternative in . /// /// The default implementation returns the result of calling @@ -525,9 +525,9 @@ internal partial class sqlBaseVisitor : AbstractParseTreeVisitor /// /// The parse tree. /// The visitor result. - public virtual Result VisitSubqueryScalarExpression([NotNull] sqlParser.SubqueryScalarExpressionContext context) { return VisitChildren(context); } + public virtual Result VisitAllScalarExpression([NotNull] sqlParser.AllScalarExpressionContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by the PropertyRefScalarExpressionBase + /// Visit a parse tree produced by the LiteralScalarExpression /// labeled alternative in . /// /// The default implementation returns the result of calling @@ -536,9 +536,9 @@ internal partial class sqlBaseVisitor : AbstractParseTreeVisitor /// /// The parse tree. /// The visitor result. - public virtual Result VisitPropertyRefScalarExpressionBase([NotNull] sqlParser.PropertyRefScalarExpressionBaseContext context) { return VisitChildren(context); } + public virtual Result VisitLiteralScalarExpression([NotNull] sqlParser.LiteralScalarExpressionContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by the FunctionCallScalarExpression + /// Visit a parse tree produced by the ObjectCreateScalarExpression /// labeled alternative in . /// /// The default implementation returns the result of calling @@ -547,9 +547,9 @@ internal partial class sqlBaseVisitor : AbstractParseTreeVisitor /// /// The parse tree. /// The visitor result. - public virtual Result VisitFunctionCallScalarExpression([NotNull] sqlParser.FunctionCallScalarExpressionContext context) { return VisitChildren(context); } + public virtual Result VisitObjectCreateScalarExpression([NotNull] sqlParser.ObjectCreateScalarExpressionContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by the LiteralScalarExpression + /// Visit a parse tree produced by the ArrayCreateScalarExpression /// labeled alternative in . /// /// The default implementation returns the result of calling @@ -558,9 +558,9 @@ internal partial class sqlBaseVisitor : AbstractParseTreeVisitor /// /// The parse tree. /// The visitor result. - public virtual Result VisitLiteralScalarExpression([NotNull] sqlParser.LiteralScalarExpressionContext context) { return VisitChildren(context); } + public virtual Result VisitArrayCreateScalarExpression([NotNull] sqlParser.ArrayCreateScalarExpressionContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by the ObjectCreateScalarExpression + /// Visit a parse tree produced by the MemberIndexerScalarExpression /// labeled alternative in . /// /// The default implementation returns the result of calling @@ -569,9 +569,9 @@ internal partial class sqlBaseVisitor : AbstractParseTreeVisitor /// /// The parse tree. /// The visitor result. - public virtual Result VisitObjectCreateScalarExpression([NotNull] sqlParser.ObjectCreateScalarExpressionContext context) { return VisitChildren(context); } + public virtual Result VisitMemberIndexerScalarExpression([NotNull] sqlParser.MemberIndexerScalarExpressionContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by the ParenthesizedScalarExperession + /// Visit a parse tree produced by the SubqueryScalarExpression /// labeled alternative in . /// /// The default implementation returns the result of calling @@ -580,9 +580,9 @@ internal partial class sqlBaseVisitor : AbstractParseTreeVisitor /// /// The parse tree. /// The visitor result. - public virtual Result VisitParenthesizedScalarExperession([NotNull] sqlParser.ParenthesizedScalarExperessionContext context) { return VisitChildren(context); } + public virtual Result VisitSubqueryScalarExpression([NotNull] sqlParser.SubqueryScalarExpressionContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by the ParameterRefScalarExpression + /// Visit a parse tree produced by the PropertyRefScalarExpressionBase /// labeled alternative in . /// /// The default implementation returns the result of calling @@ -591,9 +591,9 @@ internal partial class sqlBaseVisitor : AbstractParseTreeVisitor /// /// The parse tree. /// The visitor result. - public virtual Result VisitParameterRefScalarExpression([NotNull] sqlParser.ParameterRefScalarExpressionContext context) { return VisitChildren(context); } + public virtual Result VisitPropertyRefScalarExpressionBase([NotNull] sqlParser.PropertyRefScalarExpressionBaseContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by the ArrayCreateScalarExpression + /// Visit a parse tree produced by the FunctionCallScalarExpression /// labeled alternative in . /// /// The default implementation returns the result of calling @@ -602,7 +602,29 @@ internal partial class sqlBaseVisitor : AbstractParseTreeVisitor /// /// The parse tree. /// The visitor result. - public virtual Result VisitArrayCreateScalarExpression([NotNull] sqlParser.ArrayCreateScalarExpressionContext context) { return VisitChildren(context); } + public virtual Result VisitFunctionCallScalarExpression([NotNull] sqlParser.FunctionCallScalarExpressionContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by the ParenthesizedScalarExperession + /// labeled alternative in . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitParenthesizedScalarExperession([NotNull] sqlParser.ParenthesizedScalarExperessionContext context) { return VisitChildren(context); } + /// + /// Visit a parse tree produced by the ParameterRefScalarExpression + /// labeled alternative in . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitParameterRefScalarExpression([NotNull] sqlParser.ParameterRefScalarExpressionContext context) { return VisitChildren(context); } /// /// Visit a parse tree produced by the ExistsScalarExpression /// labeled alternative in . @@ -626,7 +648,7 @@ internal partial class sqlBaseVisitor : AbstractParseTreeVisitor /// The visitor result. public virtual Result VisitArrayScalarExpression([NotNull] sqlParser.ArrayScalarExpressionContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by the MemberIndexerScalarExpression + /// Visit a parse tree produced by the PropertyRefScalarExpressionRecursive /// labeled alternative in . /// /// The default implementation returns the result of calling @@ -635,10 +657,9 @@ internal partial class sqlBaseVisitor : AbstractParseTreeVisitor /// /// The parse tree. /// The visitor result. - public virtual Result VisitMemberIndexerScalarExpression([NotNull] sqlParser.MemberIndexerScalarExpressionContext context) { return VisitChildren(context); } + public virtual Result VisitPropertyRefScalarExpressionRecursive([NotNull] sqlParser.PropertyRefScalarExpressionRecursiveContext context) { return VisitChildren(context); } /// - /// Visit a parse tree produced by the PropertyRefScalarExpressionRecursive - /// labeled alternative in . + /// Visit a parse tree produced by . /// /// The default implementation returns the result of calling /// on . @@ -646,7 +667,7 @@ internal partial class sqlBaseVisitor : AbstractParseTreeVisitor /// /// The parse tree. /// The visitor result. - public virtual Result VisitPropertyRefScalarExpressionRecursive([NotNull] sqlParser.PropertyRefScalarExpressionRecursiveContext context) { return VisitChildren(context); } + public virtual Result VisitFunction_call_scalar_expression([NotNull] sqlParser.Function_call_scalar_expressionContext context) { return VisitChildren(context); } /// /// Visit a parse tree produced by . /// @@ -678,6 +699,16 @@ internal partial class sqlBaseVisitor : AbstractParseTreeVisitor /// The visitor result. public virtual Result VisitObject_property([NotNull] sqlParser.Object_propertyContext context) { return VisitChildren(context); } /// + /// Visit a parse tree produced by . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitIdentifier([NotNull] sqlParser.IdentifierContext context) { return VisitChildren(context); } + /// /// Visit a parse tree produced by . /// /// The default implementation returns the result of calling diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlLexer.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlLexer.cs index 23f23fbed2..1d5b7262bd 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlLexer.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlLexer.cs @@ -35,12 +35,13 @@ public const int T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17, T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24, - T__24=25, T__25=26, T__26=27, K_AND=28, K_ARRAY=29, K_AS=30, K_ASC=31, - K_BETWEEN=32, K_BY=33, K_DESC=34, K_DISTINCT=35, K_ESCAPE=36, K_EXISTS=37, - K_FALSE=38, K_FROM=39, K_GROUP=40, K_IN=41, K_JOIN=42, K_LIKE=43, K_LIMIT=44, - K_NOT=45, K_NULL=46, K_OFFSET=47, K_OR=48, K_ORDER=49, K_SELECT=50, K_TOP=51, - K_TRUE=52, K_UDF=53, K_UNDEFINED=54, K_VALUE=55, K_WHERE=56, WS=57, NUMERIC_LITERAL=58, - STRING_LITERAL=59, IDENTIFIER=60, PARAMETER=61; + T__24=25, T__25=26, T__26=27, K_ALL=28, K_AND=29, K_ARRAY=30, K_AS=31, + K_ASC=32, K_BETWEEN=33, K_BY=34, K_DESC=35, K_DISTINCT=36, K_ESCAPE=37, + K_EXISTS=38, K_FALSE=39, K_FROM=40, K_GROUP=41, K_IN=42, K_JOIN=43, K_LEFT=44, + K_LIKE=45, K_LIMIT=46, K_NOT=47, K_NULL=48, K_OFFSET=49, K_OR=50, K_ORDER=51, + K_RIGHT=52, K_SELECT=53, K_TOP=54, K_TRUE=55, K_UDF=56, K_UNDEFINED=57, + K_VALUE=58, K_WHERE=59, WS=60, NUMERIC_LITERAL=61, STRING_LITERAL=62, + LEX_IDENTIFIER=63, PARAMETER=64; public static string[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" }; @@ -53,15 +54,15 @@ public const int "T__0", "T__1", "T__2", "T__3", "T__4", "T__5", "T__6", "T__7", "T__8", "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", "T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "T__23", "T__24", - "T__25", "T__26", "K_AND", "K_ARRAY", "K_AS", "K_ASC", "K_BETWEEN", "K_BY", - "K_DESC", "K_DISTINCT", "K_ESCAPE", "K_EXISTS", "K_FALSE", "K_FROM", "K_GROUP", - "K_IN", "K_JOIN", "K_LIKE", "K_LIMIT", "K_NOT", "K_NULL", "K_OFFSET", - "K_OR", "K_ORDER", "K_SELECT", "K_TOP", "K_TRUE", "K_UDF", "K_UNDEFINED", - "K_VALUE", "K_WHERE", "WS", "NUMERIC_LITERAL", "STRING_LITERAL", "ESC", - "UNICODE", "HEX", "SAFECODEPOINTWITHSINGLEQUOTATION", "SAFECODEPOINTWITHDOUBLEQUOTATION", - "IDENTIFIER", "PARAMETER", "DIGIT", "A", "B", "C", "D", "E", "F", "G", - "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", - "V", "W", "X", "Y", "Z" + "T__25", "T__26", "K_ALL", "K_AND", "K_ARRAY", "K_AS", "K_ASC", "K_BETWEEN", + "K_BY", "K_DESC", "K_DISTINCT", "K_ESCAPE", "K_EXISTS", "K_FALSE", "K_FROM", + "K_GROUP", "K_IN", "K_JOIN", "K_LEFT", "K_LIKE", "K_LIMIT", "K_NOT", "K_NULL", + "K_OFFSET", "K_OR", "K_ORDER", "K_RIGHT", "K_SELECT", "K_TOP", "K_TRUE", + "K_UDF", "K_UNDEFINED", "K_VALUE", "K_WHERE", "WS", "NUMERIC_LITERAL", + "STRING_LITERAL", "ESC", "UNICODE", "HEX", "SAFECODEPOINTWITHSINGLEQUOTATION", + "SAFECODEPOINTWITHDOUBLEQUOTATION", "LEX_IDENTIFIER", "PARAMETER", "DIGIT", + "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", + "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; @@ -78,19 +79,19 @@ public sqlLexer(ICharStream input, TextWriter output, TextWriter errorOutput) null, "'*'", "','", "'('", "')'", "'.'", "'['", "']'", "'?'", "':'", "'??'", "'/'", "'%'", "'+'", "'-'", "'<'", "'>'", "'>='", "'<='", "'='", "'!='", "'&'", "'^'", "'|'", "'||'", "'~'", "'{'", "'}'", null, null, null, null, - null, null, null, null, null, null, "'false'", null, null, null, null, - null, null, null, "'null'", null, null, null, null, null, "'true'", "'udf'", - "'undefined'" + null, null, null, null, null, null, null, "'false'", null, null, null, + null, null, null, null, null, "'null'", null, null, null, null, null, + null, "'true'", "'udf'", "'undefined'" }; private static readonly string[] _SymbolicNames = { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, "K_AND", "K_ARRAY", "K_AS", "K_ASC", "K_BETWEEN", - "K_BY", "K_DESC", "K_DISTINCT", "K_ESCAPE", "K_EXISTS", "K_FALSE", "K_FROM", - "K_GROUP", "K_IN", "K_JOIN", "K_LIKE", "K_LIMIT", "K_NOT", "K_NULL", "K_OFFSET", - "K_OR", "K_ORDER", "K_SELECT", "K_TOP", "K_TRUE", "K_UDF", "K_UNDEFINED", - "K_VALUE", "K_WHERE", "WS", "NUMERIC_LITERAL", "STRING_LITERAL", "IDENTIFIER", - "PARAMETER" + null, null, null, null, "K_ALL", "K_AND", "K_ARRAY", "K_AS", "K_ASC", + "K_BETWEEN", "K_BY", "K_DESC", "K_DISTINCT", "K_ESCAPE", "K_EXISTS", "K_FALSE", + "K_FROM", "K_GROUP", "K_IN", "K_JOIN", "K_LEFT", "K_LIKE", "K_LIMIT", + "K_NOT", "K_NULL", "K_OFFSET", "K_OR", "K_ORDER", "K_RIGHT", "K_SELECT", + "K_TOP", "K_TRUE", "K_UDF", "K_UNDEFINED", "K_VALUE", "K_WHERE", "WS", + "NUMERIC_LITERAL", "STRING_LITERAL", "LEX_IDENTIFIER", "PARAMETER" }; public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames); @@ -121,7 +122,7 @@ static sqlLexer() { } private static char[] _serializedATN = { '\x3', '\x608B', '\xA72A', '\x8133', '\xB9ED', '\x417C', '\x3BE7', '\x7786', - '\x5964', '\x2', '?', '\x239', '\b', '\x1', '\x4', '\x2', '\t', '\x2', + '\x5964', '\x2', '\x42', '\x24E', '\b', '\x1', '\x4', '\x2', '\t', '\x2', '\x4', '\x3', '\t', '\x3', '\x4', '\x4', '\t', '\x4', '\x4', '\x5', '\t', '\x5', '\x4', '\x6', '\t', '\x6', '\x4', '\a', '\t', '\a', '\x4', '\b', '\t', '\b', '\x4', '\t', '\t', '\t', '\x4', '\n', '\t', '\n', '\x4', '\v', @@ -154,6 +155,7 @@ static sqlLexer() { '\t', 'U', '\x4', 'V', '\t', 'V', '\x4', 'W', '\t', 'W', '\x4', 'X', '\t', 'X', '\x4', 'Y', '\t', 'Y', '\x4', 'Z', '\t', 'Z', '\x4', '[', '\t', '[', '\x4', '\\', '\t', '\\', '\x4', ']', '\t', ']', '\x4', '^', '\t', '^', + '\x4', '_', '\t', '_', '\x4', '`', '\t', '`', '\x4', '\x61', '\t', '\x61', '\x3', '\x2', '\x3', '\x2', '\x3', '\x3', '\x3', '\x3', '\x3', '\x4', '\x3', '\x4', '\x3', '\x5', '\x3', '\x5', '\x3', '\x6', '\x3', '\x6', '\x3', '\a', '\x3', '\a', '\x3', '\b', '\x3', '\b', '\x3', '\t', '\x3', @@ -167,56 +169,58 @@ static sqlLexer() { '\x19', '\x3', '\x19', '\x3', '\x1A', '\x3', '\x1A', '\x3', '\x1B', '\x3', '\x1B', '\x3', '\x1C', '\x3', '\x1C', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1E', '\x3', '\x1E', '\x3', '\x1E', '\x3', - '\x1E', '\x3', '\x1E', '\x3', '\x1E', '\x3', '\x1F', '\x3', '\x1F', '\x3', - '\x1F', '\x3', ' ', '\x3', ' ', '\x3', ' ', '\x3', ' ', '\x3', '!', '\x3', - '!', '\x3', '!', '\x3', '!', '\x3', '!', '\x3', '!', '\x3', '!', '\x3', - '!', '\x3', '\"', '\x3', '\"', '\x3', '\"', '\x3', '#', '\x3', '#', '\x3', + '\x1E', '\x3', '\x1F', '\x3', '\x1F', '\x3', '\x1F', '\x3', '\x1F', '\x3', + '\x1F', '\x3', '\x1F', '\x3', ' ', '\x3', ' ', '\x3', ' ', '\x3', '!', + '\x3', '!', '\x3', '!', '\x3', '!', '\x3', '\"', '\x3', '\"', '\x3', '\"', + '\x3', '\"', '\x3', '\"', '\x3', '\"', '\x3', '\"', '\x3', '\"', '\x3', '#', '\x3', '#', '\x3', '#', '\x3', '$', '\x3', '$', '\x3', '$', '\x3', - '$', '\x3', '$', '\x3', '$', '\x3', '$', '\x3', '$', '\x3', '$', '\x3', - '%', '\x3', '%', '\x3', '%', '\x3', '%', '\x3', '%', '\x3', '%', '\x3', - '%', '\x3', '&', '\x3', '&', '\x3', '&', '\x3', '&', '\x3', '&', '\x3', - '&', '\x3', '&', '\x3', '\'', '\x3', '\'', '\x3', '\'', '\x3', '\'', '\x3', - '\'', '\x3', '\'', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', - '(', '\x3', ')', '\x3', ')', '\x3', ')', '\x3', ')', '\x3', ')', '\x3', - ')', '\x3', '*', '\x3', '*', '\x3', '*', '\x3', '+', '\x3', '+', '\x3', - '+', '\x3', '+', '\x3', '+', '\x3', ',', '\x3', ',', '\x3', ',', '\x3', - ',', '\x3', ',', '\x3', '-', '\x3', '-', '\x3', '-', '\x3', '-', '\x3', - '-', '\x3', '-', '\x3', '.', '\x3', '.', '\x3', '.', '\x3', '.', '\x3', - '/', '\x3', '/', '\x3', '/', '\x3', '/', '\x3', '/', '\x3', '\x30', '\x3', - '\x30', '\x3', '\x30', '\x3', '\x30', '\x3', '\x30', '\x3', '\x30', '\x3', - '\x30', '\x3', '\x31', '\x3', '\x31', '\x3', '\x31', '\x3', '\x32', '\x3', - '\x32', '\x3', '\x32', '\x3', '\x32', '\x3', '\x32', '\x3', '\x32', '\x3', - '\x33', '\x3', '\x33', '\x3', '\x33', '\x3', '\x33', '\x3', '\x33', '\x3', - '\x33', '\x3', '\x33', '\x3', '\x34', '\x3', '\x34', '\x3', '\x34', '\x3', - '\x34', '\x3', '\x35', '\x3', '\x35', '\x3', '\x35', '\x3', '\x35', '\x3', - '\x35', '\x3', '\x36', '\x3', '\x36', '\x3', '\x36', '\x3', '\x36', '\x3', - '\x37', '\x3', '\x37', '\x3', '\x37', '\x3', '\x37', '\x3', '\x37', '\x3', - '\x37', '\x3', '\x37', '\x3', '\x37', '\x3', '\x37', '\x3', '\x37', '\x3', - '\x38', '\x3', '\x38', '\x3', '\x38', '\x3', '\x38', '\x3', '\x38', '\x3', - '\x38', '\x3', '\x39', '\x3', '\x39', '\x3', '\x39', '\x3', '\x39', '\x3', - '\x39', '\x3', '\x39', '\x3', ':', '\x6', ':', '\x199', '\n', ':', '\r', - ':', '\xE', ':', '\x19A', '\x3', ':', '\x3', ':', '\x3', ';', '\x5', ';', - '\x1A0', '\n', ';', '\x3', ';', '\x6', ';', '\x1A3', '\n', ';', '\r', - ';', '\xE', ';', '\x1A4', '\x3', ';', '\x3', ';', '\a', ';', '\x1A9', - '\n', ';', '\f', ';', '\xE', ';', '\x1AC', '\v', ';', '\x5', ';', '\x1AE', - '\n', ';', '\x3', ';', '\x3', ';', '\x5', ';', '\x1B2', '\n', ';', '\x3', - ';', '\x6', ';', '\x1B5', '\n', ';', '\r', ';', '\xE', ';', '\x1B6', '\x5', - ';', '\x1B9', '\n', ';', '\x3', ';', '\x5', ';', '\x1BC', '\n', ';', '\x3', - ';', '\x3', ';', '\x6', ';', '\x1C0', '\n', ';', '\r', ';', '\xE', ';', - '\x1C1', '\x3', ';', '\x3', ';', '\x5', ';', '\x1C6', '\n', ';', '\x3', - ';', '\x6', ';', '\x1C9', '\n', ';', '\r', ';', '\xE', ';', '\x1CA', '\x5', - ';', '\x1CD', '\n', ';', '\x5', ';', '\x1CF', '\n', ';', '\x3', '<', '\x3', - '<', '\x3', '<', '\a', '<', '\x1D4', '\n', '<', '\f', '<', '\xE', '<', - '\x1D7', '\v', '<', '\x3', '<', '\x3', '<', '\x3', '<', '\x3', '<', '\a', - '<', '\x1DD', '\n', '<', '\f', '<', '\xE', '<', '\x1E0', '\v', '<', '\x3', - '<', '\x5', '<', '\x1E3', '\n', '<', '\x3', '=', '\x3', '=', '\x3', '=', - '\x5', '=', '\x1E8', '\n', '=', '\x3', '>', '\x3', '>', '\x3', '>', '\x3', - '>', '\x3', '>', '\x3', '>', '\x3', '?', '\x3', '?', '\x3', '@', '\x3', - '@', '\x3', '\x41', '\x3', '\x41', '\x3', '\x42', '\x3', '\x42', '\x3', - '\x42', '\x3', '\x42', '\a', '\x42', '\x1FA', '\n', '\x42', '\f', '\x42', - '\xE', '\x42', '\x1FD', '\v', '\x42', '\x5', '\x42', '\x1FF', '\n', '\x42', - '\x3', '\x43', '\x3', '\x43', '\x3', '\x43', '\x3', '\x44', '\x3', '\x44', - '\x3', '\x45', '\x3', '\x45', '\x3', '\x46', '\x3', '\x46', '\x3', 'G', + '$', '\x3', '$', '\x3', '%', '\x3', '%', '\x3', '%', '\x3', '%', '\x3', + '%', '\x3', '%', '\x3', '%', '\x3', '%', '\x3', '%', '\x3', '&', '\x3', + '&', '\x3', '&', '\x3', '&', '\x3', '&', '\x3', '&', '\x3', '&', '\x3', + '\'', '\x3', '\'', '\x3', '\'', '\x3', '\'', '\x3', '\'', '\x3', '\'', + '\x3', '\'', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', + '\x3', '(', '\x3', ')', '\x3', ')', '\x3', ')', '\x3', ')', '\x3', ')', + '\x3', '*', '\x3', '*', '\x3', '*', '\x3', '*', '\x3', '*', '\x3', '*', + '\x3', '+', '\x3', '+', '\x3', '+', '\x3', ',', '\x3', ',', '\x3', ',', + '\x3', ',', '\x3', ',', '\x3', '-', '\x3', '-', '\x3', '-', '\x3', '-', + '\x3', '-', '\x3', '.', '\x3', '.', '\x3', '.', '\x3', '.', '\x3', '.', + '\x3', '/', '\x3', '/', '\x3', '/', '\x3', '/', '\x3', '/', '\x3', '/', + '\x3', '\x30', '\x3', '\x30', '\x3', '\x30', '\x3', '\x30', '\x3', '\x31', + '\x3', '\x31', '\x3', '\x31', '\x3', '\x31', '\x3', '\x31', '\x3', '\x32', + '\x3', '\x32', '\x3', '\x32', '\x3', '\x32', '\x3', '\x32', '\x3', '\x32', + '\x3', '\x32', '\x3', '\x33', '\x3', '\x33', '\x3', '\x33', '\x3', '\x34', + '\x3', '\x34', '\x3', '\x34', '\x3', '\x34', '\x3', '\x34', '\x3', '\x34', + '\x3', '\x35', '\x3', '\x35', '\x3', '\x35', '\x3', '\x35', '\x3', '\x35', + '\x3', '\x35', '\x3', '\x36', '\x3', '\x36', '\x3', '\x36', '\x3', '\x36', + '\x3', '\x36', '\x3', '\x36', '\x3', '\x36', '\x3', '\x37', '\x3', '\x37', + '\x3', '\x37', '\x3', '\x37', '\x3', '\x38', '\x3', '\x38', '\x3', '\x38', + '\x3', '\x38', '\x3', '\x38', '\x3', '\x39', '\x3', '\x39', '\x3', '\x39', + '\x3', '\x39', '\x3', ':', '\x3', ':', '\x3', ':', '\x3', ':', '\x3', + ':', '\x3', ':', '\x3', ':', '\x3', ':', '\x3', ':', '\x3', ':', '\x3', + ';', '\x3', ';', '\x3', ';', '\x3', ';', '\x3', ';', '\x3', ';', '\x3', + '<', '\x3', '<', '\x3', '<', '\x3', '<', '\x3', '<', '\x3', '<', '\x3', + '=', '\x6', '=', '\x1AE', '\n', '=', '\r', '=', '\xE', '=', '\x1AF', '\x3', + '=', '\x3', '=', '\x3', '>', '\x5', '>', '\x1B5', '\n', '>', '\x3', '>', + '\x6', '>', '\x1B8', '\n', '>', '\r', '>', '\xE', '>', '\x1B9', '\x3', + '>', '\x3', '>', '\a', '>', '\x1BE', '\n', '>', '\f', '>', '\xE', '>', + '\x1C1', '\v', '>', '\x5', '>', '\x1C3', '\n', '>', '\x3', '>', '\x3', + '>', '\x5', '>', '\x1C7', '\n', '>', '\x3', '>', '\x6', '>', '\x1CA', + '\n', '>', '\r', '>', '\xE', '>', '\x1CB', '\x5', '>', '\x1CE', '\n', + '>', '\x3', '>', '\x5', '>', '\x1D1', '\n', '>', '\x3', '>', '\x3', '>', + '\x6', '>', '\x1D5', '\n', '>', '\r', '>', '\xE', '>', '\x1D6', '\x3', + '>', '\x3', '>', '\x5', '>', '\x1DB', '\n', '>', '\x3', '>', '\x6', '>', + '\x1DE', '\n', '>', '\r', '>', '\xE', '>', '\x1DF', '\x5', '>', '\x1E2', + '\n', '>', '\x5', '>', '\x1E4', '\n', '>', '\x3', '?', '\x3', '?', '\x3', + '?', '\a', '?', '\x1E9', '\n', '?', '\f', '?', '\xE', '?', '\x1EC', '\v', + '?', '\x3', '?', '\x3', '?', '\x3', '?', '\x3', '?', '\a', '?', '\x1F2', + '\n', '?', '\f', '?', '\xE', '?', '\x1F5', '\v', '?', '\x3', '?', '\x5', + '?', '\x1F8', '\n', '?', '\x3', '@', '\x3', '@', '\x3', '@', '\x5', '@', + '\x1FD', '\n', '@', '\x3', '\x41', '\x3', '\x41', '\x3', '\x41', '\x3', + '\x41', '\x3', '\x41', '\x3', '\x41', '\x3', '\x42', '\x3', '\x42', '\x3', + '\x43', '\x3', '\x43', '\x3', '\x44', '\x3', '\x44', '\x3', '\x45', '\x3', + '\x45', '\x3', '\x45', '\x3', '\x45', '\a', '\x45', '\x20F', '\n', '\x45', + '\f', '\x45', '\xE', '\x45', '\x212', '\v', '\x45', '\x5', '\x45', '\x214', + '\n', '\x45', '\x3', '\x46', '\x3', '\x46', '\x3', '\x46', '\x3', 'G', '\x3', 'G', '\x3', 'H', '\x3', 'H', '\x3', 'I', '\x3', 'I', '\x3', 'J', '\x3', 'J', '\x3', 'K', '\x3', 'K', '\x3', 'L', '\x3', 'L', '\x3', 'M', '\x3', 'M', '\x3', 'N', '\x3', 'N', '\x3', 'O', '\x3', 'O', '\x3', 'P', @@ -224,382 +228,397 @@ static sqlLexer() { '\x3', 'S', '\x3', 'T', '\x3', 'T', '\x3', 'U', '\x3', 'U', '\x3', 'V', '\x3', 'V', '\x3', 'W', '\x3', 'W', '\x3', 'X', '\x3', 'X', '\x3', 'Y', '\x3', 'Y', '\x3', 'Z', '\x3', 'Z', '\x3', '[', '\x3', '[', '\x3', '\\', - '\x3', '\\', '\x3', ']', '\x3', ']', '\x3', '^', '\x3', '^', '\x2', '\x2', - '_', '\x3', '\x3', '\x5', '\x4', '\a', '\x5', '\t', '\x6', '\v', '\a', - '\r', '\b', '\xF', '\t', '\x11', '\n', '\x13', '\v', '\x15', '\f', '\x17', - '\r', '\x19', '\xE', '\x1B', '\xF', '\x1D', '\x10', '\x1F', '\x11', '!', - '\x12', '#', '\x13', '%', '\x14', '\'', '\x15', ')', '\x16', '+', '\x17', - '-', '\x18', '/', '\x19', '\x31', '\x1A', '\x33', '\x1B', '\x35', '\x1C', - '\x37', '\x1D', '\x39', '\x1E', ';', '\x1F', '=', ' ', '?', '!', '\x41', - '\"', '\x43', '#', '\x45', '$', 'G', '%', 'I', '&', 'K', '\'', 'M', '(', - 'O', ')', 'Q', '*', 'S', '+', 'U', ',', 'W', '-', 'Y', '.', '[', '/', - ']', '\x30', '_', '\x31', '\x61', '\x32', '\x63', '\x33', '\x65', '\x34', - 'g', '\x35', 'i', '\x36', 'k', '\x37', 'm', '\x38', 'o', '\x39', 'q', - ':', 's', ';', 'u', '<', 'w', '=', 'y', '\x2', '{', '\x2', '}', '\x2', - '\x7F', '\x2', '\x81', '\x2', '\x83', '>', '\x85', '?', '\x87', '\x2', - '\x89', '\x2', '\x8B', '\x2', '\x8D', '\x2', '\x8F', '\x2', '\x91', '\x2', - '\x93', '\x2', '\x95', '\x2', '\x97', '\x2', '\x99', '\x2', '\x9B', '\x2', - '\x9D', '\x2', '\x9F', '\x2', '\xA1', '\x2', '\xA3', '\x2', '\xA5', '\x2', - '\xA7', '\x2', '\xA9', '\x2', '\xAB', '\x2', '\xAD', '\x2', '\xAF', '\x2', - '\xB1', '\x2', '\xB3', '\x2', '\xB5', '\x2', '\xB7', '\x2', '\xB9', '\x2', - '\xBB', '\x2', '\x3', '\x2', '$', '\x5', '\x2', '\v', '\f', '\xF', '\xF', - '\"', '\"', '\x4', '\x2', '-', '-', '/', '/', '\n', '\x2', '$', '$', '\x31', - '\x31', '^', '^', '\x64', '\x64', 'h', 'h', 'p', 'p', 't', 't', 'v', 'v', - '\x5', '\x2', '\x32', ';', '\x43', 'H', '\x63', 'h', '\x5', '\x2', '\x2', - '!', ')', ')', '^', '^', '\x5', '\x2', '\x2', '!', '$', '$', '^', '^', - '\x5', '\x2', '\x43', '\\', '\x61', '\x61', '\x63', '|', '\x3', '\x2', - '\x32', ';', '\x4', '\x2', '\x43', '\x43', '\x63', '\x63', '\x4', '\x2', - '\x44', '\x44', '\x64', '\x64', '\x4', '\x2', '\x45', '\x45', '\x65', - '\x65', '\x4', '\x2', '\x46', '\x46', '\x66', '\x66', '\x4', '\x2', 'G', - 'G', 'g', 'g', '\x4', '\x2', 'H', 'H', 'h', 'h', '\x4', '\x2', 'I', 'I', - 'i', 'i', '\x4', '\x2', 'J', 'J', 'j', 'j', '\x4', '\x2', 'K', 'K', 'k', - 'k', '\x4', '\x2', 'L', 'L', 'l', 'l', '\x4', '\x2', 'M', 'M', 'm', 'm', - '\x4', '\x2', 'N', 'N', 'n', 'n', '\x4', '\x2', 'O', 'O', 'o', 'o', '\x4', - '\x2', 'P', 'P', 'p', 'p', '\x4', '\x2', 'Q', 'Q', 'q', 'q', '\x4', '\x2', - 'R', 'R', 'r', 'r', '\x4', '\x2', 'S', 'S', 's', 's', '\x4', '\x2', 'T', - 'T', 't', 't', '\x4', '\x2', 'U', 'U', 'u', 'u', '\x4', '\x2', 'V', 'V', - 'v', 'v', '\x4', '\x2', 'W', 'W', 'w', 'w', '\x4', '\x2', 'X', 'X', 'x', - 'x', '\x4', '\x2', 'Y', 'Y', 'y', 'y', '\x4', '\x2', 'Z', 'Z', 'z', 'z', - '\x4', '\x2', '[', '[', '{', '{', '\x4', '\x2', '\\', '\\', '|', '|', - '\x2', '\x22F', '\x2', '\x3', '\x3', '\x2', '\x2', '\x2', '\x2', '\x5', - '\x3', '\x2', '\x2', '\x2', '\x2', '\a', '\x3', '\x2', '\x2', '\x2', '\x2', - '\t', '\x3', '\x2', '\x2', '\x2', '\x2', '\v', '\x3', '\x2', '\x2', '\x2', - '\x2', '\r', '\x3', '\x2', '\x2', '\x2', '\x2', '\xF', '\x3', '\x2', '\x2', - '\x2', '\x2', '\x11', '\x3', '\x2', '\x2', '\x2', '\x2', '\x13', '\x3', - '\x2', '\x2', '\x2', '\x2', '\x15', '\x3', '\x2', '\x2', '\x2', '\x2', - '\x17', '\x3', '\x2', '\x2', '\x2', '\x2', '\x19', '\x3', '\x2', '\x2', - '\x2', '\x2', '\x1B', '\x3', '\x2', '\x2', '\x2', '\x2', '\x1D', '\x3', - '\x2', '\x2', '\x2', '\x2', '\x1F', '\x3', '\x2', '\x2', '\x2', '\x2', - '!', '\x3', '\x2', '\x2', '\x2', '\x2', '#', '\x3', '\x2', '\x2', '\x2', - '\x2', '%', '\x3', '\x2', '\x2', '\x2', '\x2', '\'', '\x3', '\x2', '\x2', - '\x2', '\x2', ')', '\x3', '\x2', '\x2', '\x2', '\x2', '+', '\x3', '\x2', - '\x2', '\x2', '\x2', '-', '\x3', '\x2', '\x2', '\x2', '\x2', '/', '\x3', - '\x2', '\x2', '\x2', '\x2', '\x31', '\x3', '\x2', '\x2', '\x2', '\x2', - '\x33', '\x3', '\x2', '\x2', '\x2', '\x2', '\x35', '\x3', '\x2', '\x2', - '\x2', '\x2', '\x37', '\x3', '\x2', '\x2', '\x2', '\x2', '\x39', '\x3', - '\x2', '\x2', '\x2', '\x2', ';', '\x3', '\x2', '\x2', '\x2', '\x2', '=', - '\x3', '\x2', '\x2', '\x2', '\x2', '?', '\x3', '\x2', '\x2', '\x2', '\x2', - '\x41', '\x3', '\x2', '\x2', '\x2', '\x2', '\x43', '\x3', '\x2', '\x2', - '\x2', '\x2', '\x45', '\x3', '\x2', '\x2', '\x2', '\x2', 'G', '\x3', '\x2', - '\x2', '\x2', '\x2', 'I', '\x3', '\x2', '\x2', '\x2', '\x2', 'K', '\x3', - '\x2', '\x2', '\x2', '\x2', 'M', '\x3', '\x2', '\x2', '\x2', '\x2', 'O', - '\x3', '\x2', '\x2', '\x2', '\x2', 'Q', '\x3', '\x2', '\x2', '\x2', '\x2', - 'S', '\x3', '\x2', '\x2', '\x2', '\x2', 'U', '\x3', '\x2', '\x2', '\x2', - '\x2', 'W', '\x3', '\x2', '\x2', '\x2', '\x2', 'Y', '\x3', '\x2', '\x2', - '\x2', '\x2', '[', '\x3', '\x2', '\x2', '\x2', '\x2', ']', '\x3', '\x2', - '\x2', '\x2', '\x2', '_', '\x3', '\x2', '\x2', '\x2', '\x2', '\x61', '\x3', - '\x2', '\x2', '\x2', '\x2', '\x63', '\x3', '\x2', '\x2', '\x2', '\x2', - '\x65', '\x3', '\x2', '\x2', '\x2', '\x2', 'g', '\x3', '\x2', '\x2', '\x2', - '\x2', 'i', '\x3', '\x2', '\x2', '\x2', '\x2', 'k', '\x3', '\x2', '\x2', - '\x2', '\x2', 'm', '\x3', '\x2', '\x2', '\x2', '\x2', 'o', '\x3', '\x2', - '\x2', '\x2', '\x2', 'q', '\x3', '\x2', '\x2', '\x2', '\x2', 's', '\x3', - '\x2', '\x2', '\x2', '\x2', 'u', '\x3', '\x2', '\x2', '\x2', '\x2', 'w', - '\x3', '\x2', '\x2', '\x2', '\x2', '\x83', '\x3', '\x2', '\x2', '\x2', - '\x2', '\x85', '\x3', '\x2', '\x2', '\x2', '\x3', '\xBD', '\x3', '\x2', - '\x2', '\x2', '\x5', '\xBF', '\x3', '\x2', '\x2', '\x2', '\a', '\xC1', - '\x3', '\x2', '\x2', '\x2', '\t', '\xC3', '\x3', '\x2', '\x2', '\x2', - '\v', '\xC5', '\x3', '\x2', '\x2', '\x2', '\r', '\xC7', '\x3', '\x2', - '\x2', '\x2', '\xF', '\xC9', '\x3', '\x2', '\x2', '\x2', '\x11', '\xCB', - '\x3', '\x2', '\x2', '\x2', '\x13', '\xCD', '\x3', '\x2', '\x2', '\x2', - '\x15', '\xCF', '\x3', '\x2', '\x2', '\x2', '\x17', '\xD2', '\x3', '\x2', - '\x2', '\x2', '\x19', '\xD4', '\x3', '\x2', '\x2', '\x2', '\x1B', '\xD6', - '\x3', '\x2', '\x2', '\x2', '\x1D', '\xD8', '\x3', '\x2', '\x2', '\x2', - '\x1F', '\xDA', '\x3', '\x2', '\x2', '\x2', '!', '\xDC', '\x3', '\x2', - '\x2', '\x2', '#', '\xDE', '\x3', '\x2', '\x2', '\x2', '%', '\xE1', '\x3', - '\x2', '\x2', '\x2', '\'', '\xE4', '\x3', '\x2', '\x2', '\x2', ')', '\xE6', - '\x3', '\x2', '\x2', '\x2', '+', '\xE9', '\x3', '\x2', '\x2', '\x2', '-', - '\xEB', '\x3', '\x2', '\x2', '\x2', '/', '\xED', '\x3', '\x2', '\x2', - '\x2', '\x31', '\xEF', '\x3', '\x2', '\x2', '\x2', '\x33', '\xF2', '\x3', - '\x2', '\x2', '\x2', '\x35', '\xF4', '\x3', '\x2', '\x2', '\x2', '\x37', - '\xF6', '\x3', '\x2', '\x2', '\x2', '\x39', '\xF8', '\x3', '\x2', '\x2', - '\x2', ';', '\xFC', '\x3', '\x2', '\x2', '\x2', '=', '\x102', '\x3', '\x2', - '\x2', '\x2', '?', '\x105', '\x3', '\x2', '\x2', '\x2', '\x41', '\x109', - '\x3', '\x2', '\x2', '\x2', '\x43', '\x111', '\x3', '\x2', '\x2', '\x2', - '\x45', '\x114', '\x3', '\x2', '\x2', '\x2', 'G', '\x119', '\x3', '\x2', - '\x2', '\x2', 'I', '\x122', '\x3', '\x2', '\x2', '\x2', 'K', '\x129', - '\x3', '\x2', '\x2', '\x2', 'M', '\x130', '\x3', '\x2', '\x2', '\x2', - 'O', '\x136', '\x3', '\x2', '\x2', '\x2', 'Q', '\x13B', '\x3', '\x2', - '\x2', '\x2', 'S', '\x141', '\x3', '\x2', '\x2', '\x2', 'U', '\x144', - '\x3', '\x2', '\x2', '\x2', 'W', '\x149', '\x3', '\x2', '\x2', '\x2', - 'Y', '\x14E', '\x3', '\x2', '\x2', '\x2', '[', '\x154', '\x3', '\x2', - '\x2', '\x2', ']', '\x158', '\x3', '\x2', '\x2', '\x2', '_', '\x15D', - '\x3', '\x2', '\x2', '\x2', '\x61', '\x164', '\x3', '\x2', '\x2', '\x2', - '\x63', '\x167', '\x3', '\x2', '\x2', '\x2', '\x65', '\x16D', '\x3', '\x2', - '\x2', '\x2', 'g', '\x174', '\x3', '\x2', '\x2', '\x2', 'i', '\x178', - '\x3', '\x2', '\x2', '\x2', 'k', '\x17D', '\x3', '\x2', '\x2', '\x2', - 'm', '\x181', '\x3', '\x2', '\x2', '\x2', 'o', '\x18B', '\x3', '\x2', - '\x2', '\x2', 'q', '\x191', '\x3', '\x2', '\x2', '\x2', 's', '\x198', - '\x3', '\x2', '\x2', '\x2', 'u', '\x1CE', '\x3', '\x2', '\x2', '\x2', - 'w', '\x1E2', '\x3', '\x2', '\x2', '\x2', 'y', '\x1E4', '\x3', '\x2', - '\x2', '\x2', '{', '\x1E9', '\x3', '\x2', '\x2', '\x2', '}', '\x1EF', - '\x3', '\x2', '\x2', '\x2', '\x7F', '\x1F1', '\x3', '\x2', '\x2', '\x2', - '\x81', '\x1F3', '\x3', '\x2', '\x2', '\x2', '\x83', '\x1FE', '\x3', '\x2', - '\x2', '\x2', '\x85', '\x200', '\x3', '\x2', '\x2', '\x2', '\x87', '\x203', - '\x3', '\x2', '\x2', '\x2', '\x89', '\x205', '\x3', '\x2', '\x2', '\x2', - '\x8B', '\x207', '\x3', '\x2', '\x2', '\x2', '\x8D', '\x209', '\x3', '\x2', - '\x2', '\x2', '\x8F', '\x20B', '\x3', '\x2', '\x2', '\x2', '\x91', '\x20D', - '\x3', '\x2', '\x2', '\x2', '\x93', '\x20F', '\x3', '\x2', '\x2', '\x2', - '\x95', '\x211', '\x3', '\x2', '\x2', '\x2', '\x97', '\x213', '\x3', '\x2', - '\x2', '\x2', '\x99', '\x215', '\x3', '\x2', '\x2', '\x2', '\x9B', '\x217', - '\x3', '\x2', '\x2', '\x2', '\x9D', '\x219', '\x3', '\x2', '\x2', '\x2', - '\x9F', '\x21B', '\x3', '\x2', '\x2', '\x2', '\xA1', '\x21D', '\x3', '\x2', - '\x2', '\x2', '\xA3', '\x21F', '\x3', '\x2', '\x2', '\x2', '\xA5', '\x221', - '\x3', '\x2', '\x2', '\x2', '\xA7', '\x223', '\x3', '\x2', '\x2', '\x2', - '\xA9', '\x225', '\x3', '\x2', '\x2', '\x2', '\xAB', '\x227', '\x3', '\x2', - '\x2', '\x2', '\xAD', '\x229', '\x3', '\x2', '\x2', '\x2', '\xAF', '\x22B', - '\x3', '\x2', '\x2', '\x2', '\xB1', '\x22D', '\x3', '\x2', '\x2', '\x2', - '\xB3', '\x22F', '\x3', '\x2', '\x2', '\x2', '\xB5', '\x231', '\x3', '\x2', - '\x2', '\x2', '\xB7', '\x233', '\x3', '\x2', '\x2', '\x2', '\xB9', '\x235', - '\x3', '\x2', '\x2', '\x2', '\xBB', '\x237', '\x3', '\x2', '\x2', '\x2', - '\xBD', '\xBE', '\a', ',', '\x2', '\x2', '\xBE', '\x4', '\x3', '\x2', - '\x2', '\x2', '\xBF', '\xC0', '\a', '.', '\x2', '\x2', '\xC0', '\x6', - '\x3', '\x2', '\x2', '\x2', '\xC1', '\xC2', '\a', '*', '\x2', '\x2', '\xC2', - '\b', '\x3', '\x2', '\x2', '\x2', '\xC3', '\xC4', '\a', '+', '\x2', '\x2', - '\xC4', '\n', '\x3', '\x2', '\x2', '\x2', '\xC5', '\xC6', '\a', '\x30', - '\x2', '\x2', '\xC6', '\f', '\x3', '\x2', '\x2', '\x2', '\xC7', '\xC8', - '\a', ']', '\x2', '\x2', '\xC8', '\xE', '\x3', '\x2', '\x2', '\x2', '\xC9', - '\xCA', '\a', '_', '\x2', '\x2', '\xCA', '\x10', '\x3', '\x2', '\x2', - '\x2', '\xCB', '\xCC', '\a', '\x41', '\x2', '\x2', '\xCC', '\x12', '\x3', - '\x2', '\x2', '\x2', '\xCD', '\xCE', '\a', '<', '\x2', '\x2', '\xCE', - '\x14', '\x3', '\x2', '\x2', '\x2', '\xCF', '\xD0', '\a', '\x41', '\x2', - '\x2', '\xD0', '\xD1', '\a', '\x41', '\x2', '\x2', '\xD1', '\x16', '\x3', - '\x2', '\x2', '\x2', '\xD2', '\xD3', '\a', '\x31', '\x2', '\x2', '\xD3', - '\x18', '\x3', '\x2', '\x2', '\x2', '\xD4', '\xD5', '\a', '\'', '\x2', - '\x2', '\xD5', '\x1A', '\x3', '\x2', '\x2', '\x2', '\xD6', '\xD7', '\a', - '-', '\x2', '\x2', '\xD7', '\x1C', '\x3', '\x2', '\x2', '\x2', '\xD8', - '\xD9', '\a', '/', '\x2', '\x2', '\xD9', '\x1E', '\x3', '\x2', '\x2', - '\x2', '\xDA', '\xDB', '\a', '>', '\x2', '\x2', '\xDB', ' ', '\x3', '\x2', - '\x2', '\x2', '\xDC', '\xDD', '\a', '@', '\x2', '\x2', '\xDD', '\"', '\x3', - '\x2', '\x2', '\x2', '\xDE', '\xDF', '\a', '@', '\x2', '\x2', '\xDF', - '\xE0', '\a', '?', '\x2', '\x2', '\xE0', '$', '\x3', '\x2', '\x2', '\x2', - '\xE1', '\xE2', '\a', '>', '\x2', '\x2', '\xE2', '\xE3', '\a', '?', '\x2', - '\x2', '\xE3', '&', '\x3', '\x2', '\x2', '\x2', '\xE4', '\xE5', '\a', - '?', '\x2', '\x2', '\xE5', '(', '\x3', '\x2', '\x2', '\x2', '\xE6', '\xE7', - '\a', '#', '\x2', '\x2', '\xE7', '\xE8', '\a', '?', '\x2', '\x2', '\xE8', - '*', '\x3', '\x2', '\x2', '\x2', '\xE9', '\xEA', '\a', '(', '\x2', '\x2', - '\xEA', ',', '\x3', '\x2', '\x2', '\x2', '\xEB', '\xEC', '\a', '`', '\x2', - '\x2', '\xEC', '.', '\x3', '\x2', '\x2', '\x2', '\xED', '\xEE', '\a', - '~', '\x2', '\x2', '\xEE', '\x30', '\x3', '\x2', '\x2', '\x2', '\xEF', - '\xF0', '\a', '~', '\x2', '\x2', '\xF0', '\xF1', '\a', '~', '\x2', '\x2', - '\xF1', '\x32', '\x3', '\x2', '\x2', '\x2', '\xF2', '\xF3', '\a', '\x80', - '\x2', '\x2', '\xF3', '\x34', '\x3', '\x2', '\x2', '\x2', '\xF4', '\xF5', - '\a', '}', '\x2', '\x2', '\xF5', '\x36', '\x3', '\x2', '\x2', '\x2', '\xF6', - '\xF7', '\a', '\x7F', '\x2', '\x2', '\xF7', '\x38', '\x3', '\x2', '\x2', - '\x2', '\xF8', '\xF9', '\x5', '\x89', '\x45', '\x2', '\xF9', '\xFA', '\x5', - '\xA3', 'R', '\x2', '\xFA', '\xFB', '\x5', '\x8F', 'H', '\x2', '\xFB', - ':', '\x3', '\x2', '\x2', '\x2', '\xFC', '\xFD', '\x5', '\x89', '\x45', - '\x2', '\xFD', '\xFE', '\x5', '\xAB', 'V', '\x2', '\xFE', '\xFF', '\x5', - '\xAB', 'V', '\x2', '\xFF', '\x100', '\x5', '\x89', '\x45', '\x2', '\x100', - '\x101', '\x5', '\xB9', ']', '\x2', '\x101', '<', '\x3', '\x2', '\x2', - '\x2', '\x102', '\x103', '\x5', '\x89', '\x45', '\x2', '\x103', '\x104', - '\x5', '\xAD', 'W', '\x2', '\x104', '>', '\x3', '\x2', '\x2', '\x2', '\x105', - '\x106', '\x5', '\x89', '\x45', '\x2', '\x106', '\x107', '\x5', '\xAD', - 'W', '\x2', '\x107', '\x108', '\x5', '\x8D', 'G', '\x2', '\x108', '@', - '\x3', '\x2', '\x2', '\x2', '\x109', '\x10A', '\x5', '\x8B', '\x46', '\x2', - '\x10A', '\x10B', '\x5', '\x91', 'I', '\x2', '\x10B', '\x10C', '\x5', - '\xAF', 'X', '\x2', '\x10C', '\x10D', '\x5', '\xB5', '[', '\x2', '\x10D', - '\x10E', '\x5', '\x91', 'I', '\x2', '\x10E', '\x10F', '\x5', '\x91', 'I', - '\x2', '\x10F', '\x110', '\x5', '\xA3', 'R', '\x2', '\x110', '\x42', '\x3', - '\x2', '\x2', '\x2', '\x111', '\x112', '\x5', '\x8B', '\x46', '\x2', '\x112', - '\x113', '\x5', '\xB9', ']', '\x2', '\x113', '\x44', '\x3', '\x2', '\x2', - '\x2', '\x114', '\x115', '\x5', '\x8F', 'H', '\x2', '\x115', '\x116', - '\x5', '\x91', 'I', '\x2', '\x116', '\x117', '\x5', '\xAD', 'W', '\x2', - '\x117', '\x118', '\x5', '\x8D', 'G', '\x2', '\x118', '\x46', '\x3', '\x2', - '\x2', '\x2', '\x119', '\x11A', '\x5', '\x8F', 'H', '\x2', '\x11A', '\x11B', - '\x5', '\x99', 'M', '\x2', '\x11B', '\x11C', '\x5', '\xAD', 'W', '\x2', - '\x11C', '\x11D', '\x5', '\xAF', 'X', '\x2', '\x11D', '\x11E', '\x5', - '\x99', 'M', '\x2', '\x11E', '\x11F', '\x5', '\xA3', 'R', '\x2', '\x11F', - '\x120', '\x5', '\x8D', 'G', '\x2', '\x120', '\x121', '\x5', '\xAF', 'X', - '\x2', '\x121', 'H', '\x3', '\x2', '\x2', '\x2', '\x122', '\x123', '\x5', - '\x91', 'I', '\x2', '\x123', '\x124', '\x5', '\xAD', 'W', '\x2', '\x124', - '\x125', '\x5', '\x8D', 'G', '\x2', '\x125', '\x126', '\x5', '\x89', '\x45', - '\x2', '\x126', '\x127', '\x5', '\xA7', 'T', '\x2', '\x127', '\x128', - '\x5', '\x91', 'I', '\x2', '\x128', 'J', '\x3', '\x2', '\x2', '\x2', '\x129', - '\x12A', '\x5', '\x91', 'I', '\x2', '\x12A', '\x12B', '\x5', '\xB7', '\\', - '\x2', '\x12B', '\x12C', '\x5', '\x99', 'M', '\x2', '\x12C', '\x12D', - '\x5', '\xAD', 'W', '\x2', '\x12D', '\x12E', '\x5', '\xAF', 'X', '\x2', - '\x12E', '\x12F', '\x5', '\xAD', 'W', '\x2', '\x12F', 'L', '\x3', '\x2', - '\x2', '\x2', '\x130', '\x131', '\a', 'h', '\x2', '\x2', '\x131', '\x132', - '\a', '\x63', '\x2', '\x2', '\x132', '\x133', '\a', 'n', '\x2', '\x2', - '\x133', '\x134', '\a', 'u', '\x2', '\x2', '\x134', '\x135', '\a', 'g', - '\x2', '\x2', '\x135', 'N', '\x3', '\x2', '\x2', '\x2', '\x136', '\x137', - '\x5', '\x93', 'J', '\x2', '\x137', '\x138', '\x5', '\xAB', 'V', '\x2', - '\x138', '\x139', '\x5', '\xA5', 'S', '\x2', '\x139', '\x13A', '\x5', - '\xA1', 'Q', '\x2', '\x13A', 'P', '\x3', '\x2', '\x2', '\x2', '\x13B', - '\x13C', '\x5', '\x95', 'K', '\x2', '\x13C', '\x13D', '\x5', '\xAB', 'V', - '\x2', '\x13D', '\x13E', '\x5', '\xA5', 'S', '\x2', '\x13E', '\x13F', - '\x5', '\xB1', 'Y', '\x2', '\x13F', '\x140', '\x5', '\xA7', 'T', '\x2', - '\x140', 'R', '\x3', '\x2', '\x2', '\x2', '\x141', '\x142', '\x5', '\x99', - 'M', '\x2', '\x142', '\x143', '\x5', '\xA3', 'R', '\x2', '\x143', 'T', - '\x3', '\x2', '\x2', '\x2', '\x144', '\x145', '\x5', '\x9B', 'N', '\x2', - '\x145', '\x146', '\x5', '\xA5', 'S', '\x2', '\x146', '\x147', '\x5', - '\x99', 'M', '\x2', '\x147', '\x148', '\x5', '\xA3', 'R', '\x2', '\x148', - 'V', '\x3', '\x2', '\x2', '\x2', '\x149', '\x14A', '\x5', '\x9F', 'P', - '\x2', '\x14A', '\x14B', '\x5', '\x99', 'M', '\x2', '\x14B', '\x14C', - '\x5', '\x9D', 'O', '\x2', '\x14C', '\x14D', '\x5', '\x91', 'I', '\x2', - '\x14D', 'X', '\x3', '\x2', '\x2', '\x2', '\x14E', '\x14F', '\x5', '\x9F', - 'P', '\x2', '\x14F', '\x150', '\x5', '\x99', 'M', '\x2', '\x150', '\x151', - '\x5', '\xA1', 'Q', '\x2', '\x151', '\x152', '\x5', '\x99', 'M', '\x2', - '\x152', '\x153', '\x5', '\xAF', 'X', '\x2', '\x153', 'Z', '\x3', '\x2', - '\x2', '\x2', '\x154', '\x155', '\x5', '\xA3', 'R', '\x2', '\x155', '\x156', - '\x5', '\xA5', 'S', '\x2', '\x156', '\x157', '\x5', '\xAF', 'X', '\x2', - '\x157', '\\', '\x3', '\x2', '\x2', '\x2', '\x158', '\x159', '\a', 'p', - '\x2', '\x2', '\x159', '\x15A', '\a', 'w', '\x2', '\x2', '\x15A', '\x15B', - '\a', 'n', '\x2', '\x2', '\x15B', '\x15C', '\a', 'n', '\x2', '\x2', '\x15C', - '^', '\x3', '\x2', '\x2', '\x2', '\x15D', '\x15E', '\x5', '\xA5', 'S', - '\x2', '\x15E', '\x15F', '\x5', '\x93', 'J', '\x2', '\x15F', '\x160', - '\x5', '\x93', 'J', '\x2', '\x160', '\x161', '\x5', '\xAD', 'W', '\x2', - '\x161', '\x162', '\x5', '\x91', 'I', '\x2', '\x162', '\x163', '\x5', - '\xAF', 'X', '\x2', '\x163', '`', '\x3', '\x2', '\x2', '\x2', '\x164', - '\x165', '\x5', '\xA5', 'S', '\x2', '\x165', '\x166', '\x5', '\xAB', 'V', - '\x2', '\x166', '\x62', '\x3', '\x2', '\x2', '\x2', '\x167', '\x168', - '\x5', '\xA5', 'S', '\x2', '\x168', '\x169', '\x5', '\xAB', 'V', '\x2', - '\x169', '\x16A', '\x5', '\x8F', 'H', '\x2', '\x16A', '\x16B', '\x5', - '\x91', 'I', '\x2', '\x16B', '\x16C', '\x5', '\xAB', 'V', '\x2', '\x16C', - '\x64', '\x3', '\x2', '\x2', '\x2', '\x16D', '\x16E', '\x5', '\xAD', 'W', - '\x2', '\x16E', '\x16F', '\x5', '\x91', 'I', '\x2', '\x16F', '\x170', - '\x5', '\x9F', 'P', '\x2', '\x170', '\x171', '\x5', '\x91', 'I', '\x2', - '\x171', '\x172', '\x5', '\x8D', 'G', '\x2', '\x172', '\x173', '\x5', - '\xAF', 'X', '\x2', '\x173', '\x66', '\x3', '\x2', '\x2', '\x2', '\x174', - '\x175', '\x5', '\xAF', 'X', '\x2', '\x175', '\x176', '\x5', '\xA5', 'S', - '\x2', '\x176', '\x177', '\x5', '\xA7', 'T', '\x2', '\x177', 'h', '\x3', - '\x2', '\x2', '\x2', '\x178', '\x179', '\a', 'v', '\x2', '\x2', '\x179', - '\x17A', '\a', 't', '\x2', '\x2', '\x17A', '\x17B', '\a', 'w', '\x2', - '\x2', '\x17B', '\x17C', '\a', 'g', '\x2', '\x2', '\x17C', 'j', '\x3', - '\x2', '\x2', '\x2', '\x17D', '\x17E', '\a', 'w', '\x2', '\x2', '\x17E', - '\x17F', '\a', '\x66', '\x2', '\x2', '\x17F', '\x180', '\a', 'h', '\x2', - '\x2', '\x180', 'l', '\x3', '\x2', '\x2', '\x2', '\x181', '\x182', '\a', - 'w', '\x2', '\x2', '\x182', '\x183', '\a', 'p', '\x2', '\x2', '\x183', - '\x184', '\a', '\x66', '\x2', '\x2', '\x184', '\x185', '\a', 'g', '\x2', - '\x2', '\x185', '\x186', '\a', 'h', '\x2', '\x2', '\x186', '\x187', '\a', - 'k', '\x2', '\x2', '\x187', '\x188', '\a', 'p', '\x2', '\x2', '\x188', - '\x189', '\a', 'g', '\x2', '\x2', '\x189', '\x18A', '\a', '\x66', '\x2', - '\x2', '\x18A', 'n', '\x3', '\x2', '\x2', '\x2', '\x18B', '\x18C', '\x5', - '\xB3', 'Z', '\x2', '\x18C', '\x18D', '\x5', '\x89', '\x45', '\x2', '\x18D', - '\x18E', '\x5', '\x9F', 'P', '\x2', '\x18E', '\x18F', '\x5', '\xB1', 'Y', - '\x2', '\x18F', '\x190', '\x5', '\x91', 'I', '\x2', '\x190', 'p', '\x3', - '\x2', '\x2', '\x2', '\x191', '\x192', '\x5', '\xB5', '[', '\x2', '\x192', - '\x193', '\x5', '\x97', 'L', '\x2', '\x193', '\x194', '\x5', '\x91', 'I', - '\x2', '\x194', '\x195', '\x5', '\xAB', 'V', '\x2', '\x195', '\x196', - '\x5', '\x91', 'I', '\x2', '\x196', 'r', '\x3', '\x2', '\x2', '\x2', '\x197', - '\x199', '\t', '\x2', '\x2', '\x2', '\x198', '\x197', '\x3', '\x2', '\x2', - '\x2', '\x199', '\x19A', '\x3', '\x2', '\x2', '\x2', '\x19A', '\x198', - '\x3', '\x2', '\x2', '\x2', '\x19A', '\x19B', '\x3', '\x2', '\x2', '\x2', - '\x19B', '\x19C', '\x3', '\x2', '\x2', '\x2', '\x19C', '\x19D', '\b', - ':', '\x2', '\x2', '\x19D', 't', '\x3', '\x2', '\x2', '\x2', '\x19E', - '\x1A0', '\t', '\x3', '\x2', '\x2', '\x19F', '\x19E', '\x3', '\x2', '\x2', - '\x2', '\x19F', '\x1A0', '\x3', '\x2', '\x2', '\x2', '\x1A0', '\x1A2', - '\x3', '\x2', '\x2', '\x2', '\x1A1', '\x1A3', '\x5', '\x87', '\x44', '\x2', - '\x1A2', '\x1A1', '\x3', '\x2', '\x2', '\x2', '\x1A3', '\x1A4', '\x3', - '\x2', '\x2', '\x2', '\x1A4', '\x1A2', '\x3', '\x2', '\x2', '\x2', '\x1A4', - '\x1A5', '\x3', '\x2', '\x2', '\x2', '\x1A5', '\x1AD', '\x3', '\x2', '\x2', - '\x2', '\x1A6', '\x1AA', '\a', '\x30', '\x2', '\x2', '\x1A7', '\x1A9', - '\x5', '\x87', '\x44', '\x2', '\x1A8', '\x1A7', '\x3', '\x2', '\x2', '\x2', - '\x1A9', '\x1AC', '\x3', '\x2', '\x2', '\x2', '\x1AA', '\x1A8', '\x3', - '\x2', '\x2', '\x2', '\x1AA', '\x1AB', '\x3', '\x2', '\x2', '\x2', '\x1AB', - '\x1AE', '\x3', '\x2', '\x2', '\x2', '\x1AC', '\x1AA', '\x3', '\x2', '\x2', - '\x2', '\x1AD', '\x1A6', '\x3', '\x2', '\x2', '\x2', '\x1AD', '\x1AE', - '\x3', '\x2', '\x2', '\x2', '\x1AE', '\x1B8', '\x3', '\x2', '\x2', '\x2', - '\x1AF', '\x1B1', '\x5', '\x91', 'I', '\x2', '\x1B0', '\x1B2', '\t', '\x3', - '\x2', '\x2', '\x1B1', '\x1B0', '\x3', '\x2', '\x2', '\x2', '\x1B1', '\x1B2', - '\x3', '\x2', '\x2', '\x2', '\x1B2', '\x1B4', '\x3', '\x2', '\x2', '\x2', - '\x1B3', '\x1B5', '\x5', '\x87', '\x44', '\x2', '\x1B4', '\x1B3', '\x3', - '\x2', '\x2', '\x2', '\x1B5', '\x1B6', '\x3', '\x2', '\x2', '\x2', '\x1B6', - '\x1B4', '\x3', '\x2', '\x2', '\x2', '\x1B6', '\x1B7', '\x3', '\x2', '\x2', - '\x2', '\x1B7', '\x1B9', '\x3', '\x2', '\x2', '\x2', '\x1B8', '\x1AF', - '\x3', '\x2', '\x2', '\x2', '\x1B8', '\x1B9', '\x3', '\x2', '\x2', '\x2', - '\x1B9', '\x1CF', '\x3', '\x2', '\x2', '\x2', '\x1BA', '\x1BC', '\t', - '\x3', '\x2', '\x2', '\x1BB', '\x1BA', '\x3', '\x2', '\x2', '\x2', '\x1BB', - '\x1BC', '\x3', '\x2', '\x2', '\x2', '\x1BC', '\x1BD', '\x3', '\x2', '\x2', - '\x2', '\x1BD', '\x1BF', '\a', '\x30', '\x2', '\x2', '\x1BE', '\x1C0', - '\x5', '\x87', '\x44', '\x2', '\x1BF', '\x1BE', '\x3', '\x2', '\x2', '\x2', - '\x1C0', '\x1C1', '\x3', '\x2', '\x2', '\x2', '\x1C1', '\x1BF', '\x3', - '\x2', '\x2', '\x2', '\x1C1', '\x1C2', '\x3', '\x2', '\x2', '\x2', '\x1C2', - '\x1CC', '\x3', '\x2', '\x2', '\x2', '\x1C3', '\x1C5', '\x5', '\x91', - 'I', '\x2', '\x1C4', '\x1C6', '\t', '\x3', '\x2', '\x2', '\x1C5', '\x1C4', - '\x3', '\x2', '\x2', '\x2', '\x1C5', '\x1C6', '\x3', '\x2', '\x2', '\x2', - '\x1C6', '\x1C8', '\x3', '\x2', '\x2', '\x2', '\x1C7', '\x1C9', '\x5', - '\x87', '\x44', '\x2', '\x1C8', '\x1C7', '\x3', '\x2', '\x2', '\x2', '\x1C9', - '\x1CA', '\x3', '\x2', '\x2', '\x2', '\x1CA', '\x1C8', '\x3', '\x2', '\x2', - '\x2', '\x1CA', '\x1CB', '\x3', '\x2', '\x2', '\x2', '\x1CB', '\x1CD', - '\x3', '\x2', '\x2', '\x2', '\x1CC', '\x1C3', '\x3', '\x2', '\x2', '\x2', - '\x1CC', '\x1CD', '\x3', '\x2', '\x2', '\x2', '\x1CD', '\x1CF', '\x3', - '\x2', '\x2', '\x2', '\x1CE', '\x19F', '\x3', '\x2', '\x2', '\x2', '\x1CE', - '\x1BB', '\x3', '\x2', '\x2', '\x2', '\x1CF', 'v', '\x3', '\x2', '\x2', - '\x2', '\x1D0', '\x1D5', '\a', '$', '\x2', '\x2', '\x1D1', '\x1D4', '\x5', - 'y', '=', '\x2', '\x1D2', '\x1D4', '\x5', '\x81', '\x41', '\x2', '\x1D3', - '\x1D1', '\x3', '\x2', '\x2', '\x2', '\x1D3', '\x1D2', '\x3', '\x2', '\x2', - '\x2', '\x1D4', '\x1D7', '\x3', '\x2', '\x2', '\x2', '\x1D5', '\x1D3', - '\x3', '\x2', '\x2', '\x2', '\x1D5', '\x1D6', '\x3', '\x2', '\x2', '\x2', - '\x1D6', '\x1D8', '\x3', '\x2', '\x2', '\x2', '\x1D7', '\x1D5', '\x3', - '\x2', '\x2', '\x2', '\x1D8', '\x1E3', '\a', '$', '\x2', '\x2', '\x1D9', - '\x1DE', '\a', ')', '\x2', '\x2', '\x1DA', '\x1DD', '\x5', 'y', '=', '\x2', - '\x1DB', '\x1DD', '\x5', '\x7F', '@', '\x2', '\x1DC', '\x1DA', '\x3', - '\x2', '\x2', '\x2', '\x1DC', '\x1DB', '\x3', '\x2', '\x2', '\x2', '\x1DD', - '\x1E0', '\x3', '\x2', '\x2', '\x2', '\x1DE', '\x1DC', '\x3', '\x2', '\x2', - '\x2', '\x1DE', '\x1DF', '\x3', '\x2', '\x2', '\x2', '\x1DF', '\x1E1', - '\x3', '\x2', '\x2', '\x2', '\x1E0', '\x1DE', '\x3', '\x2', '\x2', '\x2', - '\x1E1', '\x1E3', '\a', ')', '\x2', '\x2', '\x1E2', '\x1D0', '\x3', '\x2', - '\x2', '\x2', '\x1E2', '\x1D9', '\x3', '\x2', '\x2', '\x2', '\x1E3', 'x', - '\x3', '\x2', '\x2', '\x2', '\x1E4', '\x1E7', '\a', '^', '\x2', '\x2', - '\x1E5', '\x1E8', '\t', '\x4', '\x2', '\x2', '\x1E6', '\x1E8', '\x5', - '{', '>', '\x2', '\x1E7', '\x1E5', '\x3', '\x2', '\x2', '\x2', '\x1E7', - '\x1E6', '\x3', '\x2', '\x2', '\x2', '\x1E8', 'z', '\x3', '\x2', '\x2', - '\x2', '\x1E9', '\x1EA', '\a', 'w', '\x2', '\x2', '\x1EA', '\x1EB', '\x5', - '}', '?', '\x2', '\x1EB', '\x1EC', '\x5', '}', '?', '\x2', '\x1EC', '\x1ED', - '\x5', '}', '?', '\x2', '\x1ED', '\x1EE', '\x5', '}', '?', '\x2', '\x1EE', - '|', '\x3', '\x2', '\x2', '\x2', '\x1EF', '\x1F0', '\t', '\x5', '\x2', - '\x2', '\x1F0', '~', '\x3', '\x2', '\x2', '\x2', '\x1F1', '\x1F2', '\n', - '\x6', '\x2', '\x2', '\x1F2', '\x80', '\x3', '\x2', '\x2', '\x2', '\x1F3', - '\x1F4', '\n', '\a', '\x2', '\x2', '\x1F4', '\x82', '\x3', '\x2', '\x2', - '\x2', '\x1F5', '\x1FF', '\x3', '\x2', '\x2', '\x2', '\x1F6', '\x1FB', - '\t', '\b', '\x2', '\x2', '\x1F7', '\x1FA', '\t', '\b', '\x2', '\x2', - '\x1F8', '\x1FA', '\x5', '\x87', '\x44', '\x2', '\x1F9', '\x1F7', '\x3', - '\x2', '\x2', '\x2', '\x1F9', '\x1F8', '\x3', '\x2', '\x2', '\x2', '\x1FA', - '\x1FD', '\x3', '\x2', '\x2', '\x2', '\x1FB', '\x1F9', '\x3', '\x2', '\x2', - '\x2', '\x1FB', '\x1FC', '\x3', '\x2', '\x2', '\x2', '\x1FC', '\x1FF', - '\x3', '\x2', '\x2', '\x2', '\x1FD', '\x1FB', '\x3', '\x2', '\x2', '\x2', - '\x1FE', '\x1F5', '\x3', '\x2', '\x2', '\x2', '\x1FE', '\x1F6', '\x3', - '\x2', '\x2', '\x2', '\x1FF', '\x84', '\x3', '\x2', '\x2', '\x2', '\x200', - '\x201', '\a', '\x42', '\x2', '\x2', '\x201', '\x202', '\x5', '\x83', - '\x42', '\x2', '\x202', '\x86', '\x3', '\x2', '\x2', '\x2', '\x203', '\x204', - '\t', '\t', '\x2', '\x2', '\x204', '\x88', '\x3', '\x2', '\x2', '\x2', - '\x205', '\x206', '\t', '\n', '\x2', '\x2', '\x206', '\x8A', '\x3', '\x2', - '\x2', '\x2', '\x207', '\x208', '\t', '\v', '\x2', '\x2', '\x208', '\x8C', - '\x3', '\x2', '\x2', '\x2', '\x209', '\x20A', '\t', '\f', '\x2', '\x2', - '\x20A', '\x8E', '\x3', '\x2', '\x2', '\x2', '\x20B', '\x20C', '\t', '\r', - '\x2', '\x2', '\x20C', '\x90', '\x3', '\x2', '\x2', '\x2', '\x20D', '\x20E', - '\t', '\xE', '\x2', '\x2', '\x20E', '\x92', '\x3', '\x2', '\x2', '\x2', - '\x20F', '\x210', '\t', '\xF', '\x2', '\x2', '\x210', '\x94', '\x3', '\x2', - '\x2', '\x2', '\x211', '\x212', '\t', '\x10', '\x2', '\x2', '\x212', '\x96', - '\x3', '\x2', '\x2', '\x2', '\x213', '\x214', '\t', '\x11', '\x2', '\x2', - '\x214', '\x98', '\x3', '\x2', '\x2', '\x2', '\x215', '\x216', '\t', '\x12', - '\x2', '\x2', '\x216', '\x9A', '\x3', '\x2', '\x2', '\x2', '\x217', '\x218', - '\t', '\x13', '\x2', '\x2', '\x218', '\x9C', '\x3', '\x2', '\x2', '\x2', - '\x219', '\x21A', '\t', '\x14', '\x2', '\x2', '\x21A', '\x9E', '\x3', - '\x2', '\x2', '\x2', '\x21B', '\x21C', '\t', '\x15', '\x2', '\x2', '\x21C', - '\xA0', '\x3', '\x2', '\x2', '\x2', '\x21D', '\x21E', '\t', '\x16', '\x2', - '\x2', '\x21E', '\xA2', '\x3', '\x2', '\x2', '\x2', '\x21F', '\x220', - '\t', '\x17', '\x2', '\x2', '\x220', '\xA4', '\x3', '\x2', '\x2', '\x2', - '\x221', '\x222', '\t', '\x18', '\x2', '\x2', '\x222', '\xA6', '\x3', - '\x2', '\x2', '\x2', '\x223', '\x224', '\t', '\x19', '\x2', '\x2', '\x224', - '\xA8', '\x3', '\x2', '\x2', '\x2', '\x225', '\x226', '\t', '\x1A', '\x2', - '\x2', '\x226', '\xAA', '\x3', '\x2', '\x2', '\x2', '\x227', '\x228', - '\t', '\x1B', '\x2', '\x2', '\x228', '\xAC', '\x3', '\x2', '\x2', '\x2', - '\x229', '\x22A', '\t', '\x1C', '\x2', '\x2', '\x22A', '\xAE', '\x3', - '\x2', '\x2', '\x2', '\x22B', '\x22C', '\t', '\x1D', '\x2', '\x2', '\x22C', - '\xB0', '\x3', '\x2', '\x2', '\x2', '\x22D', '\x22E', '\t', '\x1E', '\x2', - '\x2', '\x22E', '\xB2', '\x3', '\x2', '\x2', '\x2', '\x22F', '\x230', - '\t', '\x1F', '\x2', '\x2', '\x230', '\xB4', '\x3', '\x2', '\x2', '\x2', - '\x231', '\x232', '\t', ' ', '\x2', '\x2', '\x232', '\xB6', '\x3', '\x2', - '\x2', '\x2', '\x233', '\x234', '\t', '!', '\x2', '\x2', '\x234', '\xB8', - '\x3', '\x2', '\x2', '\x2', '\x235', '\x236', '\t', '\"', '\x2', '\x2', - '\x236', '\xBA', '\x3', '\x2', '\x2', '\x2', '\x237', '\x238', '\t', '#', - '\x2', '\x2', '\x238', '\xBC', '\x3', '\x2', '\x2', '\x2', '\x1A', '\x2', - '\x19A', '\x19F', '\x1A4', '\x1AA', '\x1AD', '\x1B1', '\x1B6', '\x1B8', - '\x1BB', '\x1C1', '\x1C5', '\x1CA', '\x1CC', '\x1CE', '\x1D3', '\x1D5', - '\x1DC', '\x1DE', '\x1E2', '\x1E7', '\x1F9', '\x1FB', '\x1FE', '\x3', - '\b', '\x2', '\x2', + '\x3', '\\', '\x3', ']', '\x3', ']', '\x3', '^', '\x3', '^', '\x3', '_', + '\x3', '_', '\x3', '`', '\x3', '`', '\x3', '\x61', '\x3', '\x61', '\x2', + '\x2', '\x62', '\x3', '\x3', '\x5', '\x4', '\a', '\x5', '\t', '\x6', '\v', + '\a', '\r', '\b', '\xF', '\t', '\x11', '\n', '\x13', '\v', '\x15', '\f', + '\x17', '\r', '\x19', '\xE', '\x1B', '\xF', '\x1D', '\x10', '\x1F', '\x11', + '!', '\x12', '#', '\x13', '%', '\x14', '\'', '\x15', ')', '\x16', '+', + '\x17', '-', '\x18', '/', '\x19', '\x31', '\x1A', '\x33', '\x1B', '\x35', + '\x1C', '\x37', '\x1D', '\x39', '\x1E', ';', '\x1F', '=', ' ', '?', '!', + '\x41', '\"', '\x43', '#', '\x45', '$', 'G', '%', 'I', '&', 'K', '\'', + 'M', '(', 'O', ')', 'Q', '*', 'S', '+', 'U', ',', 'W', '-', 'Y', '.', + '[', '/', ']', '\x30', '_', '\x31', '\x61', '\x32', '\x63', '\x33', '\x65', + '\x34', 'g', '\x35', 'i', '\x36', 'k', '\x37', 'm', '\x38', 'o', '\x39', + 'q', ':', 's', ';', 'u', '<', 'w', '=', 'y', '>', '{', '?', '}', '@', + '\x7F', '\x2', '\x81', '\x2', '\x83', '\x2', '\x85', '\x2', '\x87', '\x2', + '\x89', '\x41', '\x8B', '\x42', '\x8D', '\x2', '\x8F', '\x2', '\x91', + '\x2', '\x93', '\x2', '\x95', '\x2', '\x97', '\x2', '\x99', '\x2', '\x9B', + '\x2', '\x9D', '\x2', '\x9F', '\x2', '\xA1', '\x2', '\xA3', '\x2', '\xA5', + '\x2', '\xA7', '\x2', '\xA9', '\x2', '\xAB', '\x2', '\xAD', '\x2', '\xAF', + '\x2', '\xB1', '\x2', '\xB3', '\x2', '\xB5', '\x2', '\xB7', '\x2', '\xB9', + '\x2', '\xBB', '\x2', '\xBD', '\x2', '\xBF', '\x2', '\xC1', '\x2', '\x3', + '\x2', '$', '\x5', '\x2', '\v', '\f', '\xF', '\xF', '\"', '\"', '\x4', + '\x2', '-', '-', '/', '/', '\n', '\x2', '$', '$', '\x31', '\x31', '^', + '^', '\x64', '\x64', 'h', 'h', 'p', 'p', 't', 't', 'v', 'v', '\x5', '\x2', + '\x32', ';', '\x43', 'H', '\x63', 'h', '\x5', '\x2', '\x2', '!', ')', + ')', '^', '^', '\x5', '\x2', '\x2', '!', '$', '$', '^', '^', '\x5', '\x2', + '\x43', '\\', '\x61', '\x61', '\x63', '|', '\x3', '\x2', '\x32', ';', + '\x4', '\x2', '\x43', '\x43', '\x63', '\x63', '\x4', '\x2', '\x44', '\x44', + '\x64', '\x64', '\x4', '\x2', '\x45', '\x45', '\x65', '\x65', '\x4', '\x2', + '\x46', '\x46', '\x66', '\x66', '\x4', '\x2', 'G', 'G', 'g', 'g', '\x4', + '\x2', 'H', 'H', 'h', 'h', '\x4', '\x2', 'I', 'I', 'i', 'i', '\x4', '\x2', + 'J', 'J', 'j', 'j', '\x4', '\x2', 'K', 'K', 'k', 'k', '\x4', '\x2', 'L', + 'L', 'l', 'l', '\x4', '\x2', 'M', 'M', 'm', 'm', '\x4', '\x2', 'N', 'N', + 'n', 'n', '\x4', '\x2', 'O', 'O', 'o', 'o', '\x4', '\x2', 'P', 'P', 'p', + 'p', '\x4', '\x2', 'Q', 'Q', 'q', 'q', '\x4', '\x2', 'R', 'R', 'r', 'r', + '\x4', '\x2', 'S', 'S', 's', 's', '\x4', '\x2', 'T', 'T', 't', 't', '\x4', + '\x2', 'U', 'U', 'u', 'u', '\x4', '\x2', 'V', 'V', 'v', 'v', '\x4', '\x2', + 'W', 'W', 'w', 'w', '\x4', '\x2', 'X', 'X', 'x', 'x', '\x4', '\x2', 'Y', + 'Y', 'y', 'y', '\x4', '\x2', 'Z', 'Z', 'z', 'z', '\x4', '\x2', '[', '[', + '{', '{', '\x4', '\x2', '\\', '\\', '|', '|', '\x2', '\x244', '\x2', '\x3', + '\x3', '\x2', '\x2', '\x2', '\x2', '\x5', '\x3', '\x2', '\x2', '\x2', + '\x2', '\a', '\x3', '\x2', '\x2', '\x2', '\x2', '\t', '\x3', '\x2', '\x2', + '\x2', '\x2', '\v', '\x3', '\x2', '\x2', '\x2', '\x2', '\r', '\x3', '\x2', + '\x2', '\x2', '\x2', '\xF', '\x3', '\x2', '\x2', '\x2', '\x2', '\x11', + '\x3', '\x2', '\x2', '\x2', '\x2', '\x13', '\x3', '\x2', '\x2', '\x2', + '\x2', '\x15', '\x3', '\x2', '\x2', '\x2', '\x2', '\x17', '\x3', '\x2', + '\x2', '\x2', '\x2', '\x19', '\x3', '\x2', '\x2', '\x2', '\x2', '\x1B', + '\x3', '\x2', '\x2', '\x2', '\x2', '\x1D', '\x3', '\x2', '\x2', '\x2', + '\x2', '\x1F', '\x3', '\x2', '\x2', '\x2', '\x2', '!', '\x3', '\x2', '\x2', + '\x2', '\x2', '#', '\x3', '\x2', '\x2', '\x2', '\x2', '%', '\x3', '\x2', + '\x2', '\x2', '\x2', '\'', '\x3', '\x2', '\x2', '\x2', '\x2', ')', '\x3', + '\x2', '\x2', '\x2', '\x2', '+', '\x3', '\x2', '\x2', '\x2', '\x2', '-', + '\x3', '\x2', '\x2', '\x2', '\x2', '/', '\x3', '\x2', '\x2', '\x2', '\x2', + '\x31', '\x3', '\x2', '\x2', '\x2', '\x2', '\x33', '\x3', '\x2', '\x2', + '\x2', '\x2', '\x35', '\x3', '\x2', '\x2', '\x2', '\x2', '\x37', '\x3', + '\x2', '\x2', '\x2', '\x2', '\x39', '\x3', '\x2', '\x2', '\x2', '\x2', + ';', '\x3', '\x2', '\x2', '\x2', '\x2', '=', '\x3', '\x2', '\x2', '\x2', + '\x2', '?', '\x3', '\x2', '\x2', '\x2', '\x2', '\x41', '\x3', '\x2', '\x2', + '\x2', '\x2', '\x43', '\x3', '\x2', '\x2', '\x2', '\x2', '\x45', '\x3', + '\x2', '\x2', '\x2', '\x2', 'G', '\x3', '\x2', '\x2', '\x2', '\x2', 'I', + '\x3', '\x2', '\x2', '\x2', '\x2', 'K', '\x3', '\x2', '\x2', '\x2', '\x2', + 'M', '\x3', '\x2', '\x2', '\x2', '\x2', 'O', '\x3', '\x2', '\x2', '\x2', + '\x2', 'Q', '\x3', '\x2', '\x2', '\x2', '\x2', 'S', '\x3', '\x2', '\x2', + '\x2', '\x2', 'U', '\x3', '\x2', '\x2', '\x2', '\x2', 'W', '\x3', '\x2', + '\x2', '\x2', '\x2', 'Y', '\x3', '\x2', '\x2', '\x2', '\x2', '[', '\x3', + '\x2', '\x2', '\x2', '\x2', ']', '\x3', '\x2', '\x2', '\x2', '\x2', '_', + '\x3', '\x2', '\x2', '\x2', '\x2', '\x61', '\x3', '\x2', '\x2', '\x2', + '\x2', '\x63', '\x3', '\x2', '\x2', '\x2', '\x2', '\x65', '\x3', '\x2', + '\x2', '\x2', '\x2', 'g', '\x3', '\x2', '\x2', '\x2', '\x2', 'i', '\x3', + '\x2', '\x2', '\x2', '\x2', 'k', '\x3', '\x2', '\x2', '\x2', '\x2', 'm', + '\x3', '\x2', '\x2', '\x2', '\x2', 'o', '\x3', '\x2', '\x2', '\x2', '\x2', + 'q', '\x3', '\x2', '\x2', '\x2', '\x2', 's', '\x3', '\x2', '\x2', '\x2', + '\x2', 'u', '\x3', '\x2', '\x2', '\x2', '\x2', 'w', '\x3', '\x2', '\x2', + '\x2', '\x2', 'y', '\x3', '\x2', '\x2', '\x2', '\x2', '{', '\x3', '\x2', + '\x2', '\x2', '\x2', '}', '\x3', '\x2', '\x2', '\x2', '\x2', '\x89', '\x3', + '\x2', '\x2', '\x2', '\x2', '\x8B', '\x3', '\x2', '\x2', '\x2', '\x3', + '\xC3', '\x3', '\x2', '\x2', '\x2', '\x5', '\xC5', '\x3', '\x2', '\x2', + '\x2', '\a', '\xC7', '\x3', '\x2', '\x2', '\x2', '\t', '\xC9', '\x3', + '\x2', '\x2', '\x2', '\v', '\xCB', '\x3', '\x2', '\x2', '\x2', '\r', '\xCD', + '\x3', '\x2', '\x2', '\x2', '\xF', '\xCF', '\x3', '\x2', '\x2', '\x2', + '\x11', '\xD1', '\x3', '\x2', '\x2', '\x2', '\x13', '\xD3', '\x3', '\x2', + '\x2', '\x2', '\x15', '\xD5', '\x3', '\x2', '\x2', '\x2', '\x17', '\xD8', + '\x3', '\x2', '\x2', '\x2', '\x19', '\xDA', '\x3', '\x2', '\x2', '\x2', + '\x1B', '\xDC', '\x3', '\x2', '\x2', '\x2', '\x1D', '\xDE', '\x3', '\x2', + '\x2', '\x2', '\x1F', '\xE0', '\x3', '\x2', '\x2', '\x2', '!', '\xE2', + '\x3', '\x2', '\x2', '\x2', '#', '\xE4', '\x3', '\x2', '\x2', '\x2', '%', + '\xE7', '\x3', '\x2', '\x2', '\x2', '\'', '\xEA', '\x3', '\x2', '\x2', + '\x2', ')', '\xEC', '\x3', '\x2', '\x2', '\x2', '+', '\xEF', '\x3', '\x2', + '\x2', '\x2', '-', '\xF1', '\x3', '\x2', '\x2', '\x2', '/', '\xF3', '\x3', + '\x2', '\x2', '\x2', '\x31', '\xF5', '\x3', '\x2', '\x2', '\x2', '\x33', + '\xF8', '\x3', '\x2', '\x2', '\x2', '\x35', '\xFA', '\x3', '\x2', '\x2', + '\x2', '\x37', '\xFC', '\x3', '\x2', '\x2', '\x2', '\x39', '\xFE', '\x3', + '\x2', '\x2', '\x2', ';', '\x102', '\x3', '\x2', '\x2', '\x2', '=', '\x106', + '\x3', '\x2', '\x2', '\x2', '?', '\x10C', '\x3', '\x2', '\x2', '\x2', + '\x41', '\x10F', '\x3', '\x2', '\x2', '\x2', '\x43', '\x113', '\x3', '\x2', + '\x2', '\x2', '\x45', '\x11B', '\x3', '\x2', '\x2', '\x2', 'G', '\x11E', + '\x3', '\x2', '\x2', '\x2', 'I', '\x123', '\x3', '\x2', '\x2', '\x2', + 'K', '\x12C', '\x3', '\x2', '\x2', '\x2', 'M', '\x133', '\x3', '\x2', + '\x2', '\x2', 'O', '\x13A', '\x3', '\x2', '\x2', '\x2', 'Q', '\x140', + '\x3', '\x2', '\x2', '\x2', 'S', '\x145', '\x3', '\x2', '\x2', '\x2', + 'U', '\x14B', '\x3', '\x2', '\x2', '\x2', 'W', '\x14E', '\x3', '\x2', + '\x2', '\x2', 'Y', '\x153', '\x3', '\x2', '\x2', '\x2', '[', '\x158', + '\x3', '\x2', '\x2', '\x2', ']', '\x15D', '\x3', '\x2', '\x2', '\x2', + '_', '\x163', '\x3', '\x2', '\x2', '\x2', '\x61', '\x167', '\x3', '\x2', + '\x2', '\x2', '\x63', '\x16C', '\x3', '\x2', '\x2', '\x2', '\x65', '\x173', + '\x3', '\x2', '\x2', '\x2', 'g', '\x176', '\x3', '\x2', '\x2', '\x2', + 'i', '\x17C', '\x3', '\x2', '\x2', '\x2', 'k', '\x182', '\x3', '\x2', + '\x2', '\x2', 'm', '\x189', '\x3', '\x2', '\x2', '\x2', 'o', '\x18D', + '\x3', '\x2', '\x2', '\x2', 'q', '\x192', '\x3', '\x2', '\x2', '\x2', + 's', '\x196', '\x3', '\x2', '\x2', '\x2', 'u', '\x1A0', '\x3', '\x2', + '\x2', '\x2', 'w', '\x1A6', '\x3', '\x2', '\x2', '\x2', 'y', '\x1AD', + '\x3', '\x2', '\x2', '\x2', '{', '\x1E3', '\x3', '\x2', '\x2', '\x2', + '}', '\x1F7', '\x3', '\x2', '\x2', '\x2', '\x7F', '\x1F9', '\x3', '\x2', + '\x2', '\x2', '\x81', '\x1FE', '\x3', '\x2', '\x2', '\x2', '\x83', '\x204', + '\x3', '\x2', '\x2', '\x2', '\x85', '\x206', '\x3', '\x2', '\x2', '\x2', + '\x87', '\x208', '\x3', '\x2', '\x2', '\x2', '\x89', '\x213', '\x3', '\x2', + '\x2', '\x2', '\x8B', '\x215', '\x3', '\x2', '\x2', '\x2', '\x8D', '\x218', + '\x3', '\x2', '\x2', '\x2', '\x8F', '\x21A', '\x3', '\x2', '\x2', '\x2', + '\x91', '\x21C', '\x3', '\x2', '\x2', '\x2', '\x93', '\x21E', '\x3', '\x2', + '\x2', '\x2', '\x95', '\x220', '\x3', '\x2', '\x2', '\x2', '\x97', '\x222', + '\x3', '\x2', '\x2', '\x2', '\x99', '\x224', '\x3', '\x2', '\x2', '\x2', + '\x9B', '\x226', '\x3', '\x2', '\x2', '\x2', '\x9D', '\x228', '\x3', '\x2', + '\x2', '\x2', '\x9F', '\x22A', '\x3', '\x2', '\x2', '\x2', '\xA1', '\x22C', + '\x3', '\x2', '\x2', '\x2', '\xA3', '\x22E', '\x3', '\x2', '\x2', '\x2', + '\xA5', '\x230', '\x3', '\x2', '\x2', '\x2', '\xA7', '\x232', '\x3', '\x2', + '\x2', '\x2', '\xA9', '\x234', '\x3', '\x2', '\x2', '\x2', '\xAB', '\x236', + '\x3', '\x2', '\x2', '\x2', '\xAD', '\x238', '\x3', '\x2', '\x2', '\x2', + '\xAF', '\x23A', '\x3', '\x2', '\x2', '\x2', '\xB1', '\x23C', '\x3', '\x2', + '\x2', '\x2', '\xB3', '\x23E', '\x3', '\x2', '\x2', '\x2', '\xB5', '\x240', + '\x3', '\x2', '\x2', '\x2', '\xB7', '\x242', '\x3', '\x2', '\x2', '\x2', + '\xB9', '\x244', '\x3', '\x2', '\x2', '\x2', '\xBB', '\x246', '\x3', '\x2', + '\x2', '\x2', '\xBD', '\x248', '\x3', '\x2', '\x2', '\x2', '\xBF', '\x24A', + '\x3', '\x2', '\x2', '\x2', '\xC1', '\x24C', '\x3', '\x2', '\x2', '\x2', + '\xC3', '\xC4', '\a', ',', '\x2', '\x2', '\xC4', '\x4', '\x3', '\x2', + '\x2', '\x2', '\xC5', '\xC6', '\a', '.', '\x2', '\x2', '\xC6', '\x6', + '\x3', '\x2', '\x2', '\x2', '\xC7', '\xC8', '\a', '*', '\x2', '\x2', '\xC8', + '\b', '\x3', '\x2', '\x2', '\x2', '\xC9', '\xCA', '\a', '+', '\x2', '\x2', + '\xCA', '\n', '\x3', '\x2', '\x2', '\x2', '\xCB', '\xCC', '\a', '\x30', + '\x2', '\x2', '\xCC', '\f', '\x3', '\x2', '\x2', '\x2', '\xCD', '\xCE', + '\a', ']', '\x2', '\x2', '\xCE', '\xE', '\x3', '\x2', '\x2', '\x2', '\xCF', + '\xD0', '\a', '_', '\x2', '\x2', '\xD0', '\x10', '\x3', '\x2', '\x2', + '\x2', '\xD1', '\xD2', '\a', '\x41', '\x2', '\x2', '\xD2', '\x12', '\x3', + '\x2', '\x2', '\x2', '\xD3', '\xD4', '\a', '<', '\x2', '\x2', '\xD4', + '\x14', '\x3', '\x2', '\x2', '\x2', '\xD5', '\xD6', '\a', '\x41', '\x2', + '\x2', '\xD6', '\xD7', '\a', '\x41', '\x2', '\x2', '\xD7', '\x16', '\x3', + '\x2', '\x2', '\x2', '\xD8', '\xD9', '\a', '\x31', '\x2', '\x2', '\xD9', + '\x18', '\x3', '\x2', '\x2', '\x2', '\xDA', '\xDB', '\a', '\'', '\x2', + '\x2', '\xDB', '\x1A', '\x3', '\x2', '\x2', '\x2', '\xDC', '\xDD', '\a', + '-', '\x2', '\x2', '\xDD', '\x1C', '\x3', '\x2', '\x2', '\x2', '\xDE', + '\xDF', '\a', '/', '\x2', '\x2', '\xDF', '\x1E', '\x3', '\x2', '\x2', + '\x2', '\xE0', '\xE1', '\a', '>', '\x2', '\x2', '\xE1', ' ', '\x3', '\x2', + '\x2', '\x2', '\xE2', '\xE3', '\a', '@', '\x2', '\x2', '\xE3', '\"', '\x3', + '\x2', '\x2', '\x2', '\xE4', '\xE5', '\a', '@', '\x2', '\x2', '\xE5', + '\xE6', '\a', '?', '\x2', '\x2', '\xE6', '$', '\x3', '\x2', '\x2', '\x2', + '\xE7', '\xE8', '\a', '>', '\x2', '\x2', '\xE8', '\xE9', '\a', '?', '\x2', + '\x2', '\xE9', '&', '\x3', '\x2', '\x2', '\x2', '\xEA', '\xEB', '\a', + '?', '\x2', '\x2', '\xEB', '(', '\x3', '\x2', '\x2', '\x2', '\xEC', '\xED', + '\a', '#', '\x2', '\x2', '\xED', '\xEE', '\a', '?', '\x2', '\x2', '\xEE', + '*', '\x3', '\x2', '\x2', '\x2', '\xEF', '\xF0', '\a', '(', '\x2', '\x2', + '\xF0', ',', '\x3', '\x2', '\x2', '\x2', '\xF1', '\xF2', '\a', '`', '\x2', + '\x2', '\xF2', '.', '\x3', '\x2', '\x2', '\x2', '\xF3', '\xF4', '\a', + '~', '\x2', '\x2', '\xF4', '\x30', '\x3', '\x2', '\x2', '\x2', '\xF5', + '\xF6', '\a', '~', '\x2', '\x2', '\xF6', '\xF7', '\a', '~', '\x2', '\x2', + '\xF7', '\x32', '\x3', '\x2', '\x2', '\x2', '\xF8', '\xF9', '\a', '\x80', + '\x2', '\x2', '\xF9', '\x34', '\x3', '\x2', '\x2', '\x2', '\xFA', '\xFB', + '\a', '}', '\x2', '\x2', '\xFB', '\x36', '\x3', '\x2', '\x2', '\x2', '\xFC', + '\xFD', '\a', '\x7F', '\x2', '\x2', '\xFD', '\x38', '\x3', '\x2', '\x2', + '\x2', '\xFE', '\xFF', '\x5', '\x8F', 'H', '\x2', '\xFF', '\x100', '\x5', + '\xA5', 'S', '\x2', '\x100', '\x101', '\x5', '\xA5', 'S', '\x2', '\x101', + ':', '\x3', '\x2', '\x2', '\x2', '\x102', '\x103', '\x5', '\x8F', 'H', + '\x2', '\x103', '\x104', '\x5', '\xA9', 'U', '\x2', '\x104', '\x105', + '\x5', '\x95', 'K', '\x2', '\x105', '<', '\x3', '\x2', '\x2', '\x2', '\x106', + '\x107', '\x5', '\x8F', 'H', '\x2', '\x107', '\x108', '\x5', '\xB1', 'Y', + '\x2', '\x108', '\x109', '\x5', '\xB1', 'Y', '\x2', '\x109', '\x10A', + '\x5', '\x8F', 'H', '\x2', '\x10A', '\x10B', '\x5', '\xBF', '`', '\x2', + '\x10B', '>', '\x3', '\x2', '\x2', '\x2', '\x10C', '\x10D', '\x5', '\x8F', + 'H', '\x2', '\x10D', '\x10E', '\x5', '\xB3', 'Z', '\x2', '\x10E', '@', + '\x3', '\x2', '\x2', '\x2', '\x10F', '\x110', '\x5', '\x8F', 'H', '\x2', + '\x110', '\x111', '\x5', '\xB3', 'Z', '\x2', '\x111', '\x112', '\x5', + '\x93', 'J', '\x2', '\x112', '\x42', '\x3', '\x2', '\x2', '\x2', '\x113', + '\x114', '\x5', '\x91', 'I', '\x2', '\x114', '\x115', '\x5', '\x97', 'L', + '\x2', '\x115', '\x116', '\x5', '\xB5', '[', '\x2', '\x116', '\x117', + '\x5', '\xBB', '^', '\x2', '\x117', '\x118', '\x5', '\x97', 'L', '\x2', + '\x118', '\x119', '\x5', '\x97', 'L', '\x2', '\x119', '\x11A', '\x5', + '\xA9', 'U', '\x2', '\x11A', '\x44', '\x3', '\x2', '\x2', '\x2', '\x11B', + '\x11C', '\x5', '\x91', 'I', '\x2', '\x11C', '\x11D', '\x5', '\xBF', '`', + '\x2', '\x11D', '\x46', '\x3', '\x2', '\x2', '\x2', '\x11E', '\x11F', + '\x5', '\x95', 'K', '\x2', '\x11F', '\x120', '\x5', '\x97', 'L', '\x2', + '\x120', '\x121', '\x5', '\xB3', 'Z', '\x2', '\x121', '\x122', '\x5', + '\x93', 'J', '\x2', '\x122', 'H', '\x3', '\x2', '\x2', '\x2', '\x123', + '\x124', '\x5', '\x95', 'K', '\x2', '\x124', '\x125', '\x5', '\x9F', 'P', + '\x2', '\x125', '\x126', '\x5', '\xB3', 'Z', '\x2', '\x126', '\x127', + '\x5', '\xB5', '[', '\x2', '\x127', '\x128', '\x5', '\x9F', 'P', '\x2', + '\x128', '\x129', '\x5', '\xA9', 'U', '\x2', '\x129', '\x12A', '\x5', + '\x93', 'J', '\x2', '\x12A', '\x12B', '\x5', '\xB5', '[', '\x2', '\x12B', + 'J', '\x3', '\x2', '\x2', '\x2', '\x12C', '\x12D', '\x5', '\x97', 'L', + '\x2', '\x12D', '\x12E', '\x5', '\xB3', 'Z', '\x2', '\x12E', '\x12F', + '\x5', '\x93', 'J', '\x2', '\x12F', '\x130', '\x5', '\x8F', 'H', '\x2', + '\x130', '\x131', '\x5', '\xAD', 'W', '\x2', '\x131', '\x132', '\x5', + '\x97', 'L', '\x2', '\x132', 'L', '\x3', '\x2', '\x2', '\x2', '\x133', + '\x134', '\x5', '\x97', 'L', '\x2', '\x134', '\x135', '\x5', '\xBD', '_', + '\x2', '\x135', '\x136', '\x5', '\x9F', 'P', '\x2', '\x136', '\x137', + '\x5', '\xB3', 'Z', '\x2', '\x137', '\x138', '\x5', '\xB5', '[', '\x2', + '\x138', '\x139', '\x5', '\xB3', 'Z', '\x2', '\x139', 'N', '\x3', '\x2', + '\x2', '\x2', '\x13A', '\x13B', '\a', 'h', '\x2', '\x2', '\x13B', '\x13C', + '\a', '\x63', '\x2', '\x2', '\x13C', '\x13D', '\a', 'n', '\x2', '\x2', + '\x13D', '\x13E', '\a', 'u', '\x2', '\x2', '\x13E', '\x13F', '\a', 'g', + '\x2', '\x2', '\x13F', 'P', '\x3', '\x2', '\x2', '\x2', '\x140', '\x141', + '\x5', '\x99', 'M', '\x2', '\x141', '\x142', '\x5', '\xB1', 'Y', '\x2', + '\x142', '\x143', '\x5', '\xAB', 'V', '\x2', '\x143', '\x144', '\x5', + '\xA7', 'T', '\x2', '\x144', 'R', '\x3', '\x2', '\x2', '\x2', '\x145', + '\x146', '\x5', '\x9B', 'N', '\x2', '\x146', '\x147', '\x5', '\xB1', 'Y', + '\x2', '\x147', '\x148', '\x5', '\xAB', 'V', '\x2', '\x148', '\x149', + '\x5', '\xB7', '\\', '\x2', '\x149', '\x14A', '\x5', '\xAD', 'W', '\x2', + '\x14A', 'T', '\x3', '\x2', '\x2', '\x2', '\x14B', '\x14C', '\x5', '\x9F', + 'P', '\x2', '\x14C', '\x14D', '\x5', '\xA9', 'U', '\x2', '\x14D', 'V', + '\x3', '\x2', '\x2', '\x2', '\x14E', '\x14F', '\x5', '\xA1', 'Q', '\x2', + '\x14F', '\x150', '\x5', '\xAB', 'V', '\x2', '\x150', '\x151', '\x5', + '\x9F', 'P', '\x2', '\x151', '\x152', '\x5', '\xA9', 'U', '\x2', '\x152', + 'X', '\x3', '\x2', '\x2', '\x2', '\x153', '\x154', '\x5', '\xA5', 'S', + '\x2', '\x154', '\x155', '\x5', '\x97', 'L', '\x2', '\x155', '\x156', + '\x5', '\x99', 'M', '\x2', '\x156', '\x157', '\x5', '\xB5', '[', '\x2', + '\x157', 'Z', '\x3', '\x2', '\x2', '\x2', '\x158', '\x159', '\x5', '\xA5', + 'S', '\x2', '\x159', '\x15A', '\x5', '\x9F', 'P', '\x2', '\x15A', '\x15B', + '\x5', '\xA3', 'R', '\x2', '\x15B', '\x15C', '\x5', '\x97', 'L', '\x2', + '\x15C', '\\', '\x3', '\x2', '\x2', '\x2', '\x15D', '\x15E', '\x5', '\xA5', + 'S', '\x2', '\x15E', '\x15F', '\x5', '\x9F', 'P', '\x2', '\x15F', '\x160', + '\x5', '\xA7', 'T', '\x2', '\x160', '\x161', '\x5', '\x9F', 'P', '\x2', + '\x161', '\x162', '\x5', '\xB5', '[', '\x2', '\x162', '^', '\x3', '\x2', + '\x2', '\x2', '\x163', '\x164', '\x5', '\xA9', 'U', '\x2', '\x164', '\x165', + '\x5', '\xAB', 'V', '\x2', '\x165', '\x166', '\x5', '\xB5', '[', '\x2', + '\x166', '`', '\x3', '\x2', '\x2', '\x2', '\x167', '\x168', '\a', 'p', + '\x2', '\x2', '\x168', '\x169', '\a', 'w', '\x2', '\x2', '\x169', '\x16A', + '\a', 'n', '\x2', '\x2', '\x16A', '\x16B', '\a', 'n', '\x2', '\x2', '\x16B', + '\x62', '\x3', '\x2', '\x2', '\x2', '\x16C', '\x16D', '\x5', '\xAB', 'V', + '\x2', '\x16D', '\x16E', '\x5', '\x99', 'M', '\x2', '\x16E', '\x16F', + '\x5', '\x99', 'M', '\x2', '\x16F', '\x170', '\x5', '\xB3', 'Z', '\x2', + '\x170', '\x171', '\x5', '\x97', 'L', '\x2', '\x171', '\x172', '\x5', + '\xB5', '[', '\x2', '\x172', '\x64', '\x3', '\x2', '\x2', '\x2', '\x173', + '\x174', '\x5', '\xAB', 'V', '\x2', '\x174', '\x175', '\x5', '\xB1', 'Y', + '\x2', '\x175', '\x66', '\x3', '\x2', '\x2', '\x2', '\x176', '\x177', + '\x5', '\xAB', 'V', '\x2', '\x177', '\x178', '\x5', '\xB1', 'Y', '\x2', + '\x178', '\x179', '\x5', '\x95', 'K', '\x2', '\x179', '\x17A', '\x5', + '\x97', 'L', '\x2', '\x17A', '\x17B', '\x5', '\xB1', 'Y', '\x2', '\x17B', + 'h', '\x3', '\x2', '\x2', '\x2', '\x17C', '\x17D', '\x5', '\xB1', 'Y', + '\x2', '\x17D', '\x17E', '\x5', '\x9F', 'P', '\x2', '\x17E', '\x17F', + '\x5', '\x9B', 'N', '\x2', '\x17F', '\x180', '\x5', '\x9D', 'O', '\x2', + '\x180', '\x181', '\x5', '\xB5', '[', '\x2', '\x181', 'j', '\x3', '\x2', + '\x2', '\x2', '\x182', '\x183', '\x5', '\xB3', 'Z', '\x2', '\x183', '\x184', + '\x5', '\x97', 'L', '\x2', '\x184', '\x185', '\x5', '\xA5', 'S', '\x2', + '\x185', '\x186', '\x5', '\x97', 'L', '\x2', '\x186', '\x187', '\x5', + '\x93', 'J', '\x2', '\x187', '\x188', '\x5', '\xB5', '[', '\x2', '\x188', + 'l', '\x3', '\x2', '\x2', '\x2', '\x189', '\x18A', '\x5', '\xB5', '[', + '\x2', '\x18A', '\x18B', '\x5', '\xAB', 'V', '\x2', '\x18B', '\x18C', + '\x5', '\xAD', 'W', '\x2', '\x18C', 'n', '\x3', '\x2', '\x2', '\x2', '\x18D', + '\x18E', '\a', 'v', '\x2', '\x2', '\x18E', '\x18F', '\a', 't', '\x2', + '\x2', '\x18F', '\x190', '\a', 'w', '\x2', '\x2', '\x190', '\x191', '\a', + 'g', '\x2', '\x2', '\x191', 'p', '\x3', '\x2', '\x2', '\x2', '\x192', + '\x193', '\a', 'w', '\x2', '\x2', '\x193', '\x194', '\a', '\x66', '\x2', + '\x2', '\x194', '\x195', '\a', 'h', '\x2', '\x2', '\x195', 'r', '\x3', + '\x2', '\x2', '\x2', '\x196', '\x197', '\a', 'w', '\x2', '\x2', '\x197', + '\x198', '\a', 'p', '\x2', '\x2', '\x198', '\x199', '\a', '\x66', '\x2', + '\x2', '\x199', '\x19A', '\a', 'g', '\x2', '\x2', '\x19A', '\x19B', '\a', + 'h', '\x2', '\x2', '\x19B', '\x19C', '\a', 'k', '\x2', '\x2', '\x19C', + '\x19D', '\a', 'p', '\x2', '\x2', '\x19D', '\x19E', '\a', 'g', '\x2', + '\x2', '\x19E', '\x19F', '\a', '\x66', '\x2', '\x2', '\x19F', 't', '\x3', + '\x2', '\x2', '\x2', '\x1A0', '\x1A1', '\x5', '\xB9', ']', '\x2', '\x1A1', + '\x1A2', '\x5', '\x8F', 'H', '\x2', '\x1A2', '\x1A3', '\x5', '\xA5', 'S', + '\x2', '\x1A3', '\x1A4', '\x5', '\xB7', '\\', '\x2', '\x1A4', '\x1A5', + '\x5', '\x97', 'L', '\x2', '\x1A5', 'v', '\x3', '\x2', '\x2', '\x2', '\x1A6', + '\x1A7', '\x5', '\xBB', '^', '\x2', '\x1A7', '\x1A8', '\x5', '\x9D', 'O', + '\x2', '\x1A8', '\x1A9', '\x5', '\x97', 'L', '\x2', '\x1A9', '\x1AA', + '\x5', '\xB1', 'Y', '\x2', '\x1AA', '\x1AB', '\x5', '\x97', 'L', '\x2', + '\x1AB', 'x', '\x3', '\x2', '\x2', '\x2', '\x1AC', '\x1AE', '\t', '\x2', + '\x2', '\x2', '\x1AD', '\x1AC', '\x3', '\x2', '\x2', '\x2', '\x1AE', '\x1AF', + '\x3', '\x2', '\x2', '\x2', '\x1AF', '\x1AD', '\x3', '\x2', '\x2', '\x2', + '\x1AF', '\x1B0', '\x3', '\x2', '\x2', '\x2', '\x1B0', '\x1B1', '\x3', + '\x2', '\x2', '\x2', '\x1B1', '\x1B2', '\b', '=', '\x2', '\x2', '\x1B2', + 'z', '\x3', '\x2', '\x2', '\x2', '\x1B3', '\x1B5', '\t', '\x3', '\x2', + '\x2', '\x1B4', '\x1B3', '\x3', '\x2', '\x2', '\x2', '\x1B4', '\x1B5', + '\x3', '\x2', '\x2', '\x2', '\x1B5', '\x1B7', '\x3', '\x2', '\x2', '\x2', + '\x1B6', '\x1B8', '\x5', '\x8D', 'G', '\x2', '\x1B7', '\x1B6', '\x3', + '\x2', '\x2', '\x2', '\x1B8', '\x1B9', '\x3', '\x2', '\x2', '\x2', '\x1B9', + '\x1B7', '\x3', '\x2', '\x2', '\x2', '\x1B9', '\x1BA', '\x3', '\x2', '\x2', + '\x2', '\x1BA', '\x1C2', '\x3', '\x2', '\x2', '\x2', '\x1BB', '\x1BF', + '\a', '\x30', '\x2', '\x2', '\x1BC', '\x1BE', '\x5', '\x8D', 'G', '\x2', + '\x1BD', '\x1BC', '\x3', '\x2', '\x2', '\x2', '\x1BE', '\x1C1', '\x3', + '\x2', '\x2', '\x2', '\x1BF', '\x1BD', '\x3', '\x2', '\x2', '\x2', '\x1BF', + '\x1C0', '\x3', '\x2', '\x2', '\x2', '\x1C0', '\x1C3', '\x3', '\x2', '\x2', + '\x2', '\x1C1', '\x1BF', '\x3', '\x2', '\x2', '\x2', '\x1C2', '\x1BB', + '\x3', '\x2', '\x2', '\x2', '\x1C2', '\x1C3', '\x3', '\x2', '\x2', '\x2', + '\x1C3', '\x1CD', '\x3', '\x2', '\x2', '\x2', '\x1C4', '\x1C6', '\x5', + '\x97', 'L', '\x2', '\x1C5', '\x1C7', '\t', '\x3', '\x2', '\x2', '\x1C6', + '\x1C5', '\x3', '\x2', '\x2', '\x2', '\x1C6', '\x1C7', '\x3', '\x2', '\x2', + '\x2', '\x1C7', '\x1C9', '\x3', '\x2', '\x2', '\x2', '\x1C8', '\x1CA', + '\x5', '\x8D', 'G', '\x2', '\x1C9', '\x1C8', '\x3', '\x2', '\x2', '\x2', + '\x1CA', '\x1CB', '\x3', '\x2', '\x2', '\x2', '\x1CB', '\x1C9', '\x3', + '\x2', '\x2', '\x2', '\x1CB', '\x1CC', '\x3', '\x2', '\x2', '\x2', '\x1CC', + '\x1CE', '\x3', '\x2', '\x2', '\x2', '\x1CD', '\x1C4', '\x3', '\x2', '\x2', + '\x2', '\x1CD', '\x1CE', '\x3', '\x2', '\x2', '\x2', '\x1CE', '\x1E4', + '\x3', '\x2', '\x2', '\x2', '\x1CF', '\x1D1', '\t', '\x3', '\x2', '\x2', + '\x1D0', '\x1CF', '\x3', '\x2', '\x2', '\x2', '\x1D0', '\x1D1', '\x3', + '\x2', '\x2', '\x2', '\x1D1', '\x1D2', '\x3', '\x2', '\x2', '\x2', '\x1D2', + '\x1D4', '\a', '\x30', '\x2', '\x2', '\x1D3', '\x1D5', '\x5', '\x8D', + 'G', '\x2', '\x1D4', '\x1D3', '\x3', '\x2', '\x2', '\x2', '\x1D5', '\x1D6', + '\x3', '\x2', '\x2', '\x2', '\x1D6', '\x1D4', '\x3', '\x2', '\x2', '\x2', + '\x1D6', '\x1D7', '\x3', '\x2', '\x2', '\x2', '\x1D7', '\x1E1', '\x3', + '\x2', '\x2', '\x2', '\x1D8', '\x1DA', '\x5', '\x97', 'L', '\x2', '\x1D9', + '\x1DB', '\t', '\x3', '\x2', '\x2', '\x1DA', '\x1D9', '\x3', '\x2', '\x2', + '\x2', '\x1DA', '\x1DB', '\x3', '\x2', '\x2', '\x2', '\x1DB', '\x1DD', + '\x3', '\x2', '\x2', '\x2', '\x1DC', '\x1DE', '\x5', '\x8D', 'G', '\x2', + '\x1DD', '\x1DC', '\x3', '\x2', '\x2', '\x2', '\x1DE', '\x1DF', '\x3', + '\x2', '\x2', '\x2', '\x1DF', '\x1DD', '\x3', '\x2', '\x2', '\x2', '\x1DF', + '\x1E0', '\x3', '\x2', '\x2', '\x2', '\x1E0', '\x1E2', '\x3', '\x2', '\x2', + '\x2', '\x1E1', '\x1D8', '\x3', '\x2', '\x2', '\x2', '\x1E1', '\x1E2', + '\x3', '\x2', '\x2', '\x2', '\x1E2', '\x1E4', '\x3', '\x2', '\x2', '\x2', + '\x1E3', '\x1B4', '\x3', '\x2', '\x2', '\x2', '\x1E3', '\x1D0', '\x3', + '\x2', '\x2', '\x2', '\x1E4', '|', '\x3', '\x2', '\x2', '\x2', '\x1E5', + '\x1EA', '\a', '$', '\x2', '\x2', '\x1E6', '\x1E9', '\x5', '\x7F', '@', + '\x2', '\x1E7', '\x1E9', '\x5', '\x87', '\x44', '\x2', '\x1E8', '\x1E6', + '\x3', '\x2', '\x2', '\x2', '\x1E8', '\x1E7', '\x3', '\x2', '\x2', '\x2', + '\x1E9', '\x1EC', '\x3', '\x2', '\x2', '\x2', '\x1EA', '\x1E8', '\x3', + '\x2', '\x2', '\x2', '\x1EA', '\x1EB', '\x3', '\x2', '\x2', '\x2', '\x1EB', + '\x1ED', '\x3', '\x2', '\x2', '\x2', '\x1EC', '\x1EA', '\x3', '\x2', '\x2', + '\x2', '\x1ED', '\x1F8', '\a', '$', '\x2', '\x2', '\x1EE', '\x1F3', '\a', + ')', '\x2', '\x2', '\x1EF', '\x1F2', '\x5', '\x7F', '@', '\x2', '\x1F0', + '\x1F2', '\x5', '\x85', '\x43', '\x2', '\x1F1', '\x1EF', '\x3', '\x2', + '\x2', '\x2', '\x1F1', '\x1F0', '\x3', '\x2', '\x2', '\x2', '\x1F2', '\x1F5', + '\x3', '\x2', '\x2', '\x2', '\x1F3', '\x1F1', '\x3', '\x2', '\x2', '\x2', + '\x1F3', '\x1F4', '\x3', '\x2', '\x2', '\x2', '\x1F4', '\x1F6', '\x3', + '\x2', '\x2', '\x2', '\x1F5', '\x1F3', '\x3', '\x2', '\x2', '\x2', '\x1F6', + '\x1F8', '\a', ')', '\x2', '\x2', '\x1F7', '\x1E5', '\x3', '\x2', '\x2', + '\x2', '\x1F7', '\x1EE', '\x3', '\x2', '\x2', '\x2', '\x1F8', '~', '\x3', + '\x2', '\x2', '\x2', '\x1F9', '\x1FC', '\a', '^', '\x2', '\x2', '\x1FA', + '\x1FD', '\t', '\x4', '\x2', '\x2', '\x1FB', '\x1FD', '\x5', '\x81', '\x41', + '\x2', '\x1FC', '\x1FA', '\x3', '\x2', '\x2', '\x2', '\x1FC', '\x1FB', + '\x3', '\x2', '\x2', '\x2', '\x1FD', '\x80', '\x3', '\x2', '\x2', '\x2', + '\x1FE', '\x1FF', '\a', 'w', '\x2', '\x2', '\x1FF', '\x200', '\x5', '\x83', + '\x42', '\x2', '\x200', '\x201', '\x5', '\x83', '\x42', '\x2', '\x201', + '\x202', '\x5', '\x83', '\x42', '\x2', '\x202', '\x203', '\x5', '\x83', + '\x42', '\x2', '\x203', '\x82', '\x3', '\x2', '\x2', '\x2', '\x204', '\x205', + '\t', '\x5', '\x2', '\x2', '\x205', '\x84', '\x3', '\x2', '\x2', '\x2', + '\x206', '\x207', '\n', '\x6', '\x2', '\x2', '\x207', '\x86', '\x3', '\x2', + '\x2', '\x2', '\x208', '\x209', '\n', '\a', '\x2', '\x2', '\x209', '\x88', + '\x3', '\x2', '\x2', '\x2', '\x20A', '\x214', '\x3', '\x2', '\x2', '\x2', + '\x20B', '\x210', '\t', '\b', '\x2', '\x2', '\x20C', '\x20F', '\t', '\b', + '\x2', '\x2', '\x20D', '\x20F', '\x5', '\x8D', 'G', '\x2', '\x20E', '\x20C', + '\x3', '\x2', '\x2', '\x2', '\x20E', '\x20D', '\x3', '\x2', '\x2', '\x2', + '\x20F', '\x212', '\x3', '\x2', '\x2', '\x2', '\x210', '\x20E', '\x3', + '\x2', '\x2', '\x2', '\x210', '\x211', '\x3', '\x2', '\x2', '\x2', '\x211', + '\x214', '\x3', '\x2', '\x2', '\x2', '\x212', '\x210', '\x3', '\x2', '\x2', + '\x2', '\x213', '\x20A', '\x3', '\x2', '\x2', '\x2', '\x213', '\x20B', + '\x3', '\x2', '\x2', '\x2', '\x214', '\x8A', '\x3', '\x2', '\x2', '\x2', + '\x215', '\x216', '\a', '\x42', '\x2', '\x2', '\x216', '\x217', '\x5', + '\x89', '\x45', '\x2', '\x217', '\x8C', '\x3', '\x2', '\x2', '\x2', '\x218', + '\x219', '\t', '\t', '\x2', '\x2', '\x219', '\x8E', '\x3', '\x2', '\x2', + '\x2', '\x21A', '\x21B', '\t', '\n', '\x2', '\x2', '\x21B', '\x90', '\x3', + '\x2', '\x2', '\x2', '\x21C', '\x21D', '\t', '\v', '\x2', '\x2', '\x21D', + '\x92', '\x3', '\x2', '\x2', '\x2', '\x21E', '\x21F', '\t', '\f', '\x2', + '\x2', '\x21F', '\x94', '\x3', '\x2', '\x2', '\x2', '\x220', '\x221', + '\t', '\r', '\x2', '\x2', '\x221', '\x96', '\x3', '\x2', '\x2', '\x2', + '\x222', '\x223', '\t', '\xE', '\x2', '\x2', '\x223', '\x98', '\x3', '\x2', + '\x2', '\x2', '\x224', '\x225', '\t', '\xF', '\x2', '\x2', '\x225', '\x9A', + '\x3', '\x2', '\x2', '\x2', '\x226', '\x227', '\t', '\x10', '\x2', '\x2', + '\x227', '\x9C', '\x3', '\x2', '\x2', '\x2', '\x228', '\x229', '\t', '\x11', + '\x2', '\x2', '\x229', '\x9E', '\x3', '\x2', '\x2', '\x2', '\x22A', '\x22B', + '\t', '\x12', '\x2', '\x2', '\x22B', '\xA0', '\x3', '\x2', '\x2', '\x2', + '\x22C', '\x22D', '\t', '\x13', '\x2', '\x2', '\x22D', '\xA2', '\x3', + '\x2', '\x2', '\x2', '\x22E', '\x22F', '\t', '\x14', '\x2', '\x2', '\x22F', + '\xA4', '\x3', '\x2', '\x2', '\x2', '\x230', '\x231', '\t', '\x15', '\x2', + '\x2', '\x231', '\xA6', '\x3', '\x2', '\x2', '\x2', '\x232', '\x233', + '\t', '\x16', '\x2', '\x2', '\x233', '\xA8', '\x3', '\x2', '\x2', '\x2', + '\x234', '\x235', '\t', '\x17', '\x2', '\x2', '\x235', '\xAA', '\x3', + '\x2', '\x2', '\x2', '\x236', '\x237', '\t', '\x18', '\x2', '\x2', '\x237', + '\xAC', '\x3', '\x2', '\x2', '\x2', '\x238', '\x239', '\t', '\x19', '\x2', + '\x2', '\x239', '\xAE', '\x3', '\x2', '\x2', '\x2', '\x23A', '\x23B', + '\t', '\x1A', '\x2', '\x2', '\x23B', '\xB0', '\x3', '\x2', '\x2', '\x2', + '\x23C', '\x23D', '\t', '\x1B', '\x2', '\x2', '\x23D', '\xB2', '\x3', + '\x2', '\x2', '\x2', '\x23E', '\x23F', '\t', '\x1C', '\x2', '\x2', '\x23F', + '\xB4', '\x3', '\x2', '\x2', '\x2', '\x240', '\x241', '\t', '\x1D', '\x2', + '\x2', '\x241', '\xB6', '\x3', '\x2', '\x2', '\x2', '\x242', '\x243', + '\t', '\x1E', '\x2', '\x2', '\x243', '\xB8', '\x3', '\x2', '\x2', '\x2', + '\x244', '\x245', '\t', '\x1F', '\x2', '\x2', '\x245', '\xBA', '\x3', + '\x2', '\x2', '\x2', '\x246', '\x247', '\t', ' ', '\x2', '\x2', '\x247', + '\xBC', '\x3', '\x2', '\x2', '\x2', '\x248', '\x249', '\t', '!', '\x2', + '\x2', '\x249', '\xBE', '\x3', '\x2', '\x2', '\x2', '\x24A', '\x24B', + '\t', '\"', '\x2', '\x2', '\x24B', '\xC0', '\x3', '\x2', '\x2', '\x2', + '\x24C', '\x24D', '\t', '#', '\x2', '\x2', '\x24D', '\xC2', '\x3', '\x2', + '\x2', '\x2', '\x1A', '\x2', '\x1AF', '\x1B4', '\x1B9', '\x1BF', '\x1C2', + '\x1C6', '\x1CB', '\x1CD', '\x1D0', '\x1D6', '\x1DA', '\x1DF', '\x1E1', + '\x1E3', '\x1E8', '\x1EA', '\x1F1', '\x1F3', '\x1F7', '\x1FC', '\x20E', + '\x210', '\x213', '\x3', '\b', '\x2', '\x2', }; public static readonly ATN _ATN = diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlParser.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlParser.cs index 5de50b9faa..53293f9382 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlParser.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlParser.cs @@ -38,12 +38,13 @@ public const int T__0=1, T__1=2, T__2=3, T__3=4, T__4=5, T__5=6, T__6=7, T__7=8, T__8=9, T__9=10, T__10=11, T__11=12, T__12=13, T__13=14, T__14=15, T__15=16, T__16=17, T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24, - T__24=25, T__25=26, T__26=27, K_AND=28, K_ARRAY=29, K_AS=30, K_ASC=31, - K_BETWEEN=32, K_BY=33, K_DESC=34, K_DISTINCT=35, K_ESCAPE=36, K_EXISTS=37, - K_FALSE=38, K_FROM=39, K_GROUP=40, K_IN=41, K_JOIN=42, K_LIKE=43, K_LIMIT=44, - K_NOT=45, K_NULL=46, K_OFFSET=47, K_OR=48, K_ORDER=49, K_SELECT=50, K_TOP=51, - K_TRUE=52, K_UDF=53, K_UNDEFINED=54, K_VALUE=55, K_WHERE=56, WS=57, NUMERIC_LITERAL=58, - STRING_LITERAL=59, IDENTIFIER=60, PARAMETER=61; + T__24=25, T__25=26, T__26=27, K_ALL=28, K_AND=29, K_ARRAY=30, K_AS=31, + K_ASC=32, K_BETWEEN=33, K_BY=34, K_DESC=35, K_DISTINCT=36, K_ESCAPE=37, + K_EXISTS=38, K_FALSE=39, K_FROM=40, K_GROUP=41, K_IN=42, K_JOIN=43, K_LEFT=44, + K_LIKE=45, K_LIMIT=46, K_NOT=47, K_NULL=48, K_OFFSET=49, K_OR=50, K_ORDER=51, + K_RIGHT=52, K_SELECT=53, K_TOP=54, K_TRUE=55, K_UDF=56, K_UNDEFINED=57, + K_VALUE=58, K_WHERE=59, WS=60, NUMERIC_LITERAL=61, STRING_LITERAL=62, + LEX_IDENTIFIER=63, PARAMETER=64; public const int RULE_program = 0, RULE_sql_query = 1, RULE_select_clause = 2, RULE_top_spec = 3, RULE_selection = 4, RULE_select_star_spec = 5, RULE_select_value_spec = 6, @@ -58,8 +59,9 @@ public const int RULE_equality_operator = 31, RULE_bitwise_and_operator = 32, RULE_bitwise_exclusive_or_operator = 33, RULE_bitwise_inclusive_or_operator = 34, RULE_string_concat_operator = 35, RULE_unary_scalar_expression = 36, RULE_unary_operator = 37, RULE_primary_expression = 38, - RULE_scalar_expression_list = 39, RULE_object_property_list = 40, RULE_object_property = 41, - RULE_literal = 42; + RULE_function_call_scalar_expression = 39, RULE_scalar_expression_list = 40, + RULE_object_property_list = 41, RULE_object_property = 42, RULE_identifier = 43, + RULE_literal = 44; public static readonly string[] ruleNames = { "program", "sql_query", "select_clause", "top_spec", "selection", "select_star_spec", "select_value_spec", "select_list_spec", "select_item", "from_clause", @@ -70,27 +72,28 @@ public const int "escape_expression", "binary_scalar_expression", "multiplicative_operator", "additive_operator", "relational_operator", "equality_operator", "bitwise_and_operator", "bitwise_exclusive_or_operator", "bitwise_inclusive_or_operator", "string_concat_operator", - "unary_scalar_expression", "unary_operator", "primary_expression", "scalar_expression_list", - "object_property_list", "object_property", "literal" + "unary_scalar_expression", "unary_operator", "primary_expression", "function_call_scalar_expression", + "scalar_expression_list", "object_property_list", "object_property", "identifier", + "literal" }; private static readonly string[] _LiteralNames = { null, "'*'", "','", "'('", "')'", "'.'", "'['", "']'", "'?'", "':'", "'??'", "'/'", "'%'", "'+'", "'-'", "'<'", "'>'", "'>='", "'<='", "'='", "'!='", "'&'", "'^'", "'|'", "'||'", "'~'", "'{'", "'}'", null, null, null, null, - null, null, null, null, null, null, "'false'", null, null, null, null, - null, null, null, "'null'", null, null, null, null, null, "'true'", "'udf'", - "'undefined'" + null, null, null, null, null, null, null, "'false'", null, null, null, + null, null, null, null, null, "'null'", null, null, null, null, null, + null, "'true'", "'udf'", "'undefined'" }; private static readonly string[] _SymbolicNames = { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, - null, null, null, null, "K_AND", "K_ARRAY", "K_AS", "K_ASC", "K_BETWEEN", - "K_BY", "K_DESC", "K_DISTINCT", "K_ESCAPE", "K_EXISTS", "K_FALSE", "K_FROM", - "K_GROUP", "K_IN", "K_JOIN", "K_LIKE", "K_LIMIT", "K_NOT", "K_NULL", "K_OFFSET", - "K_OR", "K_ORDER", "K_SELECT", "K_TOP", "K_TRUE", "K_UDF", "K_UNDEFINED", - "K_VALUE", "K_WHERE", "WS", "NUMERIC_LITERAL", "STRING_LITERAL", "IDENTIFIER", - "PARAMETER" + null, null, null, null, "K_ALL", "K_AND", "K_ARRAY", "K_AS", "K_ASC", + "K_BETWEEN", "K_BY", "K_DESC", "K_DISTINCT", "K_ESCAPE", "K_EXISTS", "K_FALSE", + "K_FROM", "K_GROUP", "K_IN", "K_JOIN", "K_LEFT", "K_LIKE", "K_LIMIT", + "K_NOT", "K_NULL", "K_OFFSET", "K_OR", "K_ORDER", "K_RIGHT", "K_SELECT", + "K_TOP", "K_TRUE", "K_UDF", "K_UNDEFINED", "K_VALUE", "K_WHERE", "WS", + "NUMERIC_LITERAL", "STRING_LITERAL", "LEX_IDENTIFIER", "PARAMETER" }; public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames); @@ -123,7 +126,6 @@ public sqlParser(ITokenStream input, TextWriter output, TextWriter errorOutput) { Interpreter = new ParserATNSimulator(this, _ATN, decisionToDFA, sharedContextCache); } - public partial class ProgramContext : ParserRuleContext { public Sql_queryContext sql_query() { return GetRuleContext(0); @@ -156,8 +158,8 @@ public ProgramContext program() { try { EnterOuterAlt(_localctx, 1); { - State = 86; sql_query(); - State = 87; Match(Eof); + State = 90; sql_query(); + State = 91; Match(Eof); } } catch (RecognitionException re) { @@ -218,49 +220,49 @@ public Sql_queryContext sql_query() { try { EnterOuterAlt(_localctx, 1); { - State = 89; select_clause(); - State = 91; + State = 93; select_clause(); + State = 95; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==K_FROM) { { - State = 90; from_clause(); + State = 94; from_clause(); } } - State = 94; + State = 98; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==K_WHERE) { { - State = 93; where_clause(); + State = 97; where_clause(); } } - State = 97; + State = 101; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==K_GROUP) { { - State = 96; group_by_clause(); + State = 100; group_by_clause(); } } - State = 100; + State = 104; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==K_ORDER) { { - State = 99; order_by_clause(); + State = 103; order_by_clause(); } } - State = 103; + State = 107; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==K_OFFSET) { { - State = 102; offset_limit_clause(); + State = 106; offset_limit_clause(); } } @@ -314,26 +316,26 @@ public Select_clauseContext select_clause() { try { EnterOuterAlt(_localctx, 1); { - State = 105; Match(K_SELECT); - State = 107; + State = 109; Match(K_SELECT); + State = 111; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==K_DISTINCT) { { - State = 106; Match(K_DISTINCT); + State = 110; Match(K_DISTINCT); } } - State = 110; + State = 114; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==K_TOP) { { - State = 109; top_spec(); + State = 113; top_spec(); } } - State = 112; selection(); + State = 116; selection(); } } catch (RecognitionException re) { @@ -379,8 +381,8 @@ public Top_specContext top_spec() { try { EnterOuterAlt(_localctx, 1); { - State = 114; Match(K_TOP); - State = 115; + State = 118; Match(K_TOP); + State = 119; _la = TokenStream.LA(1); if ( !(_la==NUMERIC_LITERAL || _la==PARAMETER) ) { ErrorHandler.RecoverInline(this); @@ -437,19 +439,19 @@ public SelectionContext selection() { SelectionContext _localctx = new SelectionContext(Context, State); EnterRule(_localctx, 8, RULE_selection); try { - State = 120; + State = 124; ErrorHandler.Sync(this); switch (TokenStream.LA(1)) { case T__0: EnterOuterAlt(_localctx, 1); { - State = 117; select_star_spec(); + State = 121; select_star_spec(); } break; case K_VALUE: EnterOuterAlt(_localctx, 2); { - State = 118; select_value_spec(); + State = 122; select_value_spec(); } break; case T__2: @@ -458,21 +460,24 @@ public SelectionContext selection() { case T__13: case T__24: case T__25: + case K_ALL: case K_ARRAY: case K_EXISTS: case K_FALSE: + case K_LEFT: case K_NOT: case K_NULL: + case K_RIGHT: case K_TRUE: case K_UDF: case K_UNDEFINED: case NUMERIC_LITERAL: case STRING_LITERAL: - case IDENTIFIER: + case LEX_IDENTIFIER: case PARAMETER: EnterOuterAlt(_localctx, 3); { - State = 119; select_list_spec(); + State = 123; select_list_spec(); } break; default: @@ -518,7 +523,7 @@ public Select_star_specContext select_star_spec() { try { EnterOuterAlt(_localctx, 1); { - State = 122; Match(T__0); + State = 126; Match(T__0); } } catch (RecognitionException re) { @@ -564,8 +569,8 @@ public Select_value_specContext select_value_spec() { try { EnterOuterAlt(_localctx, 1); { - State = 124; Match(K_VALUE); - State = 125; scalar_expression(0); + State = 128; Match(K_VALUE); + State = 129; scalar_expression(0); } } catch (RecognitionException re) { @@ -614,18 +619,18 @@ public Select_list_specContext select_list_spec() { try { EnterOuterAlt(_localctx, 1); { - State = 127; select_item(); - State = 132; + State = 131; select_item(); + State = 136; ErrorHandler.Sync(this); _la = TokenStream.LA(1); while (_la==T__1) { { { - State = 128; Match(T__1); - State = 129; select_item(); + State = 132; Match(T__1); + State = 133; select_item(); } } - State = 134; + State = 138; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } @@ -647,7 +652,9 @@ public Scalar_expressionContext scalar_expression() { return GetRuleContext(0); } public ITerminalNode K_AS() { return GetToken(sqlParser.K_AS, 0); } - public ITerminalNode IDENTIFIER() { return GetToken(sqlParser.IDENTIFIER, 0); } + public IdentifierContext identifier() { + return GetRuleContext(0); + } public Select_itemContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { @@ -676,14 +683,14 @@ public Select_itemContext select_item() { try { EnterOuterAlt(_localctx, 1); { - State = 135; scalar_expression(0); - State = 138; + State = 139; scalar_expression(0); + State = 142; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==K_AS) { { - State = 136; Match(K_AS); - State = 137; Match(IDENTIFIER); + State = 140; Match(K_AS); + State = 141; identifier(); } } @@ -732,8 +739,8 @@ public From_clauseContext from_clause() { try { EnterOuterAlt(_localctx, 1); { - State = 140; Match(K_FROM); - State = 141; collection_expression(0); + State = 144; Match(K_FROM); + State = 145; collection_expression(0); } } catch (RecognitionException re) { @@ -786,7 +793,9 @@ public partial class AliasedCollectionExpressionContext : Collection_expressionC public CollectionContext collection() { return GetRuleContext(0); } - public ITerminalNode IDENTIFIER() { return GetToken(sqlParser.IDENTIFIER, 0); } + public IdentifierContext identifier() { + return GetRuleContext(0); + } public ITerminalNode K_AS() { return GetToken(sqlParser.K_AS, 0); } public AliasedCollectionExpressionContext(Collection_expressionContext context) { CopyFrom(context); } public override void EnterRule(IParseTreeListener listener) { @@ -804,7 +813,9 @@ public override TResult Accept(IParseTreeVisitor visitor) { } } public partial class ArrayIteratorCollectionExpressionContext : Collection_expressionContext { - public ITerminalNode IDENTIFIER() { return GetToken(sqlParser.IDENTIFIER, 0); } + public IdentifierContext identifier() { + return GetRuleContext(0); + } public ITerminalNode K_IN() { return GetToken(sqlParser.K_IN, 0); } public CollectionContext collection() { return GetRuleContext(0); @@ -842,7 +853,7 @@ private Collection_expressionContext collection_expression(int _p) { int _alt; EnterOuterAlt(_localctx, 1); { - State = 154; + State = 159; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,12,Context) ) { case 1: @@ -851,22 +862,22 @@ private Collection_expressionContext collection_expression(int _p) { Context = _localctx; _prevctx = _localctx; - State = 144; collection(); - State = 149; + State = 148; collection(); + State = 153; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,11,Context) ) { case 1: { - State = 146; + State = 150; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==K_AS) { { - State = 145; Match(K_AS); + State = 149; Match(K_AS); } } - State = 148; Match(IDENTIFIER); + State = 152; identifier(); } break; } @@ -877,14 +888,14 @@ private Collection_expressionContext collection_expression(int _p) { _localctx = new ArrayIteratorCollectionExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 151; Match(IDENTIFIER); - State = 152; Match(K_IN); - State = 153; collection(); + State = 155; identifier(); + State = 156; Match(K_IN); + State = 157; collection(); } break; } Context.Stop = TokenStream.LT(-1); - State = 161; + State = 166; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,13,Context); while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) { @@ -896,14 +907,14 @@ private Collection_expressionContext collection_expression(int _p) { { _localctx = new JoinCollectionExpressionContext(new Collection_expressionContext(_parentctx, _parentState)); PushNewRecursionContext(_localctx, _startState, RULE_collection_expression); - State = 156; + State = 161; if (!(Precpred(Context, 1))) throw new FailedPredicateException(this, "Precpred(Context, 1)"); - State = 157; Match(K_JOIN); - State = 158; collection_expression(2); + State = 162; Match(K_JOIN); + State = 163; collection_expression(2); } } } - State = 163; + State = 168; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,13,Context); } @@ -933,7 +944,9 @@ public virtual void CopyFrom(CollectionContext context) { } } public partial class InputPathCollectionContext : CollectionContext { - public ITerminalNode IDENTIFIER() { return GetToken(sqlParser.IDENTIFIER, 0); } + public IdentifierContext identifier() { + return GetRuleContext(0); + } public Path_expressionContext path_expression() { return GetRuleContext(0); } @@ -977,20 +990,21 @@ public CollectionContext collection() { CollectionContext _localctx = new CollectionContext(Context, State); EnterRule(_localctx, 22, RULE_collection); try { - State = 172; + State = 177; ErrorHandler.Sync(this); switch (TokenStream.LA(1)) { - case IDENTIFIER: + case K_ALL: + case LEX_IDENTIFIER: _localctx = new InputPathCollectionContext(_localctx); EnterOuterAlt(_localctx, 1); { - State = 164; Match(IDENTIFIER); - State = 166; + State = 169; identifier(); + State = 171; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,14,Context) ) { case 1: { - State = 165; path_expression(0); + State = 170; path_expression(0); } break; } @@ -1000,9 +1014,9 @@ public CollectionContext collection() { _localctx = new SubqueryCollectionContext(_localctx); EnterOuterAlt(_localctx, 2); { - State = 168; Match(T__2); - State = 169; sql_query(); - State = 170; Match(T__3); + State = 173; Match(T__2); + State = 174; sql_query(); + State = 175; Match(T__3); } break; default: @@ -1072,7 +1086,9 @@ public partial class IdentifierPathExpressionContext : Path_expressionContext { public Path_expressionContext path_expression() { return GetRuleContext(0); } - public ITerminalNode IDENTIFIER() { return GetToken(sqlParser.IDENTIFIER, 0); } + public IdentifierContext identifier() { + return GetRuleContext(0); + } public IdentifierPathExpressionContext(Path_expressionContext context) { CopyFrom(context); } public override void EnterRule(IParseTreeListener listener) { IsqlListener typedListener = listener as IsqlListener; @@ -1132,7 +1148,7 @@ private Path_expressionContext path_expression(int _p) { } Context.Stop = TokenStream.LT(-1); - State = 188; + State = 193; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,17,Context); while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) { @@ -1141,45 +1157,45 @@ private Path_expressionContext path_expression(int _p) { TriggerExitRuleEvent(); _prevctx = _localctx; { - State = 186; + State = 191; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,16,Context) ) { case 1: { _localctx = new IdentifierPathExpressionContext(new Path_expressionContext(_parentctx, _parentState)); PushNewRecursionContext(_localctx, _startState, RULE_path_expression); - State = 175; + State = 180; if (!(Precpred(Context, 4))) throw new FailedPredicateException(this, "Precpred(Context, 4)"); - State = 176; Match(T__4); - State = 177; Match(IDENTIFIER); + State = 181; Match(T__4); + State = 182; identifier(); } break; case 2: { _localctx = new NumberPathExpressionContext(new Path_expressionContext(_parentctx, _parentState)); PushNewRecursionContext(_localctx, _startState, RULE_path_expression); - State = 178; + State = 183; if (!(Precpred(Context, 3))) throw new FailedPredicateException(this, "Precpred(Context, 3)"); - State = 179; Match(T__5); - State = 180; Match(NUMERIC_LITERAL); - State = 181; Match(T__6); + State = 184; Match(T__5); + State = 185; Match(NUMERIC_LITERAL); + State = 186; Match(T__6); } break; case 3: { _localctx = new StringPathExpressionContext(new Path_expressionContext(_parentctx, _parentState)); PushNewRecursionContext(_localctx, _startState, RULE_path_expression); - State = 182; + State = 187; if (!(Precpred(Context, 2))) throw new FailedPredicateException(this, "Precpred(Context, 2)"); - State = 183; Match(T__5); - State = 184; Match(STRING_LITERAL); - State = 185; Match(T__6); + State = 188; Match(T__5); + State = 189; Match(STRING_LITERAL); + State = 190; Match(T__6); } break; } } } - State = 190; + State = 195; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,17,Context); } @@ -1228,8 +1244,8 @@ public Where_clauseContext where_clause() { try { EnterOuterAlt(_localctx, 1); { - State = 191; Match(K_WHERE); - State = 192; scalar_expression(0); + State = 196; Match(K_WHERE); + State = 197; scalar_expression(0); } } catch (RecognitionException re) { @@ -1276,9 +1292,9 @@ public Group_by_clauseContext group_by_clause() { try { EnterOuterAlt(_localctx, 1); { - State = 194; Match(K_GROUP); - State = 195; Match(K_BY); - State = 196; scalar_expression_list(); + State = 199; Match(K_GROUP); + State = 200; Match(K_BY); + State = 201; scalar_expression_list(); } } catch (RecognitionException re) { @@ -1325,9 +1341,9 @@ public Order_by_clauseContext order_by_clause() { try { EnterOuterAlt(_localctx, 1); { - State = 198; Match(K_ORDER); - State = 199; Match(K_BY); - State = 200; order_by_items(); + State = 203; Match(K_ORDER); + State = 204; Match(K_BY); + State = 205; order_by_items(); } } catch (RecognitionException re) { @@ -1376,18 +1392,18 @@ public Order_by_itemsContext order_by_items() { try { EnterOuterAlt(_localctx, 1); { - State = 202; order_by_item(); - State = 207; + State = 207; order_by_item(); + State = 212; ErrorHandler.Sync(this); _la = TokenStream.LA(1); while (_la==T__1) { { { - State = 203; Match(T__1); - State = 204; order_by_item(); + State = 208; Match(T__1); + State = 209; order_by_item(); } } - State = 209; + State = 214; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } @@ -1439,13 +1455,13 @@ public Order_by_itemContext order_by_item() { try { EnterOuterAlt(_localctx, 1); { - State = 210; scalar_expression(0); - State = 212; + State = 215; scalar_expression(0); + State = 217; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==K_ASC || _la==K_DESC) { { - State = 211; sort_order(); + State = 216; sort_order(); } } @@ -1493,7 +1509,7 @@ public Sort_orderContext sort_order() { try { EnterOuterAlt(_localctx, 1); { - State = 214; + State = 219; _la = TokenStream.LA(1); if ( !(_la==K_ASC || _la==K_DESC) ) { ErrorHandler.RecoverInline(this); @@ -1551,10 +1567,10 @@ public Offset_limit_clauseContext offset_limit_clause() { try { EnterOuterAlt(_localctx, 1); { - State = 216; Match(K_OFFSET); - State = 217; offset_count(); - State = 218; Match(K_LIMIT); - State = 219; limit_count(); + State = 221; Match(K_OFFSET); + State = 222; offset_count(); + State = 223; Match(K_LIMIT); + State = 224; limit_count(); } } catch (RecognitionException re) { @@ -1599,7 +1615,7 @@ public Offset_countContext offset_count() { try { EnterOuterAlt(_localctx, 1); { - State = 221; + State = 226; _la = TokenStream.LA(1); if ( !(_la==NUMERIC_LITERAL || _la==PARAMETER) ) { ErrorHandler.RecoverInline(this); @@ -1652,7 +1668,7 @@ public Limit_countContext limit_count() { try { EnterOuterAlt(_localctx, 1); { - State = 223; + State = 228; _la = TokenStream.LA(1); if ( !(_la==NUMERIC_LITERAL || _la==PARAMETER) ) { ErrorHandler.RecoverInline(this); @@ -1792,7 +1808,7 @@ private Scalar_expressionContext scalar_expression(int _p) { int _alt; EnterOuterAlt(_localctx, 1); { - State = 236; + State = 241; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,21,Context) ) { case 1: @@ -1801,7 +1817,7 @@ private Scalar_expressionContext scalar_expression(int _p) { Context = _localctx; _prevctx = _localctx; - State = 226; logical_scalar_expression(0); + State = 231; logical_scalar_expression(0); } break; case 2: @@ -1809,25 +1825,25 @@ private Scalar_expressionContext scalar_expression(int _p) { _localctx = new BetweenScalarExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 227; binary_scalar_expression(0); - State = 229; + State = 232; binary_scalar_expression(0); + State = 234; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==K_NOT) { { - State = 228; Match(K_NOT); + State = 233; Match(K_NOT); } } - State = 231; Match(K_BETWEEN); - State = 232; binary_scalar_expression(0); - State = 233; Match(K_AND); - State = 234; binary_scalar_expression(0); + State = 236; Match(K_BETWEEN); + State = 237; binary_scalar_expression(0); + State = 238; Match(K_AND); + State = 239; binary_scalar_expression(0); } break; } Context.Stop = TokenStream.LT(-1); - State = 249; + State = 254; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,23,Context); while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) { @@ -1836,35 +1852,35 @@ private Scalar_expressionContext scalar_expression(int _p) { TriggerExitRuleEvent(); _prevctx = _localctx; { - State = 247; + State = 252; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,22,Context) ) { case 1: { _localctx = new ConditionalScalarExpressionContext(new Scalar_expressionContext(_parentctx, _parentState)); PushNewRecursionContext(_localctx, _startState, RULE_scalar_expression); - State = 238; + State = 243; if (!(Precpred(Context, 4))) throw new FailedPredicateException(this, "Precpred(Context, 4)"); - State = 239; Match(T__7); - State = 240; scalar_expression(0); - State = 241; Match(T__8); - State = 242; scalar_expression(5); + State = 244; Match(T__7); + State = 245; scalar_expression(0); + State = 246; Match(T__8); + State = 247; scalar_expression(5); } break; case 2: { _localctx = new CoalesceScalarExpressionContext(new Scalar_expressionContext(_parentctx, _parentState)); PushNewRecursionContext(_localctx, _startState, RULE_scalar_expression); - State = 244; + State = 249; if (!(Precpred(Context, 3))) throw new FailedPredicateException(this, "Precpred(Context, 3)"); - State = 245; Match(T__9); - State = 246; scalar_expression(4); + State = 250; Match(T__9); + State = 251; scalar_expression(4); } break; } } } - State = 251; + State = 256; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,23,Context); } @@ -1935,27 +1951,27 @@ private Logical_scalar_expressionContext logical_scalar_expression(int _p) { int _alt; EnterOuterAlt(_localctx, 1); { - State = 256; + State = 261; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,24,Context) ) { case 1: { - State = 253; binary_scalar_expression(0); + State = 258; binary_scalar_expression(0); } break; case 2: { - State = 254; in_scalar_expression(); + State = 259; in_scalar_expression(); } break; case 3: { - State = 255; like_scalar_expression(); + State = 260; like_scalar_expression(); } break; } Context.Stop = TokenStream.LT(-1); - State = 266; + State = 271; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,26,Context); while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) { @@ -1964,33 +1980,33 @@ private Logical_scalar_expressionContext logical_scalar_expression(int _p) { TriggerExitRuleEvent(); _prevctx = _localctx; { - State = 264; + State = 269; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,25,Context) ) { case 1: { _localctx = new Logical_scalar_expressionContext(_parentctx, _parentState); PushNewRecursionContext(_localctx, _startState, RULE_logical_scalar_expression); - State = 258; + State = 263; if (!(Precpred(Context, 2))) throw new FailedPredicateException(this, "Precpred(Context, 2)"); - State = 259; Match(K_AND); - State = 260; logical_scalar_expression(3); + State = 264; Match(K_AND); + State = 265; logical_scalar_expression(3); } break; case 2: { _localctx = new Logical_scalar_expressionContext(_parentctx, _parentState); PushNewRecursionContext(_localctx, _startState, RULE_logical_scalar_expression); - State = 261; + State = 266; if (!(Precpred(Context, 1))) throw new FailedPredicateException(this, "Precpred(Context, 1)"); - State = 262; Match(K_OR); - State = 263; logical_scalar_expression(2); + State = 267; Match(K_OR); + State = 268; logical_scalar_expression(2); } break; } } } - State = 268; + State = 273; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,26,Context); } @@ -2044,20 +2060,20 @@ public In_scalar_expressionContext in_scalar_expression() { try { EnterOuterAlt(_localctx, 1); { - State = 269; binary_scalar_expression(0); - State = 271; + State = 274; binary_scalar_expression(0); + State = 276; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==K_NOT) { { - State = 270; Match(K_NOT); + State = 275; Match(K_NOT); } } - State = 273; Match(K_IN); - State = 274; Match(T__2); - State = 275; scalar_expression_list(); - State = 276; Match(T__3); + State = 278; Match(K_IN); + State = 279; Match(T__2); + State = 280; scalar_expression_list(); + State = 281; Match(T__3); } } catch (RecognitionException re) { @@ -2111,24 +2127,24 @@ public Like_scalar_expressionContext like_scalar_expression() { try { EnterOuterAlt(_localctx, 1); { - State = 278; binary_scalar_expression(0); - State = 280; + State = 283; binary_scalar_expression(0); + State = 285; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==K_NOT) { { - State = 279; Match(K_NOT); + State = 284; Match(K_NOT); } } - State = 282; Match(K_LIKE); - State = 283; binary_scalar_expression(0); - State = 285; + State = 287; Match(K_LIKE); + State = 288; binary_scalar_expression(0); + State = 290; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,29,Context) ) { case 1: { - State = 284; escape_expression(); + State = 289; escape_expression(); } break; } @@ -2175,8 +2191,8 @@ public Escape_expressionContext escape_expression() { try { EnterOuterAlt(_localctx, 1); { - State = 287; Match(K_ESCAPE); - State = 288; Match(STRING_LITERAL); + State = 292; Match(K_ESCAPE); + State = 293; Match(STRING_LITERAL); } } catch (RecognitionException re) { @@ -2261,10 +2277,10 @@ private Binary_scalar_expressionContext binary_scalar_expression(int _p) { EnterOuterAlt(_localctx, 1); { { - State = 291; unary_scalar_expression(); + State = 296; unary_scalar_expression(); } Context.Stop = TokenStream.LT(-1); - State = 327; + State = 332; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,31,Context); while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) { @@ -2273,93 +2289,93 @@ private Binary_scalar_expressionContext binary_scalar_expression(int _p) { TriggerExitRuleEvent(); _prevctx = _localctx; { - State = 325; + State = 330; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,30,Context) ) { case 1: { _localctx = new Binary_scalar_expressionContext(_parentctx, _parentState); PushNewRecursionContext(_localctx, _startState, RULE_binary_scalar_expression); - State = 293; + State = 298; if (!(Precpred(Context, 8))) throw new FailedPredicateException(this, "Precpred(Context, 8)"); - State = 294; multiplicative_operator(); - State = 295; binary_scalar_expression(9); + State = 299; multiplicative_operator(); + State = 300; binary_scalar_expression(9); } break; case 2: { _localctx = new Binary_scalar_expressionContext(_parentctx, _parentState); PushNewRecursionContext(_localctx, _startState, RULE_binary_scalar_expression); - State = 297; + State = 302; if (!(Precpred(Context, 7))) throw new FailedPredicateException(this, "Precpred(Context, 7)"); - State = 298; additive_operator(); - State = 299; binary_scalar_expression(8); + State = 303; additive_operator(); + State = 304; binary_scalar_expression(8); } break; case 3: { _localctx = new Binary_scalar_expressionContext(_parentctx, _parentState); PushNewRecursionContext(_localctx, _startState, RULE_binary_scalar_expression); - State = 301; + State = 306; if (!(Precpred(Context, 6))) throw new FailedPredicateException(this, "Precpred(Context, 6)"); - State = 302; relational_operator(); - State = 303; binary_scalar_expression(7); + State = 307; relational_operator(); + State = 308; binary_scalar_expression(7); } break; case 4: { _localctx = new Binary_scalar_expressionContext(_parentctx, _parentState); PushNewRecursionContext(_localctx, _startState, RULE_binary_scalar_expression); - State = 305; + State = 310; if (!(Precpred(Context, 5))) throw new FailedPredicateException(this, "Precpred(Context, 5)"); - State = 306; equality_operator(); - State = 307; binary_scalar_expression(6); + State = 311; equality_operator(); + State = 312; binary_scalar_expression(6); } break; case 5: { _localctx = new Binary_scalar_expressionContext(_parentctx, _parentState); PushNewRecursionContext(_localctx, _startState, RULE_binary_scalar_expression); - State = 309; + State = 314; if (!(Precpred(Context, 4))) throw new FailedPredicateException(this, "Precpred(Context, 4)"); - State = 310; bitwise_and_operator(); - State = 311; binary_scalar_expression(5); + State = 315; bitwise_and_operator(); + State = 316; binary_scalar_expression(5); } break; case 6: { _localctx = new Binary_scalar_expressionContext(_parentctx, _parentState); PushNewRecursionContext(_localctx, _startState, RULE_binary_scalar_expression); - State = 313; + State = 318; if (!(Precpred(Context, 3))) throw new FailedPredicateException(this, "Precpred(Context, 3)"); - State = 314; bitwise_exclusive_or_operator(); - State = 315; binary_scalar_expression(4); + State = 319; bitwise_exclusive_or_operator(); + State = 320; binary_scalar_expression(4); } break; case 7: { _localctx = new Binary_scalar_expressionContext(_parentctx, _parentState); PushNewRecursionContext(_localctx, _startState, RULE_binary_scalar_expression); - State = 317; + State = 322; if (!(Precpred(Context, 2))) throw new FailedPredicateException(this, "Precpred(Context, 2)"); - State = 318; bitwise_inclusive_or_operator(); - State = 319; binary_scalar_expression(3); + State = 323; bitwise_inclusive_or_operator(); + State = 324; binary_scalar_expression(3); } break; case 8: { _localctx = new Binary_scalar_expressionContext(_parentctx, _parentState); PushNewRecursionContext(_localctx, _startState, RULE_binary_scalar_expression); - State = 321; + State = 326; if (!(Precpred(Context, 1))) throw new FailedPredicateException(this, "Precpred(Context, 1)"); - State = 322; string_concat_operator(); - State = 323; binary_scalar_expression(2); + State = 327; string_concat_operator(); + State = 328; binary_scalar_expression(2); } break; } } } - State = 329; + State = 334; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,31,Context); } @@ -2405,7 +2421,7 @@ public Multiplicative_operatorContext multiplicative_operator() { try { EnterOuterAlt(_localctx, 1); { - State = 330; + State = 335; _la = TokenStream.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__0) | (1L << T__10) | (1L << T__11))) != 0)) ) { ErrorHandler.RecoverInline(this); @@ -2456,7 +2472,7 @@ public Additive_operatorContext additive_operator() { try { EnterOuterAlt(_localctx, 1); { - State = 332; + State = 337; _la = TokenStream.LA(1); if ( !(_la==T__12 || _la==T__13) ) { ErrorHandler.RecoverInline(this); @@ -2507,7 +2523,7 @@ public Relational_operatorContext relational_operator() { try { EnterOuterAlt(_localctx, 1); { - State = 334; + State = 339; _la = TokenStream.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__14) | (1L << T__15) | (1L << T__16) | (1L << T__17))) != 0)) ) { ErrorHandler.RecoverInline(this); @@ -2558,7 +2574,7 @@ public Equality_operatorContext equality_operator() { try { EnterOuterAlt(_localctx, 1); { - State = 336; + State = 341; _la = TokenStream.LA(1); if ( !(_la==T__18 || _la==T__19) ) { ErrorHandler.RecoverInline(this); @@ -2608,7 +2624,7 @@ public Bitwise_and_operatorContext bitwise_and_operator() { try { EnterOuterAlt(_localctx, 1); { - State = 338; Match(T__20); + State = 343; Match(T__20); } } catch (RecognitionException re) { @@ -2650,7 +2666,7 @@ public Bitwise_exclusive_or_operatorContext bitwise_exclusive_or_operator() { try { EnterOuterAlt(_localctx, 1); { - State = 340; Match(T__21); + State = 345; Match(T__21); } } catch (RecognitionException re) { @@ -2692,7 +2708,7 @@ public Bitwise_inclusive_or_operatorContext bitwise_inclusive_or_operator() { try { EnterOuterAlt(_localctx, 1); { - State = 342; Match(T__22); + State = 347; Match(T__22); } } catch (RecognitionException re) { @@ -2734,7 +2750,7 @@ public String_concat_operatorContext string_concat_operator() { try { EnterOuterAlt(_localctx, 1); { - State = 344; Match(T__23); + State = 349; Match(T__23); } } catch (RecognitionException re) { @@ -2783,26 +2799,29 @@ public Unary_scalar_expressionContext unary_scalar_expression() { Unary_scalar_expressionContext _localctx = new Unary_scalar_expressionContext(Context, State); EnterRule(_localctx, 72, RULE_unary_scalar_expression); try { - State = 350; + State = 355; ErrorHandler.Sync(this); switch (TokenStream.LA(1)) { case T__2: case T__5: case T__25: + case K_ALL: case K_ARRAY: case K_EXISTS: case K_FALSE: + case K_LEFT: case K_NULL: + case K_RIGHT: case K_TRUE: case K_UDF: case K_UNDEFINED: case NUMERIC_LITERAL: case STRING_LITERAL: - case IDENTIFIER: + case LEX_IDENTIFIER: case PARAMETER: EnterOuterAlt(_localctx, 1); { - State = 346; primary_expression(0); + State = 351; primary_expression(0); } break; case T__12: @@ -2811,8 +2830,8 @@ public Unary_scalar_expressionContext unary_scalar_expression() { case K_NOT: EnterOuterAlt(_localctx, 2); { - State = 347; unary_operator(); - State = 348; unary_scalar_expression(); + State = 352; unary_operator(); + State = 353; unary_scalar_expression(); } break; default: @@ -2860,7 +2879,7 @@ public Unary_operatorContext unary_operator() { try { EnterOuterAlt(_localctx, 1); { - State = 352; + State = 357; _la = TokenStream.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__12) | (1L << T__13) | (1L << T__24) | (1L << K_NOT))) != 0)) ) { ErrorHandler.RecoverInline(this); @@ -2894,98 +2913,159 @@ public virtual void CopyFrom(Primary_expressionContext context) { base.CopyFrom(context); } } - public partial class SubqueryScalarExpressionContext : Primary_expressionContext { + public partial class AllScalarExpressionContext : Primary_expressionContext { + public ITerminalNode K_ALL() { return GetToken(sqlParser.K_ALL, 0); } public Sql_queryContext sql_query() { return GetRuleContext(0); } - public SubqueryScalarExpressionContext(Primary_expressionContext context) { CopyFrom(context); } + public AllScalarExpressionContext(Primary_expressionContext context) { CopyFrom(context); } public override void EnterRule(IParseTreeListener listener) { IsqlListener typedListener = listener as IsqlListener; - if (typedListener != null) typedListener.EnterSubqueryScalarExpression(this); + if (typedListener != null) typedListener.EnterAllScalarExpression(this); } public override void ExitRule(IParseTreeListener listener) { IsqlListener typedListener = listener as IsqlListener; - if (typedListener != null) typedListener.ExitSubqueryScalarExpression(this); + if (typedListener != null) typedListener.ExitAllScalarExpression(this); } public override TResult Accept(IParseTreeVisitor visitor) { IsqlVisitor typedVisitor = visitor as IsqlVisitor; - if (typedVisitor != null) return typedVisitor.VisitSubqueryScalarExpression(this); + if (typedVisitor != null) return typedVisitor.VisitAllScalarExpression(this); else return visitor.VisitChildren(this); } } - public partial class PropertyRefScalarExpressionBaseContext : Primary_expressionContext { - public ITerminalNode IDENTIFIER() { return GetToken(sqlParser.IDENTIFIER, 0); } - public PropertyRefScalarExpressionBaseContext(Primary_expressionContext context) { CopyFrom(context); } + public partial class LiteralScalarExpressionContext : Primary_expressionContext { + public LiteralContext literal() { + return GetRuleContext(0); + } + public LiteralScalarExpressionContext(Primary_expressionContext context) { CopyFrom(context); } public override void EnterRule(IParseTreeListener listener) { IsqlListener typedListener = listener as IsqlListener; - if (typedListener != null) typedListener.EnterPropertyRefScalarExpressionBase(this); + if (typedListener != null) typedListener.EnterLiteralScalarExpression(this); } public override void ExitRule(IParseTreeListener listener) { IsqlListener typedListener = listener as IsqlListener; - if (typedListener != null) typedListener.ExitPropertyRefScalarExpressionBase(this); + if (typedListener != null) typedListener.ExitLiteralScalarExpression(this); } public override TResult Accept(IParseTreeVisitor visitor) { IsqlVisitor typedVisitor = visitor as IsqlVisitor; - if (typedVisitor != null) return typedVisitor.VisitPropertyRefScalarExpressionBase(this); + if (typedVisitor != null) return typedVisitor.VisitLiteralScalarExpression(this); else return visitor.VisitChildren(this); } } - public partial class FunctionCallScalarExpressionContext : Primary_expressionContext { - public ITerminalNode IDENTIFIER() { return GetToken(sqlParser.IDENTIFIER, 0); } - public ITerminalNode K_UDF() { return GetToken(sqlParser.K_UDF, 0); } + public partial class ObjectCreateScalarExpressionContext : Primary_expressionContext { + public Object_property_listContext object_property_list() { + return GetRuleContext(0); + } + public ObjectCreateScalarExpressionContext(Primary_expressionContext context) { CopyFrom(context); } + public override void EnterRule(IParseTreeListener listener) { + IsqlListener typedListener = listener as IsqlListener; + if (typedListener != null) typedListener.EnterObjectCreateScalarExpression(this); + } + public override void ExitRule(IParseTreeListener listener) { + IsqlListener typedListener = listener as IsqlListener; + if (typedListener != null) typedListener.ExitObjectCreateScalarExpression(this); + } + public override TResult Accept(IParseTreeVisitor visitor) { + IsqlVisitor typedVisitor = visitor as IsqlVisitor; + if (typedVisitor != null) return typedVisitor.VisitObjectCreateScalarExpression(this); + else return visitor.VisitChildren(this); + } + } + public partial class ArrayCreateScalarExpressionContext : Primary_expressionContext { public Scalar_expression_listContext scalar_expression_list() { return GetRuleContext(0); } - public FunctionCallScalarExpressionContext(Primary_expressionContext context) { CopyFrom(context); } + public ArrayCreateScalarExpressionContext(Primary_expressionContext context) { CopyFrom(context); } public override void EnterRule(IParseTreeListener listener) { IsqlListener typedListener = listener as IsqlListener; - if (typedListener != null) typedListener.EnterFunctionCallScalarExpression(this); + if (typedListener != null) typedListener.EnterArrayCreateScalarExpression(this); } public override void ExitRule(IParseTreeListener listener) { IsqlListener typedListener = listener as IsqlListener; - if (typedListener != null) typedListener.ExitFunctionCallScalarExpression(this); + if (typedListener != null) typedListener.ExitArrayCreateScalarExpression(this); } public override TResult Accept(IParseTreeVisitor visitor) { IsqlVisitor typedVisitor = visitor as IsqlVisitor; - if (typedVisitor != null) return typedVisitor.VisitFunctionCallScalarExpression(this); + if (typedVisitor != null) return typedVisitor.VisitArrayCreateScalarExpression(this); else return visitor.VisitChildren(this); } } - public partial class LiteralScalarExpressionContext : Primary_expressionContext { - public LiteralContext literal() { - return GetRuleContext(0); + public partial class MemberIndexerScalarExpressionContext : Primary_expressionContext { + public Primary_expressionContext primary_expression() { + return GetRuleContext(0); } - public LiteralScalarExpressionContext(Primary_expressionContext context) { CopyFrom(context); } + public Scalar_expressionContext scalar_expression() { + return GetRuleContext(0); + } + public MemberIndexerScalarExpressionContext(Primary_expressionContext context) { CopyFrom(context); } public override void EnterRule(IParseTreeListener listener) { IsqlListener typedListener = listener as IsqlListener; - if (typedListener != null) typedListener.EnterLiteralScalarExpression(this); + if (typedListener != null) typedListener.EnterMemberIndexerScalarExpression(this); } public override void ExitRule(IParseTreeListener listener) { IsqlListener typedListener = listener as IsqlListener; - if (typedListener != null) typedListener.ExitLiteralScalarExpression(this); + if (typedListener != null) typedListener.ExitMemberIndexerScalarExpression(this); } public override TResult Accept(IParseTreeVisitor visitor) { IsqlVisitor typedVisitor = visitor as IsqlVisitor; - if (typedVisitor != null) return typedVisitor.VisitLiteralScalarExpression(this); + if (typedVisitor != null) return typedVisitor.VisitMemberIndexerScalarExpression(this); else return visitor.VisitChildren(this); } } - public partial class ObjectCreateScalarExpressionContext : Primary_expressionContext { - public Object_property_listContext object_property_list() { - return GetRuleContext(0); + public partial class SubqueryScalarExpressionContext : Primary_expressionContext { + public Sql_queryContext sql_query() { + return GetRuleContext(0); } - public ObjectCreateScalarExpressionContext(Primary_expressionContext context) { CopyFrom(context); } + public SubqueryScalarExpressionContext(Primary_expressionContext context) { CopyFrom(context); } public override void EnterRule(IParseTreeListener listener) { IsqlListener typedListener = listener as IsqlListener; - if (typedListener != null) typedListener.EnterObjectCreateScalarExpression(this); + if (typedListener != null) typedListener.EnterSubqueryScalarExpression(this); } public override void ExitRule(IParseTreeListener listener) { IsqlListener typedListener = listener as IsqlListener; - if (typedListener != null) typedListener.ExitObjectCreateScalarExpression(this); + if (typedListener != null) typedListener.ExitSubqueryScalarExpression(this); } public override TResult Accept(IParseTreeVisitor visitor) { IsqlVisitor typedVisitor = visitor as IsqlVisitor; - if (typedVisitor != null) return typedVisitor.VisitObjectCreateScalarExpression(this); + if (typedVisitor != null) return typedVisitor.VisitSubqueryScalarExpression(this); + else return visitor.VisitChildren(this); + } + } + public partial class PropertyRefScalarExpressionBaseContext : Primary_expressionContext { + public IdentifierContext identifier() { + return GetRuleContext(0); + } + public PropertyRefScalarExpressionBaseContext(Primary_expressionContext context) { CopyFrom(context); } + public override void EnterRule(IParseTreeListener listener) { + IsqlListener typedListener = listener as IsqlListener; + if (typedListener != null) typedListener.EnterPropertyRefScalarExpressionBase(this); + } + public override void ExitRule(IParseTreeListener listener) { + IsqlListener typedListener = listener as IsqlListener; + if (typedListener != null) typedListener.ExitPropertyRefScalarExpressionBase(this); + } + public override TResult Accept(IParseTreeVisitor visitor) { + IsqlVisitor typedVisitor = visitor as IsqlVisitor; + if (typedVisitor != null) return typedVisitor.VisitPropertyRefScalarExpressionBase(this); + else return visitor.VisitChildren(this); + } + } + public partial class FunctionCallScalarExpressionContext : Primary_expressionContext { + public Function_call_scalar_expressionContext function_call_scalar_expression() { + return GetRuleContext(0); + } + public FunctionCallScalarExpressionContext(Primary_expressionContext context) { CopyFrom(context); } + public override void EnterRule(IParseTreeListener listener) { + IsqlListener typedListener = listener as IsqlListener; + if (typedListener != null) typedListener.EnterFunctionCallScalarExpression(this); + } + public override void ExitRule(IParseTreeListener listener) { + IsqlListener typedListener = listener as IsqlListener; + if (typedListener != null) typedListener.ExitFunctionCallScalarExpression(this); + } + public override TResult Accept(IParseTreeVisitor visitor) { + IsqlVisitor typedVisitor = visitor as IsqlVisitor; + if (typedVisitor != null) return typedVisitor.VisitFunctionCallScalarExpression(this); else return visitor.VisitChildren(this); } } @@ -3025,25 +3105,6 @@ public override TResult Accept(IParseTreeVisitor visitor) { else return visitor.VisitChildren(this); } } - public partial class ArrayCreateScalarExpressionContext : Primary_expressionContext { - public Scalar_expression_listContext scalar_expression_list() { - return GetRuleContext(0); - } - public ArrayCreateScalarExpressionContext(Primary_expressionContext context) { CopyFrom(context); } - public override void EnterRule(IParseTreeListener listener) { - IsqlListener typedListener = listener as IsqlListener; - if (typedListener != null) typedListener.EnterArrayCreateScalarExpression(this); - } - public override void ExitRule(IParseTreeListener listener) { - IsqlListener typedListener = listener as IsqlListener; - if (typedListener != null) typedListener.ExitArrayCreateScalarExpression(this); - } - public override TResult Accept(IParseTreeVisitor visitor) { - IsqlVisitor typedVisitor = visitor as IsqlVisitor; - if (typedVisitor != null) return typedVisitor.VisitArrayCreateScalarExpression(this); - else return visitor.VisitChildren(this); - } - } public partial class ExistsScalarExpressionContext : Primary_expressionContext { public ITerminalNode K_EXISTS() { return GetToken(sqlParser.K_EXISTS, 0); } public Sql_queryContext sql_query() { @@ -3084,33 +3145,13 @@ public override TResult Accept(IParseTreeVisitor visitor) { else return visitor.VisitChildren(this); } } - public partial class MemberIndexerScalarExpressionContext : Primary_expressionContext { - public Primary_expressionContext primary_expression() { - return GetRuleContext(0); - } - public Scalar_expressionContext scalar_expression() { - return GetRuleContext(0); - } - public MemberIndexerScalarExpressionContext(Primary_expressionContext context) { CopyFrom(context); } - public override void EnterRule(IParseTreeListener listener) { - IsqlListener typedListener = listener as IsqlListener; - if (typedListener != null) typedListener.EnterMemberIndexerScalarExpression(this); - } - public override void ExitRule(IParseTreeListener listener) { - IsqlListener typedListener = listener as IsqlListener; - if (typedListener != null) typedListener.ExitMemberIndexerScalarExpression(this); - } - public override TResult Accept(IParseTreeVisitor visitor) { - IsqlVisitor typedVisitor = visitor as IsqlVisitor; - if (typedVisitor != null) return typedVisitor.VisitMemberIndexerScalarExpression(this); - else return visitor.VisitChildren(this); - } - } public partial class PropertyRefScalarExpressionRecursiveContext : Primary_expressionContext { public Primary_expressionContext primary_expression() { return GetRuleContext(0); } - public ITerminalNode IDENTIFIER() { return GetToken(sqlParser.IDENTIFIER, 0); } + public IdentifierContext identifier() { + return GetRuleContext(0); + } public PropertyRefScalarExpressionRecursiveContext(Primary_expressionContext context) { CopyFrom(context); } public override void EnterRule(IParseTreeListener listener) { IsqlListener typedListener = listener as IsqlListener; @@ -3144,16 +3185,16 @@ private Primary_expressionContext primary_expression(int _p) { int _alt; EnterOuterAlt(_localctx, 1); { - State = 396; + State = 397; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,37,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,35,Context) ) { case 1: { _localctx = new PropertyRefScalarExpressionBaseContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 355; Match(IDENTIFIER); + State = 360; identifier(); } break; case 2: @@ -3161,7 +3202,7 @@ private Primary_expressionContext primary_expression(int _p) { _localctx = new ParameterRefScalarExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 356; Match(PARAMETER); + State = 361; Match(PARAMETER); } break; case 3: @@ -3169,7 +3210,7 @@ private Primary_expressionContext primary_expression(int _p) { _localctx = new LiteralScalarExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 357; literal(); + State = 362; literal(); } break; case 4: @@ -3177,17 +3218,17 @@ private Primary_expressionContext primary_expression(int _p) { _localctx = new ArrayCreateScalarExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 358; Match(T__5); - State = 360; + State = 363; Match(T__5); + State = 365; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__2) | (1L << T__5) | (1L << T__12) | (1L << T__13) | (1L << T__24) | (1L << T__25) | (1L << K_ARRAY) | (1L << K_EXISTS) | (1L << K_FALSE) | (1L << K_NOT) | (1L << K_NULL) | (1L << K_TRUE) | (1L << K_UDF) | (1L << K_UNDEFINED) | (1L << NUMERIC_LITERAL) | (1L << STRING_LITERAL) | (1L << IDENTIFIER) | (1L << PARAMETER))) != 0)) { + if (((((_la - 3)) & ~0x3f) == 0 && ((1L << (_la - 3)) & ((1L << (T__2 - 3)) | (1L << (T__5 - 3)) | (1L << (T__12 - 3)) | (1L << (T__13 - 3)) | (1L << (T__24 - 3)) | (1L << (T__25 - 3)) | (1L << (K_ALL - 3)) | (1L << (K_ARRAY - 3)) | (1L << (K_EXISTS - 3)) | (1L << (K_FALSE - 3)) | (1L << (K_LEFT - 3)) | (1L << (K_NOT - 3)) | (1L << (K_NULL - 3)) | (1L << (K_RIGHT - 3)) | (1L << (K_TRUE - 3)) | (1L << (K_UDF - 3)) | (1L << (K_UNDEFINED - 3)) | (1L << (NUMERIC_LITERAL - 3)) | (1L << (STRING_LITERAL - 3)) | (1L << (LEX_IDENTIFIER - 3)) | (1L << (PARAMETER - 3)))) != 0)) { { - State = 359; scalar_expression_list(); + State = 364; scalar_expression_list(); } } - State = 362; Match(T__6); + State = 367; Match(T__6); } break; case 5: @@ -3195,63 +3236,45 @@ private Primary_expressionContext primary_expression(int _p) { _localctx = new ObjectCreateScalarExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 363; Match(T__25); - State = 365; + State = 368; Match(T__25); + State = 370; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==STRING_LITERAL) { { - State = 364; object_property_list(); + State = 369; object_property_list(); } } - State = 367; Match(T__26); + State = 372; Match(T__26); } break; case 6: { - _localctx = new FunctionCallScalarExpressionContext(_localctx); + _localctx = new ParenthesizedScalarExperessionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 370; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - if (_la==K_UDF) { - { - State = 368; Match(K_UDF); - State = 369; Match(T__4); - } - } - - State = 372; Match(IDENTIFIER); State = 373; Match(T__2); - State = 375; - ErrorHandler.Sync(this); - _la = TokenStream.LA(1); - if ((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << T__2) | (1L << T__5) | (1L << T__12) | (1L << T__13) | (1L << T__24) | (1L << T__25) | (1L << K_ARRAY) | (1L << K_EXISTS) | (1L << K_FALSE) | (1L << K_NOT) | (1L << K_NULL) | (1L << K_TRUE) | (1L << K_UDF) | (1L << K_UNDEFINED) | (1L << NUMERIC_LITERAL) | (1L << STRING_LITERAL) | (1L << IDENTIFIER) | (1L << PARAMETER))) != 0)) { - { - State = 374; scalar_expression_list(); - } - } - - State = 377; Match(T__3); + State = 374; scalar_expression(0); + State = 375; Match(T__3); } break; case 7: { - _localctx = new ParenthesizedScalarExperessionContext(_localctx); + _localctx = new SubqueryScalarExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 378; Match(T__2); - State = 379; scalar_expression(0); - State = 380; Match(T__3); + State = 377; Match(T__2); + State = 378; sql_query(); + State = 379; Match(T__3); } break; case 8: { - _localctx = new SubqueryScalarExpressionContext(_localctx); + _localctx = new ExistsScalarExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; + State = 381; Match(K_EXISTS); State = 382; Match(T__2); State = 383; sql_query(); State = 384; Match(T__3); @@ -3259,10 +3282,10 @@ private Primary_expressionContext primary_expression(int _p) { break; case 9: { - _localctx = new ExistsScalarExpressionContext(_localctx); + _localctx = new ArrayScalarExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 386; Match(K_EXISTS); + State = 386; Match(K_ARRAY); State = 387; Match(T__2); State = 388; sql_query(); State = 389; Match(T__3); @@ -3270,56 +3293,64 @@ private Primary_expressionContext primary_expression(int _p) { break; case 10: { - _localctx = new ArrayScalarExpressionContext(_localctx); + _localctx = new AllScalarExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 391; Match(K_ARRAY); + State = 391; Match(K_ALL); State = 392; Match(T__2); State = 393; sql_query(); State = 394; Match(T__3); } break; + case 11: + { + _localctx = new FunctionCallScalarExpressionContext(_localctx); + Context = _localctx; + _prevctx = _localctx; + State = 396; function_call_scalar_expression(); + } + break; } Context.Stop = TokenStream.LT(-1); - State = 408; + State = 409; ErrorHandler.Sync(this); - _alt = Interpreter.AdaptivePredict(TokenStream,39,Context); + _alt = Interpreter.AdaptivePredict(TokenStream,37,Context); while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) { if ( _alt==1 ) { if ( ParseListeners!=null ) TriggerExitRuleEvent(); _prevctx = _localctx; { - State = 406; + State = 407; ErrorHandler.Sync(this); - switch ( Interpreter.AdaptivePredict(TokenStream,38,Context) ) { + switch ( Interpreter.AdaptivePredict(TokenStream,36,Context) ) { case 1: { _localctx = new PropertyRefScalarExpressionRecursiveContext(new Primary_expressionContext(_parentctx, _parentState)); PushNewRecursionContext(_localctx, _startState, RULE_primary_expression); - State = 398; - if (!(Precpred(Context, 4))) throw new FailedPredicateException(this, "Precpred(Context, 4)"); - State = 399; Match(T__4); - State = 400; Match(IDENTIFIER); + State = 399; + if (!(Precpred(Context, 6))) throw new FailedPredicateException(this, "Precpred(Context, 6)"); + State = 400; Match(T__4); + State = 401; identifier(); } break; case 2: { _localctx = new MemberIndexerScalarExpressionContext(new Primary_expressionContext(_parentctx, _parentState)); PushNewRecursionContext(_localctx, _startState, RULE_primary_expression); - State = 401; - if (!(Precpred(Context, 3))) throw new FailedPredicateException(this, "Precpred(Context, 3)"); - State = 402; Match(T__5); - State = 403; scalar_expression(0); - State = 404; Match(T__6); + State = 402; + if (!(Precpred(Context, 5))) throw new FailedPredicateException(this, "Precpred(Context, 5)"); + State = 403; Match(T__5); + State = 404; scalar_expression(0); + State = 405; Match(T__6); } break; } } } - State = 410; + State = 411; ErrorHandler.Sync(this); - _alt = Interpreter.AdaptivePredict(TokenStream,39,Context); + _alt = Interpreter.AdaptivePredict(TokenStream,37,Context); } } } @@ -3334,6 +3365,123 @@ private Primary_expressionContext primary_expression(int _p) { return _localctx; } + public partial class Function_call_scalar_expressionContext : ParserRuleContext { + public IdentifierContext identifier() { + return GetRuleContext(0); + } + public ITerminalNode K_UDF() { return GetToken(sqlParser.K_UDF, 0); } + public Scalar_expression_listContext scalar_expression_list() { + return GetRuleContext(0); + } + public ITerminalNode K_LEFT() { return GetToken(sqlParser.K_LEFT, 0); } + public ITerminalNode K_RIGHT() { return GetToken(sqlParser.K_RIGHT, 0); } + public Function_call_scalar_expressionContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_function_call_scalar_expression; } } + public override void EnterRule(IParseTreeListener listener) { + IsqlListener typedListener = listener as IsqlListener; + if (typedListener != null) typedListener.EnterFunction_call_scalar_expression(this); + } + public override void ExitRule(IParseTreeListener listener) { + IsqlListener typedListener = listener as IsqlListener; + if (typedListener != null) typedListener.ExitFunction_call_scalar_expression(this); + } + public override TResult Accept(IParseTreeVisitor visitor) { + IsqlVisitor typedVisitor = visitor as IsqlVisitor; + if (typedVisitor != null) return typedVisitor.VisitFunction_call_scalar_expression(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public Function_call_scalar_expressionContext function_call_scalar_expression() { + Function_call_scalar_expressionContext _localctx = new Function_call_scalar_expressionContext(Context, State); + EnterRule(_localctx, 78, RULE_function_call_scalar_expression); + int _la; + try { + State = 435; + ErrorHandler.Sync(this); + switch (TokenStream.LA(1)) { + case K_ALL: + case K_UDF: + case LEX_IDENTIFIER: + EnterOuterAlt(_localctx, 1); + { + State = 414; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + if (_la==K_UDF) { + { + State = 412; Match(K_UDF); + State = 413; Match(T__4); + } + } + + State = 416; identifier(); + State = 417; Match(T__2); + State = 419; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + if (((((_la - 3)) & ~0x3f) == 0 && ((1L << (_la - 3)) & ((1L << (T__2 - 3)) | (1L << (T__5 - 3)) | (1L << (T__12 - 3)) | (1L << (T__13 - 3)) | (1L << (T__24 - 3)) | (1L << (T__25 - 3)) | (1L << (K_ALL - 3)) | (1L << (K_ARRAY - 3)) | (1L << (K_EXISTS - 3)) | (1L << (K_FALSE - 3)) | (1L << (K_LEFT - 3)) | (1L << (K_NOT - 3)) | (1L << (K_NULL - 3)) | (1L << (K_RIGHT - 3)) | (1L << (K_TRUE - 3)) | (1L << (K_UDF - 3)) | (1L << (K_UNDEFINED - 3)) | (1L << (NUMERIC_LITERAL - 3)) | (1L << (STRING_LITERAL - 3)) | (1L << (LEX_IDENTIFIER - 3)) | (1L << (PARAMETER - 3)))) != 0)) { + { + State = 418; scalar_expression_list(); + } + } + + State = 421; Match(T__3); + } + break; + case K_LEFT: + EnterOuterAlt(_localctx, 2); + { + State = 423; Match(K_LEFT); + State = 424; Match(T__2); + State = 426; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + if (((((_la - 3)) & ~0x3f) == 0 && ((1L << (_la - 3)) & ((1L << (T__2 - 3)) | (1L << (T__5 - 3)) | (1L << (T__12 - 3)) | (1L << (T__13 - 3)) | (1L << (T__24 - 3)) | (1L << (T__25 - 3)) | (1L << (K_ALL - 3)) | (1L << (K_ARRAY - 3)) | (1L << (K_EXISTS - 3)) | (1L << (K_FALSE - 3)) | (1L << (K_LEFT - 3)) | (1L << (K_NOT - 3)) | (1L << (K_NULL - 3)) | (1L << (K_RIGHT - 3)) | (1L << (K_TRUE - 3)) | (1L << (K_UDF - 3)) | (1L << (K_UNDEFINED - 3)) | (1L << (NUMERIC_LITERAL - 3)) | (1L << (STRING_LITERAL - 3)) | (1L << (LEX_IDENTIFIER - 3)) | (1L << (PARAMETER - 3)))) != 0)) { + { + State = 425; scalar_expression_list(); + } + } + + State = 428; Match(T__3); + } + break; + case K_RIGHT: + EnterOuterAlt(_localctx, 3); + { + State = 429; Match(K_RIGHT); + State = 430; Match(T__2); + State = 432; + ErrorHandler.Sync(this); + _la = TokenStream.LA(1); + if (((((_la - 3)) & ~0x3f) == 0 && ((1L << (_la - 3)) & ((1L << (T__2 - 3)) | (1L << (T__5 - 3)) | (1L << (T__12 - 3)) | (1L << (T__13 - 3)) | (1L << (T__24 - 3)) | (1L << (T__25 - 3)) | (1L << (K_ALL - 3)) | (1L << (K_ARRAY - 3)) | (1L << (K_EXISTS - 3)) | (1L << (K_FALSE - 3)) | (1L << (K_LEFT - 3)) | (1L << (K_NOT - 3)) | (1L << (K_NULL - 3)) | (1L << (K_RIGHT - 3)) | (1L << (K_TRUE - 3)) | (1L << (K_UDF - 3)) | (1L << (K_UNDEFINED - 3)) | (1L << (NUMERIC_LITERAL - 3)) | (1L << (STRING_LITERAL - 3)) | (1L << (LEX_IDENTIFIER - 3)) | (1L << (PARAMETER - 3)))) != 0)) { + { + State = 431; scalar_expression_list(); + } + } + + State = 434; Match(T__3); + } + break; + default: + throw new NoViableAltException(this); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + public partial class Scalar_expression_listContext : ParserRuleContext { public Scalar_expressionContext[] scalar_expression() { return GetRuleContexts(); @@ -3364,23 +3512,23 @@ public override TResult Accept(IParseTreeVisitor visitor) { [RuleVersion(0)] public Scalar_expression_listContext scalar_expression_list() { Scalar_expression_listContext _localctx = new Scalar_expression_listContext(Context, State); - EnterRule(_localctx, 78, RULE_scalar_expression_list); + EnterRule(_localctx, 80, RULE_scalar_expression_list); int _la; try { EnterOuterAlt(_localctx, 1); { - State = 411; scalar_expression(0); - State = 416; + State = 437; scalar_expression(0); + State = 442; ErrorHandler.Sync(this); _la = TokenStream.LA(1); while (_la==T__1) { { { - State = 412; Match(T__1); - State = 413; scalar_expression(0); + State = 438; Match(T__1); + State = 439; scalar_expression(0); } } - State = 418; + State = 444; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } @@ -3427,23 +3575,23 @@ public override TResult Accept(IParseTreeVisitor visitor) { [RuleVersion(0)] public Object_property_listContext object_property_list() { Object_property_listContext _localctx = new Object_property_listContext(Context, State); - EnterRule(_localctx, 80, RULE_object_property_list); + EnterRule(_localctx, 82, RULE_object_property_list); int _la; try { EnterOuterAlt(_localctx, 1); { - State = 419; object_property(); - State = 424; + State = 445; object_property(); + State = 450; ErrorHandler.Sync(this); _la = TokenStream.LA(1); while (_la==T__1) { { { - State = 420; Match(T__1); - State = 421; object_property(); + State = 446; Match(T__1); + State = 447; object_property(); } } - State = 426; + State = 452; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } @@ -3488,13 +3636,66 @@ public override TResult Accept(IParseTreeVisitor visitor) { [RuleVersion(0)] public Object_propertyContext object_property() { Object_propertyContext _localctx = new Object_propertyContext(Context, State); - EnterRule(_localctx, 82, RULE_object_property); + EnterRule(_localctx, 84, RULE_object_property); try { EnterOuterAlt(_localctx, 1); { - State = 427; Match(STRING_LITERAL); - State = 428; Match(T__8); - State = 429; scalar_expression(0); + State = 453; Match(STRING_LITERAL); + State = 454; Match(T__8); + State = 455; scalar_expression(0); + } + } + catch (RecognitionException re) { + _localctx.exception = re; + ErrorHandler.ReportError(this, re); + ErrorHandler.Recover(this, re); + } + finally { + ExitRule(); + } + return _localctx; + } + + public partial class IdentifierContext : ParserRuleContext { + public ITerminalNode LEX_IDENTIFIER() { return GetToken(sqlParser.LEX_IDENTIFIER, 0); } + public ITerminalNode K_ALL() { return GetToken(sqlParser.K_ALL, 0); } + public IdentifierContext(ParserRuleContext parent, int invokingState) + : base(parent, invokingState) + { + } + public override int RuleIndex { get { return RULE_identifier; } } + public override void EnterRule(IParseTreeListener listener) { + IsqlListener typedListener = listener as IsqlListener; + if (typedListener != null) typedListener.EnterIdentifier(this); + } + public override void ExitRule(IParseTreeListener listener) { + IsqlListener typedListener = listener as IsqlListener; + if (typedListener != null) typedListener.ExitIdentifier(this); + } + public override TResult Accept(IParseTreeVisitor visitor) { + IsqlVisitor typedVisitor = visitor as IsqlVisitor; + if (typedVisitor != null) return typedVisitor.VisitIdentifier(this); + else return visitor.VisitChildren(this); + } + } + + [RuleVersion(0)] + public IdentifierContext identifier() { + IdentifierContext _localctx = new IdentifierContext(Context, State); + EnterRule(_localctx, 86, RULE_identifier); + int _la; + try { + EnterOuterAlt(_localctx, 1); + { + State = 457; + _la = TokenStream.LA(1); + if ( !(_la==K_ALL || _la==LEX_IDENTIFIER) ) { + ErrorHandler.RecoverInline(this); + } + else { + ErrorHandler.ReportMatch(this); + Consume(); + } } } catch (RecognitionException re) { @@ -3538,12 +3739,12 @@ public override TResult Accept(IParseTreeVisitor visitor) { [RuleVersion(0)] public LiteralContext literal() { LiteralContext _localctx = new LiteralContext(Context, State); - EnterRule(_localctx, 84, RULE_literal); + EnterRule(_localctx, 88, RULE_literal); int _la; try { EnterOuterAlt(_localctx, 1); { - State = 431; + State = 459; _la = TokenStream.LA(1); if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << K_FALSE) | (1L << K_NULL) | (1L << K_TRUE) | (1L << K_UNDEFINED) | (1L << NUMERIC_LITERAL) | (1L << STRING_LITERAL))) != 0)) ) { ErrorHandler.RecoverInline(this); @@ -3619,15 +3820,15 @@ private bool binary_scalar_expression_sempred(Binary_scalar_expressionContext _l } private bool primary_expression_sempred(Primary_expressionContext _localctx, int predIndex) { switch (predIndex) { - case 16: return Precpred(Context, 4); - case 17: return Precpred(Context, 3); + case 16: return Precpred(Context, 6); + case 17: return Precpred(Context, 5); } return true; } private static char[] _serializedATN = { '\x3', '\x608B', '\xA72A', '\x8133', '\xB9ED', '\x417C', '\x3BE7', '\x7786', - '\x5964', '\x3', '?', '\x1B4', '\x4', '\x2', '\t', '\x2', '\x4', '\x3', + '\x5964', '\x3', '\x42', '\x1D0', '\x4', '\x2', '\t', '\x2', '\x4', '\x3', '\t', '\x3', '\x4', '\x4', '\t', '\x4', '\x4', '\x5', '\t', '\x5', '\x4', '\x6', '\t', '\x6', '\x4', '\a', '\t', '\a', '\x4', '\b', '\t', '\b', '\x4', '\t', '\t', '\t', '\x4', '\n', '\t', '\n', '\x4', '\v', '\t', '\v', @@ -3643,358 +3844,383 @@ private bool primary_expression_sempred(Primary_expressionContext _localctx, int '#', '\t', '#', '\x4', '$', '\t', '$', '\x4', '%', '\t', '%', '\x4', '&', '\t', '&', '\x4', '\'', '\t', '\'', '\x4', '(', '\t', '(', '\x4', ')', '\t', ')', '\x4', '*', '\t', '*', '\x4', '+', '\t', '+', '\x4', ',', '\t', - ',', '\x3', '\x2', '\x3', '\x2', '\x3', '\x2', '\x3', '\x3', '\x3', '\x3', - '\x5', '\x3', '^', '\n', '\x3', '\x3', '\x3', '\x5', '\x3', '\x61', '\n', - '\x3', '\x3', '\x3', '\x5', '\x3', '\x64', '\n', '\x3', '\x3', '\x3', - '\x5', '\x3', 'g', '\n', '\x3', '\x3', '\x3', '\x5', '\x3', 'j', '\n', - '\x3', '\x3', '\x4', '\x3', '\x4', '\x5', '\x4', 'n', '\n', '\x4', '\x3', - '\x4', '\x5', '\x4', 'q', '\n', '\x4', '\x3', '\x4', '\x3', '\x4', '\x3', - '\x5', '\x3', '\x5', '\x3', '\x5', '\x3', '\x6', '\x3', '\x6', '\x3', - '\x6', '\x5', '\x6', '{', '\n', '\x6', '\x3', '\a', '\x3', '\a', '\x3', - '\b', '\x3', '\b', '\x3', '\b', '\x3', '\t', '\x3', '\t', '\x3', '\t', - '\a', '\t', '\x85', '\n', '\t', '\f', '\t', '\xE', '\t', '\x88', '\v', - '\t', '\x3', '\n', '\x3', '\n', '\x3', '\n', '\x5', '\n', '\x8D', '\n', - '\n', '\x3', '\v', '\x3', '\v', '\x3', '\v', '\x3', '\f', '\x3', '\f', - '\x3', '\f', '\x5', '\f', '\x95', '\n', '\f', '\x3', '\f', '\x5', '\f', - '\x98', '\n', '\f', '\x3', '\f', '\x3', '\f', '\x3', '\f', '\x5', '\f', - '\x9D', '\n', '\f', '\x3', '\f', '\x3', '\f', '\x3', '\f', '\a', '\f', - '\xA2', '\n', '\f', '\f', '\f', '\xE', '\f', '\xA5', '\v', '\f', '\x3', - '\r', '\x3', '\r', '\x5', '\r', '\xA9', '\n', '\r', '\x3', '\r', '\x3', - '\r', '\x3', '\r', '\x3', '\r', '\x5', '\r', '\xAF', '\n', '\r', '\x3', + ',', '\x4', '-', '\t', '-', '\x4', '.', '\t', '.', '\x3', '\x2', '\x3', + '\x2', '\x3', '\x2', '\x3', '\x3', '\x3', '\x3', '\x5', '\x3', '\x62', + '\n', '\x3', '\x3', '\x3', '\x5', '\x3', '\x65', '\n', '\x3', '\x3', '\x3', + '\x5', '\x3', 'h', '\n', '\x3', '\x3', '\x3', '\x5', '\x3', 'k', '\n', + '\x3', '\x3', '\x3', '\x5', '\x3', 'n', '\n', '\x3', '\x3', '\x4', '\x3', + '\x4', '\x5', '\x4', 'r', '\n', '\x4', '\x3', '\x4', '\x5', '\x4', 'u', + '\n', '\x4', '\x3', '\x4', '\x3', '\x4', '\x3', '\x5', '\x3', '\x5', '\x3', + '\x5', '\x3', '\x6', '\x3', '\x6', '\x3', '\x6', '\x5', '\x6', '\x7F', + '\n', '\x6', '\x3', '\a', '\x3', '\a', '\x3', '\b', '\x3', '\b', '\x3', + '\b', '\x3', '\t', '\x3', '\t', '\x3', '\t', '\a', '\t', '\x89', '\n', + '\t', '\f', '\t', '\xE', '\t', '\x8C', '\v', '\t', '\x3', '\n', '\x3', + '\n', '\x3', '\n', '\x5', '\n', '\x91', '\n', '\n', '\x3', '\v', '\x3', + '\v', '\x3', '\v', '\x3', '\f', '\x3', '\f', '\x3', '\f', '\x5', '\f', + '\x99', '\n', '\f', '\x3', '\f', '\x5', '\f', '\x9C', '\n', '\f', '\x3', + '\f', '\x3', '\f', '\x3', '\f', '\x3', '\f', '\x5', '\f', '\xA2', '\n', + '\f', '\x3', '\f', '\x3', '\f', '\x3', '\f', '\a', '\f', '\xA7', '\n', + '\f', '\f', '\f', '\xE', '\f', '\xAA', '\v', '\f', '\x3', '\r', '\x3', + '\r', '\x5', '\r', '\xAE', '\n', '\r', '\x3', '\r', '\x3', '\r', '\x3', + '\r', '\x3', '\r', '\x5', '\r', '\xB4', '\n', '\r', '\x3', '\xE', '\x3', '\xE', '\x3', '\xE', '\x3', '\xE', '\x3', '\xE', '\x3', '\xE', '\x3', '\xE', '\x3', '\xE', '\x3', '\xE', '\x3', '\xE', '\x3', '\xE', '\x3', - '\xE', '\x3', '\xE', '\a', '\xE', '\xBD', '\n', '\xE', '\f', '\xE', '\xE', - '\xE', '\xC0', '\v', '\xE', '\x3', '\xF', '\x3', '\xF', '\x3', '\xF', - '\x3', '\x10', '\x3', '\x10', '\x3', '\x10', '\x3', '\x10', '\x3', '\x11', - '\x3', '\x11', '\x3', '\x11', '\x3', '\x11', '\x3', '\x12', '\x3', '\x12', - '\x3', '\x12', '\a', '\x12', '\xD0', '\n', '\x12', '\f', '\x12', '\xE', - '\x12', '\xD3', '\v', '\x12', '\x3', '\x13', '\x3', '\x13', '\x5', '\x13', - '\xD7', '\n', '\x13', '\x3', '\x14', '\x3', '\x14', '\x3', '\x15', '\x3', - '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x16', '\x3', - '\x16', '\x3', '\x17', '\x3', '\x17', '\x3', '\x18', '\x3', '\x18', '\x3', - '\x18', '\x3', '\x18', '\x5', '\x18', '\xE8', '\n', '\x18', '\x3', '\x18', - '\x3', '\x18', '\x3', '\x18', '\x3', '\x18', '\x3', '\x18', '\x5', '\x18', - '\xEF', '\n', '\x18', '\x3', '\x18', '\x3', '\x18', '\x3', '\x18', '\x3', + '\xE', '\a', '\xE', '\xC2', '\n', '\xE', '\f', '\xE', '\xE', '\xE', '\xC5', + '\v', '\xE', '\x3', '\xF', '\x3', '\xF', '\x3', '\xF', '\x3', '\x10', + '\x3', '\x10', '\x3', '\x10', '\x3', '\x10', '\x3', '\x11', '\x3', '\x11', + '\x3', '\x11', '\x3', '\x11', '\x3', '\x12', '\x3', '\x12', '\x3', '\x12', + '\a', '\x12', '\xD5', '\n', '\x12', '\f', '\x12', '\xE', '\x12', '\xD8', + '\v', '\x12', '\x3', '\x13', '\x3', '\x13', '\x5', '\x13', '\xDC', '\n', + '\x13', '\x3', '\x14', '\x3', '\x14', '\x3', '\x15', '\x3', '\x15', '\x3', + '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x16', '\x3', '\x16', '\x3', + '\x17', '\x3', '\x17', '\x3', '\x18', '\x3', '\x18', '\x3', '\x18', '\x3', + '\x18', '\x5', '\x18', '\xED', '\n', '\x18', '\x3', '\x18', '\x3', '\x18', + '\x3', '\x18', '\x3', '\x18', '\x3', '\x18', '\x5', '\x18', '\xF4', '\n', '\x18', '\x3', '\x18', '\x3', '\x18', '\x3', '\x18', '\x3', '\x18', '\x3', - '\x18', '\a', '\x18', '\xFA', '\n', '\x18', '\f', '\x18', '\xE', '\x18', - '\xFD', '\v', '\x18', '\x3', '\x19', '\x3', '\x19', '\x3', '\x19', '\x3', - '\x19', '\x5', '\x19', '\x103', '\n', '\x19', '\x3', '\x19', '\x3', '\x19', - '\x3', '\x19', '\x3', '\x19', '\x3', '\x19', '\x3', '\x19', '\a', '\x19', - '\x10B', '\n', '\x19', '\f', '\x19', '\xE', '\x19', '\x10E', '\v', '\x19', - '\x3', '\x1A', '\x3', '\x1A', '\x5', '\x1A', '\x112', '\n', '\x1A', '\x3', - '\x1A', '\x3', '\x1A', '\x3', '\x1A', '\x3', '\x1A', '\x3', '\x1A', '\x3', - '\x1B', '\x3', '\x1B', '\x5', '\x1B', '\x11B', '\n', '\x1B', '\x3', '\x1B', - '\x3', '\x1B', '\x3', '\x1B', '\x5', '\x1B', '\x120', '\n', '\x1B', '\x3', - '\x1C', '\x3', '\x1C', '\x3', '\x1C', '\x3', '\x1D', '\x3', '\x1D', '\x3', + '\x18', '\x3', '\x18', '\x3', '\x18', '\x3', '\x18', '\x3', '\x18', '\a', + '\x18', '\xFF', '\n', '\x18', '\f', '\x18', '\xE', '\x18', '\x102', '\v', + '\x18', '\x3', '\x19', '\x3', '\x19', '\x3', '\x19', '\x3', '\x19', '\x5', + '\x19', '\x108', '\n', '\x19', '\x3', '\x19', '\x3', '\x19', '\x3', '\x19', + '\x3', '\x19', '\x3', '\x19', '\x3', '\x19', '\a', '\x19', '\x110', '\n', + '\x19', '\f', '\x19', '\xE', '\x19', '\x113', '\v', '\x19', '\x3', '\x1A', + '\x3', '\x1A', '\x5', '\x1A', '\x117', '\n', '\x1A', '\x3', '\x1A', '\x3', + '\x1A', '\x3', '\x1A', '\x3', '\x1A', '\x3', '\x1A', '\x3', '\x1B', '\x3', + '\x1B', '\x5', '\x1B', '\x120', '\n', '\x1B', '\x3', '\x1B', '\x3', '\x1B', + '\x3', '\x1B', '\x5', '\x1B', '\x125', '\n', '\x1B', '\x3', '\x1C', '\x3', + '\x1C', '\x3', '\x1C', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', - '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\a', '\x1D', '\x148', '\n', '\x1D', - '\f', '\x1D', '\xE', '\x1D', '\x14B', '\v', '\x1D', '\x3', '\x1E', '\x3', - '\x1E', '\x3', '\x1F', '\x3', '\x1F', '\x3', ' ', '\x3', ' ', '\x3', '!', - '\x3', '!', '\x3', '\"', '\x3', '\"', '\x3', '#', '\x3', '#', '\x3', '$', - '\x3', '$', '\x3', '%', '\x3', '%', '\x3', '&', '\x3', '&', '\x3', '&', - '\x3', '&', '\x5', '&', '\x161', '\n', '&', '\x3', '\'', '\x3', '\'', - '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', - '\x5', '(', '\x16B', '\n', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x5', - '(', '\x170', '\n', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x5', '(', - '\x175', '\n', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x5', '(', '\x17A', + '\x1D', '\x3', '\x1D', '\a', '\x1D', '\x14D', '\n', '\x1D', '\f', '\x1D', + '\xE', '\x1D', '\x150', '\v', '\x1D', '\x3', '\x1E', '\x3', '\x1E', '\x3', + '\x1F', '\x3', '\x1F', '\x3', ' ', '\x3', ' ', '\x3', '!', '\x3', '!', + '\x3', '\"', '\x3', '\"', '\x3', '#', '\x3', '#', '\x3', '$', '\x3', '$', + '\x3', '%', '\x3', '%', '\x3', '&', '\x3', '&', '\x3', '&', '\x3', '&', + '\x5', '&', '\x166', '\n', '&', '\x3', '\'', '\x3', '\'', '\x3', '(', + '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x5', '(', + '\x170', '\n', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x5', '(', '\x175', '\n', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', - '\x3', '(', '\x3', '(', '\x5', '(', '\x18F', '\n', '(', '\x3', '(', '\x3', + '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', + '\x3', '(', '\x3', '(', '\x5', '(', '\x190', '\n', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', - '(', '\a', '(', '\x199', '\n', '(', '\f', '(', '\xE', '(', '\x19C', '\v', - '(', '\x3', ')', '\x3', ')', '\x3', ')', '\a', ')', '\x1A1', '\n', ')', - '\f', ')', '\xE', ')', '\x1A4', '\v', ')', '\x3', '*', '\x3', '*', '\x3', - '*', '\a', '*', '\x1A9', '\n', '*', '\f', '*', '\xE', '*', '\x1AC', '\v', - '*', '\x3', '+', '\x3', '+', '\x3', '+', '\x3', '+', '\x3', ',', '\x3', - ',', '\x3', ',', '\x2', '\b', '\x16', '\x1A', '.', '\x30', '\x38', 'N', - '-', '\x2', '\x4', '\x6', '\b', '\n', '\f', '\xE', '\x10', '\x12', '\x14', + '(', '\a', '(', '\x19A', '\n', '(', '\f', '(', '\xE', '(', '\x19D', '\v', + '(', '\x3', ')', '\x3', ')', '\x5', ')', '\x1A1', '\n', ')', '\x3', ')', + '\x3', ')', '\x3', ')', '\x5', ')', '\x1A6', '\n', ')', '\x3', ')', '\x3', + ')', '\x3', ')', '\x3', ')', '\x3', ')', '\x5', ')', '\x1AD', '\n', ')', + '\x3', ')', '\x3', ')', '\x3', ')', '\x3', ')', '\x5', ')', '\x1B3', '\n', + ')', '\x3', ')', '\x5', ')', '\x1B6', '\n', ')', '\x3', '*', '\x3', '*', + '\x3', '*', '\a', '*', '\x1BB', '\n', '*', '\f', '*', '\xE', '*', '\x1BE', + '\v', '*', '\x3', '+', '\x3', '+', '\x3', '+', '\a', '+', '\x1C3', '\n', + '+', '\f', '+', '\xE', '+', '\x1C6', '\v', '+', '\x3', ',', '\x3', ',', + '\x3', ',', '\x3', ',', '\x3', '-', '\x3', '-', '\x3', '.', '\x3', '.', + '\x3', '.', '\x2', '\b', '\x16', '\x1A', '.', '\x30', '\x38', 'N', '/', + '\x2', '\x4', '\x6', '\b', '\n', '\f', '\xE', '\x10', '\x12', '\x14', '\x16', '\x18', '\x1A', '\x1C', '\x1E', ' ', '\"', '$', '&', '(', '*', ',', '.', '\x30', '\x32', '\x34', '\x36', '\x38', ':', '<', '>', '@', - '\x42', '\x44', '\x46', 'H', 'J', 'L', 'N', 'P', 'R', 'T', 'V', '\x2', - '\n', '\x4', '\x2', '<', '<', '?', '?', '\x4', '\x2', '!', '!', '$', '$', - '\x4', '\x2', '\x3', '\x3', '\r', '\xE', '\x3', '\x2', '\xF', '\x10', - '\x3', '\x2', '\x11', '\x14', '\x3', '\x2', '\x15', '\x16', '\x5', '\x2', - '\xF', '\x10', '\x1B', '\x1B', '/', '/', '\a', '\x2', '(', '(', '\x30', - '\x30', '\x36', '\x36', '\x38', '\x38', '<', '=', '\x2', '\x1C3', '\x2', - 'X', '\x3', '\x2', '\x2', '\x2', '\x4', '[', '\x3', '\x2', '\x2', '\x2', - '\x6', 'k', '\x3', '\x2', '\x2', '\x2', '\b', 't', '\x3', '\x2', '\x2', - '\x2', '\n', 'z', '\x3', '\x2', '\x2', '\x2', '\f', '|', '\x3', '\x2', - '\x2', '\x2', '\xE', '~', '\x3', '\x2', '\x2', '\x2', '\x10', '\x81', - '\x3', '\x2', '\x2', '\x2', '\x12', '\x89', '\x3', '\x2', '\x2', '\x2', - '\x14', '\x8E', '\x3', '\x2', '\x2', '\x2', '\x16', '\x9C', '\x3', '\x2', - '\x2', '\x2', '\x18', '\xAE', '\x3', '\x2', '\x2', '\x2', '\x1A', '\xB0', - '\x3', '\x2', '\x2', '\x2', '\x1C', '\xC1', '\x3', '\x2', '\x2', '\x2', - '\x1E', '\xC4', '\x3', '\x2', '\x2', '\x2', ' ', '\xC8', '\x3', '\x2', - '\x2', '\x2', '\"', '\xCC', '\x3', '\x2', '\x2', '\x2', '$', '\xD4', '\x3', - '\x2', '\x2', '\x2', '&', '\xD8', '\x3', '\x2', '\x2', '\x2', '(', '\xDA', - '\x3', '\x2', '\x2', '\x2', '*', '\xDF', '\x3', '\x2', '\x2', '\x2', ',', - '\xE1', '\x3', '\x2', '\x2', '\x2', '.', '\xEE', '\x3', '\x2', '\x2', - '\x2', '\x30', '\x102', '\x3', '\x2', '\x2', '\x2', '\x32', '\x10F', '\x3', - '\x2', '\x2', '\x2', '\x34', '\x118', '\x3', '\x2', '\x2', '\x2', '\x36', - '\x121', '\x3', '\x2', '\x2', '\x2', '\x38', '\x124', '\x3', '\x2', '\x2', - '\x2', ':', '\x14C', '\x3', '\x2', '\x2', '\x2', '<', '\x14E', '\x3', - '\x2', '\x2', '\x2', '>', '\x150', '\x3', '\x2', '\x2', '\x2', '@', '\x152', - '\x3', '\x2', '\x2', '\x2', '\x42', '\x154', '\x3', '\x2', '\x2', '\x2', - '\x44', '\x156', '\x3', '\x2', '\x2', '\x2', '\x46', '\x158', '\x3', '\x2', - '\x2', '\x2', 'H', '\x15A', '\x3', '\x2', '\x2', '\x2', 'J', '\x160', - '\x3', '\x2', '\x2', '\x2', 'L', '\x162', '\x3', '\x2', '\x2', '\x2', - 'N', '\x18E', '\x3', '\x2', '\x2', '\x2', 'P', '\x19D', '\x3', '\x2', - '\x2', '\x2', 'R', '\x1A5', '\x3', '\x2', '\x2', '\x2', 'T', '\x1AD', - '\x3', '\x2', '\x2', '\x2', 'V', '\x1B1', '\x3', '\x2', '\x2', '\x2', - 'X', 'Y', '\x5', '\x4', '\x3', '\x2', 'Y', 'Z', '\a', '\x2', '\x2', '\x3', - 'Z', '\x3', '\x3', '\x2', '\x2', '\x2', '[', ']', '\x5', '\x6', '\x4', - '\x2', '\\', '^', '\x5', '\x14', '\v', '\x2', ']', '\\', '\x3', '\x2', - '\x2', '\x2', ']', '^', '\x3', '\x2', '\x2', '\x2', '^', '`', '\x3', '\x2', - '\x2', '\x2', '_', '\x61', '\x5', '\x1C', '\xF', '\x2', '`', '_', '\x3', - '\x2', '\x2', '\x2', '`', '\x61', '\x3', '\x2', '\x2', '\x2', '\x61', - '\x63', '\x3', '\x2', '\x2', '\x2', '\x62', '\x64', '\x5', '\x1E', '\x10', - '\x2', '\x63', '\x62', '\x3', '\x2', '\x2', '\x2', '\x63', '\x64', '\x3', - '\x2', '\x2', '\x2', '\x64', '\x66', '\x3', '\x2', '\x2', '\x2', '\x65', - 'g', '\x5', ' ', '\x11', '\x2', '\x66', '\x65', '\x3', '\x2', '\x2', '\x2', - '\x66', 'g', '\x3', '\x2', '\x2', '\x2', 'g', 'i', '\x3', '\x2', '\x2', - '\x2', 'h', 'j', '\x5', '(', '\x15', '\x2', 'i', 'h', '\x3', '\x2', '\x2', - '\x2', 'i', 'j', '\x3', '\x2', '\x2', '\x2', 'j', '\x5', '\x3', '\x2', - '\x2', '\x2', 'k', 'm', '\a', '\x34', '\x2', '\x2', 'l', 'n', '\a', '%', - '\x2', '\x2', 'm', 'l', '\x3', '\x2', '\x2', '\x2', 'm', 'n', '\x3', '\x2', - '\x2', '\x2', 'n', 'p', '\x3', '\x2', '\x2', '\x2', 'o', 'q', '\x5', '\b', - '\x5', '\x2', 'p', 'o', '\x3', '\x2', '\x2', '\x2', 'p', 'q', '\x3', '\x2', - '\x2', '\x2', 'q', 'r', '\x3', '\x2', '\x2', '\x2', 'r', 's', '\x5', '\n', - '\x6', '\x2', 's', '\a', '\x3', '\x2', '\x2', '\x2', 't', 'u', '\a', '\x35', - '\x2', '\x2', 'u', 'v', '\t', '\x2', '\x2', '\x2', 'v', '\t', '\x3', '\x2', - '\x2', '\x2', 'w', '{', '\x5', '\f', '\a', '\x2', 'x', '{', '\x5', '\xE', - '\b', '\x2', 'y', '{', '\x5', '\x10', '\t', '\x2', 'z', 'w', '\x3', '\x2', - '\x2', '\x2', 'z', 'x', '\x3', '\x2', '\x2', '\x2', 'z', 'y', '\x3', '\x2', - '\x2', '\x2', '{', '\v', '\x3', '\x2', '\x2', '\x2', '|', '}', '\a', '\x3', - '\x2', '\x2', '}', '\r', '\x3', '\x2', '\x2', '\x2', '~', '\x7F', '\a', - '\x39', '\x2', '\x2', '\x7F', '\x80', '\x5', '.', '\x18', '\x2', '\x80', - '\xF', '\x3', '\x2', '\x2', '\x2', '\x81', '\x86', '\x5', '\x12', '\n', - '\x2', '\x82', '\x83', '\a', '\x4', '\x2', '\x2', '\x83', '\x85', '\x5', - '\x12', '\n', '\x2', '\x84', '\x82', '\x3', '\x2', '\x2', '\x2', '\x85', - '\x88', '\x3', '\x2', '\x2', '\x2', '\x86', '\x84', '\x3', '\x2', '\x2', - '\x2', '\x86', '\x87', '\x3', '\x2', '\x2', '\x2', '\x87', '\x11', '\x3', - '\x2', '\x2', '\x2', '\x88', '\x86', '\x3', '\x2', '\x2', '\x2', '\x89', - '\x8C', '\x5', '.', '\x18', '\x2', '\x8A', '\x8B', '\a', ' ', '\x2', '\x2', - '\x8B', '\x8D', '\a', '>', '\x2', '\x2', '\x8C', '\x8A', '\x3', '\x2', - '\x2', '\x2', '\x8C', '\x8D', '\x3', '\x2', '\x2', '\x2', '\x8D', '\x13', - '\x3', '\x2', '\x2', '\x2', '\x8E', '\x8F', '\a', ')', '\x2', '\x2', '\x8F', - '\x90', '\x5', '\x16', '\f', '\x2', '\x90', '\x15', '\x3', '\x2', '\x2', - '\x2', '\x91', '\x92', '\b', '\f', '\x1', '\x2', '\x92', '\x97', '\x5', - '\x18', '\r', '\x2', '\x93', '\x95', '\a', ' ', '\x2', '\x2', '\x94', - '\x93', '\x3', '\x2', '\x2', '\x2', '\x94', '\x95', '\x3', '\x2', '\x2', - '\x2', '\x95', '\x96', '\x3', '\x2', '\x2', '\x2', '\x96', '\x98', '\a', - '>', '\x2', '\x2', '\x97', '\x94', '\x3', '\x2', '\x2', '\x2', '\x97', - '\x98', '\x3', '\x2', '\x2', '\x2', '\x98', '\x9D', '\x3', '\x2', '\x2', - '\x2', '\x99', '\x9A', '\a', '>', '\x2', '\x2', '\x9A', '\x9B', '\a', - '+', '\x2', '\x2', '\x9B', '\x9D', '\x5', '\x18', '\r', '\x2', '\x9C', - '\x91', '\x3', '\x2', '\x2', '\x2', '\x9C', '\x99', '\x3', '\x2', '\x2', - '\x2', '\x9D', '\xA3', '\x3', '\x2', '\x2', '\x2', '\x9E', '\x9F', '\f', - '\x3', '\x2', '\x2', '\x9F', '\xA0', '\a', ',', '\x2', '\x2', '\xA0', - '\xA2', '\x5', '\x16', '\f', '\x4', '\xA1', '\x9E', '\x3', '\x2', '\x2', - '\x2', '\xA2', '\xA5', '\x3', '\x2', '\x2', '\x2', '\xA3', '\xA1', '\x3', - '\x2', '\x2', '\x2', '\xA3', '\xA4', '\x3', '\x2', '\x2', '\x2', '\xA4', - '\x17', '\x3', '\x2', '\x2', '\x2', '\xA5', '\xA3', '\x3', '\x2', '\x2', - '\x2', '\xA6', '\xA8', '\a', '>', '\x2', '\x2', '\xA7', '\xA9', '\x5', - '\x1A', '\xE', '\x2', '\xA8', '\xA7', '\x3', '\x2', '\x2', '\x2', '\xA8', - '\xA9', '\x3', '\x2', '\x2', '\x2', '\xA9', '\xAF', '\x3', '\x2', '\x2', - '\x2', '\xAA', '\xAB', '\a', '\x5', '\x2', '\x2', '\xAB', '\xAC', '\x5', - '\x4', '\x3', '\x2', '\xAC', '\xAD', '\a', '\x6', '\x2', '\x2', '\xAD', - '\xAF', '\x3', '\x2', '\x2', '\x2', '\xAE', '\xA6', '\x3', '\x2', '\x2', - '\x2', '\xAE', '\xAA', '\x3', '\x2', '\x2', '\x2', '\xAF', '\x19', '\x3', - '\x2', '\x2', '\x2', '\xB0', '\xBE', '\b', '\xE', '\x1', '\x2', '\xB1', - '\xB2', '\f', '\x6', '\x2', '\x2', '\xB2', '\xB3', '\a', '\a', '\x2', - '\x2', '\xB3', '\xBD', '\a', '>', '\x2', '\x2', '\xB4', '\xB5', '\f', - '\x5', '\x2', '\x2', '\xB5', '\xB6', '\a', '\b', '\x2', '\x2', '\xB6', - '\xB7', '\a', '<', '\x2', '\x2', '\xB7', '\xBD', '\a', '\t', '\x2', '\x2', - '\xB8', '\xB9', '\f', '\x4', '\x2', '\x2', '\xB9', '\xBA', '\a', '\b', - '\x2', '\x2', '\xBA', '\xBB', '\a', '=', '\x2', '\x2', '\xBB', '\xBD', - '\a', '\t', '\x2', '\x2', '\xBC', '\xB1', '\x3', '\x2', '\x2', '\x2', - '\xBC', '\xB4', '\x3', '\x2', '\x2', '\x2', '\xBC', '\xB8', '\x3', '\x2', - '\x2', '\x2', '\xBD', '\xC0', '\x3', '\x2', '\x2', '\x2', '\xBE', '\xBC', - '\x3', '\x2', '\x2', '\x2', '\xBE', '\xBF', '\x3', '\x2', '\x2', '\x2', - '\xBF', '\x1B', '\x3', '\x2', '\x2', '\x2', '\xC0', '\xBE', '\x3', '\x2', - '\x2', '\x2', '\xC1', '\xC2', '\a', ':', '\x2', '\x2', '\xC2', '\xC3', - '\x5', '.', '\x18', '\x2', '\xC3', '\x1D', '\x3', '\x2', '\x2', '\x2', - '\xC4', '\xC5', '\a', '*', '\x2', '\x2', '\xC5', '\xC6', '\a', '#', '\x2', - '\x2', '\xC6', '\xC7', '\x5', 'P', ')', '\x2', '\xC7', '\x1F', '\x3', - '\x2', '\x2', '\x2', '\xC8', '\xC9', '\a', '\x33', '\x2', '\x2', '\xC9', - '\xCA', '\a', '#', '\x2', '\x2', '\xCA', '\xCB', '\x5', '\"', '\x12', - '\x2', '\xCB', '!', '\x3', '\x2', '\x2', '\x2', '\xCC', '\xD1', '\x5', - '$', '\x13', '\x2', '\xCD', '\xCE', '\a', '\x4', '\x2', '\x2', '\xCE', - '\xD0', '\x5', '$', '\x13', '\x2', '\xCF', '\xCD', '\x3', '\x2', '\x2', - '\x2', '\xD0', '\xD3', '\x3', '\x2', '\x2', '\x2', '\xD1', '\xCF', '\x3', - '\x2', '\x2', '\x2', '\xD1', '\xD2', '\x3', '\x2', '\x2', '\x2', '\xD2', - '#', '\x3', '\x2', '\x2', '\x2', '\xD3', '\xD1', '\x3', '\x2', '\x2', - '\x2', '\xD4', '\xD6', '\x5', '.', '\x18', '\x2', '\xD5', '\xD7', '\x5', - '&', '\x14', '\x2', '\xD6', '\xD5', '\x3', '\x2', '\x2', '\x2', '\xD6', - '\xD7', '\x3', '\x2', '\x2', '\x2', '\xD7', '%', '\x3', '\x2', '\x2', - '\x2', '\xD8', '\xD9', '\t', '\x3', '\x2', '\x2', '\xD9', '\'', '\x3', - '\x2', '\x2', '\x2', '\xDA', '\xDB', '\a', '\x31', '\x2', '\x2', '\xDB', - '\xDC', '\x5', '*', '\x16', '\x2', '\xDC', '\xDD', '\a', '.', '\x2', '\x2', - '\xDD', '\xDE', '\x5', ',', '\x17', '\x2', '\xDE', ')', '\x3', '\x2', - '\x2', '\x2', '\xDF', '\xE0', '\t', '\x2', '\x2', '\x2', '\xE0', '+', - '\x3', '\x2', '\x2', '\x2', '\xE1', '\xE2', '\t', '\x2', '\x2', '\x2', - '\xE2', '-', '\x3', '\x2', '\x2', '\x2', '\xE3', '\xE4', '\b', '\x18', - '\x1', '\x2', '\xE4', '\xEF', '\x5', '\x30', '\x19', '\x2', '\xE5', '\xE7', - '\x5', '\x38', '\x1D', '\x2', '\xE6', '\xE8', '\a', '/', '\x2', '\x2', - '\xE7', '\xE6', '\x3', '\x2', '\x2', '\x2', '\xE7', '\xE8', '\x3', '\x2', - '\x2', '\x2', '\xE8', '\xE9', '\x3', '\x2', '\x2', '\x2', '\xE9', '\xEA', - '\a', '\"', '\x2', '\x2', '\xEA', '\xEB', '\x5', '\x38', '\x1D', '\x2', - '\xEB', '\xEC', '\a', '\x1E', '\x2', '\x2', '\xEC', '\xED', '\x5', '\x38', - '\x1D', '\x2', '\xED', '\xEF', '\x3', '\x2', '\x2', '\x2', '\xEE', '\xE3', - '\x3', '\x2', '\x2', '\x2', '\xEE', '\xE5', '\x3', '\x2', '\x2', '\x2', - '\xEF', '\xFB', '\x3', '\x2', '\x2', '\x2', '\xF0', '\xF1', '\f', '\x6', - '\x2', '\x2', '\xF1', '\xF2', '\a', '\n', '\x2', '\x2', '\xF2', '\xF3', - '\x5', '.', '\x18', '\x2', '\xF3', '\xF4', '\a', '\v', '\x2', '\x2', '\xF4', - '\xF5', '\x5', '.', '\x18', '\a', '\xF5', '\xFA', '\x3', '\x2', '\x2', - '\x2', '\xF6', '\xF7', '\f', '\x5', '\x2', '\x2', '\xF7', '\xF8', '\a', - '\f', '\x2', '\x2', '\xF8', '\xFA', '\x5', '.', '\x18', '\x6', '\xF9', - '\xF0', '\x3', '\x2', '\x2', '\x2', '\xF9', '\xF6', '\x3', '\x2', '\x2', - '\x2', '\xFA', '\xFD', '\x3', '\x2', '\x2', '\x2', '\xFB', '\xF9', '\x3', - '\x2', '\x2', '\x2', '\xFB', '\xFC', '\x3', '\x2', '\x2', '\x2', '\xFC', - '/', '\x3', '\x2', '\x2', '\x2', '\xFD', '\xFB', '\x3', '\x2', '\x2', - '\x2', '\xFE', '\xFF', '\b', '\x19', '\x1', '\x2', '\xFF', '\x103', '\x5', - '\x38', '\x1D', '\x2', '\x100', '\x103', '\x5', '\x32', '\x1A', '\x2', - '\x101', '\x103', '\x5', '\x34', '\x1B', '\x2', '\x102', '\xFE', '\x3', - '\x2', '\x2', '\x2', '\x102', '\x100', '\x3', '\x2', '\x2', '\x2', '\x102', - '\x101', '\x3', '\x2', '\x2', '\x2', '\x103', '\x10C', '\x3', '\x2', '\x2', - '\x2', '\x104', '\x105', '\f', '\x4', '\x2', '\x2', '\x105', '\x106', - '\a', '\x1E', '\x2', '\x2', '\x106', '\x10B', '\x5', '\x30', '\x19', '\x5', - '\x107', '\x108', '\f', '\x3', '\x2', '\x2', '\x108', '\x109', '\a', '\x32', - '\x2', '\x2', '\x109', '\x10B', '\x5', '\x30', '\x19', '\x4', '\x10A', - '\x104', '\x3', '\x2', '\x2', '\x2', '\x10A', '\x107', '\x3', '\x2', '\x2', - '\x2', '\x10B', '\x10E', '\x3', '\x2', '\x2', '\x2', '\x10C', '\x10A', - '\x3', '\x2', '\x2', '\x2', '\x10C', '\x10D', '\x3', '\x2', '\x2', '\x2', - '\x10D', '\x31', '\x3', '\x2', '\x2', '\x2', '\x10E', '\x10C', '\x3', - '\x2', '\x2', '\x2', '\x10F', '\x111', '\x5', '\x38', '\x1D', '\x2', '\x110', - '\x112', '\a', '/', '\x2', '\x2', '\x111', '\x110', '\x3', '\x2', '\x2', - '\x2', '\x111', '\x112', '\x3', '\x2', '\x2', '\x2', '\x112', '\x113', - '\x3', '\x2', '\x2', '\x2', '\x113', '\x114', '\a', '+', '\x2', '\x2', - '\x114', '\x115', '\a', '\x5', '\x2', '\x2', '\x115', '\x116', '\x5', - 'P', ')', '\x2', '\x116', '\x117', '\a', '\x6', '\x2', '\x2', '\x117', - '\x33', '\x3', '\x2', '\x2', '\x2', '\x118', '\x11A', '\x5', '\x38', '\x1D', - '\x2', '\x119', '\x11B', '\a', '/', '\x2', '\x2', '\x11A', '\x119', '\x3', - '\x2', '\x2', '\x2', '\x11A', '\x11B', '\x3', '\x2', '\x2', '\x2', '\x11B', - '\x11C', '\x3', '\x2', '\x2', '\x2', '\x11C', '\x11D', '\a', '-', '\x2', - '\x2', '\x11D', '\x11F', '\x5', '\x38', '\x1D', '\x2', '\x11E', '\x120', - '\x5', '\x36', '\x1C', '\x2', '\x11F', '\x11E', '\x3', '\x2', '\x2', '\x2', - '\x11F', '\x120', '\x3', '\x2', '\x2', '\x2', '\x120', '\x35', '\x3', - '\x2', '\x2', '\x2', '\x121', '\x122', '\a', '&', '\x2', '\x2', '\x122', - '\x123', '\a', '=', '\x2', '\x2', '\x123', '\x37', '\x3', '\x2', '\x2', - '\x2', '\x124', '\x125', '\b', '\x1D', '\x1', '\x2', '\x125', '\x126', - '\x5', 'J', '&', '\x2', '\x126', '\x149', '\x3', '\x2', '\x2', '\x2', - '\x127', '\x128', '\f', '\n', '\x2', '\x2', '\x128', '\x129', '\x5', ':', - '\x1E', '\x2', '\x129', '\x12A', '\x5', '\x38', '\x1D', '\v', '\x12A', - '\x148', '\x3', '\x2', '\x2', '\x2', '\x12B', '\x12C', '\f', '\t', '\x2', - '\x2', '\x12C', '\x12D', '\x5', '<', '\x1F', '\x2', '\x12D', '\x12E', - '\x5', '\x38', '\x1D', '\n', '\x12E', '\x148', '\x3', '\x2', '\x2', '\x2', - '\x12F', '\x130', '\f', '\b', '\x2', '\x2', '\x130', '\x131', '\x5', '>', - ' ', '\x2', '\x131', '\x132', '\x5', '\x38', '\x1D', '\t', '\x132', '\x148', - '\x3', '\x2', '\x2', '\x2', '\x133', '\x134', '\f', '\a', '\x2', '\x2', - '\x134', '\x135', '\x5', '@', '!', '\x2', '\x135', '\x136', '\x5', '\x38', - '\x1D', '\b', '\x136', '\x148', '\x3', '\x2', '\x2', '\x2', '\x137', '\x138', - '\f', '\x6', '\x2', '\x2', '\x138', '\x139', '\x5', '\x42', '\"', '\x2', - '\x139', '\x13A', '\x5', '\x38', '\x1D', '\a', '\x13A', '\x148', '\x3', - '\x2', '\x2', '\x2', '\x13B', '\x13C', '\f', '\x5', '\x2', '\x2', '\x13C', - '\x13D', '\x5', '\x44', '#', '\x2', '\x13D', '\x13E', '\x5', '\x38', '\x1D', - '\x6', '\x13E', '\x148', '\x3', '\x2', '\x2', '\x2', '\x13F', '\x140', - '\f', '\x4', '\x2', '\x2', '\x140', '\x141', '\x5', '\x46', '$', '\x2', - '\x141', '\x142', '\x5', '\x38', '\x1D', '\x5', '\x142', '\x148', '\x3', - '\x2', '\x2', '\x2', '\x143', '\x144', '\f', '\x3', '\x2', '\x2', '\x144', - '\x145', '\x5', 'H', '%', '\x2', '\x145', '\x146', '\x5', '\x38', '\x1D', - '\x4', '\x146', '\x148', '\x3', '\x2', '\x2', '\x2', '\x147', '\x127', - '\x3', '\x2', '\x2', '\x2', '\x147', '\x12B', '\x3', '\x2', '\x2', '\x2', - '\x147', '\x12F', '\x3', '\x2', '\x2', '\x2', '\x147', '\x133', '\x3', - '\x2', '\x2', '\x2', '\x147', '\x137', '\x3', '\x2', '\x2', '\x2', '\x147', - '\x13B', '\x3', '\x2', '\x2', '\x2', '\x147', '\x13F', '\x3', '\x2', '\x2', - '\x2', '\x147', '\x143', '\x3', '\x2', '\x2', '\x2', '\x148', '\x14B', - '\x3', '\x2', '\x2', '\x2', '\x149', '\x147', '\x3', '\x2', '\x2', '\x2', - '\x149', '\x14A', '\x3', '\x2', '\x2', '\x2', '\x14A', '\x39', '\x3', - '\x2', '\x2', '\x2', '\x14B', '\x149', '\x3', '\x2', '\x2', '\x2', '\x14C', - '\x14D', '\t', '\x4', '\x2', '\x2', '\x14D', ';', '\x3', '\x2', '\x2', - '\x2', '\x14E', '\x14F', '\t', '\x5', '\x2', '\x2', '\x14F', '=', '\x3', - '\x2', '\x2', '\x2', '\x150', '\x151', '\t', '\x6', '\x2', '\x2', '\x151', - '?', '\x3', '\x2', '\x2', '\x2', '\x152', '\x153', '\t', '\a', '\x2', - '\x2', '\x153', '\x41', '\x3', '\x2', '\x2', '\x2', '\x154', '\x155', - '\a', '\x17', '\x2', '\x2', '\x155', '\x43', '\x3', '\x2', '\x2', '\x2', - '\x156', '\x157', '\a', '\x18', '\x2', '\x2', '\x157', '\x45', '\x3', - '\x2', '\x2', '\x2', '\x158', '\x159', '\a', '\x19', '\x2', '\x2', '\x159', - 'G', '\x3', '\x2', '\x2', '\x2', '\x15A', '\x15B', '\a', '\x1A', '\x2', - '\x2', '\x15B', 'I', '\x3', '\x2', '\x2', '\x2', '\x15C', '\x161', '\x5', - 'N', '(', '\x2', '\x15D', '\x15E', '\x5', 'L', '\'', '\x2', '\x15E', '\x15F', - '\x5', 'J', '&', '\x2', '\x15F', '\x161', '\x3', '\x2', '\x2', '\x2', - '\x160', '\x15C', '\x3', '\x2', '\x2', '\x2', '\x160', '\x15D', '\x3', - '\x2', '\x2', '\x2', '\x161', 'K', '\x3', '\x2', '\x2', '\x2', '\x162', - '\x163', '\t', '\b', '\x2', '\x2', '\x163', 'M', '\x3', '\x2', '\x2', - '\x2', '\x164', '\x165', '\b', '(', '\x1', '\x2', '\x165', '\x18F', '\a', - '>', '\x2', '\x2', '\x166', '\x18F', '\a', '?', '\x2', '\x2', '\x167', - '\x18F', '\x5', 'V', ',', '\x2', '\x168', '\x16A', '\a', '\b', '\x2', - '\x2', '\x169', '\x16B', '\x5', 'P', ')', '\x2', '\x16A', '\x169', '\x3', - '\x2', '\x2', '\x2', '\x16A', '\x16B', '\x3', '\x2', '\x2', '\x2', '\x16B', - '\x16C', '\x3', '\x2', '\x2', '\x2', '\x16C', '\x18F', '\a', '\t', '\x2', - '\x2', '\x16D', '\x16F', '\a', '\x1C', '\x2', '\x2', '\x16E', '\x170', - '\x5', 'R', '*', '\x2', '\x16F', '\x16E', '\x3', '\x2', '\x2', '\x2', - '\x16F', '\x170', '\x3', '\x2', '\x2', '\x2', '\x170', '\x171', '\x3', - '\x2', '\x2', '\x2', '\x171', '\x18F', '\a', '\x1D', '\x2', '\x2', '\x172', - '\x173', '\a', '\x37', '\x2', '\x2', '\x173', '\x175', '\a', '\a', '\x2', - '\x2', '\x174', '\x172', '\x3', '\x2', '\x2', '\x2', '\x174', '\x175', - '\x3', '\x2', '\x2', '\x2', '\x175', '\x176', '\x3', '\x2', '\x2', '\x2', - '\x176', '\x177', '\a', '>', '\x2', '\x2', '\x177', '\x179', '\a', '\x5', - '\x2', '\x2', '\x178', '\x17A', '\x5', 'P', ')', '\x2', '\x179', '\x178', - '\x3', '\x2', '\x2', '\x2', '\x179', '\x17A', '\x3', '\x2', '\x2', '\x2', - '\x17A', '\x17B', '\x3', '\x2', '\x2', '\x2', '\x17B', '\x18F', '\a', - '\x6', '\x2', '\x2', '\x17C', '\x17D', '\a', '\x5', '\x2', '\x2', '\x17D', - '\x17E', '\x5', '.', '\x18', '\x2', '\x17E', '\x17F', '\a', '\x6', '\x2', - '\x2', '\x17F', '\x18F', '\x3', '\x2', '\x2', '\x2', '\x180', '\x181', - '\a', '\x5', '\x2', '\x2', '\x181', '\x182', '\x5', '\x4', '\x3', '\x2', - '\x182', '\x183', '\a', '\x6', '\x2', '\x2', '\x183', '\x18F', '\x3', - '\x2', '\x2', '\x2', '\x184', '\x185', '\a', '\'', '\x2', '\x2', '\x185', - '\x186', '\a', '\x5', '\x2', '\x2', '\x186', '\x187', '\x5', '\x4', '\x3', - '\x2', '\x187', '\x188', '\a', '\x6', '\x2', '\x2', '\x188', '\x18F', - '\x3', '\x2', '\x2', '\x2', '\x189', '\x18A', '\a', '\x1F', '\x2', '\x2', - '\x18A', '\x18B', '\a', '\x5', '\x2', '\x2', '\x18B', '\x18C', '\x5', - '\x4', '\x3', '\x2', '\x18C', '\x18D', '\a', '\x6', '\x2', '\x2', '\x18D', - '\x18F', '\x3', '\x2', '\x2', '\x2', '\x18E', '\x164', '\x3', '\x2', '\x2', - '\x2', '\x18E', '\x166', '\x3', '\x2', '\x2', '\x2', '\x18E', '\x167', - '\x3', '\x2', '\x2', '\x2', '\x18E', '\x168', '\x3', '\x2', '\x2', '\x2', - '\x18E', '\x16D', '\x3', '\x2', '\x2', '\x2', '\x18E', '\x174', '\x3', - '\x2', '\x2', '\x2', '\x18E', '\x17C', '\x3', '\x2', '\x2', '\x2', '\x18E', - '\x180', '\x3', '\x2', '\x2', '\x2', '\x18E', '\x184', '\x3', '\x2', '\x2', - '\x2', '\x18E', '\x189', '\x3', '\x2', '\x2', '\x2', '\x18F', '\x19A', - '\x3', '\x2', '\x2', '\x2', '\x190', '\x191', '\f', '\x6', '\x2', '\x2', - '\x191', '\x192', '\a', '\a', '\x2', '\x2', '\x192', '\x199', '\a', '>', - '\x2', '\x2', '\x193', '\x194', '\f', '\x5', '\x2', '\x2', '\x194', '\x195', - '\a', '\b', '\x2', '\x2', '\x195', '\x196', '\x5', '.', '\x18', '\x2', - '\x196', '\x197', '\a', '\t', '\x2', '\x2', '\x197', '\x199', '\x3', '\x2', - '\x2', '\x2', '\x198', '\x190', '\x3', '\x2', '\x2', '\x2', '\x198', '\x193', - '\x3', '\x2', '\x2', '\x2', '\x199', '\x19C', '\x3', '\x2', '\x2', '\x2', - '\x19A', '\x198', '\x3', '\x2', '\x2', '\x2', '\x19A', '\x19B', '\x3', - '\x2', '\x2', '\x2', '\x19B', 'O', '\x3', '\x2', '\x2', '\x2', '\x19C', - '\x19A', '\x3', '\x2', '\x2', '\x2', '\x19D', '\x1A2', '\x5', '.', '\x18', - '\x2', '\x19E', '\x19F', '\a', '\x4', '\x2', '\x2', '\x19F', '\x1A1', - '\x5', '.', '\x18', '\x2', '\x1A0', '\x19E', '\x3', '\x2', '\x2', '\x2', - '\x1A1', '\x1A4', '\x3', '\x2', '\x2', '\x2', '\x1A2', '\x1A0', '\x3', - '\x2', '\x2', '\x2', '\x1A2', '\x1A3', '\x3', '\x2', '\x2', '\x2', '\x1A3', - 'Q', '\x3', '\x2', '\x2', '\x2', '\x1A4', '\x1A2', '\x3', '\x2', '\x2', - '\x2', '\x1A5', '\x1AA', '\x5', 'T', '+', '\x2', '\x1A6', '\x1A7', '\a', - '\x4', '\x2', '\x2', '\x1A7', '\x1A9', '\x5', 'T', '+', '\x2', '\x1A8', - '\x1A6', '\x3', '\x2', '\x2', '\x2', '\x1A9', '\x1AC', '\x3', '\x2', '\x2', - '\x2', '\x1AA', '\x1A8', '\x3', '\x2', '\x2', '\x2', '\x1AA', '\x1AB', - '\x3', '\x2', '\x2', '\x2', '\x1AB', 'S', '\x3', '\x2', '\x2', '\x2', - '\x1AC', '\x1AA', '\x3', '\x2', '\x2', '\x2', '\x1AD', '\x1AE', '\a', - '=', '\x2', '\x2', '\x1AE', '\x1AF', '\a', '\v', '\x2', '\x2', '\x1AF', - '\x1B0', '\x5', '.', '\x18', '\x2', '\x1B0', 'U', '\x3', '\x2', '\x2', - '\x2', '\x1B1', '\x1B2', '\t', '\t', '\x2', '\x2', '\x1B2', 'W', '\x3', - '\x2', '\x2', '\x2', ',', ']', '`', '\x63', '\x66', 'i', 'm', 'p', 'z', - '\x86', '\x8C', '\x94', '\x97', '\x9C', '\xA3', '\xA8', '\xAE', '\xBC', - '\xBE', '\xD1', '\xD6', '\xE7', '\xEE', '\xF9', '\xFB', '\x102', '\x10A', - '\x10C', '\x111', '\x11A', '\x11F', '\x147', '\x149', '\x160', '\x16A', - '\x16F', '\x174', '\x179', '\x18E', '\x198', '\x19A', '\x1A2', '\x1AA', + '\x42', '\x44', '\x46', 'H', 'J', 'L', 'N', 'P', 'R', 'T', 'V', 'X', 'Z', + '\x2', '\v', '\x4', '\x2', '?', '?', '\x42', '\x42', '\x4', '\x2', '\"', + '\"', '%', '%', '\x4', '\x2', '\x3', '\x3', '\r', '\xE', '\x3', '\x2', + '\xF', '\x10', '\x3', '\x2', '\x11', '\x14', '\x3', '\x2', '\x15', '\x16', + '\x5', '\x2', '\xF', '\x10', '\x1B', '\x1B', '\x31', '\x31', '\x4', '\x2', + '\x1E', '\x1E', '\x41', '\x41', '\a', '\x2', ')', ')', '\x32', '\x32', + '\x39', '\x39', ';', ';', '?', '@', '\x2', '\x1E2', '\x2', '\\', '\x3', + '\x2', '\x2', '\x2', '\x4', '_', '\x3', '\x2', '\x2', '\x2', '\x6', 'o', + '\x3', '\x2', '\x2', '\x2', '\b', 'x', '\x3', '\x2', '\x2', '\x2', '\n', + '~', '\x3', '\x2', '\x2', '\x2', '\f', '\x80', '\x3', '\x2', '\x2', '\x2', + '\xE', '\x82', '\x3', '\x2', '\x2', '\x2', '\x10', '\x85', '\x3', '\x2', + '\x2', '\x2', '\x12', '\x8D', '\x3', '\x2', '\x2', '\x2', '\x14', '\x92', + '\x3', '\x2', '\x2', '\x2', '\x16', '\xA1', '\x3', '\x2', '\x2', '\x2', + '\x18', '\xB3', '\x3', '\x2', '\x2', '\x2', '\x1A', '\xB5', '\x3', '\x2', + '\x2', '\x2', '\x1C', '\xC6', '\x3', '\x2', '\x2', '\x2', '\x1E', '\xC9', + '\x3', '\x2', '\x2', '\x2', ' ', '\xCD', '\x3', '\x2', '\x2', '\x2', '\"', + '\xD1', '\x3', '\x2', '\x2', '\x2', '$', '\xD9', '\x3', '\x2', '\x2', + '\x2', '&', '\xDD', '\x3', '\x2', '\x2', '\x2', '(', '\xDF', '\x3', '\x2', + '\x2', '\x2', '*', '\xE4', '\x3', '\x2', '\x2', '\x2', ',', '\xE6', '\x3', + '\x2', '\x2', '\x2', '.', '\xF3', '\x3', '\x2', '\x2', '\x2', '\x30', + '\x107', '\x3', '\x2', '\x2', '\x2', '\x32', '\x114', '\x3', '\x2', '\x2', + '\x2', '\x34', '\x11D', '\x3', '\x2', '\x2', '\x2', '\x36', '\x126', '\x3', + '\x2', '\x2', '\x2', '\x38', '\x129', '\x3', '\x2', '\x2', '\x2', ':', + '\x151', '\x3', '\x2', '\x2', '\x2', '<', '\x153', '\x3', '\x2', '\x2', + '\x2', '>', '\x155', '\x3', '\x2', '\x2', '\x2', '@', '\x157', '\x3', + '\x2', '\x2', '\x2', '\x42', '\x159', '\x3', '\x2', '\x2', '\x2', '\x44', + '\x15B', '\x3', '\x2', '\x2', '\x2', '\x46', '\x15D', '\x3', '\x2', '\x2', + '\x2', 'H', '\x15F', '\x3', '\x2', '\x2', '\x2', 'J', '\x165', '\x3', + '\x2', '\x2', '\x2', 'L', '\x167', '\x3', '\x2', '\x2', '\x2', 'N', '\x18F', + '\x3', '\x2', '\x2', '\x2', 'P', '\x1B5', '\x3', '\x2', '\x2', '\x2', + 'R', '\x1B7', '\x3', '\x2', '\x2', '\x2', 'T', '\x1BF', '\x3', '\x2', + '\x2', '\x2', 'V', '\x1C7', '\x3', '\x2', '\x2', '\x2', 'X', '\x1CB', + '\x3', '\x2', '\x2', '\x2', 'Z', '\x1CD', '\x3', '\x2', '\x2', '\x2', + '\\', ']', '\x5', '\x4', '\x3', '\x2', ']', '^', '\a', '\x2', '\x2', '\x3', + '^', '\x3', '\x3', '\x2', '\x2', '\x2', '_', '\x61', '\x5', '\x6', '\x4', + '\x2', '`', '\x62', '\x5', '\x14', '\v', '\x2', '\x61', '`', '\x3', '\x2', + '\x2', '\x2', '\x61', '\x62', '\x3', '\x2', '\x2', '\x2', '\x62', '\x64', + '\x3', '\x2', '\x2', '\x2', '\x63', '\x65', '\x5', '\x1C', '\xF', '\x2', + '\x64', '\x63', '\x3', '\x2', '\x2', '\x2', '\x64', '\x65', '\x3', '\x2', + '\x2', '\x2', '\x65', 'g', '\x3', '\x2', '\x2', '\x2', '\x66', 'h', '\x5', + '\x1E', '\x10', '\x2', 'g', '\x66', '\x3', '\x2', '\x2', '\x2', 'g', 'h', + '\x3', '\x2', '\x2', '\x2', 'h', 'j', '\x3', '\x2', '\x2', '\x2', 'i', + 'k', '\x5', ' ', '\x11', '\x2', 'j', 'i', '\x3', '\x2', '\x2', '\x2', + 'j', 'k', '\x3', '\x2', '\x2', '\x2', 'k', 'm', '\x3', '\x2', '\x2', '\x2', + 'l', 'n', '\x5', '(', '\x15', '\x2', 'm', 'l', '\x3', '\x2', '\x2', '\x2', + 'm', 'n', '\x3', '\x2', '\x2', '\x2', 'n', '\x5', '\x3', '\x2', '\x2', + '\x2', 'o', 'q', '\a', '\x37', '\x2', '\x2', 'p', 'r', '\a', '&', '\x2', + '\x2', 'q', 'p', '\x3', '\x2', '\x2', '\x2', 'q', 'r', '\x3', '\x2', '\x2', + '\x2', 'r', 't', '\x3', '\x2', '\x2', '\x2', 's', 'u', '\x5', '\b', '\x5', + '\x2', 't', 's', '\x3', '\x2', '\x2', '\x2', 't', 'u', '\x3', '\x2', '\x2', + '\x2', 'u', 'v', '\x3', '\x2', '\x2', '\x2', 'v', 'w', '\x5', '\n', '\x6', + '\x2', 'w', '\a', '\x3', '\x2', '\x2', '\x2', 'x', 'y', '\a', '\x38', + '\x2', '\x2', 'y', 'z', '\t', '\x2', '\x2', '\x2', 'z', '\t', '\x3', '\x2', + '\x2', '\x2', '{', '\x7F', '\x5', '\f', '\a', '\x2', '|', '\x7F', '\x5', + '\xE', '\b', '\x2', '}', '\x7F', '\x5', '\x10', '\t', '\x2', '~', '{', + '\x3', '\x2', '\x2', '\x2', '~', '|', '\x3', '\x2', '\x2', '\x2', '~', + '}', '\x3', '\x2', '\x2', '\x2', '\x7F', '\v', '\x3', '\x2', '\x2', '\x2', + '\x80', '\x81', '\a', '\x3', '\x2', '\x2', '\x81', '\r', '\x3', '\x2', + '\x2', '\x2', '\x82', '\x83', '\a', '<', '\x2', '\x2', '\x83', '\x84', + '\x5', '.', '\x18', '\x2', '\x84', '\xF', '\x3', '\x2', '\x2', '\x2', + '\x85', '\x8A', '\x5', '\x12', '\n', '\x2', '\x86', '\x87', '\a', '\x4', + '\x2', '\x2', '\x87', '\x89', '\x5', '\x12', '\n', '\x2', '\x88', '\x86', + '\x3', '\x2', '\x2', '\x2', '\x89', '\x8C', '\x3', '\x2', '\x2', '\x2', + '\x8A', '\x88', '\x3', '\x2', '\x2', '\x2', '\x8A', '\x8B', '\x3', '\x2', + '\x2', '\x2', '\x8B', '\x11', '\x3', '\x2', '\x2', '\x2', '\x8C', '\x8A', + '\x3', '\x2', '\x2', '\x2', '\x8D', '\x90', '\x5', '.', '\x18', '\x2', + '\x8E', '\x8F', '\a', '!', '\x2', '\x2', '\x8F', '\x91', '\x5', 'X', '-', + '\x2', '\x90', '\x8E', '\x3', '\x2', '\x2', '\x2', '\x90', '\x91', '\x3', + '\x2', '\x2', '\x2', '\x91', '\x13', '\x3', '\x2', '\x2', '\x2', '\x92', + '\x93', '\a', '*', '\x2', '\x2', '\x93', '\x94', '\x5', '\x16', '\f', + '\x2', '\x94', '\x15', '\x3', '\x2', '\x2', '\x2', '\x95', '\x96', '\b', + '\f', '\x1', '\x2', '\x96', '\x9B', '\x5', '\x18', '\r', '\x2', '\x97', + '\x99', '\a', '!', '\x2', '\x2', '\x98', '\x97', '\x3', '\x2', '\x2', + '\x2', '\x98', '\x99', '\x3', '\x2', '\x2', '\x2', '\x99', '\x9A', '\x3', + '\x2', '\x2', '\x2', '\x9A', '\x9C', '\x5', 'X', '-', '\x2', '\x9B', '\x98', + '\x3', '\x2', '\x2', '\x2', '\x9B', '\x9C', '\x3', '\x2', '\x2', '\x2', + '\x9C', '\xA2', '\x3', '\x2', '\x2', '\x2', '\x9D', '\x9E', '\x5', 'X', + '-', '\x2', '\x9E', '\x9F', '\a', ',', '\x2', '\x2', '\x9F', '\xA0', '\x5', + '\x18', '\r', '\x2', '\xA0', '\xA2', '\x3', '\x2', '\x2', '\x2', '\xA1', + '\x95', '\x3', '\x2', '\x2', '\x2', '\xA1', '\x9D', '\x3', '\x2', '\x2', + '\x2', '\xA2', '\xA8', '\x3', '\x2', '\x2', '\x2', '\xA3', '\xA4', '\f', + '\x3', '\x2', '\x2', '\xA4', '\xA5', '\a', '-', '\x2', '\x2', '\xA5', + '\xA7', '\x5', '\x16', '\f', '\x4', '\xA6', '\xA3', '\x3', '\x2', '\x2', + '\x2', '\xA7', '\xAA', '\x3', '\x2', '\x2', '\x2', '\xA8', '\xA6', '\x3', + '\x2', '\x2', '\x2', '\xA8', '\xA9', '\x3', '\x2', '\x2', '\x2', '\xA9', + '\x17', '\x3', '\x2', '\x2', '\x2', '\xAA', '\xA8', '\x3', '\x2', '\x2', + '\x2', '\xAB', '\xAD', '\x5', 'X', '-', '\x2', '\xAC', '\xAE', '\x5', + '\x1A', '\xE', '\x2', '\xAD', '\xAC', '\x3', '\x2', '\x2', '\x2', '\xAD', + '\xAE', '\x3', '\x2', '\x2', '\x2', '\xAE', '\xB4', '\x3', '\x2', '\x2', + '\x2', '\xAF', '\xB0', '\a', '\x5', '\x2', '\x2', '\xB0', '\xB1', '\x5', + '\x4', '\x3', '\x2', '\xB1', '\xB2', '\a', '\x6', '\x2', '\x2', '\xB2', + '\xB4', '\x3', '\x2', '\x2', '\x2', '\xB3', '\xAB', '\x3', '\x2', '\x2', + '\x2', '\xB3', '\xAF', '\x3', '\x2', '\x2', '\x2', '\xB4', '\x19', '\x3', + '\x2', '\x2', '\x2', '\xB5', '\xC3', '\b', '\xE', '\x1', '\x2', '\xB6', + '\xB7', '\f', '\x6', '\x2', '\x2', '\xB7', '\xB8', '\a', '\a', '\x2', + '\x2', '\xB8', '\xC2', '\x5', 'X', '-', '\x2', '\xB9', '\xBA', '\f', '\x5', + '\x2', '\x2', '\xBA', '\xBB', '\a', '\b', '\x2', '\x2', '\xBB', '\xBC', + '\a', '?', '\x2', '\x2', '\xBC', '\xC2', '\a', '\t', '\x2', '\x2', '\xBD', + '\xBE', '\f', '\x4', '\x2', '\x2', '\xBE', '\xBF', '\a', '\b', '\x2', + '\x2', '\xBF', '\xC0', '\a', '@', '\x2', '\x2', '\xC0', '\xC2', '\a', + '\t', '\x2', '\x2', '\xC1', '\xB6', '\x3', '\x2', '\x2', '\x2', '\xC1', + '\xB9', '\x3', '\x2', '\x2', '\x2', '\xC1', '\xBD', '\x3', '\x2', '\x2', + '\x2', '\xC2', '\xC5', '\x3', '\x2', '\x2', '\x2', '\xC3', '\xC1', '\x3', + '\x2', '\x2', '\x2', '\xC3', '\xC4', '\x3', '\x2', '\x2', '\x2', '\xC4', + '\x1B', '\x3', '\x2', '\x2', '\x2', '\xC5', '\xC3', '\x3', '\x2', '\x2', + '\x2', '\xC6', '\xC7', '\a', '=', '\x2', '\x2', '\xC7', '\xC8', '\x5', + '.', '\x18', '\x2', '\xC8', '\x1D', '\x3', '\x2', '\x2', '\x2', '\xC9', + '\xCA', '\a', '+', '\x2', '\x2', '\xCA', '\xCB', '\a', '$', '\x2', '\x2', + '\xCB', '\xCC', '\x5', 'R', '*', '\x2', '\xCC', '\x1F', '\x3', '\x2', + '\x2', '\x2', '\xCD', '\xCE', '\a', '\x35', '\x2', '\x2', '\xCE', '\xCF', + '\a', '$', '\x2', '\x2', '\xCF', '\xD0', '\x5', '\"', '\x12', '\x2', '\xD0', + '!', '\x3', '\x2', '\x2', '\x2', '\xD1', '\xD6', '\x5', '$', '\x13', '\x2', + '\xD2', '\xD3', '\a', '\x4', '\x2', '\x2', '\xD3', '\xD5', '\x5', '$', + '\x13', '\x2', '\xD4', '\xD2', '\x3', '\x2', '\x2', '\x2', '\xD5', '\xD8', + '\x3', '\x2', '\x2', '\x2', '\xD6', '\xD4', '\x3', '\x2', '\x2', '\x2', + '\xD6', '\xD7', '\x3', '\x2', '\x2', '\x2', '\xD7', '#', '\x3', '\x2', + '\x2', '\x2', '\xD8', '\xD6', '\x3', '\x2', '\x2', '\x2', '\xD9', '\xDB', + '\x5', '.', '\x18', '\x2', '\xDA', '\xDC', '\x5', '&', '\x14', '\x2', + '\xDB', '\xDA', '\x3', '\x2', '\x2', '\x2', '\xDB', '\xDC', '\x3', '\x2', + '\x2', '\x2', '\xDC', '%', '\x3', '\x2', '\x2', '\x2', '\xDD', '\xDE', + '\t', '\x3', '\x2', '\x2', '\xDE', '\'', '\x3', '\x2', '\x2', '\x2', '\xDF', + '\xE0', '\a', '\x33', '\x2', '\x2', '\xE0', '\xE1', '\x5', '*', '\x16', + '\x2', '\xE1', '\xE2', '\a', '\x30', '\x2', '\x2', '\xE2', '\xE3', '\x5', + ',', '\x17', '\x2', '\xE3', ')', '\x3', '\x2', '\x2', '\x2', '\xE4', '\xE5', + '\t', '\x2', '\x2', '\x2', '\xE5', '+', '\x3', '\x2', '\x2', '\x2', '\xE6', + '\xE7', '\t', '\x2', '\x2', '\x2', '\xE7', '-', '\x3', '\x2', '\x2', '\x2', + '\xE8', '\xE9', '\b', '\x18', '\x1', '\x2', '\xE9', '\xF4', '\x5', '\x30', + '\x19', '\x2', '\xEA', '\xEC', '\x5', '\x38', '\x1D', '\x2', '\xEB', '\xED', + '\a', '\x31', '\x2', '\x2', '\xEC', '\xEB', '\x3', '\x2', '\x2', '\x2', + '\xEC', '\xED', '\x3', '\x2', '\x2', '\x2', '\xED', '\xEE', '\x3', '\x2', + '\x2', '\x2', '\xEE', '\xEF', '\a', '#', '\x2', '\x2', '\xEF', '\xF0', + '\x5', '\x38', '\x1D', '\x2', '\xF0', '\xF1', '\a', '\x1F', '\x2', '\x2', + '\xF1', '\xF2', '\x5', '\x38', '\x1D', '\x2', '\xF2', '\xF4', '\x3', '\x2', + '\x2', '\x2', '\xF3', '\xE8', '\x3', '\x2', '\x2', '\x2', '\xF3', '\xEA', + '\x3', '\x2', '\x2', '\x2', '\xF4', '\x100', '\x3', '\x2', '\x2', '\x2', + '\xF5', '\xF6', '\f', '\x6', '\x2', '\x2', '\xF6', '\xF7', '\a', '\n', + '\x2', '\x2', '\xF7', '\xF8', '\x5', '.', '\x18', '\x2', '\xF8', '\xF9', + '\a', '\v', '\x2', '\x2', '\xF9', '\xFA', '\x5', '.', '\x18', '\a', '\xFA', + '\xFF', '\x3', '\x2', '\x2', '\x2', '\xFB', '\xFC', '\f', '\x5', '\x2', + '\x2', '\xFC', '\xFD', '\a', '\f', '\x2', '\x2', '\xFD', '\xFF', '\x5', + '.', '\x18', '\x6', '\xFE', '\xF5', '\x3', '\x2', '\x2', '\x2', '\xFE', + '\xFB', '\x3', '\x2', '\x2', '\x2', '\xFF', '\x102', '\x3', '\x2', '\x2', + '\x2', '\x100', '\xFE', '\x3', '\x2', '\x2', '\x2', '\x100', '\x101', + '\x3', '\x2', '\x2', '\x2', '\x101', '/', '\x3', '\x2', '\x2', '\x2', + '\x102', '\x100', '\x3', '\x2', '\x2', '\x2', '\x103', '\x104', '\b', + '\x19', '\x1', '\x2', '\x104', '\x108', '\x5', '\x38', '\x1D', '\x2', + '\x105', '\x108', '\x5', '\x32', '\x1A', '\x2', '\x106', '\x108', '\x5', + '\x34', '\x1B', '\x2', '\x107', '\x103', '\x3', '\x2', '\x2', '\x2', '\x107', + '\x105', '\x3', '\x2', '\x2', '\x2', '\x107', '\x106', '\x3', '\x2', '\x2', + '\x2', '\x108', '\x111', '\x3', '\x2', '\x2', '\x2', '\x109', '\x10A', + '\f', '\x4', '\x2', '\x2', '\x10A', '\x10B', '\a', '\x1F', '\x2', '\x2', + '\x10B', '\x110', '\x5', '\x30', '\x19', '\x5', '\x10C', '\x10D', '\f', + '\x3', '\x2', '\x2', '\x10D', '\x10E', '\a', '\x34', '\x2', '\x2', '\x10E', + '\x110', '\x5', '\x30', '\x19', '\x4', '\x10F', '\x109', '\x3', '\x2', + '\x2', '\x2', '\x10F', '\x10C', '\x3', '\x2', '\x2', '\x2', '\x110', '\x113', + '\x3', '\x2', '\x2', '\x2', '\x111', '\x10F', '\x3', '\x2', '\x2', '\x2', + '\x111', '\x112', '\x3', '\x2', '\x2', '\x2', '\x112', '\x31', '\x3', + '\x2', '\x2', '\x2', '\x113', '\x111', '\x3', '\x2', '\x2', '\x2', '\x114', + '\x116', '\x5', '\x38', '\x1D', '\x2', '\x115', '\x117', '\a', '\x31', + '\x2', '\x2', '\x116', '\x115', '\x3', '\x2', '\x2', '\x2', '\x116', '\x117', + '\x3', '\x2', '\x2', '\x2', '\x117', '\x118', '\x3', '\x2', '\x2', '\x2', + '\x118', '\x119', '\a', ',', '\x2', '\x2', '\x119', '\x11A', '\a', '\x5', + '\x2', '\x2', '\x11A', '\x11B', '\x5', 'R', '*', '\x2', '\x11B', '\x11C', + '\a', '\x6', '\x2', '\x2', '\x11C', '\x33', '\x3', '\x2', '\x2', '\x2', + '\x11D', '\x11F', '\x5', '\x38', '\x1D', '\x2', '\x11E', '\x120', '\a', + '\x31', '\x2', '\x2', '\x11F', '\x11E', '\x3', '\x2', '\x2', '\x2', '\x11F', + '\x120', '\x3', '\x2', '\x2', '\x2', '\x120', '\x121', '\x3', '\x2', '\x2', + '\x2', '\x121', '\x122', '\a', '/', '\x2', '\x2', '\x122', '\x124', '\x5', + '\x38', '\x1D', '\x2', '\x123', '\x125', '\x5', '\x36', '\x1C', '\x2', + '\x124', '\x123', '\x3', '\x2', '\x2', '\x2', '\x124', '\x125', '\x3', + '\x2', '\x2', '\x2', '\x125', '\x35', '\x3', '\x2', '\x2', '\x2', '\x126', + '\x127', '\a', '\'', '\x2', '\x2', '\x127', '\x128', '\a', '@', '\x2', + '\x2', '\x128', '\x37', '\x3', '\x2', '\x2', '\x2', '\x129', '\x12A', + '\b', '\x1D', '\x1', '\x2', '\x12A', '\x12B', '\x5', 'J', '&', '\x2', + '\x12B', '\x14E', '\x3', '\x2', '\x2', '\x2', '\x12C', '\x12D', '\f', + '\n', '\x2', '\x2', '\x12D', '\x12E', '\x5', ':', '\x1E', '\x2', '\x12E', + '\x12F', '\x5', '\x38', '\x1D', '\v', '\x12F', '\x14D', '\x3', '\x2', + '\x2', '\x2', '\x130', '\x131', '\f', '\t', '\x2', '\x2', '\x131', '\x132', + '\x5', '<', '\x1F', '\x2', '\x132', '\x133', '\x5', '\x38', '\x1D', '\n', + '\x133', '\x14D', '\x3', '\x2', '\x2', '\x2', '\x134', '\x135', '\f', + '\b', '\x2', '\x2', '\x135', '\x136', '\x5', '>', ' ', '\x2', '\x136', + '\x137', '\x5', '\x38', '\x1D', '\t', '\x137', '\x14D', '\x3', '\x2', + '\x2', '\x2', '\x138', '\x139', '\f', '\a', '\x2', '\x2', '\x139', '\x13A', + '\x5', '@', '!', '\x2', '\x13A', '\x13B', '\x5', '\x38', '\x1D', '\b', + '\x13B', '\x14D', '\x3', '\x2', '\x2', '\x2', '\x13C', '\x13D', '\f', + '\x6', '\x2', '\x2', '\x13D', '\x13E', '\x5', '\x42', '\"', '\x2', '\x13E', + '\x13F', '\x5', '\x38', '\x1D', '\a', '\x13F', '\x14D', '\x3', '\x2', + '\x2', '\x2', '\x140', '\x141', '\f', '\x5', '\x2', '\x2', '\x141', '\x142', + '\x5', '\x44', '#', '\x2', '\x142', '\x143', '\x5', '\x38', '\x1D', '\x6', + '\x143', '\x14D', '\x3', '\x2', '\x2', '\x2', '\x144', '\x145', '\f', + '\x4', '\x2', '\x2', '\x145', '\x146', '\x5', '\x46', '$', '\x2', '\x146', + '\x147', '\x5', '\x38', '\x1D', '\x5', '\x147', '\x14D', '\x3', '\x2', + '\x2', '\x2', '\x148', '\x149', '\f', '\x3', '\x2', '\x2', '\x149', '\x14A', + '\x5', 'H', '%', '\x2', '\x14A', '\x14B', '\x5', '\x38', '\x1D', '\x4', + '\x14B', '\x14D', '\x3', '\x2', '\x2', '\x2', '\x14C', '\x12C', '\x3', + '\x2', '\x2', '\x2', '\x14C', '\x130', '\x3', '\x2', '\x2', '\x2', '\x14C', + '\x134', '\x3', '\x2', '\x2', '\x2', '\x14C', '\x138', '\x3', '\x2', '\x2', + '\x2', '\x14C', '\x13C', '\x3', '\x2', '\x2', '\x2', '\x14C', '\x140', + '\x3', '\x2', '\x2', '\x2', '\x14C', '\x144', '\x3', '\x2', '\x2', '\x2', + '\x14C', '\x148', '\x3', '\x2', '\x2', '\x2', '\x14D', '\x150', '\x3', + '\x2', '\x2', '\x2', '\x14E', '\x14C', '\x3', '\x2', '\x2', '\x2', '\x14E', + '\x14F', '\x3', '\x2', '\x2', '\x2', '\x14F', '\x39', '\x3', '\x2', '\x2', + '\x2', '\x150', '\x14E', '\x3', '\x2', '\x2', '\x2', '\x151', '\x152', + '\t', '\x4', '\x2', '\x2', '\x152', ';', '\x3', '\x2', '\x2', '\x2', '\x153', + '\x154', '\t', '\x5', '\x2', '\x2', '\x154', '=', '\x3', '\x2', '\x2', + '\x2', '\x155', '\x156', '\t', '\x6', '\x2', '\x2', '\x156', '?', '\x3', + '\x2', '\x2', '\x2', '\x157', '\x158', '\t', '\a', '\x2', '\x2', '\x158', + '\x41', '\x3', '\x2', '\x2', '\x2', '\x159', '\x15A', '\a', '\x17', '\x2', + '\x2', '\x15A', '\x43', '\x3', '\x2', '\x2', '\x2', '\x15B', '\x15C', + '\a', '\x18', '\x2', '\x2', '\x15C', '\x45', '\x3', '\x2', '\x2', '\x2', + '\x15D', '\x15E', '\a', '\x19', '\x2', '\x2', '\x15E', 'G', '\x3', '\x2', + '\x2', '\x2', '\x15F', '\x160', '\a', '\x1A', '\x2', '\x2', '\x160', 'I', + '\x3', '\x2', '\x2', '\x2', '\x161', '\x166', '\x5', 'N', '(', '\x2', + '\x162', '\x163', '\x5', 'L', '\'', '\x2', '\x163', '\x164', '\x5', 'J', + '&', '\x2', '\x164', '\x166', '\x3', '\x2', '\x2', '\x2', '\x165', '\x161', + '\x3', '\x2', '\x2', '\x2', '\x165', '\x162', '\x3', '\x2', '\x2', '\x2', + '\x166', 'K', '\x3', '\x2', '\x2', '\x2', '\x167', '\x168', '\t', '\b', + '\x2', '\x2', '\x168', 'M', '\x3', '\x2', '\x2', '\x2', '\x169', '\x16A', + '\b', '(', '\x1', '\x2', '\x16A', '\x190', '\x5', 'X', '-', '\x2', '\x16B', + '\x190', '\a', '\x42', '\x2', '\x2', '\x16C', '\x190', '\x5', 'Z', '.', + '\x2', '\x16D', '\x16F', '\a', '\b', '\x2', '\x2', '\x16E', '\x170', '\x5', + 'R', '*', '\x2', '\x16F', '\x16E', '\x3', '\x2', '\x2', '\x2', '\x16F', + '\x170', '\x3', '\x2', '\x2', '\x2', '\x170', '\x171', '\x3', '\x2', '\x2', + '\x2', '\x171', '\x190', '\a', '\t', '\x2', '\x2', '\x172', '\x174', '\a', + '\x1C', '\x2', '\x2', '\x173', '\x175', '\x5', 'T', '+', '\x2', '\x174', + '\x173', '\x3', '\x2', '\x2', '\x2', '\x174', '\x175', '\x3', '\x2', '\x2', + '\x2', '\x175', '\x176', '\x3', '\x2', '\x2', '\x2', '\x176', '\x190', + '\a', '\x1D', '\x2', '\x2', '\x177', '\x178', '\a', '\x5', '\x2', '\x2', + '\x178', '\x179', '\x5', '.', '\x18', '\x2', '\x179', '\x17A', '\a', '\x6', + '\x2', '\x2', '\x17A', '\x190', '\x3', '\x2', '\x2', '\x2', '\x17B', '\x17C', + '\a', '\x5', '\x2', '\x2', '\x17C', '\x17D', '\x5', '\x4', '\x3', '\x2', + '\x17D', '\x17E', '\a', '\x6', '\x2', '\x2', '\x17E', '\x190', '\x3', + '\x2', '\x2', '\x2', '\x17F', '\x180', '\a', '(', '\x2', '\x2', '\x180', + '\x181', '\a', '\x5', '\x2', '\x2', '\x181', '\x182', '\x5', '\x4', '\x3', + '\x2', '\x182', '\x183', '\a', '\x6', '\x2', '\x2', '\x183', '\x190', + '\x3', '\x2', '\x2', '\x2', '\x184', '\x185', '\a', ' ', '\x2', '\x2', + '\x185', '\x186', '\a', '\x5', '\x2', '\x2', '\x186', '\x187', '\x5', + '\x4', '\x3', '\x2', '\x187', '\x188', '\a', '\x6', '\x2', '\x2', '\x188', + '\x190', '\x3', '\x2', '\x2', '\x2', '\x189', '\x18A', '\a', '\x1E', '\x2', + '\x2', '\x18A', '\x18B', '\a', '\x5', '\x2', '\x2', '\x18B', '\x18C', + '\x5', '\x4', '\x3', '\x2', '\x18C', '\x18D', '\a', '\x6', '\x2', '\x2', + '\x18D', '\x190', '\x3', '\x2', '\x2', '\x2', '\x18E', '\x190', '\x5', + 'P', ')', '\x2', '\x18F', '\x169', '\x3', '\x2', '\x2', '\x2', '\x18F', + '\x16B', '\x3', '\x2', '\x2', '\x2', '\x18F', '\x16C', '\x3', '\x2', '\x2', + '\x2', '\x18F', '\x16D', '\x3', '\x2', '\x2', '\x2', '\x18F', '\x172', + '\x3', '\x2', '\x2', '\x2', '\x18F', '\x177', '\x3', '\x2', '\x2', '\x2', + '\x18F', '\x17B', '\x3', '\x2', '\x2', '\x2', '\x18F', '\x17F', '\x3', + '\x2', '\x2', '\x2', '\x18F', '\x184', '\x3', '\x2', '\x2', '\x2', '\x18F', + '\x189', '\x3', '\x2', '\x2', '\x2', '\x18F', '\x18E', '\x3', '\x2', '\x2', + '\x2', '\x190', '\x19B', '\x3', '\x2', '\x2', '\x2', '\x191', '\x192', + '\f', '\b', '\x2', '\x2', '\x192', '\x193', '\a', '\a', '\x2', '\x2', + '\x193', '\x19A', '\x5', 'X', '-', '\x2', '\x194', '\x195', '\f', '\a', + '\x2', '\x2', '\x195', '\x196', '\a', '\b', '\x2', '\x2', '\x196', '\x197', + '\x5', '.', '\x18', '\x2', '\x197', '\x198', '\a', '\t', '\x2', '\x2', + '\x198', '\x19A', '\x3', '\x2', '\x2', '\x2', '\x199', '\x191', '\x3', + '\x2', '\x2', '\x2', '\x199', '\x194', '\x3', '\x2', '\x2', '\x2', '\x19A', + '\x19D', '\x3', '\x2', '\x2', '\x2', '\x19B', '\x199', '\x3', '\x2', '\x2', + '\x2', '\x19B', '\x19C', '\x3', '\x2', '\x2', '\x2', '\x19C', 'O', '\x3', + '\x2', '\x2', '\x2', '\x19D', '\x19B', '\x3', '\x2', '\x2', '\x2', '\x19E', + '\x19F', '\a', ':', '\x2', '\x2', '\x19F', '\x1A1', '\a', '\a', '\x2', + '\x2', '\x1A0', '\x19E', '\x3', '\x2', '\x2', '\x2', '\x1A0', '\x1A1', + '\x3', '\x2', '\x2', '\x2', '\x1A1', '\x1A2', '\x3', '\x2', '\x2', '\x2', + '\x1A2', '\x1A3', '\x5', 'X', '-', '\x2', '\x1A3', '\x1A5', '\a', '\x5', + '\x2', '\x2', '\x1A4', '\x1A6', '\x5', 'R', '*', '\x2', '\x1A5', '\x1A4', + '\x3', '\x2', '\x2', '\x2', '\x1A5', '\x1A6', '\x3', '\x2', '\x2', '\x2', + '\x1A6', '\x1A7', '\x3', '\x2', '\x2', '\x2', '\x1A7', '\x1A8', '\a', + '\x6', '\x2', '\x2', '\x1A8', '\x1B6', '\x3', '\x2', '\x2', '\x2', '\x1A9', + '\x1AA', '\a', '.', '\x2', '\x2', '\x1AA', '\x1AC', '\a', '\x5', '\x2', + '\x2', '\x1AB', '\x1AD', '\x5', 'R', '*', '\x2', '\x1AC', '\x1AB', '\x3', + '\x2', '\x2', '\x2', '\x1AC', '\x1AD', '\x3', '\x2', '\x2', '\x2', '\x1AD', + '\x1AE', '\x3', '\x2', '\x2', '\x2', '\x1AE', '\x1B6', '\a', '\x6', '\x2', + '\x2', '\x1AF', '\x1B0', '\a', '\x36', '\x2', '\x2', '\x1B0', '\x1B2', + '\a', '\x5', '\x2', '\x2', '\x1B1', '\x1B3', '\x5', 'R', '*', '\x2', '\x1B2', + '\x1B1', '\x3', '\x2', '\x2', '\x2', '\x1B2', '\x1B3', '\x3', '\x2', '\x2', + '\x2', '\x1B3', '\x1B4', '\x3', '\x2', '\x2', '\x2', '\x1B4', '\x1B6', + '\a', '\x6', '\x2', '\x2', '\x1B5', '\x1A0', '\x3', '\x2', '\x2', '\x2', + '\x1B5', '\x1A9', '\x3', '\x2', '\x2', '\x2', '\x1B5', '\x1AF', '\x3', + '\x2', '\x2', '\x2', '\x1B6', 'Q', '\x3', '\x2', '\x2', '\x2', '\x1B7', + '\x1BC', '\x5', '.', '\x18', '\x2', '\x1B8', '\x1B9', '\a', '\x4', '\x2', + '\x2', '\x1B9', '\x1BB', '\x5', '.', '\x18', '\x2', '\x1BA', '\x1B8', + '\x3', '\x2', '\x2', '\x2', '\x1BB', '\x1BE', '\x3', '\x2', '\x2', '\x2', + '\x1BC', '\x1BA', '\x3', '\x2', '\x2', '\x2', '\x1BC', '\x1BD', '\x3', + '\x2', '\x2', '\x2', '\x1BD', 'S', '\x3', '\x2', '\x2', '\x2', '\x1BE', + '\x1BC', '\x3', '\x2', '\x2', '\x2', '\x1BF', '\x1C4', '\x5', 'V', ',', + '\x2', '\x1C0', '\x1C1', '\a', '\x4', '\x2', '\x2', '\x1C1', '\x1C3', + '\x5', 'V', ',', '\x2', '\x1C2', '\x1C0', '\x3', '\x2', '\x2', '\x2', + '\x1C3', '\x1C6', '\x3', '\x2', '\x2', '\x2', '\x1C4', '\x1C2', '\x3', + '\x2', '\x2', '\x2', '\x1C4', '\x1C5', '\x3', '\x2', '\x2', '\x2', '\x1C5', + 'U', '\x3', '\x2', '\x2', '\x2', '\x1C6', '\x1C4', '\x3', '\x2', '\x2', + '\x2', '\x1C7', '\x1C8', '\a', '@', '\x2', '\x2', '\x1C8', '\x1C9', '\a', + '\v', '\x2', '\x2', '\x1C9', '\x1CA', '\x5', '.', '\x18', '\x2', '\x1CA', + 'W', '\x3', '\x2', '\x2', '\x2', '\x1CB', '\x1CC', '\t', '\t', '\x2', + '\x2', '\x1CC', 'Y', '\x3', '\x2', '\x2', '\x2', '\x1CD', '\x1CE', '\t', + '\n', '\x2', '\x2', '\x1CE', '[', '\x3', '\x2', '\x2', '\x2', '/', '\x61', + '\x64', 'g', 'j', 'm', 'q', 't', '~', '\x8A', '\x90', '\x98', '\x9B', + '\xA1', '\xA8', '\xAD', '\xB3', '\xC1', '\xC3', '\xD6', '\xDB', '\xEC', + '\xF3', '\xFE', '\x100', '\x107', '\x10F', '\x111', '\x116', '\x11F', + '\x124', '\x14C', '\x14E', '\x165', '\x16F', '\x174', '\x18F', '\x199', + '\x19B', '\x1A0', '\x1A5', '\x1AC', '\x1B2', '\x1B5', '\x1BC', '\x1C4', }; public static readonly ATN _ATN = diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs index 4e6bacb145..36e14d78bd 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs @@ -789,6 +789,12 @@ private enum Aggregate public static readonly AggregateScalarExpressionDetector Singleton = new AggregateScalarExpressionDetector(); + public override bool Visit(SqlAllScalarExpression sqlAllScalarExpression) + { + // No need to worry about aggregates within the subquery (they will recursively get rewritten). + return false; + } + public override bool Visit(SqlArrayCreateScalarExpression sqlArrayCreateScalarExpression) { bool hasAggregates = false; diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/SqlAllScalarExpression.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/SqlAllScalarExpression.cs new file mode 100644 index 0000000000..4bfbee4668 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/SqlAllScalarExpression.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.SqlObjects +{ + using System; + using Microsoft.Azure.Cosmos.SqlObjects.Visitors; + +#if INTERNAL +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +#pragma warning disable SA1600 // Elements should be documented + public +#else + internal +#endif + sealed class SqlAllScalarExpression : SqlScalarExpression + { + private SqlAllScalarExpression(SqlQuery subquery) + { + this.Subquery = subquery ?? throw new ArgumentNullException(nameof(subquery)); + } + + public SqlQuery Subquery { get; } + + public static SqlAllScalarExpression Create(SqlQuery subquery) => new SqlAllScalarExpression(subquery); + + public override void Accept(SqlObjectVisitor visitor) => visitor.Visit(this); + + public override TResult Accept(SqlObjectVisitor visitor) => visitor.Visit(this); + + public override TResult Accept(SqlObjectVisitor visitor, T input) => visitor.Visit(this, input); + + public override void Accept(SqlScalarExpressionVisitor visitor) => visitor.Visit(this); + + public override TResult Accept(SqlScalarExpressionVisitor visitor) => visitor.Visit(this); + + public override TResult Accept(SqlScalarExpressionVisitor visitor, T input) => visitor.Visit(this, input); + } +} diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectEqualityVisitor.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectEqualityVisitor.cs index 5a4bd72d63..3a9bf01970 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectEqualityVisitor.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectEqualityVisitor.cs @@ -36,6 +36,21 @@ public override bool Visit(SqlAliasedCollectionExpression first, SqlObject secon return true; } + public override bool Visit(SqlAllScalarExpression first, SqlObject secondAsObject) + { + if (!(secondAsObject is SqlAllScalarExpression second)) + { + return false; + } + + if (!Equals(first.Subquery, second.Subquery)) + { + return false; + } + + return true; + } + public override bool Visit(SqlArrayCreateScalarExpression first, SqlObject secondAsObject) { if (!(secondAsObject is SqlArrayCreateScalarExpression second)) diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectHasher.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectHasher.cs index a5f11d45c3..dfbab84bc0 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectHasher.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectHasher.cs @@ -12,6 +12,7 @@ internal sealed class SqlObjectHasher : SqlObjectVisitor public static readonly SqlObjectHasher Singleton = new SqlObjectHasher(true); private const int SqlAliasedCollectionExpressionHashCode = 1202039781; + private const int SqlAllScalarExpressionHashCode = 1369048120; private const int SqlArrayCreateScalarExpressionHashCode = 1760950661; private const int SqlArrayIteratorCollectionExpressionHashCode = -468874086; private const int SqlArrayScalarExpressionHashCode = -1093553293; @@ -119,6 +120,13 @@ public override int Visit(SqlAliasedCollectionExpression sqlAliasedCollectionExp return hashCode; } + public override int Visit(SqlAllScalarExpression sqlAllScalarExpression) + { + int hashCode = SqlAllScalarExpressionHashCode; + hashCode = CombineHashes(hashCode, sqlAllScalarExpression.Subquery.Accept(this)); + return hashCode; + } + public override int Visit(SqlArrayCreateScalarExpression sqlArrayCreateScalarExpression) { int hashCode = SqlArrayCreateScalarExpressionHashCode; diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectObfuscator.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectObfuscator.cs index 7fa52c4437..5e6faaef45 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectObfuscator.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectObfuscator.cs @@ -44,6 +44,11 @@ public override SqlObject Visit(SqlAliasedCollectionExpression sqlAliasedCollect sqlAliasedCollectionExpression.Alias.Accept(this) as SqlIdentifier); } + public override SqlObject Visit(SqlAllScalarExpression sqlAllScalarExpression) + { + return SqlExistsScalarExpression.Create(sqlAllScalarExpression.Subquery.Accept(this) as SqlQuery); + } + public override SqlObject Visit(SqlArrayCreateScalarExpression sqlArrayCreateScalarExpression) { List items = new List(); diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectTextSerializer.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectTextSerializer.cs index c4d3dfa68d..75076e512c 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectTextSerializer.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectTextSerializer.cs @@ -39,6 +39,14 @@ public override void Visit(SqlAliasedCollectionExpression sqlAliasedCollectionEx } } + public override void Visit(SqlAllScalarExpression sqlAllScalarExpression) + { + this.writer.Write("ALL"); + this.WriteStartContext("("); + sqlAllScalarExpression.Subquery.Accept(this); + this.WriteEndContext(")"); + } + public override void Visit(SqlArrayCreateScalarExpression sqlArrayCreateScalarExpression) { int numberOfItems = sqlArrayCreateScalarExpression.Items.Count(); diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor.cs index ada48254b6..d8d8899395 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.Cosmos.SqlObjects.Visitors abstract class SqlObjectVisitor { public abstract void Visit(SqlAliasedCollectionExpression sqlObject); + public abstract void Visit(SqlAllScalarExpression sqlObject); public abstract void Visit(SqlArrayCreateScalarExpression sqlObject); public abstract void Visit(SqlArrayIteratorCollectionExpression sqlObject); public abstract void Visit(SqlArrayScalarExpression sqlObject); diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor{TArg,TOutput}.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor{TArg,TOutput}.cs index eda7022f3b..3ba9878ae6 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor{TArg,TOutput}.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor{TArg,TOutput}.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.Cosmos.SqlObjects.Visitors abstract class SqlObjectVisitor { public abstract TOutput Visit(SqlAliasedCollectionExpression sqlObject, TArg input); + public abstract TOutput Visit(SqlAllScalarExpression sqlObject, TArg input); public abstract TOutput Visit(SqlArrayCreateScalarExpression sqlObject, TArg input); public abstract TOutput Visit(SqlArrayIteratorCollectionExpression sqlObject, TArg input); public abstract TOutput Visit(SqlArrayScalarExpression sqlObject, TArg input); diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor{TResult}.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor{TResult}.cs index 08d8b7ef10..6f0ce75e99 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor{TResult}.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor{TResult}.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.Cosmos.SqlObjects.Visitors abstract class SqlObjectVisitor { public abstract TResult Visit(SqlAliasedCollectionExpression sqlObject); + public abstract TResult Visit(SqlAllScalarExpression sqlObject); public abstract TResult Visit(SqlArrayCreateScalarExpression sqlObject); public abstract TResult Visit(SqlArrayIteratorCollectionExpression sqlObject); public abstract TResult Visit(SqlArrayScalarExpression sqlObject); diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor.cs index 1e1770403b..8e6e75b7f0 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Cosmos.SqlObjects.Visitors #endif abstract class SqlScalarExpressionVisitor { + public abstract void Visit(SqlAllScalarExpression scalarExpression); public abstract void Visit(SqlArrayCreateScalarExpression scalarExpression); public abstract void Visit(SqlArrayScalarExpression scalarExpression); public abstract void Visit(SqlBetweenScalarExpression scalarExpression); diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor{TArg,TOutput}.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor{TArg,TOutput}.cs index 3862aaab40..ff5cdbc019 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor{TArg,TOutput}.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor{TArg,TOutput}.cs @@ -13,6 +13,7 @@ namespace Microsoft.Azure.Cosmos.SqlObjects.Visitors #endif abstract class SqlScalarExpressionVisitor { + public abstract TOutput Visit(SqlAllScalarExpression scalarExpression, TArg input); public abstract TOutput Visit(SqlArrayCreateScalarExpression scalarExpression, TArg input); public abstract TOutput Visit(SqlArrayScalarExpression scalarExpression, TArg input); public abstract TOutput Visit(SqlBetweenScalarExpression scalarExpression, TArg input); diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor{TResult}.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor{TResult}.cs index 1ca9150582..bdc7b5f04f 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor{TResult}.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor{TResult}.cs @@ -13,6 +13,7 @@ namespace Microsoft.Azure.Cosmos.SqlObjects.Visitors #endif abstract class SqlScalarExpressionVisitor { + public abstract TResult Visit(SqlAllScalarExpression scalarExpression); public abstract TResult Visit(SqlArrayCreateScalarExpression scalarExpression); public abstract TResult Visit(SqlArrayScalarExpression scalarExpression); public abstract TResult Visit(SqlBetweenScalarExpression scalarExpression); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/AggregateSubquerySqlParserBaselineTests.All.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/AggregateSubquerySqlParserBaselineTests.All.xml new file mode 100644 index 0000000000..4df32ccb12 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/AggregateSubquerySqlParserBaselineTests.All.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ScalarExpressionSqlParserBaselineTests.All.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ScalarExpressionSqlParserBaselineTests.All.xml new file mode 100644 index 0000000000..70040beaf4 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ScalarExpressionSqlParserBaselineTests.All.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj index ef7e193dbf..dc5f2c8e41 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj @@ -1,4 +1,4 @@ - + true @@ -174,6 +174,12 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + PreserveNewest diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/AggregateProjectionDector.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/AggregateProjectionDector.cs index f0ee3beb3d..ca162fc467 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/AggregateProjectionDector.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/AggregateProjectionDector.cs @@ -55,6 +55,12 @@ public override bool Visit(SqlSelectStarSpec selectSpec) private sealed class AggregateScalarExpressionDetector : SqlScalarExpressionVisitor { public static readonly AggregateScalarExpressionDetector Singleton = new AggregateScalarExpressionDetector(); + + public override bool Visit(SqlAllScalarExpression sqlAllScalarExpression) + { + // No need to worry about aggregates within the subquery (they will recursively get rewritten). + return false; + } public override bool Visit(SqlArrayCreateScalarExpression sqlArrayCreateScalarExpression) { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/AggregateProjectionTransformer.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/AggregateProjectionTransformer.cs index 15411612f1..1ce82d3c98 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/AggregateProjectionTransformer.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/AggregateProjectionTransformer.cs @@ -79,6 +79,12 @@ public AggregateScalarExpressionTransformer(IEnumerable dataSourc this.dataSource = dataSource; } + public override SqlScalarExpression Visit(SqlAllScalarExpression sqlAllScalarExpression) + { + // No need to worry about aggregates within the subquery (they will recursively get rewritten). + return sqlAllScalarExpression; + } + public override SqlScalarExpression Visit(SqlArrayCreateScalarExpression sqlArrayCreateScalarExpression) { List items = new List(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/ScalarExpressionEvaluator.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/ScalarExpressionEvaluator.cs index 2274c876a5..2a671f2568 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/ScalarExpressionEvaluator.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/ScalarExpressionEvaluator.cs @@ -24,6 +24,54 @@ private ScalarExpressionEvaluator() { } + public override CosmosElement Visit( + SqlAllScalarExpression scalarExpression, + CosmosElement document) + { + // We evaluate the ALL expression by constructing an equivalent EXISTS and evaluating that. + // ALL ( Filter Expression ) ==> NOT EXISTS ( NOT Filter Expression ) + + // If there is is no filter expression, then an equivalent filter expression of just true is created. + SqlScalarExpression filterExpression; + if (scalarExpression.Subquery.WhereClause == null) + { + SqlLiteral trueLiteral = SqlBooleanLiteral.Create(true); + filterExpression = SqlLiteralScalarExpression.Create(trueLiteral); + } + else + { + filterExpression = scalarExpression.Subquery.WhereClause.FilterExpression; + } + + // Create a NOT unary with filter expression. + SqlUnaryScalarExpression negatedFilterExpression = SqlUnaryScalarExpression.Create( + SqlUnaryScalarOperatorKind.Not, + filterExpression); + + // Create new where clause with negated filter expression. + SqlWhereClause newWhereClause = SqlWhereClause.Create(negatedFilterExpression); + + // create new subquery with new where clause. + SqlQuery newSqlQuery = SqlQuery.Create( + scalarExpression.Subquery.SelectClause, + scalarExpression.Subquery.FromClause, + newWhereClause, + scalarExpression.Subquery.GroupByClause, + scalarExpression.Subquery.OrderByClause, + scalarExpression.Subquery.OffsetLimitClause); + + // Create an exists expression with new subquery. + SqlExistsScalarExpression newExistsScalarExpression = SqlExistsScalarExpression.Create(newSqlQuery); + + // Create a not unary with the exists expression. + SqlUnaryScalarExpression negatedExistsExpression = SqlUnaryScalarExpression.Create( + SqlUnaryScalarOperatorKind.Not, + newExistsScalarExpression); + + // Visit the equivalent NOT EXISTS expression. + return this.Visit(negatedExistsExpression, document); + } + public override CosmosElement Visit( SqlArrayCreateScalarExpression scalarExpression, CosmosElement document) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/SqlInterpreter.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/SqlInterpreter.cs index ec02c45bde..ba45092faa 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/SqlInterpreter.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/SqlInterpreter.cs @@ -631,6 +631,11 @@ public GroupByProjectionScalarExpressionVisitor(IReadOnlyList inputs = new List() + { + CreateInput( + description: "ALL in an SqlSelectItem as an alias", + query: "SELECT 1 AS ALL"), + CreateInput( + description: "ALL in an AliasedCollectionExpression as an alias", + query: "SELECT * " + + "FROM (SELECT VALUE 1) AS ALL"), + CreateInput( + description: "ALL in an ArrayIteratorCollectionExpression", + query: "SELECT * " + + "FROM ALL IN (SELECT VALUE 1)"), + CreateInput( + description: "ALL in an InputPathCollection and IdentifierPathExpression", + query: "SELECT * " + + "FROM ALL.ALL"), + CreateInput( + description: "ALL in a PropertyRefScalarExpression", + query: "SELECT ALL"), + CreateInput( + description: "ALL in a PropertyRefScalarExpression as child", + query: "SELECT c.ALL"), + CreateInput( + description: "ALL in a PropertyRefScalarExpression as parent and child", + query: "SELECT ALL.ALL"), + CreateInput( + description: "ALL in a function call", + query: "SELECT ALL(1, 2)"), + CreateInput( + description: "ALL in a UDF function call", + query: "SELECT udf.ALL(1, 2)"), + CreateInput( + description: "ALL in every possible grammar rule at the same time", + query: "SELECT ALL(1, 2) AS ALL " + + "FROM ALL IN (SELECT ALL.ALL) " + + "WHERE ALL( " + + " SELECT ALL " + + " FROM (SELECT udf.ALL(1, 2)) AS ALL " + + " WHERE ALL( SELECT VALUE 1) " + + ")") + + }; + + this.ExecuteTestSuite(inputs); + } + + public static SqlParserBaselineTestInput CreateInput(string description, string query) + { + return new SqlParserBaselineTestInput(description, query); + } + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/ScalarExpressionSqlParserBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/ScalarExpressionSqlParserBaselineTests.cs index 7f0ec89943..2faed74686 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/ScalarExpressionSqlParserBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/ScalarExpressionSqlParserBaselineTests.cs @@ -8,6 +8,38 @@ [TestClass] public sealed class ScalarExpressionSqlParserBaselineTests : SqlParserBaselineTests { + [TestMethod] + public void All() + { + List inputs = new List() + { + // Positive + CreateInput(description: "Basic", scalarExpression: "ALL(SELECT *)"), + CreateInput(description: "case insensitive", scalarExpression: "aLl(SELECT *)"), + CreateInput(description: "nested", scalarExpression:"ALL( SELECT * WHERE ALL( SELECT *))"), + CreateInput( + description: "multiple nested", + scalarExpression: + "ALL( " + + " SELECT * " + + " WHERE ALL( " + + " SELECT *" + + " WHERE ALL(" + + " SELECT *" + + " WHERE ALL(" + + " SELECT VALUE 1" + + " )" + + " )" + + " )" + + ")"), + + // Negative + CreateInput(description: "No closing parens", scalarExpression: "ALL(SELECT *") + }; + + this.ExecuteTestSuite(inputs); + } + [TestMethod] public void ArrayCreate() { From 07b34e6213a628f9580717d198faeb7268c8ce80 Mon Sep 17 00:00:00 2001 From: neildsh <35383880+neildsh@users.noreply.github.com> Date: Mon, 28 Nov 2022 11:50:57 -0800 Subject: [PATCH 025/240] Release: Adds API contracts for 3.31.2-preview (#3586) --- .../contracts/API_3.31.2-preview.txt | 1526 +++++++++++++++++ 1 file changed, 1526 insertions(+) create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.31.2-preview.txt diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.31.2-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.31.2-preview.txt new file mode 100644 index 0000000000..e299887d03 --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.31.2-preview.txt @@ -0,0 +1,1526 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode FullFidelity { get; } + public static ChangeFeedMode Incremental { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsPrimitive(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} From 531864605930ad4ac7eb405889affb21f231fcc8 Mon Sep 17 00:00:00 2001 From: Vivek Ravindran Date: Tue, 29 Nov 2022 06:38:22 -0800 Subject: [PATCH 026/240] [Internal] sccignore: Adds a .sccignore file to apply an exception for artifacts configuration issues (#3589) --- .sscignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .sscignore diff --git a/.sscignore b/.sscignore new file mode 100644 index 0000000000..1558a1ea7b --- /dev/null +++ b/.sscignore @@ -0,0 +1,3 @@ +{ +"cfs" : ["CFS0011"] +} \ No newline at end of file From 28318b0fe2cbfceb80276574f131f6b79f4b64ed Mon Sep 17 00:00:00 2001 From: Prasad Ullal <36418906+prasadu-microsoft@users.noreply.github.com> Date: Thu, 1 Dec 2022 08:24:15 -0800 Subject: [PATCH 027/240] [Internal] PermissionTests: Adds CosmosPermissionTests Coverage (#3593) * Ensures that both Direct and Gateway connection modes are tested * Validates that container read works with PermissionMode.Read (test was previously only validating that Delete was blocked - i.e. the negative case). --- .../CosmosPermissionTests.cs | 100 ++++++++++++++---- 1 file changed, 80 insertions(+), 20 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosPermissionTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosPermissionTests.cs index 531757c3ba..003ca8690b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosPermissionTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosPermissionTests.cs @@ -107,8 +107,15 @@ public async Task CRUDTest() } [TestMethod] - public async Task ContainerResourcePermissionTest() + [DataRow(ConnectionMode.Gateway)] + [DataRow(ConnectionMode.Direct)] + public async Task ContainerResourcePermissionTest(ConnectionMode mode) { + CosmosClientOptions cosmosClientOptions = new CosmosClientOptions() + { + ConnectionMode = mode, + }; + //create user string userId = Guid.NewGuid().ToString(); UserResponse userResponse = await this.cosmosDatabase.CreateUserAsync(userId); @@ -121,7 +128,7 @@ public async Task ContainerResourcePermissionTest() ContainerResponse containerResponse = await this.cosmosDatabase.CreateContainerAsync(containerId, "/id"); Assert.AreEqual(HttpStatusCode.Created, containerResponse.StatusCode); Container container = containerResponse.Container; - + //create permission string permissionId = Guid.NewGuid().ToString(); PermissionProperties permissionProperties = new PermissionProperties(permissionId, PermissionMode.Read, container); @@ -131,9 +138,18 @@ public async Task ContainerResourcePermissionTest() Assert.AreEqual(permissionId, permission.Id); Assert.AreEqual(permissionProperties.PermissionMode, permission.PermissionMode); - //delete resource with PermissionMode.Read - using (CosmosClient tokenCosmosClient = TestCommon.CreateCosmosClient(clientOptions: null, resourceToken: permission.Token)) + using (CosmosClient tokenCosmosClient = TestCommon.CreateCosmosClient(cosmosClientOptions, resourceToken: permission.Token)) { + Container readContainerRef = tokenCosmosClient.GetContainer(this.cosmosDatabase.Id, containerId); + + //read resource with PermissionMode.Read + using FeedIterator feedIterator = readContainerRef.GetItemQueryIterator("SELECT * FROM c"); + while (feedIterator.HasMoreResults) + { + _ = await feedIterator.ReadNextAsync(); + } + + //delete resource with PermissionMode.Read try { ContainerResponse response = await tokenCosmosClient @@ -147,14 +163,14 @@ public async Task ContainerResourcePermissionTest() Assert.AreEqual(HttpStatusCode.Forbidden, ex.StatusCode); } } - + //update permission to PermissionMode.All permissionProperties = new PermissionProperties(permissionId, PermissionMode.All, container); permissionResponse = await user.GetPermission(permissionId).ReplaceAsync(permissionProperties); permission = permissionResponse.Resource; //delete resource with PermissionMode.All - using (CosmosClient tokenCosmosClient = TestCommon.CreateCosmosClient(clientOptions: null, resourceToken: permission.Token)) + using (CosmosClient tokenCosmosClient = TestCommon.CreateCosmosClient(cosmosClientOptions, resourceToken: permission.Token)) { ContainerResponse response = await tokenCosmosClient .GetDatabase(this.cosmosDatabase.Id) @@ -284,8 +300,15 @@ await container.CreateItemAsync( } [TestMethod] - public async Task ItemResourcePermissionTest() + [DataRow(ConnectionMode.Gateway)] + [DataRow(ConnectionMode.Direct)] + public async Task ItemResourcePermissionTest(ConnectionMode connectionMode) { + CosmosClientOptions cosmosClientOptions = new CosmosClientOptions() + { + ConnectionMode = connectionMode + }; + //create user string userId = Guid.NewGuid().ToString(); UserResponse userResponse = await this.cosmosDatabase.CreateUserAsync(userId); @@ -313,13 +336,15 @@ public async Task ItemResourcePermissionTest() Assert.AreEqual(permissionId, permission.Id); Assert.AreEqual(permissionProperties.PermissionMode, permission.PermissionMode); - //delete resource with PermissionMode.Read - using (CosmosClient tokenCosmosClient = TestCommon.CreateCosmosClient(clientOptions: null, resourceToken: permission.Token)) + using (CosmosClient tokenCosmosClient = TestCommon.CreateCosmosClient(clientOptions: cosmosClientOptions, resourceToken: permission.Token)) { Container tokenContainer = tokenCosmosClient.GetContainer(this.cosmosDatabase.Id, containerId); + + //read resource with PermissionMode.Read ItemResponse readPermissionItem = await tokenContainer.ReadItemAsync(itemId, partitionKey); Assert.AreEqual(itemId, readPermissionItem.Resource.id.ToString()); + //delete resource with PermissionMode.Read try { ItemResponse response = await tokenContainer.DeleteItemAsync( @@ -340,7 +365,7 @@ public async Task ItemResourcePermissionTest() permission = permissionResponse.Resource; //delete resource with PermissionMode.All - using (CosmosClient tokenCosmosClient = TestCommon.CreateCosmosClient(clientOptions: null, resourceToken: permission.Token)) + using (CosmosClient tokenCosmosClient = TestCommon.CreateCosmosClient(clientOptions: cosmosClientOptions, resourceToken: permission.Token)) { using (FeedIterator feed = tokenCosmosClient .GetDatabase(this.cosmosDatabase.Id) @@ -357,8 +382,15 @@ public async Task ItemResourcePermissionTest() } [TestMethod] - public async Task EnsureUnauthorized_ThrowsCosmosClientException() + [DataRow(ConnectionMode.Gateway)] + [DataRow(ConnectionMode.Direct)] + public async Task EnsureUnauthorized_ThrowsCosmosClientException(ConnectionMode connectionMode) { + CosmosClientOptions cosmosClientOptions = new CosmosClientOptions() + { + ConnectionMode = connectionMode + }; + string authKey = ConfigurationManager.AppSettings["MasterKey"]; string endpoint = ConfigurationManager.AppSettings["GatewayEndpoint"]; @@ -367,21 +399,32 @@ public async Task EnsureUnauthorized_ThrowsCosmosClientException() using CosmosClient cosmosClient = new CosmosClient( endpoint, - authKey); + authKey, + cosmosClientOptions); CosmosException exception = await Assert.ThrowsExceptionAsync(() => cosmosClient.GetContainer("test", "test").ReadItemAsync("test", new PartitionKey("test"))); Assert.AreEqual(HttpStatusCode.Unauthorized, exception.StatusCode); } [TestMethod] - public async Task EnsureUnauthorized_ThrowsCosmosClientException_ReadAccountAsync() + [DataRow(ConnectionMode.Gateway)] + [DataRow(ConnectionMode.Direct)] + public async Task EnsureUnauthorized_ThrowsCosmosClientException_ReadAccountAsync(ConnectionMode connectionMode) { + CosmosClientOptions cosmosClientOptions = new CosmosClientOptions() + { + ConnectionMode = connectionMode + }; + string authKey = ConfigurationManager.AppSettings["MasterKey"]; string endpoint = ConfigurationManager.AppSettings["GatewayEndpoint"]; // Take the key and change some middle character authKey = authKey.Replace("m", "M"); - CosmosClient cosmosClient = new CosmosClient(endpoint, authKey); + using CosmosClient cosmosClient = new CosmosClient( + endpoint, + authKey, + cosmosClientOptions); CosmosException exception1 = await Assert.ThrowsExceptionAsync(() => cosmosClient.ReadAccountAsync()); Assert.AreEqual(HttpStatusCode.Unauthorized, exception1.StatusCode); @@ -389,33 +432,50 @@ public async Task EnsureUnauthorized_ThrowsCosmosClientException_ReadAccountAsyn } [TestMethod] - public async Task EnsureUnauthorized_Writes_ThrowsCosmosClientException() + [DataRow(ConnectionMode.Gateway)] + [DataRow(ConnectionMode.Direct)] + public async Task EnsureUnauthorized_Writes_ThrowsCosmosClientException(ConnectionMode connectionMode) { + CosmosClientOptions cosmosClientOptions = new CosmosClientOptions() + { + ConnectionMode = connectionMode + }; + string authKey = ConfigurationManager.AppSettings["MasterKey"]; string endpoint = ConfigurationManager.AppSettings["GatewayEndpoint"]; - + // Take the key and change some middle character authKey = authKey.Replace("m", "M"); using CosmosClient cosmosClient = new CosmosClient( endpoint, - authKey); + authKey, + cosmosClientOptions); + CosmosException exception = await Assert.ThrowsExceptionAsync(() => cosmosClient.GetContainer("test", "test").CreateItemAsync(new { id = "test" })); Assert.AreEqual(HttpStatusCode.Unauthorized, exception.StatusCode); } [TestMethod] - public async Task EnsureUnauthorized_Query_ThrowsCosmosClientException() + [DataRow(ConnectionMode.Gateway)] + [DataRow(ConnectionMode.Direct)] + public async Task EnsureUnauthorized_Query_ThrowsCosmosClientException(ConnectionMode connectionMode) { + CosmosClientOptions cosmosClientOptions = new CosmosClientOptions() + { + ConnectionMode = connectionMode + }; + string authKey = ConfigurationManager.AppSettings["MasterKey"]; string endpoint = ConfigurationManager.AppSettings["GatewayEndpoint"]; - + // Take the key and change some middle character authKey = authKey.Replace("m", "M"); using CosmosClient cosmosClient = new CosmosClient( endpoint, - authKey); + authKey, + cosmosClientOptions); using FeedIterator iterator = cosmosClient.GetContainer("test", "test").GetItemQueryIterator("SELECT * FROM c"); From a34bac772e11642b8855251467d3f5a36a6c1fb8 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 6 Dec 2022 01:02:13 +0530 Subject: [PATCH 028/240] [Internal] AI Integration: Refactors to Operation prefix and add tests (#3583) * add tests for otel and custome listener * clean up * null pointer fix * fix tets * handle event generation also at operation level * added documentation * wip * change event sourcename * rename event Name Co-authored-by: Sourabh Jain --- .../OpenTelemetry/CosmosDbEventSource.cs | 6 +- .../OpenTelemetryAttributeKeys.cs | 2 +- .../OpenTelemetryCoreRecorder.cs | 3 + .../OpenTelemetryRecorderFactory.cs | 9 + ...iterBaselineTests.BatchOperationsAsync.xml | 2 +- ...riterBaselineTests.BulkOperationsAsync.xml | 202 +++++++------- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 44 ++-- ...eWriterBaselineTests.MiscellanousAsync.xml | 8 +- ...neTests.PointOperationsExceptionsAsync.xml | 12 +- ...EndTraceWriterBaselineTests.QueryAsync.xml | 56 ++-- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 32 +-- ...TraceWriterBaselineTests.ReadManyAsync.xml | 14 +- ...selineTests.StreamPointOperationsAsync.xml | 8 +- ...aselineTests.TypedPointOperationsAsync.xml | 8 +- ...icrosoft.Azure.Cosmos.EmulatorTests.csproj | 7 +- .../Tracing/AssertActivity.cs | 90 +++++++ ...TelemetryListener.cs => CustomListener.cs} | 249 ++++++++---------- .../Tracing/CustomOtelExporter.cs | 57 ++++ .../EndToEndTraceWriterBaselineTests.cs | 109 +++++--- 19 files changed, 532 insertions(+), 386 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs rename Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/{OpenTelemetryListener.cs => CustomListener.cs} (61%) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs index 6700697914..af1115367f 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs @@ -8,10 +8,14 @@ namespace Microsoft.Azure.Cosmos.Telemetry using global::Azure.Core.Diagnostics; using Microsoft.Azure.Cosmos.Telemetry.Diagnostics; + /// + /// This class is used to generate events with Azure.Cosmos.Operation Source Name + /// [EventSource(Name = EventSourceName)] internal sealed class CosmosDbEventSource : AzureEventSource { - private const string EventSourceName = OpenTelemetryAttributeKeys.DiagnosticNamespace; + internal const string EventSourceName = "Azure-Cosmos-Operation-Request-Diagnostics"; + private static CosmosDbEventSource Singleton { get; } = new CosmosDbEventSource(); private CosmosDbEventSource() diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs index 801824b791..eb8382c0b0 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs @@ -9,7 +9,7 @@ internal sealed class OpenTelemetryAttributeKeys // Azure defaults public const string DiagnosticNamespace = "Azure.Cosmos"; public const string ResourceProviderNamespace = "Microsoft.DocumentDB"; - public const string OperationPrefix = "Cosmos"; + public const string OperationPrefix = "Operation"; // Common database attributes public const string DbSystemName = "db.system"; diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs index e0b47e744f..32e4fde67f 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs @@ -8,6 +8,9 @@ namespace Microsoft.Azure.Cosmos.Telemetry using System.Collections.Generic; using global::Azure.Core.Pipeline; + /// + /// This class is used to add information in an Activity tags ref. https://github.com/Azure/azure-cosmos-dotnet-v3/issues/3058 + /// internal struct OpenTelemetryCoreRecorder : IDisposable { private const string CosmosDb = "cosmosdb"; diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs index 88f149d608..2cd6e3a481 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs @@ -6,8 +6,14 @@ namespace Microsoft.Azure.Cosmos.Telemetry { using global::Azure.Core.Pipeline; + /// + /// This class is used to generate Activities with Azure.Cosmos.Operation Source Name + /// internal static class OpenTelemetryRecorderFactory { + /// + /// Singleton to make sure we only have one instance of the DiagnosticScopeFactory and pattern matching of listener happens only once + /// private static DiagnosticScopeFactory ScopeFactory { get; set; } public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, @@ -22,11 +28,14 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, ScopeFactory = new DiagnosticScopeFactory(clientNamespace: OpenTelemetryAttributeKeys.DiagnosticNamespace, resourceProviderNamespace: OpenTelemetryAttributeKeys.ResourceProviderNamespace, isActivityEnabled: true); + + // If there is no source then it will return default otherwise a valid diagnostic scope DiagnosticScope scope = OpenTelemetryRecorderFactory .ScopeFactory .CreateScope(name: $"{OpenTelemetryAttributeKeys.OperationPrefix}.{operationName}", kind: clientContext.ClientOptions.ConnectionMode == ConnectionMode.Gateway ? DiagnosticScope.ActivityKind.Internal : DiagnosticScope.ActivityKind.Client); + // Record values only when we have a valid Diagnostic Scope if (scope.IsEnabled) { return new OpenTelemetryCoreRecorder( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index ffce1a6bf4..f650f1e6f5 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -129,7 +129,7 @@ } ] }]]> - Cosmos.ExecuteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.ExecuteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index e999759bd3..c10633d3fa 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -134,16 +134,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -292,16 +292,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -450,16 +450,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -608,16 +608,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -766,16 +766,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -924,16 +924,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1082,16 +1082,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1240,16 +1240,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1398,16 +1398,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1556,16 +1556,16 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2288,7 +2288,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml index 2d747e9e45..e4fa3665a8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml @@ -952,11 +952,11 @@ } ] }]]> - Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1569,11 +1569,11 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2167,11 +2167,11 @@ } ] }]]> - Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2785,11 +2785,11 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3066,8 +3066,8 @@ } ] }]]> - Cosmos.Change Feed Estimator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Change Feed Estimator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml index 5b29ba3737..3825735788 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml @@ -107,8 +107,8 @@ } ] }]]> - Cosmos.DeleteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateDatabaseAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.DeleteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateDatabaseAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -207,8 +207,8 @@ } ] }]]> - Cosmos.DeleteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateDatabaseAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.DeleteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateDatabaseAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml index 7dea567de8..80dbbfb7f1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml @@ -148,7 +148,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -391,7 +391,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -616,7 +616,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -873,7 +873,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1194,7 +1194,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1348,7 +1348,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml index 937daa7a49..5b54a51e31 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml @@ -574,10 +574,10 @@ } ] }]]> - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1180,10 +1180,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1767,10 +1767,10 @@ } ] }]]> - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2374,10 +2374,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3048,10 +3048,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3644,10 +3644,10 @@ } ] }]]> - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -4260,10 +4260,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml index ee1302e06e..22feeace3c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml @@ -536,10 +536,10 @@ } ] }]]> - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1104,10 +1104,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1653,10 +1653,10 @@ } ] }]]> - Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2222,10 +2222,10 @@ } ] }]]> - Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml index 9558168b76..c6a9fcee7f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml @@ -542,12 +542,12 @@ } ] }]]> - Cosmos.ReadManyItemsStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.ReadManyItemsStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1112,7 +1112,7 @@ } ] }]]> - Cosmos.ReadManyItemsAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.ReadManyItemsAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml index a1b5ceb966..5a764d9525 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml @@ -89,7 +89,7 @@ } ] }]]> - Cosmos.CreateItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -178,7 +178,7 @@ } ] }]]> - Cosmos.ReadItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.ReadItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -275,7 +275,7 @@ } ] }]]> - Cosmos.ReplaceItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.ReplaceItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -367,7 +367,7 @@ } ] }]]> - Cosmos.DeleteItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.DeleteItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml index dfe617f632..63edd0154e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml @@ -109,7 +109,7 @@ } ] }]]> - Cosmos.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -203,7 +203,7 @@ } ] }]]> - Cosmos.ReadItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.ReadItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -310,7 +310,7 @@ } ] }]]> - Cosmos.ReplaceItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.ReplaceItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -406,7 +406,7 @@ } ] }]]> - Cosmos.DeleteItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.DeleteItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj index 9849750f54..10e0462cef 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj @@ -1,4 +1,4 @@ - + true true @@ -42,11 +42,12 @@ - + + - + diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs new file mode 100644 index 0000000000..f62d89e016 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs @@ -0,0 +1,90 @@ +namespace Microsoft.Azure.Cosmos.Tracing +{ + using System.Collections.Generic; + using System.Diagnostics; + using System.Linq; + using Microsoft.Azure.Cosmos.Telemetry; + using Microsoft.Azure.Cosmos.Tests; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using Newtonsoft.Json; + + internal static class AssertActivity + { + public static void IsValid(Activity activity) + { + Assert.IsTrue(activity.OperationName == activity.DisplayName); + Assert.IsNotNull(activity.GetTagItem("db.cosmosdb.connection_mode")); + if (activity.GetTagItem("db.cosmosdb.connection_mode").ToString() == ConnectionMode.Gateway.ToString()) + { + Assert.AreEqual(ActivityKind.Internal, activity.Kind); + } + else + { + Assert.AreEqual(ActivityKind.Client, activity.Kind); + } + + IList expectedTags = new List + { + "az.namespace", + "kind", + "db.system", + "db.name", + "db.operation", + "net.peer.name", + "db.cosmosdb.client_id", + "db.cosmosdb.machine_id", + "db.cosmosdb.user_agent", + "db.cosmosdb.connection_mode", + "db.cosmosdb.operation_type", + "db.cosmosdb.container", + "db.cosmosdb.request_content_length_bytes", + "db.cosmosdb.response_content_length_bytes", + "db.cosmosdb.status_code", + "db.cosmosdb.sub_status_code", + "db.cosmosdb.request_charge", + "db.cosmosdb.regions_contacted", + "db.cosmosdb.retry_count", + "db.cosmosdb.item_count", + "db.cosmosdb.request_diagnostics", + "exception.type", + "exception.message", + "exception.stacktrace" + }; + + foreach (KeyValuePair actualTag in activity.Tags) + { + Assert.IsTrue(expectedTags.Contains(actualTag.Key), $"{actualTag.Key} is not allowed for {activity.OperationName}"); + + AssertActivity.AssertDatabaseAndContainerName(activity.OperationName, actualTag); + } + } + + public static void AreEqualAcrossListeners() + { + Assert.AreEqual( + JsonConvert.SerializeObject(CustomListener.CollectedActivities.OrderBy(x => x.Id)), + JsonConvert.SerializeObject(CustomOtelExporter.CollectedActivities.OrderBy(x => x.Id))); + } + + private static void AssertDatabaseAndContainerName(string name, KeyValuePair tag) + { + IList exceptionsForContainerAttribute = new List + { + "Operation.CreateDatabaseAsync", + "Operation.ReadAsync", + "Operation.DeleteAsync" + }; + + if ((tag.Key == OpenTelemetryAttributeKeys.ContainerName && !exceptionsForContainerAttribute.Contains(name)) || + (tag.Key == OpenTelemetryAttributeKeys.DbName)) + { + Assert.IsNotNull(tag.Value, $"{tag.Key} is 'null' for {name} operation"); + } + else if (tag.Key == OpenTelemetryAttributeKeys.ContainerName && exceptionsForContainerAttribute.Contains(name)) + { + Assert.IsNull(tag.Value, $"{tag.Key} is '{tag.Value}' for {name} operation"); + } + } + + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/OpenTelemetryListener.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs similarity index 61% rename from Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/OpenTelemetryListener.cs rename to Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs index 05763f0bdb..5e86ee7270 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/OpenTelemetryListener.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs @@ -12,62 +12,61 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Linq; using System.Reflection; using System.Text; - using System.Threading; - using Microsoft.Azure.Cosmos.Telemetry; - using Microsoft.VisualStudio.TestTools.UnitTesting; - - public class OpenTelemetryListener : - EventListener, - IObserver>, + using System.Text.RegularExpressions; + using Microsoft.Azure.Cosmos.Tracing; + + /// + /// It is a custom listener for Activities and Event. It is used to validate the Activities generated by cosmosDb SDK. + /// + public class CustomListener : + EventListener, // Override Event Listener to capture Event source events + IObserver>, // Override IObserver to capture Activity events IObserver, IDisposable { - private readonly string EventSourceName; - private readonly Func sourceNameFilter; - private readonly AsyncLocal collectThisStack; - - private List subscriptions = new List(); - private readonly Action scopeStartCallback; - - private List Scopes { get; } = new List(); - - private ConcurrentBag GeneratedActivities { set; get; } - private ConcurrentBag GeneratedEvents { set; get; } - - public OpenTelemetryListener(string name, bool asyncLocal = false, Action scopeStartCallback = default) - : this(n => n == name, asyncLocal, scopeStartCallback) + private readonly string eventName; + + private List subscriptions = new(); + private List Scopes { get; } = new(); + + public static ConcurrentBag CollectedActivities { private set; get; } = new(); + private static ConcurrentBag CollectedEvents { set; get; } = new(); + + public CustomListener(string name, string eventName) + : this(n => Regex.Match(n, name).Success, eventName) { - this.EventSourceName = name; } - public OpenTelemetryListener(Func filter, bool asyncLocal = false, Action scopeStartCallback = default) + public CustomListener(Func filter, string eventName) { - if (asyncLocal) - { - this.collectThisStack = new AsyncLocal { Value = true }; - } this.sourceNameFilter = filter; - this.scopeStartCallback = scopeStartCallback; - - this.GeneratedActivities = new ConcurrentBag(); - this.GeneratedEvents = new ConcurrentBag(); - + this.eventName = eventName; + DiagnosticListener.AllListeners.Subscribe(this); } + /// + /// IObserver Override + /// public void OnCompleted() { + // Unimplemented Method } + /// + /// IObserver Override + /// public void OnError(Exception error) { + // Unimplemented Method } + /// + /// IObserver Override + /// public void OnNext(KeyValuePair value) { - if (this.collectThisStack?.Value == false) return; - lock (this.Scopes) { // Check for disposal @@ -92,7 +91,6 @@ public void OnNext(KeyValuePair value) }; this.Scopes.Add(scope); - this.scopeStartCallback?.Invoke(scope); } else if (value.Key.EndsWith(stopSuffix)) { @@ -101,7 +99,9 @@ public void OnNext(KeyValuePair value) { if (producedDiagnosticScope.Activity.Id == Activity.Current.Id) { - this.RecordAttributes(producedDiagnosticScope.Name, producedDiagnosticScope.Activity.Tags); + AssertActivity.IsValid(producedDiagnosticScope.Activity); + + CustomListener.CollectedActivities.Add(producedDiagnosticScope.Activity); producedDiagnosticScope.IsCompleted = true; return; @@ -128,142 +128,51 @@ public void OnNext(KeyValuePair value) } } - private void RecordAttributes(string name, IEnumerable> tags) - { - StringBuilder builder = new StringBuilder(); - builder.Append("") - .Append("") - .Append(name) - .Append(""); - - OpenTelemetryListener.AssertData(name, tags); - - foreach (KeyValuePair tag in tags) - { - builder - .Append("") - .Append(tag.Key) - .Append(""); - } - builder.Append(""); - this.GeneratedActivities.Add(builder.ToString()); - } - - private static void AssertData(string name, IEnumerable> tags) - { - IList allowedAttributes = new List - { - "az.namespace", - "kind", - "db.system", - "db.name", - "db.operation", - "net.peer.name", - "db.cosmosdb.client_id", - "db.cosmosdb.machine_id", - "db.cosmosdb.user_agent", - "db.cosmosdb.connection_mode", - "db.cosmosdb.operation_type", - "db.cosmosdb.container", - "db.cosmosdb.request_content_length_bytes", - "db.cosmosdb.response_content_length_bytes", - "db.cosmosdb.status_code", - "db.cosmosdb.sub_status_code", - "db.cosmosdb.request_charge", - "db.cosmosdb.regions_contacted", - "db.cosmosdb.retry_count", - "db.cosmosdb.item_count", - "db.cosmosdb.request_diagnostics", - "exception.type", - "exception.message", - "exception.stacktrace" - }; - - foreach (KeyValuePair tag in tags) - { - Assert.IsTrue(allowedAttributes.Contains(tag.Key), $"{tag.Key} is not allowed for {name}"); - - OpenTelemetryListener.AssertDatabaseAndContainerName(name, tag); - } - } - - private static void AssertDatabaseAndContainerName(string name, KeyValuePair tag) - { - IList exceptionsForContainerAttribute = new List - { - "Cosmos.CreateDatabaseAsync", - "Cosmos.ReadAsync", - "Cosmos.DeleteAsync", - "Cosmos.DeleteStreamAsync" - }; - - if ((tag.Key == OpenTelemetryAttributeKeys.ContainerName && !exceptionsForContainerAttribute.Contains(name)) || - (tag.Key == OpenTelemetryAttributeKeys.DbName)) - { - Assert.IsNotNull(tag.Value, $"{tag.Key} is 'null' for {name} operation"); - } - else if (tag.Key == OpenTelemetryAttributeKeys.ContainerName && exceptionsForContainerAttribute.Contains(name)) - { - Assert.IsNull(tag.Value, $"{tag.Key} is '{tag.Value}' for {name} operation"); - } - } - - public List GetRecordedAttributes() - { - List outputList = new List(); - if(this.GeneratedActivities != null && this.GeneratedActivities.Count > 0) - { - outputList.AddRange(this.GeneratedActivities); - - } - if (this.GeneratedEvents != null && this.GeneratedEvents.Count > 0) - { - outputList.AddRange(this.GeneratedEvents); - } - - return outputList; - } - - public void ResetAttributes() - { - this.GeneratedActivities = new ConcurrentBag(); - this.GeneratedEvents = new ConcurrentBag(); - } - + /// + /// IObserver Override + /// public void OnNext(DiagnosticListener value) { if (this.sourceNameFilter(value.Name) && this.subscriptions != null) { lock (this.Scopes) { - if (this.subscriptions != null) - { - this.subscriptions.Add(value.Subscribe(this)); - } + this.subscriptions?.Add(value.Subscribe(this)); } } } + /// + /// EventListener Override + /// protected override void OnEventSourceCreated(EventSource eventSource) { - if (eventSource.Name == this.EventSourceName) + if (eventSource != null && eventSource.Name.Equals(this.eventName)) { - this.EnableEvents(eventSource, EventLevel.Informational); + this.EnableEvents(eventSource, EventLevel.Informational); // Enable information level events } } + /// + /// EventListener Override + /// protected override void OnEventWritten(EventWrittenEventArgs eventData) { StringBuilder builder = new StringBuilder(); + Console.WriteLine(eventData.Payload[0].ToString()); builder.Append("") .Append("Ideally, this should contain request diagnostics but request diagnostics is " + "subject to change with each request as it contains few unique id. " + "So just putting this tag with this static text to make sure event is getting generated" + " for each test.") .Append(""); - this.GeneratedEvents.Add(builder.ToString()); + CustomListener.CollectedEvents.Add(builder.ToString()); } - + + /// + /// Dispose Override + /// + /// public override void Dispose() { base.Dispose(); @@ -310,6 +219,54 @@ public override void Dispose() this.ResetAttributes(); } + + private string GenerateTagForBaselineTest(Activity activity) + { + + StringBuilder builder = new StringBuilder(); + builder.Append("") + .Append("") + .Append(activity.OperationName) + .Append(""); + + foreach (KeyValuePair tag in activity.Tags) + { + builder + .Append("") + .Append(tag.Key) + .Append(""); + } + builder.Append(""); + + return builder.ToString(); + } + + public List GetRecordedAttributes() + { + List generatedActivityTagsForBaselineXmls = new(); + List collectedActivities = new List(CustomListener.CollectedActivities); + + collectedActivities.ForEach(activity => generatedActivityTagsForBaselineXmls.Add(this.GenerateTagForBaselineTest(activity))); + + List outputList = new List(); + if(generatedActivityTagsForBaselineXmls != null && generatedActivityTagsForBaselineXmls.Count > 0) + { + outputList.AddRange(generatedActivityTagsForBaselineXmls); + + } + if (CustomListener.CollectedEvents != null && CustomListener.CollectedEvents.Count > 0) + { + outputList.AddRange(CustomListener.CollectedEvents); + } + + return outputList; + } + + public void ResetAttributes() + { + CustomListener.CollectedEvents = new(); + CustomListener.CollectedActivities = new(); + } public class ProducedDiagnosticScope { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs new file mode 100644 index 0000000000..1f6c335fdd --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs @@ -0,0 +1,57 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Tracing +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using OpenTelemetry; + using OpenTelemetry.Trace; + + /// + /// It is a custom exporter for OpenTelemetry. It is used to validate the Activities generated by cosmosDb SDK. + /// As of now, it doesn not capture Events from event Source. + /// + internal class CustomOtelExporter : BaseExporter + { + private readonly string _name; + + public static List CollectedActivities = new List(); + + public CustomOtelExporter(string name = "CustomOtelExporter") + { + this._name = name; + } + + public override ExportResult Export(in Batch batch) + { + // SuppressInstrumentationScope should be used to prevent exporter + // code from generating telemetry and causing live-loop. + using IDisposable scope = SuppressInstrumentationScope.Begin(); + + foreach (Activity activity in batch) + { + AssertActivity.IsValid(activity); + + CollectedActivities.Add(activity); + } + + return ExportResult.Success; + } + } + + internal static class OTelExtensions + { + public static TracerProviderBuilder AddCustomOtelExporter(this TracerProviderBuilder builder) + { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + + return builder.AddProcessor(new SimpleActivityExportProcessor(new CustomOtelExporter())); + } + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs index f64d289cfe..b91fc76b8b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs @@ -19,8 +19,10 @@ using Microsoft.Azure.Cosmos.Tracing; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json.Linq; + using OpenTelemetry; using Telemetry; using static Microsoft.Azure.Cosmos.SDK.EmulatorTests.TransportClientHelper; + using OpenTelemetry.Trace; [VisualStudio.TestTools.UnitTesting.TestClass] [TestCategory("UpdateContract")] @@ -33,15 +35,26 @@ public sealed class EndToEndTraceWriterBaselineTests : BaselineTests builder @@ -90,7 +103,7 @@ public static async Task ClassInitAsync(TestContext context) await container.CreateItemAsync(JToken.Parse(cosmosObject.ToString())); } - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } [ClassCleanup()] @@ -101,13 +114,25 @@ public static async Task ClassCleanupAsync() await EndToEndTraceWriterBaselineTests.database.DeleteStreamAsync(); } + oTelTracerProvider?.Dispose(); testListener?.Dispose(); + + await Task.Delay(5000); + } + + private static void AssertAndResetActivityInformation() + { + AssertActivity.AreEqualAcrossListeners(); + + CustomOtelExporter.CollectedActivities = new(); + testListener.ResetAttributes(); } + [TestMethod] public async Task ReadFeedAsync() { - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); List inputs = new List(); @@ -140,7 +165,7 @@ public async Task ReadFeedAsync() endLineNumber: endLineNumber, oTelActivities: testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -171,7 +196,7 @@ public async Task ReadFeedAsync() endLineNumber: endLineNumber, oTelActivities: testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -202,7 +227,7 @@ public async Task ReadFeedAsync() endLineNumber: endLineNumber, oTelActivities: testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -228,7 +253,7 @@ public async Task ReadFeedAsync() inputs.Add(new Input("ReadFeed Public API Typed", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -270,7 +295,7 @@ public async Task ChangeFeedAsync() inputs.Add(new Input("ChangeFeed", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -302,7 +327,7 @@ public async Task ChangeFeedAsync() inputs.Add(new Input("ChangeFeed Typed", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -335,7 +360,7 @@ public async Task ChangeFeedAsync() inputs.Add(new Input("ChangeFeed Public API", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -368,7 +393,7 @@ public async Task ChangeFeedAsync() inputs.Add(new Input("ChangeFeed Public API Typed", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -407,7 +432,8 @@ public async Task ChangeFeedAsync() await processor.StopAsync(); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); + startLineNumber = GetLineNumber(); ChangeFeedEstimator estimator = container.GetChangeFeedEstimator( "test", @@ -428,7 +454,7 @@ public async Task ChangeFeedAsync() inputs.Add(new Input("Change Feed Estimator", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -464,7 +490,7 @@ public async Task QueryAsync() inputs.Add(new Input("Query", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -489,7 +515,7 @@ public async Task QueryAsync() inputs.Add(new Input("Query Typed", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -515,7 +541,7 @@ public async Task QueryAsync() inputs.Add(new Input("Query Public API", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -541,7 +567,7 @@ public async Task QueryAsync() inputs.Add(new Input("Query Public API Typed", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -570,7 +596,7 @@ public async Task QueryAsync() inputs.Add(new Input("Query - Without ServiceInterop", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -598,7 +624,7 @@ public async Task QueryAsync() inputs.Add(new Input("Query Public API with FeedRanges", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -626,14 +652,13 @@ public async Task QueryAsync() inputs.Add(new Input("Query Public API Typed with FeedRanges", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- this.ExecuteTestSuite(inputs); } - [TestMethod] public async Task ValidateInvalidCredentialsTraceAsync() { @@ -698,7 +723,7 @@ public async Task TypedPointOperationsAsync() inputs.Add(new Input("Point Write", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -716,7 +741,7 @@ public async Task TypedPointOperationsAsync() inputs.Add(new Input("Point Read", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -742,7 +767,7 @@ public async Task TypedPointOperationsAsync() inputs.Add(new Input("Point Replace", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -784,7 +809,7 @@ public async Task TypedPointOperationsAsync() inputs.Add(new Input("Point Delete", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -819,7 +844,7 @@ public async Task StreamPointOperationsAsync() inputs.Add(new Input("Point Write", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -837,7 +862,7 @@ public async Task StreamPointOperationsAsync() inputs.Add(new Input("Point Read", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -863,7 +888,7 @@ public async Task StreamPointOperationsAsync() inputs.Add(new Input("Point Replace", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -908,7 +933,7 @@ public async Task StreamPointOperationsAsync() inputs.Add(new Input("Point Delete", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -957,7 +982,7 @@ public async Task PointOperationsExceptionsAsync() inputs.Add(new Input("Point Operation with Request Timeout", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -1010,7 +1035,7 @@ public async Task PointOperationsExceptionsAsync() inputs.Add(new Input("Point Operation With Throttle", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -1090,7 +1115,7 @@ void interceptor(Uri uri, Documents.ResourceOperation operation, Documents.Docum endLineNumber = GetLineNumber(); inputs.Add(new Input($"Point Operation With Forbidden + Max Count = {maxCount}", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } // Check if the exception message is not growing exponentially @@ -1141,7 +1166,7 @@ void interceptor(Uri uri, Documents.ResourceOperation operation, Documents.Docum inputs.Add(new Input("Point Operation with Service Unavailable", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -1192,7 +1217,7 @@ public async Task BatchOperationsAsync() inputs.Add(new Input("Batch Operation", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -1243,7 +1268,7 @@ public async Task BulkOperationsAsync() inputs.Add(new Input("Bulk Operation", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); } - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -1298,7 +1323,7 @@ public async Task BulkOperationsAsync() inputs.Add(new Input("Bulk Operation With Throttle", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } this.ExecuteTestSuite(inputs); @@ -1330,7 +1355,7 @@ public async Task MiscellanousAsync() inputs.Add(new Input("Custom Handler", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -1349,7 +1374,7 @@ public async Task MiscellanousAsync() inputs.Add(new Input("Custom Handler", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -1390,7 +1415,7 @@ public async Task ReadManyAsync() inputs.Add(new Input("Read Many Stream Api", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- @@ -1405,7 +1430,7 @@ public async Task ReadManyAsync() inputs.Add(new Input("Read Many Typed Api", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); - testListener.ResetAttributes(); + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } //---------------------------------------------------------------- From 6b1fa035cdb50201aa7483cc3774eb0b521e8a47 Mon Sep 17 00:00:00 2001 From: Nalu Tripician Date: Thu, 15 Dec 2022 12:20:48 -0500 Subject: [PATCH 029/240] [Internal] HttpTimeoutPolicy: Removes Data Plane Writes from being able to be retried (#3607) * data plane writes no longer failover on timeout * removed duplication of test\ --- Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs | 4 ++-- .../CosmosHttpClientCoreTests.cs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs index a3fc51dd91..fa2fc25bf7 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs @@ -36,8 +36,8 @@ public static HttpTimeoutPolicy GetTimeoutPolicy( return HttpTimeoutPolicyControlPlaneRetriableHotPath.Instance; } - //Data Plane Read & Write - if (!HttpTimeoutPolicy.IsMetaData(documentServiceRequest)) + //Data Plane Read + if (!HttpTimeoutPolicy.IsMetaData(documentServiceRequest) && documentServiceRequest.IsReadOnlyRequest) { return HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs index 67c653498b..3ac919bf83 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs @@ -258,7 +258,7 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio Assert.AreEqual(3, count, "Should retry 3 times"); } - + [TestMethod] public async Task HttpTimeoutThrow503TestAsync() { @@ -307,8 +307,8 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio //Data plane read await TestScenarioAsync(HttpMethod.Get, ResourceType.Document, HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, typeof(CosmosException), 3); - //Data plane write - await TestScenarioAsync(HttpMethod.Post, ResourceType.Document, HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, typeof(CosmosException), 1); + //Data plane write (Should throw a 408 OperationCanceledException rather than a 503) + await TestScenarioAsync(HttpMethod.Post, ResourceType.Document, HttpTimeoutPolicyDefault.Instance, typeof(TaskCanceledException), 1); //Meta data read await TestScenarioAsync(HttpMethod.Get, ResourceType.Database, HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, typeof(CosmosException), 3); From 814e72eca593e855838434766596e7bf8945e1b7 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 20 Dec 2022 16:03:20 +0530 Subject: [PATCH 030/240] [Internal] Performance Testing: Adds Distributed Tracing option in benchmarks (#3611) Co-authored-by: Sourabh Jain --- .../Tools/Benchmark/BenchmarkConfig.cs | 5 +++++ Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs index dc287c8a4d..590e89297a 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs @@ -101,6 +101,9 @@ public class BenchmarkConfig [Option(Required = false, HelpText = "Enable Client Telemetry")] public bool EnableTelemetry { get; set; } + [Option(Required = false, HelpText = "Enable Distributed Tracing")] + public bool EnableDistributedTracing { get; set; } + [Option(Required = false, HelpText = "Client Telemetry Schedule in Seconds")] public int TelemetryScheduleInSec { get; set; } @@ -219,6 +222,8 @@ internal Microsoft.Azure.Cosmos.CosmosClient CreateCosmosClient(string accountKe clientOptions.ConsistencyLevel = (Microsoft.Azure.Cosmos.ConsistencyLevel)Enum.Parse(typeof(Microsoft.Azure.Cosmos.ConsistencyLevel), this.ConsistencyLevel, ignoreCase: true); } + clientOptions.EnableDistributedTracing = this.EnableDistributedTracing; + return new Microsoft.Azure.Cosmos.CosmosClient( this.EndPoint, accountKey, diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh index 2edfb67530..81cafc4a4a 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh @@ -54,8 +54,8 @@ sleep 10 #Wait dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithTelemetry --enableTelemetry --telemetryScheduleInSec 60 --telemetryEndpoint $TELEMETRY_ENDPOINT --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk sleep 10 #Wait -# Open telemetry enabled ReadStreamExistsV3. This is needed to see the impact of open telemetry. -dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithOpenTelemetry --enableOpenTelemetry --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk +# Open telemetry enabled ReadStreamExistsV3. This is needed to see the impact of distributed tracing (without listener) +dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithDistributedTracingWOListener --enableDistributedTracing --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk sleep 10 #Wait #Point read operations From 5c05fbb2d63e632f34831b8f0f200a089623695c Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Wed, 4 Jan 2023 21:38:48 +0530 Subject: [PATCH 031/240] [Internal] Benchmark: Refactors code to make Memory Stream capacity configurable (#3624) Co-authored-by: Sourabh Jain --- .../Tools/Benchmark/BenchmarkConfig.cs | 4 +++- .../Tools/Benchmark/JsonHelper.cs | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs index 590e89297a..b9235d2232 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs @@ -143,7 +143,9 @@ internal void Print() Utility.TeeTraceInformation($"{nameof(BenchmarkConfig)} arguments"); Utility.TeeTraceInformation($"IsServerGC: {GCSettings.IsServerGC}"); Utility.TeeTraceInformation("--------------------------------------------------------------------- "); - Utility.TeeTraceInformation(JsonHelper.ToString(this)); + Utility.TeeTraceInformation(JsonHelper.ToString( + input: this, + capacity: 2048)); Utility.TeeTraceInformation("--------------------------------------------------------------------- "); Utility.TeeTraceInformation(string.Empty); } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/JsonHelper.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/JsonHelper.cs index 3e9da1ef06..6d5bed44d3 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/JsonHelper.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/JsonHelper.cs @@ -17,9 +17,9 @@ internal static class JsonHelper }); private const int DefaultCapacity = 1024; - public static string ToString(T input) + public static string ToString(T input, int capacity = JsonHelper.DefaultCapacity) { - using (MemoryStream stream = JsonHelper.ToStream(input)) + using (MemoryStream stream = JsonHelper.ToStream(input, capacity)) using (StreamReader sr = new StreamReader(stream)) { return sr.ReadToEnd(); @@ -31,15 +31,15 @@ public static T Deserialize(string payload) return JsonConvert.DeserializeObject(payload); } - public static MemoryStream ToStream(T input) + public static MemoryStream ToStream(T input, int capacity = JsonHelper.DefaultCapacity) { - byte[] blob = System.Buffers.ArrayPool.Shared.Rent(JsonHelper.DefaultCapacity); - MemoryStream memStreamPayload = new MemoryStream(blob, 0, JsonHelper.DefaultCapacity, writable: true, publiclyVisible: true); + byte[] blob = System.Buffers.ArrayPool.Shared.Rent(capacity); + MemoryStream memStreamPayload = new MemoryStream(blob, 0, capacity, writable: true, publiclyVisible: true); memStreamPayload.SetLength(0); memStreamPayload.Position = 0; using (StreamWriter streamWriter = new StreamWriter(memStreamPayload, encoding: JsonHelper.DefaultEncoding, - bufferSize: JsonHelper.DefaultCapacity, + bufferSize: capacity, leaveOpen: true)) { using (JsonWriter writer = new JsonTextWriter(streamWriter)) From 73c9e08d2796c64e016fdf80007c0f8c72f8e47b Mon Sep 17 00:00:00 2001 From: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com> Date: Wed, 4 Jan 2023 15:37:36 -0500 Subject: [PATCH 032/240] add new LatestVersion changefeed mode that has same behavior as Incremental; renamed FullFidelity to AllVersionsAndDeletes (#3596) --- .../src/ChangeFeed/ChangeFeedMode.cs | 16 +++++++++++++++- .../FullFidelity/ChangeFeedItemChange{T}.cs | 4 ++-- .../FullFidelity/ChangeFeedMetadata.cs | 2 +- .../FullFidelity/ChangeFeedOperationType.cs | 2 +- .../src/Resource/Settings/ChangeFeedPolicy.cs | 2 +- .../FeedToken/ChangeFeedIteratorCoreTests.cs | 14 +++++++------- .../NetworkAttachedDocumentContainerTests.cs | 2 +- .../Contracts/DotNetPreviewSDKAPI.json | 18 ++++++++++++++---- 8 files changed, 42 insertions(+), 18 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedMode.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedMode.cs index d64a9942d5..7df0871d74 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedMode.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedMode.cs @@ -31,6 +31,20 @@ internal ChangeFeedMode() /// A to receive incremental item changes. public static ChangeFeedMode Incremental => ChangeFeedModeIncremental.Instance; + /// + /// Creates a to receive latest version item changes. + /// + /// + /// Latest version mode includes item creations and updates, not deletions. + /// + /// A to receive latest version item changes. +#if PREVIEW + public +#else + internal +#endif + static ChangeFeedMode LatestVersion => ChangeFeedModeIncremental.Instance; + /// /// Creates a to receive notifications for creations, deletes, as well as all intermediary snapshots for updates. /// @@ -49,6 +63,6 @@ internal ChangeFeedMode() #else internal #endif - static ChangeFeedMode FullFidelity => ChangeFeedModeFullFidelity.Instance; + static ChangeFeedMode AllVersionsAndDeletes => ChangeFeedModeFullFidelity.Instance; } } diff --git a/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedItemChange{T}.cs b/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedItemChange{T}.cs index 1a564443bd..deb9c7db87 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedItemChange{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedItemChange{T}.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Cosmos using Newtonsoft.Json; /// - /// The typed response that contains the current, previous, and metadata change feed resource when is initialized to . + /// The typed response that contains the current, previous, and metadata change feed resource when is initialized to . /// /// /// @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Cosmos /// public string status { get; set; } /// } /// - /// ChangeFeedMode changeFeedMode = ChangeFeedMode.FullFidelity; + /// ChangeFeedMode changeFeedMode = ChangeFeedMode.AllVersionsAndDeletes; /// PartitionKey partitionKey = new PartitionKey(@"learning"); /// ChangeFeedStartFrom changeFeedStartFrom = ChangeFeedStartFrom.Now(FeedRange.FromPartitionKey(partitionKey)); /// diff --git a/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs b/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs index 75abc2ef1e..81b10461f9 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedMetadata.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Cosmos using Newtonsoft.Json.Converters; /// - /// The metadata of a change feed resource with is initialized to . + /// The metadata of a change feed resource with is initialized to . /// #if PREVIEW public diff --git a/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedOperationType.cs b/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedOperationType.cs index 48e70b2260..9144556e91 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedOperationType.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/FullFidelity/ChangeFeedOperationType.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Cosmos using System.Runtime.Serialization; /// - /// The operation type of a change feed resource with is initialized to . Upsert operations will yield or . + /// The operation type of a change feed resource with is initialized to . Upsert operations will yield or . /// #if PREVIEW public diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/ChangeFeedPolicy.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/ChangeFeedPolicy.cs index e0b6d3ad16..e411d8ea2e 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Settings/ChangeFeedPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/ChangeFeedPolicy.cs @@ -16,7 +16,7 @@ namespace Microsoft.Azure.Cosmos /// /// The example below creates a new container with a custom change feed policy for full fidelity change feed with a retention window of 5 minutes - so intermediary snapshots of changes as well as deleted documents would be /// available for processing for 5 minutes before they vanish. - /// Processing the change feed with will only be able within this retention window - if you attempt to process a change feed after more + /// Processing the change feed with will only be able within this retention window - if you attempt to process a change feed after more /// than the retention window (5 minutes in this sample) an error (Status Code 400) will be returned. /// It would still be possible to process changes using mode even when configuring a full fidelity change /// feed policy with retention window on the container and when using Incremental mode it doesn't matter whether your are out of the retention window or not. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/ChangeFeedIteratorCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/ChangeFeedIteratorCoreTests.cs index e34bf128fc..b9d179c0c1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/ChangeFeedIteratorCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/ChangeFeedIteratorCoreTests.cs @@ -788,7 +788,7 @@ public async Task ChangeFeedIteratorCore_WithFullFidelityReadFromBeginning() // FF does not work with StartFromBeginning currently, capture error FeedIterator fullFidelityIterator = container.GetChangeFeedIterator( ChangeFeedStartFrom.Beginning(), - ChangeFeedMode.FullFidelity); + ChangeFeedMode.AllVersionsAndDeletes); CosmosException cosmosException = await Assert.ThrowsExceptionAsync(() => fullFidelityIterator.ReadNextAsync()); Assert.AreEqual(HttpStatusCode.BadRequest, cosmosException.StatusCode, "Full Fidelity Change Feed does not work with StartFromBeginning currently."); @@ -829,7 +829,7 @@ private async Task ValidateChangeFeedIteratorCore_WithQuery( // FF does not work with StartFromBeginning currently, so we capture an initial continuation. FeedIterator> fullFidelityIterator = container.GetChangeFeedIteratorWithQuery>( ChangeFeedStartFrom.Now(), - ChangeFeedMode.FullFidelity, + ChangeFeedMode.AllVersionsAndDeletes, querySpec, null); @@ -862,7 +862,7 @@ private async Task ValidateChangeFeedIteratorCore_WithQuery( // Resume Change Feed and verify we pickup the events where documents matches the query fullFidelityIterator = container.GetChangeFeedIteratorWithQuery>( ChangeFeedStartFrom.ContinuationToken(initialContinuation), - ChangeFeedMode.FullFidelity, + ChangeFeedMode.AllVersionsAndDeletes, querySpec, null); int detectedEvents = 0; @@ -891,7 +891,7 @@ private async Task ValidateChangeFeedIteratorCore_WithQuery( fullFidelityIterator = container.GetChangeFeedIteratorWithQuery>( ChangeFeedStartFrom.ContinuationToken(initialContinuation), - ChangeFeedMode.FullFidelity, + ChangeFeedMode.AllVersionsAndDeletes, querySpec, null); detectedEvents = 0; @@ -927,7 +927,7 @@ public async Task ChangeFeedIteratorCore_FeedRange_FromPartitionKey_VerifyingWir string otherId = Guid.NewGuid().ToString(); PartitionKey partitionKey = new PartitionKey(id); - ChangeFeedMode changeFeedMode = ChangeFeedMode.FullFidelity; + ChangeFeedMode changeFeedMode = ChangeFeedMode.AllVersionsAndDeletes; ChangeFeedStartFrom changeFeedStartFrom = ChangeFeedStartFrom.Now(FeedRange.FromPartitionKey(partitionKey)); using (FeedIterator> feedIterator = container.GetChangeFeedIterator>( @@ -1017,7 +1017,7 @@ public async Task ChangeFeedIteratorCore_FeedRange_VerifyingWireFormatTests() using (FeedIterator> feedIterator = container.GetChangeFeedIterator>( changeFeedStartFrom: ChangeFeedStartFrom.Now(), - changeFeedMode: ChangeFeedMode.FullFidelity)) + changeFeedMode: ChangeFeedMode.AllVersionsAndDeletes)) { string continuation = null; while (feedIterator.HasMoreResults) @@ -1124,7 +1124,7 @@ public async Task ChangeFeedIteratorCore_FeedRange_FromPartitionKey_Dynamic_Veri string otherId = Guid.NewGuid().ToString(); using (FeedIterator feedIterator = container.GetChangeFeedIterator( changeFeedStartFrom: ChangeFeedStartFrom.Now(FeedRange.FromPartitionKey(new PartitionKey(id))), - changeFeedMode: ChangeFeedMode.FullFidelity)) + changeFeedMode: ChangeFeedMode.AllVersionsAndDeletes)) { string continuation = null; while (feedIterator.HasMoreResults) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/NetworkAttachedDocumentContainerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/NetworkAttachedDocumentContainerTests.cs index 5e62114c1e..a8f5c4810c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/NetworkAttachedDocumentContainerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/NetworkAttachedDocumentContainerTests.cs @@ -144,7 +144,7 @@ public async Task MonadicChangeFeedAsync_ChangeFeedMode_FullFidelity() await networkAttachedDocumentContainer.MonadicChangeFeedAsync( feedRangeState: new FeedRangeState(new FeedRangePartitionKeyRange("0"), ChangeFeedState.Beginning()), - changeFeedPaginationOptions: new ChangeFeedPaginationOptions(ChangeFeedMode.FullFidelity, pageSizeHint: 10), + changeFeedPaginationOptions: new ChangeFeedPaginationOptions(ChangeFeedMode.AllVersionsAndDeletes, pageSizeHint: 10), trace: NoOpTrace.Singleton, cancellationToken: default); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index 07d725e2c5..add1fce30e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -160,15 +160,25 @@ "Microsoft.Azure.Cosmos.ChangeFeedMode;System.Object;IsAbstract:True;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { - "Microsoft.Azure.Cosmos.ChangeFeedMode FullFidelity": { + "Microsoft.Azure.Cosmos.ChangeFeedMode AllVersionsAndDeletes": { "Type": "Property", "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode FullFidelity;CanRead:True;CanWrite:False;Microsoft.Azure.Cosmos.ChangeFeedMode get_FullFidelity();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode AllVersionsAndDeletes;CanRead:True;CanWrite:False;Microsoft.Azure.Cosmos.ChangeFeedMode get_AllVersionsAndDeletes();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, - "Microsoft.Azure.Cosmos.ChangeFeedMode get_FullFidelity()": { + "Microsoft.Azure.Cosmos.ChangeFeedMode LatestVersion": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode LatestVersion;CanRead:True;CanWrite:False;Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.ChangeFeedMode get_AllVersionsAndDeletes()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode get_AllVersionsAndDeletes();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion()": { "Type": "Method", "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode get_FullFidelity();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {} From 77e3aa44c5704f82fcfd6e1028327e4259b40f5f Mon Sep 17 00:00:00 2001 From: neildsh <35383880+neildsh@users.noreply.github.com> Date: Fri, 6 Jan 2023 16:43:57 -0800 Subject: [PATCH 033/240] Query: Fixes handling of CosmosUndefined, CosmosGuid and CosmosBinary in unordered DISTINCT (#3632) * Handle CosmosUndefined, CosmosGuid and CosmosBinary in DistinctMap.UnorderedDistinctMap * Address code review feedback and remove unnecessary allocations from DistinctQueryPipelineStageTests --- .../DistinctMap.UnorderedDistinctMap.cs | 218 +++++++++++----- .../Core/Pipeline/Distinct/DistinctMap.cs | 2 +- .../Query/CosmosUndefinedQueryTests.cs | 5 +- .../DistinctQueryPipelineStageTests.cs | 237 ++++++++++++++++-- 4 files changed, 378 insertions(+), 84 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Distinct/DistinctMap.UnorderedDistinctMap.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Distinct/DistinctMap.UnorderedDistinctMap.cs index a0860957f5..f1d9b78fb8 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Distinct/DistinctMap.UnorderedDistinctMap.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Distinct/DistinctMap.UnorderedDistinctMap.cs @@ -12,8 +12,8 @@ namespace Microsoft.Azure.Cosmos.Query.Core.Pipeline.Distinct using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.CosmosElements.Numbers; using Microsoft.Azure.Cosmos.Query.Core.Exceptions; - using Microsoft.Azure.Cosmos.Query.Core.Monads; - + using Microsoft.Azure.Cosmos.Query.Core.Monads; + /// /// Partial wrapper /// @@ -72,7 +72,7 @@ private enum SimpleValues /// This class does that with the additional optimization that it doesn't store the whole JSON. /// Instead this class takes a GUID like hash and store that instead. /// - private sealed class UnorderdDistinctMap : DistinctMap + private sealed class UnorderedDistinctMap : DistinctMap { /// /// Length of UInt128 (in bytes). @@ -97,7 +97,9 @@ private static class PropertyNames public const string StringsLength16 = "StringsLength16"; public const string StringsLength16Plus = "StringsLength16+"; public const string Arrays = "Arrays"; - public const string Object = "Object"; + public const string Object = "Object"; + public const string Guids = "Guids"; + public const string Blobs = "Blobs"; public const string SimpleValues = "SimpleValues"; } @@ -141,14 +143,31 @@ private static class PropertyNames /// HashSet for all object seen. /// This set only stores the hash, since we don't want to spend the space for storing large objects. /// - private readonly HashSet objects; + private readonly HashSet objects; + + /// + /// HashSet for all CosmosGuids seen. + /// This set only stores the hash, since we don't want to spend the space for storing large CosmosGuids. + /// + private readonly HashSet guids; /// - /// Stores all the simple values that we don't want to dedicate a hash set for. + /// HashSet for all CosmosBinarys seen. + /// This set only stores the hash, since we don't want to spend the space for storing large CosmosBinary objects. + /// + private readonly HashSet blobs; + + /// + /// Used to dispatch Add calls. /// - private SimpleValues simpleValues; + private readonly CosmosElementVisitor visitor; - private UnorderdDistinctMap( + /// + /// Stores all the simple values that we don't want to dedicate a hash set for. + /// + private SimpleValues simpleValues; + + private UnorderedDistinctMap( HashSet numbers, HashSet stringsLength4, HashSet stringsLength8, @@ -156,6 +175,8 @@ private UnorderdDistinctMap( HashSet stringsLength16Plus, HashSet arrays, HashSet objects, + HashSet guids, + HashSet blobs, SimpleValues simpleValues) { this.numbers = numbers ?? throw new ArgumentNullException(nameof(numbers)); @@ -165,7 +186,10 @@ private UnorderdDistinctMap( this.stringsLength16Plus = stringsLength16Plus ?? throw new ArgumentNullException(nameof(stringsLength16Plus)); this.arrays = arrays ?? throw new ArgumentNullException(nameof(arrays)); this.objects = objects ?? throw new ArgumentNullException(nameof(objects)); - this.simpleValues = simpleValues; + this.guids = guids ?? throw new ArgumentNullException(nameof(guids)); + this.blobs = blobs ?? throw new ArgumentNullException(nameof(blobs)); + this.simpleValues = simpleValues; + this.visitor = new CosmosElementVisitor(this); } /// @@ -179,16 +203,7 @@ public override bool Add(CosmosElement cosmosElement, out UInt128 hash) // Unordered distinct does not need to return a valid hash. // Since it doesn't need the last hash for a continuation. hash = default; - return cosmosElement switch - { - CosmosArray cosmosArray => this.AddArrayValue(cosmosArray), - CosmosBoolean cosmosBoolean => this.AddSimpleValue(cosmosBoolean.Value ? SimpleValues.True : SimpleValues.False), - CosmosNull _ => this.AddSimpleValue(SimpleValues.Null), - CosmosNumber cosmosNumber => this.AddNumberValue(cosmosNumber.Value), - CosmosObject cosmosObject => this.AddObjectValue(cosmosObject), - CosmosString cosmosString => this.AddStringValue(cosmosString.Value), - _ => throw new ArgumentOutOfRangeException($"Unexpected {nameof(CosmosElement)}: {cosmosElement}"), - }; + return cosmosElement.Accept(this.visitor); } public override string GetContinuationToken() @@ -201,35 +216,43 @@ public override CosmosElement GetCosmosElementContinuationToken() Dictionary dictionary = new Dictionary() { { - UnorderdDistinctMap.PropertyNames.Numbers, + UnorderedDistinctMap.PropertyNames.Numbers, CosmosArray.Create(this.numbers.Select(x => CosmosNumber64.Create(x))) }, { - UnorderdDistinctMap.PropertyNames.StringsLength4, + UnorderedDistinctMap.PropertyNames.StringsLength4, CosmosArray.Create(this.stringsLength4.Select(x => CosmosUInt32.Create(x))) }, { - UnorderdDistinctMap.PropertyNames.StringsLength8, + UnorderedDistinctMap.PropertyNames.StringsLength8, CosmosArray.Create(this.stringsLength8.Select(x => CosmosInt64.Create((long)x))) }, { - UnorderdDistinctMap.PropertyNames.StringsLength16, + UnorderedDistinctMap.PropertyNames.StringsLength16, CosmosArray.Create(this.stringsLength16.Select(x => CosmosBinary.Create(UInt128.ToByteArray(x)))) }, { - UnorderdDistinctMap.PropertyNames.StringsLength16Plus, + UnorderedDistinctMap.PropertyNames.StringsLength16Plus, CosmosArray.Create(this.stringsLength16Plus.Select(x => CosmosBinary.Create(UInt128.ToByteArray(x)))) }, { - UnorderdDistinctMap.PropertyNames.Arrays, + UnorderedDistinctMap.PropertyNames.Arrays, CosmosArray.Create(this.arrays.Select(x => CosmosBinary.Create(UInt128.ToByteArray(x)))) }, { - UnorderdDistinctMap.PropertyNames.Object, + UnorderedDistinctMap.PropertyNames.Object, CosmosArray.Create(this.objects.Select(x => CosmosBinary.Create(UInt128.ToByteArray(x)))) }, { - UnorderdDistinctMap.PropertyNames.SimpleValues, + UnorderedDistinctMap.PropertyNames.Guids, + CosmosArray.Create(this.guids.Select(x => CosmosBinary.Create(UInt128.ToByteArray(x)))) + }, + { + UnorderedDistinctMap.PropertyNames.Blobs, + CosmosArray.Create(this.blobs.Select(x => CosmosBinary.Create(UInt128.ToByteArray(x)))) + }, + { + UnorderedDistinctMap.PropertyNames.SimpleValues, CosmosString.Create(this.simpleValues.ToString()) } }; @@ -274,7 +297,7 @@ private bool AddStringValue(string value) int utf8Length = Encoding.UTF8.GetByteCount(value); // If you can fit the string with full fidelity in 16 bytes, then you might as well just hash the string itself. - if (utf8Length <= UnorderdDistinctMap.UInt128Length) + if (utf8Length <= UnorderedDistinctMap.UInt128Length) { Span utf8Buffer = stackalloc byte[UInt128Length]; Encoding.UTF8.GetBytes(value, utf8Buffer); @@ -282,12 +305,12 @@ private bool AddStringValue(string value) { added = this.AddSimpleValue(SimpleValues.EmptyString); } - else if (utf8Length <= UnorderdDistinctMap.UIntLength) + else if (utf8Length <= UnorderedDistinctMap.UIntLength) { uint uintValue = MemoryMarshal.Read(utf8Buffer); added = this.stringsLength4.Add(uintValue); } - else if (utf8Length <= UnorderdDistinctMap.ULongLength) + else if (utf8Length <= UnorderedDistinctMap.ULongLength) { ulong uLongValue = MemoryMarshal.Read(utf8Buffer); added = this.stringsLength8.Add(uLongValue); @@ -328,6 +351,28 @@ private bool AddObjectValue(CosmosObject cosmosObject) { UInt128 hash = DistinctHash.GetHash(cosmosObject); return this.objects.Add(hash); + } + + /// + /// Adds a guid value to the distinct map. + /// + /// The guid to add. + /// Whether or not the value was successfully added. + private bool AddGuidValue(CosmosGuid guid) + { + UInt128 hash = DistinctHash.GetHash(guid); + return this.guids.Add(hash); + } + + /// + /// Adds a binary value to the distinct map. + /// + /// The array to add. + /// Whether or not the value was successfully added. + private bool AddBinaryValue(CosmosBinary binary) + { + UInt128 hash = DistinctHash.GetHash(binary); + return this.blobs.Add(hash); } public static TryCatch TryCreate(CosmosElement continuationToken) @@ -337,8 +382,10 @@ public static TryCatch TryCreate(CosmosElement continuationToken) HashSet stringsLength8 = new HashSet(); HashSet stringsLength16 = new HashSet(); HashSet stringsLength16Plus = new HashSet(); - HashSet arrays = new HashSet(); - HashSet objects = new HashSet(); + HashSet arrays = new HashSet(); + HashSet objects = new HashSet(); + HashSet guids = new HashSet(); + HashSet blobs = new HashSet(); SimpleValues simpleValues = SimpleValues.None; if (continuationToken != null) @@ -347,15 +394,15 @@ public static TryCatch TryCreate(CosmosElement continuationToken) { return TryCatch.FromException( new MalformedContinuationTokenException( - $"{nameof(UnorderdDistinctMap)} continuation token was malformed.")); + $"{nameof(UnorderedDistinctMap)} continuation token was malformed.")); } // Numbers - if (!hashDictionary.TryGetValue(UnorderdDistinctMap.PropertyNames.Numbers, out CosmosArray numbersArray)) + if (!hashDictionary.TryGetValue(UnorderedDistinctMap.PropertyNames.Numbers, out CosmosArray numbersArray)) { return TryCatch.FromException( new MalformedContinuationTokenException( - $"{nameof(UnorderdDistinctMap)} continuation token was malformed.")); + $"{nameof(UnorderedDistinctMap)} continuation token was malformed.")); } foreach (CosmosElement rawNumber in numbersArray) @@ -364,18 +411,18 @@ public static TryCatch TryCreate(CosmosElement continuationToken) { return TryCatch.FromException( new MalformedContinuationTokenException( - $"{nameof(UnorderdDistinctMap)} continuation token was malformed.")); + $"{nameof(UnorderedDistinctMap)} continuation token was malformed.")); } numbers.Add(number.GetValue()); } // Strings Length 4 - if (!hashDictionary.TryGetValue(UnorderdDistinctMap.PropertyNames.StringsLength4, out CosmosArray stringsLength4Array)) + if (!hashDictionary.TryGetValue(UnorderedDistinctMap.PropertyNames.StringsLength4, out CosmosArray stringsLength4Array)) { return TryCatch.FromException( new MalformedContinuationTokenException( - $"{nameof(UnorderdDistinctMap)} continuation token was malformed.")); + $"{nameof(UnorderedDistinctMap)} continuation token was malformed.")); } foreach (CosmosElement rawStringLength4 in stringsLength4Array) @@ -384,18 +431,18 @@ public static TryCatch TryCreate(CosmosElement continuationToken) { return TryCatch.FromException( new MalformedContinuationTokenException( - $"{nameof(UnorderdDistinctMap)} continuation token was malformed.")); + $"{nameof(UnorderedDistinctMap)} continuation token was malformed.")); } stringsLength4.Add(stringlength4.GetValue()); } // Strings Length 8 - if (!hashDictionary.TryGetValue(UnorderdDistinctMap.PropertyNames.StringsLength8, out CosmosArray stringsLength8Array)) + if (!hashDictionary.TryGetValue(UnorderedDistinctMap.PropertyNames.StringsLength8, out CosmosArray stringsLength8Array)) { return TryCatch.FromException( new MalformedContinuationTokenException( - $"{nameof(UnorderdDistinctMap)} continuation token was malformed.")); + $"{nameof(UnorderedDistinctMap)} continuation token was malformed.")); } foreach (CosmosElement rawStringLength8 in stringsLength8Array) @@ -404,49 +451,51 @@ public static TryCatch TryCreate(CosmosElement continuationToken) { return TryCatch.FromException( new MalformedContinuationTokenException( - $"{nameof(UnorderdDistinctMap)} continuation token was malformed.")); + $"{nameof(UnorderedDistinctMap)} continuation token was malformed.")); } stringsLength8.Add((ulong)stringlength8.GetValue()); } - // Strings Length 16 - stringsLength16 = Parse128BitHashes(hashDictionary, UnorderdDistinctMap.PropertyNames.StringsLength16); + stringsLength16 = Parse128BitHashes(hashDictionary, UnorderedDistinctMap.PropertyNames.StringsLength16); - // Strings Length 24 - stringsLength16Plus = Parse128BitHashes(hashDictionary, UnorderdDistinctMap.PropertyNames.StringsLength16Plus); + stringsLength16Plus = Parse128BitHashes(hashDictionary, UnorderedDistinctMap.PropertyNames.StringsLength16Plus); - // Array - arrays = Parse128BitHashes(hashDictionary, UnorderdDistinctMap.PropertyNames.Arrays); + arrays = Parse128BitHashes(hashDictionary, UnorderedDistinctMap.PropertyNames.Arrays); - // Object - objects = Parse128BitHashes(hashDictionary, UnorderdDistinctMap.PropertyNames.Object); + objects = Parse128BitHashes(hashDictionary, UnorderedDistinctMap.PropertyNames.Object); + + guids = Parse128BitHashes(hashDictionary, UnorderedDistinctMap.PropertyNames.Guids); + + blobs = Parse128BitHashes(hashDictionary, UnorderedDistinctMap.PropertyNames.Blobs); // Simple Values - CosmosElement rawSimpleValues = hashDictionary[UnorderdDistinctMap.PropertyNames.SimpleValues]; + CosmosElement rawSimpleValues = hashDictionary[UnorderedDistinctMap.PropertyNames.SimpleValues]; if (!(rawSimpleValues is CosmosString simpleValuesString)) { return TryCatch.FromException( new MalformedContinuationTokenException( - $"{nameof(UnorderdDistinctMap)} continuation token was malformed.")); + $"{nameof(UnorderedDistinctMap)} continuation token was malformed.")); } if (!Enum.TryParse(simpleValuesString.Value, out simpleValues)) { return TryCatch.FromException( new MalformedContinuationTokenException( - $"{nameof(UnorderdDistinctMap)} continuation token was malformed.")); + $"{nameof(UnorderedDistinctMap)} continuation token was malformed.")); } } - return TryCatch.FromResult(new UnorderdDistinctMap( + return TryCatch.FromResult(new UnorderedDistinctMap( numbers, stringsLength4, stringsLength8, stringsLength16, stringsLength16Plus, arrays, - objects, + objects, + guids, + blobs, simpleValues)); } @@ -456,7 +505,7 @@ private static HashSet Parse128BitHashes(CosmosObject hashDictionary, s if (!hashDictionary.TryGetValue(propertyName, out CosmosArray array)) { throw new MalformedContinuationTokenException( - $"{nameof(UnorderdDistinctMap)} continuation token was malformed."); + $"{nameof(UnorderedDistinctMap)} continuation token was malformed."); } foreach (CosmosElement item in array) @@ -464,7 +513,7 @@ private static HashSet Parse128BitHashes(CosmosObject hashDictionary, s if (!(item is CosmosBinary binary)) { throw new MalformedContinuationTokenException( - $"{nameof(UnorderdDistinctMap)} continuation token was malformed."); + $"{nameof(UnorderedDistinctMap)} continuation token was malformed."); } UInt128 uint128 = UInt128.FromByteArray(binary.Value.Span); @@ -472,6 +521,61 @@ private static HashSet Parse128BitHashes(CosmosObject hashDictionary, s } return hashSet; + } + + private sealed class CosmosElementVisitor : ICosmosElementVisitor + { + private readonly UnorderedDistinctMap parent; + + public CosmosElementVisitor(UnorderedDistinctMap parent) + { + this.parent = parent ?? throw new ArgumentNullException(nameof(parent)); + } + + public bool Visit(CosmosArray cosmosArray) + { + return this.parent.AddArrayValue(cosmosArray); + } + + public bool Visit(CosmosBinary cosmosBinary) + { + return this.parent.AddBinaryValue(cosmosBinary); + } + + public bool Visit(CosmosBoolean cosmosBoolean) + { + return this.parent.AddSimpleValue(cosmosBoolean.Value ? SimpleValues.True : SimpleValues.False); + } + + public bool Visit(CosmosGuid cosmosGuid) + { + return this.parent.AddGuidValue(cosmosGuid); + } + + public bool Visit(CosmosNull cosmosNull) + { + return this.parent.AddSimpleValue(SimpleValues.Null); + } + + public bool Visit(CosmosNumber cosmosNumber) + { + return this.parent.AddNumberValue(cosmosNumber.Value); + } + + public bool Visit(CosmosObject cosmosObject) + { + return this.parent.AddObjectValue(cosmosObject); + } + + public bool Visit(CosmosString cosmosString) + { + return this.parent.AddStringValue(cosmosString.Value); + } + + public bool Visit(CosmosUndefined cosmosUndefined) + { + return this.parent.AddSimpleValue(SimpleValues.Undefined); + } } } } diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Distinct/DistinctMap.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Distinct/DistinctMap.cs index 821c5ff4bf..db01fbe32d 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Distinct/DistinctMap.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Distinct/DistinctMap.cs @@ -30,7 +30,7 @@ public static TryCatch TryCreate( CosmosElement distinctMapContinuationToken) => distinctQueryType switch { DistinctQueryType.None => throw new ArgumentException("distinctQueryType can not be None. This part of code is not supposed to be reachable. Please contact support to resolve this issue."), - DistinctQueryType.Unordered => UnorderdDistinctMap.TryCreate(distinctMapContinuationToken), + DistinctQueryType.Unordered => UnorderedDistinctMap.TryCreate(distinctMapContinuationToken), DistinctQueryType.Ordered => OrderedDistinctMap.TryCreate(distinctMapContinuationToken), _ => throw new ArgumentException($"Unrecognized DistinctQueryType: {distinctQueryType}."), }; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/CosmosUndefinedQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/CosmosUndefinedQueryTests.cs index 3945169330..1b44c773fa 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/CosmosUndefinedQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/CosmosUndefinedQueryTests.cs @@ -75,7 +75,10 @@ private static async Task UntypedTests(Container container) expectedCount: 0), MakeUndefinedProjectionTest( query: $"SELECT VALUE AVG(c.{nameof(MixedTypeDocument.MixedTypeField)}) FROM c", - expectedCount: 0), + expectedCount: 0), + MakeUndefinedProjectionTest( + query: $"SELECT DISTINCT VALUE SUM(c.{nameof(MixedTypeDocument.MixedTypeField)}) FROM c", + expectedCount: 0) }; foreach (UndefinedProjectionTestCase testCase in undefinedProjectionTestCases) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/DistinctQueryPipelineStageTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/DistinctQueryPipelineStageTests.cs index 3fc5eaa05f..9b9ade94c6 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/DistinctQueryPipelineStageTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/DistinctQueryPipelineStageTests.cs @@ -2,11 +2,12 @@ { using System; using System.Collections.Generic; - using System.Linq; + using System.Linq; + using System.Text; using System.Threading; - using System.Threading.Tasks; - using Microsoft.Azure.Cosmos.CosmosElements; - using Microsoft.Azure.Cosmos.Query.Core.ExecutionContext; + using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.CosmosElements; + using Microsoft.Azure.Cosmos.CosmosElements.Numbers; using Microsoft.Azure.Cosmos.Query.Core.Monads; using Microsoft.Azure.Cosmos.Query.Core.Pipeline; using Microsoft.Azure.Cosmos.Query.Core.Pipeline.Distinct; @@ -16,28 +17,198 @@ [TestClass] public sealed class DistinctQueryPipelineStageTests - { + { + private const int InputElementCount = 400; + + // This list SHOULD NOT contain duplicates + private static readonly IReadOnlyList Literals = new List + { + CosmosUndefined.Create(), + + CosmosNull.Create(), + + CosmosBoolean.Create(true), + CosmosBoolean.Create(false), + + CosmosNumber64.Create(0), + CosmosNumber64.Create(42), + CosmosNumber64.Create(-1), + CosmosNumber64.Create(100010), + CosmosNumber64.Create(3.141619), + CosmosNumber64.Create(Math.PI), + + CosmosString.Create(string.Empty), + CosmosString.Create("Hello World"), + CosmosString.Create(string.Join(',', Enumerable.Repeat("Hello World", 75))), + CosmosString.Create(string.Join(',', Enumerable.Repeat("Hello World", 100))), + CosmosString.Create("敏捷的棕色狐狸跳过了懒狗"), + CosmosString.Create(string.Join(',', Enumerable.Repeat("敏捷的棕色狐狸跳过了懒狗", 50))), + CosmosString.Create(string.Join(',', Enumerable.Repeat("敏捷的棕色狐狸跳过了懒狗", 60))), + + CosmosArray.Create(), + CosmosArray.Create(new CosmosElement[] + { + CosmosUndefined.Create(), + CosmosNull.Create(), + CosmosBoolean.Create(true), + CosmosBoolean.Create(false), + CosmosNumber64.Create(0), + }), + CosmosArray.Create(new CosmosElement[] + { + CosmosUndefined.Create(), + CosmosNull.Create(), + CosmosBoolean.Create(true), + CosmosBoolean.Create(false) + }), + CosmosArray.Create(new CosmosElement[] + { + CosmosUndefined.Create(), + CosmosNull.Create(), + CosmosBoolean.Create(true), + CosmosBoolean.Create(false), + CosmosNumber64.Create(0), + CosmosNumber64.Create(42), + CosmosNumber64.Create(-1), + CosmosNumber64.Create(100010), + CosmosNumber64.Create(3.141619), + }), + + CosmosObject.Create(new Dictionary()), + CosmosObject.Create(new Dictionary + { + ["敏"] = CosmosUndefined.Create(), + ["b"] = CosmosNull.Create(), + ["c"] = CosmosBoolean.Create(true), + ["d"] = CosmosBoolean.Create(false), + ["懒"] = CosmosNumber64.Create(0), + }), + CosmosObject.Create(new Dictionary + { + ["敏"] = CosmosUndefined.Create(), + ["b"] = CosmosNull.Create(), + ["c"] = CosmosBoolean.Create(true), + ["d"] = CosmosBoolean.Create(false), + ["懒"] = CosmosNumber64.Create(0), + ["e"] = CosmosNumber64.Create(42), + ["f"] = CosmosNumber64.Create(-1), + ["فوق"] = CosmosNumber64.Create(100010), + ["g"] = CosmosNumber64.Create(3.141619), + }), + + CosmosGuid.Create(Guid.Parse("D29F71E3-2D43-4573-A0E6-16D7E03FDEB5")), + CosmosGuid.Create(Guid.Parse("D29F71E3-2D43-4573-B0E6-16D7E03FDEB5")), + CosmosGuid.Create(Guid.Parse("D29F71E3-2D43-4573-C0E6-16D7E03FDEB5")), + CosmosGuid.Create(Guid.Parse("D29F71E3-2D43-4573-D0E6-16D7E03FDEB5")), + CosmosGuid.Create(Guid.Parse("D29F71E3-2D43-4573-E0E6-16D7E03FDEB5")), + + CosmosBinary.Create(Guid.Parse("D29F71E3-2D43-4573-A0E6-16D7E03FDEB5").ToByteArray()), + CosmosBinary.Create(Guid.Parse("D29F71E3-2D43-4573-B0E6-16D7E03FDEB5").ToByteArray()), + CosmosBinary.Create(Guid.Parse("D29F71E3-2D43-4573-C0E6-16D7E03FDEB5").ToByteArray()), + CosmosBinary.Create(Guid.Parse("D29F71E3-2D43-4573-D0E6-16D7E03FDEB5").ToByteArray()), + CosmosBinary.Create(Guid.Parse("D29F71E3-2D43-4573-E0E6-16D7E03FDEB5").ToByteArray()), + CosmosBinary.Create(Encoding.UTF8.GetBytes("Hello World")), + CosmosBinary.Create(Encoding.UTF8.GetBytes(string.Join(',', Enumerable.Repeat("Hello World", 75)))), + CosmosBinary.Create(Encoding.UTF8.GetBytes(string.Join(',', Enumerable.Repeat("Hello World", 100)))), + CosmosBinary.Create(Encoding.UTF8.GetBytes("敏捷的棕色狐狸跳过了懒狗")), + CosmosBinary.Create(Encoding.UTF8.GetBytes(string.Join(',', Enumerable.Repeat("敏捷的棕色狐狸跳过了懒狗", 50)))), + CosmosBinary.Create(Encoding.UTF8.GetBytes(string.Join(',', Enumerable.Repeat("敏捷的棕色狐狸跳过了懒狗", 60)))), + }; + [TestMethod] public async Task SanityTests() - { - long[] values = new long[] { 42, 1337, 1337, 42 }; - IReadOnlyList> pages = values - .Select(value => new List() + { + long[] values = { 42, 1337, 1337, 42 }; + + IEnumerable input = values + .Select(value => CosmosObject.Create(new Dictionary + { + ["item"] = CosmosNumber64.Create(value) + })); + + IEnumerable expected = values + .Distinct() + .Select(value => CosmosObject.Create(new Dictionary + { + ["item"] = CosmosNumber64.Create(value) + })); + + DistinctQueryPipelineStageTestCase MakeTest(int pageSize) + { + return new DistinctQueryPipelineStageTestCase(input: input, pageSize: pageSize, expected: expected); + } + + IEnumerable testCases = new List + { + MakeTest(pageSize: 1), + MakeTest(pageSize: 3), + MakeTest(pageSize : 10), + }; + + await RunTests(testCases); + } + + [TestMethod] + public async Task MixedTypeTests() + { + IEnumerable mixedTypeValues = Enumerable + .Range(0, InputElementCount) + .Select(index => Literals[index % Literals.Count]); + + DistinctQueryPipelineStageTestCase MakeTest(int pageSize) + { + return new DistinctQueryPipelineStageTestCase(input: mixedTypeValues, pageSize: pageSize, expected: Literals); + } + + int[] pageSizes = { 400, 100, 10, 1 }; + IEnumerable testCases = pageSizes + .Select(x => MakeTest(pageSize: x)) + .ToList(); + + await RunTests(testCases); + } + + private static async Task RunTests(IEnumerable testCases) + { + foreach (DistinctQueryPipelineStageTestCase testCase in testCases) + { + IEnumerator enumerator = testCase.Input.GetEnumerator(); + int pageSize = 0; + List> pages = new List>() { new List() }; + while(enumerator.MoveNext()) + { + if (pageSize > testCase.PageSize) + { + pageSize = 0; + pages.Add(new List()); + } + + pages[pages.Count - 1].Add(enumerator.Current); + ++pageSize; + } + + foreach (ExecutionEnvironment env in new[] { ExecutionEnvironment.Compute, ExecutionEnvironment.Client }) { - CosmosElement.Parse($"{{\"item\": {value}}}") - }) - .ToList(); - - List elements = await DistinctQueryPipelineStageTests.CreateAndDrainAsync( - pages: pages, - executionEnvironment: ExecutionEnvironment.Compute, - continuationToken: null, - distinctQueryType: DistinctQueryType.Unordered); - - Assert.AreEqual(values.Distinct().Count(), elements.Count); + IEnumerable elements = await DistinctQueryPipelineStageTests.CreateAndDrainAsync( + pages: pages, + executionEnvironment: env, + continuationToken: null, + distinctQueryType: DistinctQueryType.Unordered); + + List actual = elements + .Select(value => value.ToString()) + .ToList(); + + List expected = testCase.Expected + .Select(value => value.ToString()) + .ToList(); + + CollectionAssert.AreEquivalent(expected, actual); + } + } } - private static async Task> CreateAndDrainAsync( + private static async Task> CreateAndDrainAsync( IReadOnlyList> pages, ExecutionEnvironment executionEnvironment, CosmosElement continuationToken, @@ -55,15 +226,31 @@ private static async Task> CreateAndDrainAsync( IQueryPipelineStage distinctQueryPipelineStage = tryCreateDistinctQueryPipelineStage.Result; - List elements = new List(); + IEnumerable elements = Enumerable.Empty(); await foreach (TryCatch page in new EnumerableStage(distinctQueryPipelineStage, NoOpTrace.Singleton)) { page.ThrowIfFailed(); - elements.AddRange(page.Result.Documents); + elements = elements.Concat(page.Result.Documents); } return elements; - } - } + } + + private struct DistinctQueryPipelineStageTestCase + { + public IEnumerable Input { get; } + + public int PageSize { get; } + + public IEnumerable Expected { get; } + + public DistinctQueryPipelineStageTestCase(IEnumerable input, int pageSize, IEnumerable expected) + { + this.Input = input ?? throw new ArgumentNullException(nameof(input)); + this.PageSize = pageSize; + this.Expected = expected ?? throw new ArgumentNullException(nameof(expected)); + } + } + } } From 3c875c7c15822f518c742dd4392cc6c093320b27 Mon Sep 17 00:00:00 2001 From: Nalu Tripician Date: Mon, 9 Jan 2023 10:50:57 -0800 Subject: [PATCH 034/240] [Internal] Subpartitioning: Adds updates to test coverage for subpartitioning (#3618) * updates to test coverage for subpartitioning * bug fixes * now useses Assert.ThrowsException * Seperated into multiple tests for clarity * Put MultiHash test into seperate test file * nit --- .../CosmosItemTests.cs | 110 ----- .../CosmosMultiHashTest.cs | 445 ++++++++++++++++++ 2 files changed, 445 insertions(+), 110 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs index da6d79c333..50bc71f276 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs @@ -27,7 +27,6 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using Newtonsoft.Json; using Newtonsoft.Json.Linq; using JsonReader = Json.JsonReader; - using JsonSerializer = Json.JsonSerializer; using JsonWriter = Json.JsonWriter; using PartitionKey = Documents.PartitionKey; using static Microsoft.Azure.Cosmos.SDK.EmulatorTests.TransportClientHelper; @@ -3006,115 +3005,6 @@ public async Task HaLayerDoesNotThrowNullOnGoneExceptionTest() } } -#if PREVIEW - [TestMethod] - public async Task VerifyDocumentCrudWithMultiHashKind() - { - string currentVersion = HttpConstants.Versions.CurrentVersion; - HttpConstants.Versions.CurrentVersion = "2020-07-15"; - CosmosClient client = TestCommon.CreateCosmosClient(true); - Cosmos.Database database = null; - database = await client.CreateDatabaseIfNotExistsAsync("mydb"); - try - { - ContainerProperties containerProperties = new ContainerProperties("mycoll", new List { "/ZipCode", "/Address" }); - Container container = await database.CreateContainerAsync(containerProperties); - - //Document create. - ItemResponse[] documents = new ItemResponse[3]; - Document doc1 = new Document { Id = "document1" }; - doc1.SetValue("ZipCode", "500026"); - doc1.SetValue("Address", "Secunderabad"); - documents[0] = await container.CreateItemAsync(doc1); - - doc1 = new Document { Id = "document2" }; - doc1.SetValue("ZipCode", "15232"); - doc1.SetValue("Address", "Pittsburgh"); - documents[1] = await container.CreateItemAsync(doc1); - - doc1 = new Document { Id = "document3" }; - doc1.SetValue("ZipCode", "11790"); - doc1.SetValue("Address", "Stonybrook"); - documents[2] = await container.CreateItemAsync(doc1); - - Assert.AreEqual(3, documents.Select(document => ((Document)document).SelfLink).Distinct().Count()); - - //Negative test - { - doc1 = new Document { Id = "doc1" }; - doc1.SetValue("Zipcode", 11790); - - PartitionKeyBuilder pKValueList = new PartitionKeyBuilder(); - pKValueList.Add(doc1.GetPropertyValue("ZipCode")); - - Cosmos.PartitionKey pKeyErr = pKValueList.Build(); - ResponseMessage response = await this.Container.CreateItemStreamAsync(streamPayload: TestCommon.SerializerCore.ToStream(doc1), partitionKey: pKeyErr); - - Assert.IsNotNull(response); - Assert.IsNull(response.Content); - Assert.AreEqual(HttpStatusCode.BadRequest, response.StatusCode); - } - - //Document Read. - foreach (Document document in documents) - { - Cosmos.PartitionKey pKey = new PartitionKeyBuilder() - .Add(document.GetPropertyValue("ZipCode")) - .Add(document.GetPropertyValue("Address")) - .Build(); - - Document readDocument = (await container.ReadItemAsync(document.Id, pKey)).Resource; - Assert.AreEqual(document.ToString(), readDocument.ToString()); - } - - //Document Update. - foreach (ItemResponse obj in documents) - { - Cosmos.PartitionKey pKey = new PartitionKeyBuilder() - .Add(obj.Resource.GetValue("ZipCode")) - .Add(obj.Resource.GetPropertyValue("Address")) - .Build(); - - Document document = (await container.ReadItemAsync(obj.Resource.Id, pKey)).Resource; - document.SetPropertyValue("Name", document.Id); - - Document readDocument = (await container.ReplaceItemAsync(document, document.Id, pKey)).Resource; - Assert.AreEqual(readDocument.GetValue("Name"), document.GetValue("Name")); - } - - //Document Delete. - foreach (Document document in documents) - { - Cosmos.PartitionKey pKey = new PartitionKeyBuilder() - .Add(document.GetPropertyValue("ZipCode")) - .Add(document.GetPropertyValue("Address")) - .Build(); - - Document readDocument = (await container.DeleteItemAsync(document.Id, pKey)).Resource; - try - { - readDocument = await container.ReadItemAsync(document.Id, pKey); - } - catch (CosmosException clientException) - { - Assert.AreEqual(clientException.StatusCode, HttpStatusCode.NotFound); - } - } - - } - catch (Exception) - { - Assert.Fail(); - } - finally - { - await database.DeleteAsync(); - HttpConstants.Versions.CurrentVersion = currentVersion; - } - - } - -#endif private async Task AutoGenerateIdPatternTest(Cosmos.PartitionKey pk, T itemWithoutId) { string autoId = Guid.NewGuid().ToString(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs new file mode 100644 index 0000000000..d069e87935 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs @@ -0,0 +1,445 @@ +#if PREVIEW +namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Threading.Tasks; + using Microsoft.Azure.Documents; + using Microsoft.Azure.Cosmos; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + [TestClass] + public class CosmosMultiHashTest + { + private Cosmos.Database database = null; + + private Container container = null; + private ContainerProperties containerProperties = null; + + private readonly string currentVersion = HttpConstants.Versions.CurrentVersion; + + + [TestInitialize] + public async Task TestInitialize() + { + HttpConstants.Versions.CurrentVersion = "2020-07-15"; + CosmosClient client = TestCommon.CreateCosmosClient(true); + this.database = await client.CreateDatabaseIfNotExistsAsync("mydb"); + + this.containerProperties = new ContainerProperties("mycoll", new List { "/ZipCode", "/Address" }); + this.container = await this.database.CreateContainerAsync(this.containerProperties); + } + + [TestCleanup] + public async Task Cleanup() + { + await this.database.DeleteAsync(); + HttpConstants.Versions.CurrentVersion = this.currentVersion; + } + + [TestMethod] + public async Task MultiHashCreateDocumentTest() + { + //Document create test + ItemResponse[] documents = new ItemResponse[3]; + Document doc1 = new Document { Id = "document1" }; + doc1.SetValue("ZipCode", "500026"); + doc1.SetValue("Address", "Secunderabad"); + doc1.SetValue("Type", "Residence"); + documents[0] = await this.container.CreateItemAsync(doc1); + + doc1 = new Document { Id = "document2" }; + doc1.SetValue("ZipCode", "15232"); + doc1.SetValue("Address", "Pittsburgh"); + doc1.SetValue("Type", "Business"); + documents[1] = await this.container.CreateItemAsync(doc1); + + doc1 = new Document { Id = "document3" }; + doc1.SetValue("ZipCode", "11790"); + doc1.SetValue("Address", "Stonybrook"); + doc1.SetValue("Type", "Goverment"); + documents[2] = await this.container.CreateItemAsync(doc1); + + Assert.AreEqual(3, documents.Select(document => ((Document)document).SelfLink).Distinct().Count()); + + //Negative test - using incomplete partition key + Cosmos.PartitionKey badPKey; + + foreach (Document document in documents) + { + badPKey = new PartitionKeyBuilder() + .Add(document.GetPropertyValue("Address")) + .Build(); + + document.Id += "Bad"; + + ArgumentException createException = await Assert.ThrowsExceptionAsync(() => + this.container.CreateItemAsync(document, badPKey) + ); + } + } + + [TestMethod] + public async Task MultiHashDeleteDocumentTest() + { + Cosmos.PartitionKey pKey; + Cosmos.PartitionKey badPKey; + + //Create Items for test + ItemResponse[] documents = new ItemResponse[3]; + Document doc1 = new Document { Id = "document1" }; + doc1.SetValue("ZipCode", "500026"); + doc1.SetValue("Address", "Secunderabad"); + doc1.SetValue("Type", "Residence"); + documents[0] = await this.container.CreateItemAsync(doc1); + + doc1 = new Document { Id = "document2" }; + doc1.SetValue("ZipCode", "15232"); + doc1.SetValue("Address", "Pittsburgh"); + doc1.SetValue("Type", "Business"); + documents[1] = await this.container.CreateItemAsync(doc1); + + doc1 = new Document { Id = "document3" }; + doc1.SetValue("ZipCode", "11790"); + doc1.SetValue("Address", "Stonybrook"); + doc1.SetValue("Type", "Goverment"); + documents[2] = await this.container.CreateItemAsync(doc1); + + //Document Delete Test + foreach (Document document in documents) + { + //Negative test - using incomplete partition key + badPKey = new PartitionKeyBuilder() + .Add(document.GetPropertyValue("Address")) + .Build(); + + CosmosException deleteException = await Assert.ThrowsExceptionAsync(() => + this.container.DeleteItemAsync(document.Id, badPKey) + ); + + Assert.AreEqual(deleteException.StatusCode, HttpStatusCode.BadRequest); + + //Positive test + pKey = new PartitionKeyBuilder() + .Add(document.GetPropertyValue("ZipCode")) + .Add(document.GetPropertyValue("Address")) + .Build(); + + Document readDocument = (await this.container.DeleteItemAsync(document.Id, pKey)).Resource; + + CosmosException clientException = await Assert.ThrowsExceptionAsync(() => + this.container.ReadItemAsync(document.Id, pKey) + ); + + Assert.AreEqual(clientException.StatusCode, HttpStatusCode.NotFound); + } + } + + [TestMethod] + public async Task MultiHashReadItemTest() + { + Cosmos.PartitionKey pKey; + Cosmos.PartitionKey badPKey; + + //Create Items for test + ItemResponse[] documents = new ItemResponse[3]; + Document doc1 = new Document { Id = "document1" }; + doc1.SetValue("ZipCode", "500026"); + doc1.SetValue("Address", "Secunderabad"); + doc1.SetValue("Type", "Residence"); + documents[0] = await this.container.CreateItemAsync(doc1); + + doc1 = new Document { Id = "document2" }; + doc1.SetValue("ZipCode", "15232"); + doc1.SetValue("Address", "Pittsburgh"); + doc1.SetValue("Type", "Business"); + documents[1] = await this.container.CreateItemAsync(doc1); + + doc1 = new Document { Id = "document3" }; + doc1.SetValue("ZipCode", "11790"); + doc1.SetValue("Address", "Stonybrook"); + doc1.SetValue("Type", "Goverment"); + documents[2] = await this.container.CreateItemAsync(doc1); + + //Document Read Test + foreach (Document document in documents) + { + pKey = new PartitionKeyBuilder() + .Add(document.GetPropertyValue("ZipCode")) + .Add(document.GetPropertyValue("Address")) + .Build(); + + Document readDocument = (await this.container.ReadItemAsync(document.Id, pKey)).Resource; + Assert.AreEqual(document.ToString(), readDocument.ToString()); + + //Negative test - using incomplete partition key + badPKey = new PartitionKeyBuilder() + .Add(document.GetPropertyValue("Address")) + .Build(); + + CosmosException clientException = await Assert.ThrowsExceptionAsync(() => + this.container.ReadItemAsync(document.Id, badPKey) + ); + + Assert.AreEqual(clientException.StatusCode, HttpStatusCode.BadRequest); + } + } + + [TestMethod] + public async Task MultiHashReadManyTest() + { + Cosmos.PartitionKey pKey; + + //Create Items for test + ItemResponse[] documents = new ItemResponse[3]; + Document doc1 = new Document { Id = "document1" }; + doc1.SetValue("ZipCode", "500026"); + doc1.SetValue("Address", "Secunderabad"); + doc1.SetValue("Type", "Residence"); + documents[0] = await this.container.CreateItemAsync(doc1); + + doc1 = new Document { Id = "document2" }; + doc1.SetValue("ZipCode", "15232"); + doc1.SetValue("Address", "Pittsburgh"); + doc1.SetValue("Type", "Business"); + documents[1] = await this.container.CreateItemAsync(doc1); + + doc1 = new Document { Id = "document3" }; + doc1.SetValue("ZipCode", "11790"); + doc1.SetValue("Address", "Stonybrook"); + doc1.SetValue("Type", "Goverment"); + documents[2] = await this.container.CreateItemAsync(doc1); + + //Read Many Test + List<(string, Cosmos.PartitionKey)> itemList = new List<(string, Cosmos.PartitionKey)>(); + foreach (Document document in documents) + { + pKey = new PartitionKeyBuilder() + .Add(document.GetPropertyValue("ZipCode")) + .Add(document.GetPropertyValue("Address")) + .Build(); + + itemList.Add((document.Id, pKey)); + } + + FeedResponse feedResponse = await this.container.ReadManyItemsAsync(itemList); + + Assert.IsNotNull(feedResponse); + Assert.AreEqual(feedResponse.Count, 3); + Assert.IsTrue(feedResponse.Headers.RequestCharge > 0); + Assert.IsNotNull(feedResponse.Diagnostics); + + int count = 0; + foreach (ToDoActivity item in feedResponse) + { + count++; + Assert.IsNotNull(item); + Assert.IsNotNull(item.pk); + } + Assert.AreEqual(count, 3); + } + + [TestMethod] + public async Task MultiHashUpsetItemTest() + { + Cosmos.PartitionKey pKey; + Cosmos.PartitionKey badPKey; + int count; + + //Create Items for test + ItemResponse[] documents = new ItemResponse[3]; + Document doc1 = new Document { Id = "document1" }; + doc1.SetValue("ZipCode", "500026"); + doc1.SetValue("Address", "Secunderabad"); + doc1.SetValue("Type", "Residence"); + documents[0] = await this.container.CreateItemAsync(doc1); + + doc1 = new Document { Id = "document2" }; + doc1.SetValue("ZipCode", "15232"); + doc1.SetValue("Address", "Pittsburgh"); + doc1.SetValue("Type", "Business"); + documents[1] = await this.container.CreateItemAsync(doc1); + + doc1 = new Document { Id = "document3" }; + doc1.SetValue("ZipCode", "11790"); + doc1.SetValue("Address", "Stonybrook"); + doc1.SetValue("Type", "Goverment"); + documents[2] = await this.container.CreateItemAsync(doc1); + + //Document Upsert Test + doc1 = new Document { Id = "document4" }; + doc1.SetValue("ZipCode", "97756"); + doc1.SetValue("Address", "Redmond"); + doc1.SetValue("Type", "Residence"); + + pKey = new PartitionKeyBuilder() + .Add(doc1.GetPropertyValue("ZipCode")) + .Add(doc1.GetPropertyValue("Address")) + .Build(); + + //insert check + await this.container.UpsertItemAsync(doc1, pKey); + + Document readCheck = (await this.container.ReadItemAsync(doc1.Id, pKey)).Resource; + + Assert.AreEqual(doc1.GetPropertyValue("ZipCode"), readCheck.GetPropertyValue("ZipCode")); + Assert.AreEqual(doc1.GetPropertyValue("Address"), readCheck.GetPropertyValue("Address")); + Assert.AreEqual(doc1.GetPropertyValue("Type"), readCheck.GetPropertyValue("Type")); + + doc1 = new Document { Id = "document4" }; + doc1.SetValue("ZipCode", "97756"); + doc1.SetValue("Address", "Redmond"); + doc1.SetValue("Type", "Business"); + + //update check + pKey = new PartitionKeyBuilder() + .Add(doc1.GetPropertyValue("ZipCode")) + .Add(doc1.GetPropertyValue("Address")) + .Build(); + + documents.Append>(await this.container.UpsertItemAsync(doc1, pKey)); + + readCheck = (await this.container.ReadItemAsync(doc1.Id, pKey)).Resource; + + Assert.AreEqual(doc1.GetPropertyValue("ZipCode"), readCheck.GetPropertyValue("ZipCode")); + Assert.AreEqual(doc1.GetPropertyValue("Address"), readCheck.GetPropertyValue("Address")); + Assert.AreEqual(doc1.GetPropertyValue("Type"), readCheck.GetPropertyValue("Type")); + + count = 0; + + foreach (Document doc in this.container.GetItemLinqQueryable(true)) + { + count++; + } + Assert.AreEqual(4, count); + + //Negative test - using incomplete partition key + doc1 = new Document { Id = "document4" }; + doc1.SetValue("ZipCode", "97756"); + doc1.SetValue("Address", "Redmond"); + doc1.SetValue("Type", "Residence"); + + badPKey = new PartitionKeyBuilder() + .Add(doc1.GetPropertyValue("ZipCode")) + .Build(); + + await Assert.ThrowsExceptionAsync(() => + this.container.UpsertItemAsync(doc1, badPKey) + ); + + readCheck = (await this.container.ReadItemAsync(doc1.Id, pKey)).Resource; + + Assert.AreEqual(doc1.GetPropertyValue("ZipCode"), readCheck.GetPropertyValue("ZipCode")); + Assert.AreEqual(doc1.GetPropertyValue("Address"), readCheck.GetPropertyValue("Address")); + Assert.AreNotEqual(doc1.GetPropertyValue("Type"), readCheck.GetPropertyValue("Type")); + } + + [TestMethod] + public async Task MultiHashReplaceItemTest() + { + Cosmos.PartitionKey pKey; + Cosmos.PartitionKey badPKey; + + //Create items for test + ItemResponse[] documents = new ItemResponse[3]; + Document doc1 = new Document { Id = "document1" }; + doc1.SetValue("ZipCode", "500026"); + doc1.SetValue("Address", "Secunderabad"); + doc1.SetValue("Type", "Residence"); + documents[0] = await this.container.CreateItemAsync(doc1); + + doc1 = new Document { Id = "document2" }; + doc1.SetValue("ZipCode", "15232"); + doc1.SetValue("Address", "Pittsburgh"); + doc1.SetValue("Type", "Business"); + documents[1] = await this.container.CreateItemAsync(doc1); + + doc1 = new Document { Id = "document3" }; + doc1.SetValue("ZipCode", "11790"); + doc1.SetValue("Address", "Stonybrook"); + doc1.SetValue("Type", "Goverment"); + documents[2] = await this.container.CreateItemAsync(doc1); + + //Document Replace Test + foreach (Document document in documents) + { + pKey = new PartitionKeyBuilder() + .Add(document.GetPropertyValue("ZipCode")) + .Add(document.GetPropertyValue("Address")) + .Build(); + + + Document readDocument = (await this.container.ReadItemAsync(document.Id, pKey)).Resource; + readDocument.SetValue("Type", "Park"); + + ItemResponse item = await this.container.ReplaceItemAsync(readDocument, readDocument.Id, pKey); + + Document checkDocument = (await this.container.ReadItemAsync(document.Id, pKey)).Resource; + Assert.AreEqual(checkDocument.GetPropertyValue("Type"), readDocument.GetPropertyValue("Type")); + + //Negative test - using incomplete partition key + badPKey = new PartitionKeyBuilder() + .Add(document.GetPropertyValue("Address")) + .Build(); + + readDocument.SetValue("Type", "Goverment"); + + await Assert.ThrowsExceptionAsync(() => + this.container.ReplaceItemAsync(document, document.Id, partitionKey: badPKey) + ); + } + } + + [TestMethod] + public async Task MultiHashQueryItemTest() + { + Cosmos.PartitionKey pKey; + + //Create items for test + ItemResponse[] documents = new ItemResponse[3]; + Document doc1 = new Document { Id = "document1" }; + doc1.SetValue("ZipCode", "500026"); + doc1.SetValue("Address", "Secunderabad"); + doc1.SetValue("Type", "Residence"); + documents[0] = await this.container.CreateItemAsync(doc1); + + doc1 = new Document { Id = "document2" }; + doc1.SetValue("ZipCode", "15232"); + doc1.SetValue("Address", "Pittsburgh"); + doc1.SetValue("Type", "Business"); + documents[1] = await this.container.CreateItemAsync(doc1); + + doc1 = new Document { Id = "document3" }; + doc1.SetValue("ZipCode", "11790"); + doc1.SetValue("Address", "Stonybrook"); + doc1.SetValue("Type", "Goverment"); + documents[2] = await this.container.CreateItemAsync(doc1); + + //Query + foreach (Document document in documents) + { + pKey = new PartitionKeyBuilder() + .Add(document.GetPropertyValue("ZipCode")) + .Add(document.GetPropertyValue("Address")) + .Build(); + + String query = $"SELECT * from c where c.id = {document.GetPropertyValue("Id")}"; + + using (FeedIterator feedIterator = this.container.GetItemQueryIterator( + query, + null, + new QueryRequestOptions() { PartitionKey = pKey })) + { + Assert.IsTrue(feedIterator.HasMoreResults); + + FeedResponse queryDoc = await feedIterator.ReadNextAsync(); + } + + } + } + + } +} +#endif From 416b154a7f90d35bf572d05ff69c70c5737cfaf0 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Mon, 9 Jan 2023 14:18:54 -0800 Subject: [PATCH 035/240] [Internal] ContainerProperties: Fixes version reset when setting PartitionKeyPath (#3637) * Remember previous value * test --- .../src/Resource/Settings/ContainerProperties.cs | 7 +++++++ .../CosmosContainerSettingsTests.cs | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs index e1eaa6ca96..b95efb99c8 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs @@ -362,10 +362,17 @@ public string PartitionKeyPath throw new ArgumentNullException(nameof(this.PartitionKeyPath)); } + PartitionKeyDefinitionVersion? currentDefinitionVersion = this.PartitionKeyDefinitionVersion; + this.PartitionKey = new PartitionKeyDefinition { Paths = new Collection() { value } }; + + if (currentDefinitionVersion.HasValue) + { + this.PartitionKeyDefinitionVersion = currentDefinitionVersion.Value; + } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosContainerSettingsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosContainerSettingsTests.cs index 84618705de..865bb71d18 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosContainerSettingsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosContainerSettingsTests.cs @@ -165,6 +165,17 @@ public void ValidateIncludedPathSerialization() } } + [TestMethod] + public void SettingPKShouldNotResetVersion() + { + ContainerProperties containerProperties = new(); + containerProperties.Id = "test"; + containerProperties.PartitionKeyDefinitionVersion = Cosmos.PartitionKeyDefinitionVersion.V2; + containerProperties.PartitionKeyPath = "/id"; + + Assert.AreEqual(Cosmos.PartitionKeyDefinitionVersion.V2, containerProperties.PartitionKeyDefinitionVersion); + } + private static string SerializeDocumentCollection(DocumentCollection collection) { using (MemoryStream ms = new MemoryStream()) From 59b70a6284483bfc79c6c96a2207905c652a1620 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 10 Jan 2023 21:15:04 +0530 Subject: [PATCH 036/240] [Internal] AI Integration: Adds CorrelationId and Activity Id Attributes for query operation (#3630) * add activityid in Otel attributes * added correlation id * operation type fix * remove test changes * test fix * fix baseline test * rename correlationId * fix tests again * include only not null attributes in test * fixed tests * changefeedxml * test fix * ordering activity in operationname oerder * fix test * review comments * refator header getter setter * clean up Co-authored-by: Sourabh Jain --- .../CosmosQueryResponseMessageHeaders.cs | 6 +- Microsoft.Azure.Cosmos/src/Headers/Headers.cs | 9 + .../src/Query/v3Query/QueryIterator.cs | 1 + .../OpenTelemetryAttributeKeys.cs | 4 +- .../OpenTelemetry/OpenTelemetryAttributes.cs | 15 ++ .../OpenTelemetryCoreRecorder.cs | 47 ++-- .../OpenTelemetry/OpenTelemetryResponse.cs | 18 +- .../OpenTelemetry/OpenTelemetryResponse{T}.cs | 18 +- .../BaselineTest/BaselineTests.cs | 4 - ...iterBaselineTests.BatchOperationsAsync.xml | 2 +- ...riterBaselineTests.BulkOperationsAsync.xml | 202 +++++++++--------- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 44 ++-- ...eWriterBaselineTests.MiscellanousAsync.xml | 8 +- ...neTests.PointOperationsExceptionsAsync.xml | 12 +- ...EndTraceWriterBaselineTests.QueryAsync.xml | 56 ++--- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 32 +-- ...TraceWriterBaselineTests.ReadManyAsync.xml | 14 +- ...selineTests.StreamPointOperationsAsync.xml | 8 +- ...aselineTests.TypedPointOperationsAsync.xml | 8 +- .../Tracing/AssertActivity.cs | 4 +- .../Tracing/CustomListener.cs | 28 ++- 21 files changed, 312 insertions(+), 228 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Headers/CosmosQueryResponseMessageHeaders.cs b/Microsoft.Azure.Cosmos/src/Headers/CosmosQueryResponseMessageHeaders.cs index 4c962cb6d8..2e37e62e9b 100644 --- a/Microsoft.Azure.Cosmos/src/Headers/CosmosQueryResponseMessageHeaders.cs +++ b/Microsoft.Azure.Cosmos/src/Headers/CosmosQueryResponseMessageHeaders.cs @@ -73,7 +73,8 @@ internal CosmosQueryResponseMessageHeaders CloneKnownProperties( SubStatusCodeLiteral = this.SubStatusCodeLiteral, ContentType = this.ContentType, QueryMetricsText = QueryMetricsText, - IndexUtilizationText = IndexUtilizationText + IndexUtilizationText = IndexUtilizationText, + CorrelatedActivityId = this.CorrelatedActivityId }; } @@ -108,7 +109,8 @@ internal static CosmosQueryResponseMessageHeaders ConvertToQueryHeaders( SubStatusCodeLiteral = sourceHeaders.SubStatusCodeLiteral ?? (substatusCode.HasValue ? substatusCode.Value.ToString() : null), ContentType = sourceHeaders.ContentType, QueryMetricsText = sourceHeaders.QueryMetricsText, - IndexUtilizationText = sourceHeaders.IndexUtilizationText + IndexUtilizationText = sourceHeaders.IndexUtilizationText, + CorrelatedActivityId = sourceHeaders.CorrelatedActivityId }; } } diff --git a/Microsoft.Azure.Cosmos/src/Headers/Headers.cs b/Microsoft.Azure.Cosmos/src/Headers/Headers.cs index fda0536da2..611de5f147 100644 --- a/Microsoft.Azure.Cosmos/src/Headers/Headers.cs +++ b/Microsoft.Azure.Cosmos/src/Headers/Headers.cs @@ -36,6 +36,15 @@ public virtual string ContinuationToken internal set => this.CosmosMessageHeaders.Continuation = value; } + /// + /// Gets or Set the CoorelatedActivityId in the current . + /// + internal virtual string CorrelatedActivityId + { + get => this.CosmosMessageHeaders.Get(HttpConstants.HttpHeaders.CorrelatedActivityId); + set => this.CosmosMessageHeaders.Set(HttpConstants.HttpHeaders.CorrelatedActivityId, value); + } + /// /// Gets the request charge for this request from the Azure Cosmos DB service. /// diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs index b7c43c8443..01a4e1b12e 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs @@ -235,6 +235,7 @@ public override async Task ReadNextAsync(ITrace trace, Cancella { RequestCharge = tryGetQueryPage.Result.RequestCharge, ActivityId = tryGetQueryPage.Result.ActivityId, + CorrelatedActivityId = this.correlatedActivityId.ToString(), SubStatusCode = Documents.SubStatusCodes.Unknown }; diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs index eb8382c0b0..e7c4d96cc2 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs @@ -24,7 +24,7 @@ internal sealed class OpenTelemetryAttributeKeys public const string ConnectionMode = "db.cosmosdb.connection_mode"; public const string OperationType = "db.cosmosdb.operation_type"; - // Request Specifics + // Request/Response Specifics public const string ContainerName = "db.cosmosdb.container"; public const string RequestContentLength = "db.cosmosdb.request_content_length_bytes"; public const string ResponseContentLength = "db.cosmosdb.response_content_length_bytes"; @@ -35,6 +35,8 @@ internal sealed class OpenTelemetryAttributeKeys public const string RetryCount = "db.cosmosdb.retry_count"; public const string ItemCount = "db.cosmosdb.item_count"; public const string RequestDiagnostics = "db.cosmosdb.request_diagnostics"; + public const string ActivityId = "db.cosmosdb.activity_id"; + public const string CorrelatedActivityId = "db.cosmosdb.correlated_activity_id"; // Exceptions public const string ExceptionType = "exception.type"; diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs index 7e9c798f9d..70b6cea4ef 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributes.cs @@ -54,5 +54,20 @@ internal OpenTelemetryAttributes(RequestMessage requestMessage) /// SubStatusCode /// internal int SubStatusCode { get; set; } + + /// + /// ActivityId + /// + internal string ActivityId { get; set; } + + /// + /// CorrelatedActivityId + /// + internal string CorrelatedActivityId { get; set; } + + /// + /// OperationType + /// + internal Documents.OperationType OperationType { get; set; } } } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs index 32e4fde67f..51aa1ee794 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs @@ -14,12 +14,13 @@ namespace Microsoft.Azure.Cosmos.Telemetry internal struct OpenTelemetryCoreRecorder : IDisposable { private const string CosmosDb = "cosmosdb"; - + private readonly DiagnosticScope scope; private readonly DistributedTracingOptions config; private readonly Documents.OperationType operationType; - + private OpenTelemetryAttributes response = null; + internal static IDictionary> OTelCompatibleExceptions = new Dictionary>() { { typeof(CosmosNullReferenceException), (exception, scope) => CosmosNullReferenceException.RecordOtelAttributes((CosmosNullReferenceException)exception, scope)}, @@ -41,7 +42,7 @@ public OpenTelemetryCoreRecorder( this.config = config; this.operationType = operationType; - if (this.IsEnabled) + if (scope.IsEnabled) { this.scope.Start(); @@ -49,7 +50,6 @@ public OpenTelemetryCoreRecorder( operationName: operationName, containerName: containerName, databaseName: databaseName, - operationType: operationType, clientContext: clientContext); } } @@ -70,13 +70,11 @@ public void Record(string key, string value) /// /// /// - /// /// public void Record( string operationName, string containerName, string databaseName, - Documents.OperationType operationType, CosmosClientContext clientContext) { if (this.IsEnabled) @@ -84,7 +82,6 @@ public void Record( this.scope.AddAttribute(OpenTelemetryAttributeKeys.DbOperation, operationName); this.scope.AddAttribute(OpenTelemetryAttributeKeys.DbName, databaseName); this.scope.AddAttribute(OpenTelemetryAttributeKeys.ContainerName, containerName); - this.scope.AddAttribute(OpenTelemetryAttributeKeys.OperationType, operationType); // Other information this.scope.AddAttribute(OpenTelemetryAttributeKeys.DbSystemName, OpenTelemetryCoreRecorder.CosmosDb); @@ -106,18 +103,7 @@ public void Record(OpenTelemetryAttributes response) { if (this.IsEnabled) { - this.scope.AddAttribute(OpenTelemetryAttributeKeys.RequestContentLength, response.RequestContentLength); - this.scope.AddAttribute(OpenTelemetryAttributeKeys.ResponseContentLength, response.ResponseContentLength); - this.scope.AddAttribute(OpenTelemetryAttributeKeys.StatusCode, (int)response.StatusCode); - this.scope.AddAttribute(OpenTelemetryAttributeKeys.SubStatusCode, (int)response.SubStatusCode); - this.scope.AddAttribute(OpenTelemetryAttributeKeys.RequestCharge, response.RequestCharge); - this.scope.AddAttribute(OpenTelemetryAttributeKeys.ItemCount, response.ItemCount); - - if (response.Diagnostics != null) - { - this.scope.AddAttribute(OpenTelemetryAttributeKeys.Region, ClientTelemetryHelper.GetContactedRegions(response.Diagnostics.GetContactedRegions())); - CosmosDbEventSource.RecordDiagnosticsForRequests(this.config, this.operationType, response); - } + this.response = response; } } @@ -168,6 +154,29 @@ public void Dispose() { if (this.scope.IsEnabled) { + Documents.OperationType operationType + = (this.response == null || this.response?.OperationType == Documents.OperationType.Invalid) ? this.operationType : this.response.OperationType; + + this.scope.AddAttribute(OpenTelemetryAttributeKeys.OperationType, operationType); + + if (this.response != null) + { + this.scope.AddAttribute(OpenTelemetryAttributeKeys.RequestContentLength, this.response.RequestContentLength); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.ResponseContentLength, this.response.ResponseContentLength); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.StatusCode, (int)this.response.StatusCode); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.SubStatusCode, (int)this.response.SubStatusCode); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.RequestCharge, this.response.RequestCharge); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.ItemCount, this.response.ItemCount); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.ActivityId, this.response.ActivityId); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.CorrelatedActivityId, this.response.CorrelatedActivityId); + + if (this.response.Diagnostics != null) + { + this.scope.AddAttribute(OpenTelemetryAttributeKeys.Region, ClientTelemetryHelper.GetContactedRegions(this.response.Diagnostics.GetContactedRegions())); + CosmosDbEventSource.RecordDiagnosticsForRequests(this.config, operationType, this.response); + } + } + this.scope.Dispose(); } } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs index 98c1bfab8d..c9aba10ee6 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs @@ -18,7 +18,9 @@ internal OpenTelemetryResponse(TransactionalBatchResponse responseMessage) diagnostics: responseMessage.Diagnostics, itemCount: responseMessage.Headers?.ItemCount, requestMessage: null, - subStatusCode: (int)responseMessage.Headers?.SubStatusCode) + subStatusCode: (int)responseMessage.Headers?.SubStatusCode, + activityId: responseMessage.Headers?.ActivityId, + correlationId: responseMessage.Headers?.CorrelatedActivityId) { } @@ -30,7 +32,11 @@ internal OpenTelemetryResponse(ResponseMessage responseMessage) diagnostics: responseMessage.Diagnostics, itemCount: responseMessage.Headers?.ItemCount, requestMessage: responseMessage.RequestMessage, - subStatusCode: (int)responseMessage.Headers?.SubStatusCode) + subStatusCode: (int)responseMessage.Headers?.SubStatusCode, + activityId: responseMessage.Headers?.ActivityId, + correlationId: responseMessage.Headers?.CorrelatedActivityId, + operationType: responseMessage is QueryResponse ? Documents.OperationType.Query : Documents.OperationType.Invalid + ) { } @@ -41,7 +47,10 @@ private OpenTelemetryResponse( CosmosDiagnostics diagnostics, string itemCount, RequestMessage requestMessage, - int subStatusCode) + int subStatusCode, + string activityId, + string correlationId, + Documents.OperationType operationType = Documents.OperationType.Invalid) : base(requestMessage) { this.StatusCode = statusCode; @@ -50,6 +59,9 @@ private OpenTelemetryResponse( this.Diagnostics = diagnostics; this.ItemCount = itemCount; this.SubStatusCode = subStatusCode; + this.ActivityId = activityId; + this.CorrelatedActivityId = correlationId; + this.OperationType = operationType; } private static string GetPayloadSize(ResponseMessage response) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs index 71ca5cfba2..4c96306a30 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs @@ -17,7 +17,10 @@ internal OpenTelemetryResponse(FeedResponse responseMessage) diagnostics: responseMessage.Diagnostics, itemCount: responseMessage.Headers?.ItemCount, requestMessage: responseMessage.RequestMessage, - subStatusCode: (int)responseMessage.Headers?.SubStatusCode) + subStatusCode: (int)responseMessage.Headers?.SubStatusCode, + activityId: responseMessage.Headers?.ActivityId, + correlatedActivityId: responseMessage.Headers?.CorrelatedActivityId, + operationType: responseMessage is QueryResponse ? Documents.OperationType.Query : Documents.OperationType.Invalid) { } @@ -29,7 +32,10 @@ internal OpenTelemetryResponse(Response responseMessage) diagnostics: responseMessage.Diagnostics, itemCount: responseMessage.Headers?.ItemCount, requestMessage: responseMessage.RequestMessage, - subStatusCode: (int)responseMessage.Headers?.SubStatusCode) + subStatusCode: (int)responseMessage.Headers?.SubStatusCode, + activityId: responseMessage.Headers?.ActivityId, + correlatedActivityId: responseMessage.Headers?.CorrelatedActivityId, + operationType: responseMessage is QueryResponse ? Documents.OperationType.Query : Documents.OperationType.Invalid) { } @@ -40,7 +46,10 @@ private OpenTelemetryResponse( CosmosDiagnostics diagnostics, string itemCount, RequestMessage requestMessage, - int subStatusCode) + int subStatusCode, + string activityId, + string correlatedActivityId, + Documents.OperationType operationType) : base(requestMessage) { this.StatusCode = statusCode; @@ -49,6 +58,9 @@ private OpenTelemetryResponse( this.Diagnostics = diagnostics; this.ItemCount = itemCount; this.SubStatusCode = subStatusCode; + this.ActivityId = activityId; + this.CorrelatedActivityId = correlatedActivityId; + this.OperationType = operationType; } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/BaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/BaselineTests.cs index c68a6e6bdc..e9fbc54267 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/BaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/BaselineTests.cs @@ -116,17 +116,13 @@ public void ExecuteTestSuite(IEnumerable inputs, [CallerMemberName] stri string outputText = Regex.Replace( Regex.Replace( - Regex.Replace( File.ReadAllText(outputPath), @"\s+", string.Empty), - @"[\w\W]*?", string.Empty), @"[\w\W]*?", string.Empty); // in changefeed test in was changing string baselineText = Regex.Replace( Regex.Replace( - Regex.Replace( File.ReadAllText(baselinePath), @"\s+", string.Empty), - @"[\w\W]*?", string.Empty), @"[\w\W]*?", string.Empty); int commonPrefixLength = 0; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index f650f1e6f5..a6683679f7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -129,7 +129,7 @@ } ] }]]> - Operation.ExecuteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.ExecuteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationExecuteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index c10633d3fa..6fd72499bb 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -134,16 +134,16 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -292,16 +292,16 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -450,16 +450,16 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -608,16 +608,16 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -766,16 +766,16 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -924,16 +924,16 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1082,16 +1082,16 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1240,16 +1240,16 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1398,16 +1398,16 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1556,16 +1556,16 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2288,7 +2288,7 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.messagedb.cosmosdb.operation_typeCreate Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml index e4fa3665a8..c04d573153 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml @@ -952,11 +952,11 @@ } ] }]]> - Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1569,11 +1569,11 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2167,11 +2167,11 @@ } ] }]]> - Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Change Feed Iterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2785,11 +2785,11 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3066,8 +3066,8 @@ } ] }]]> - Operation.Change Feed Estimator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Change Feed Estimator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Estimator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml index 3825735788..cd053b58e2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml @@ -107,8 +107,8 @@ } ] }]]> - Operation.DeleteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateDatabaseAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.DeleteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateDatabaseAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateDatabaseAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -207,8 +207,8 @@ } ] }]]> - Operation.DeleteAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateDatabaseAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.DeleteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateDatabaseAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateDatabaseAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml index 80dbbfb7f1..7d6a68adca 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml @@ -148,7 +148,7 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -391,7 +391,7 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -616,7 +616,7 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -873,7 +873,7 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1194,7 +1194,7 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1348,7 +1348,7 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.message + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml index 5b54a51e31..21db429e27 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml @@ -574,10 +574,10 @@ } ] }]]> - Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1180,10 +1180,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1767,10 +1767,10 @@ } ] }]]> - Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2374,10 +2374,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3048,10 +3048,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3644,10 +3644,10 @@ } ] }]]> - Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -4260,10 +4260,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml index 22feeace3c..070da7032d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml @@ -536,10 +536,10 @@ } ] }]]> - Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1104,10 +1104,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1653,10 +1653,10 @@ } ] }]]> - Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.FeedIterator Read Next Asynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2222,10 +2222,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.Typed FeedIterator ReadNextAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml index c6a9fcee7f..dd99e1694b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml @@ -542,12 +542,12 @@ } ] }]]> - Operation.ReadManyItemsStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.ReadManyItemsStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadManyItemsStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1112,7 +1112,7 @@ } ] }]]> - Operation.ReadManyItemsAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.ReadManyItemsAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadManyItemsAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml index 5a764d9525..6172446645 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml @@ -89,7 +89,7 @@ } ] }]]> - Operation.CreateItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -178,7 +178,7 @@ } ] }]]> - Operation.ReadItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.ReadItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -275,7 +275,7 @@ } ] }]]> - Operation.ReplaceItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.ReplaceItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReplaceItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -367,7 +367,7 @@ } ] }]]> - Operation.DeleteItemStreamAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.DeleteItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml index 63edd0154e..2aeaf80b15 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml @@ -109,7 +109,7 @@ } ] }]]> - Operation.CreateItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -203,7 +203,7 @@ } ] }]]> - Operation.ReadItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.ReadItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -310,7 +310,7 @@ } ] }]]> - Operation.ReplaceItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.ReplaceItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReplaceItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -406,7 +406,7 @@ } ] }]]> - Operation.DeleteItemAsynckindaz.namespacedb.operationdb.namedb.cosmosdb.containerdb.cosmosdb.operation_typedb.systemdb.cosmosdb.machine_idnet.peer.namedb.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.regions_contacted + Operation.DeleteItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs index f62d89e016..b0c605839e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs @@ -48,7 +48,9 @@ public static void IsValid(Activity activity) "db.cosmosdb.request_diagnostics", "exception.type", "exception.message", - "exception.stacktrace" + "exception.stacktrace", + "db.cosmosdb.activity_id", + "db.cosmosdb.correlated_activity_id" }; foreach (KeyValuePair actualTag in activity.Tags) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs index 5e86ee7270..c46d8578b0 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs @@ -159,7 +159,6 @@ protected override void OnEventSourceCreated(EventSource eventSource) protected override void OnEventWritten(EventWrittenEventArgs eventData) { StringBuilder builder = new StringBuilder(); - Console.WriteLine(eventData.Payload[0].ToString()); builder.Append("") .Append("Ideally, this should contain request diagnostics but request diagnostics is " + "subject to change with each request as it contains few unique id. " + @@ -222,6 +221,17 @@ public override void Dispose() private string GenerateTagForBaselineTest(Activity activity) { + List tagsWithStaticValue = new List + { + "kind", + "az.namespace", + "db.operation", + "db.system", + "net.peer.name", + "db.cosmosdb.connection_mode", + "db.cosmosdb.operation_type", + "db.cosmosdb.regions_contacted" + }; StringBuilder builder = new StringBuilder(); builder.Append("") @@ -235,7 +245,16 @@ private string GenerateTagForBaselineTest(Activity activity) .Append("") .Append(tag.Key) .Append(""); + + if (tagsWithStaticValue.Contains(tag.Key)) + { + builder + .Append("") + .Append(tag.Value) + .Append(""); + } } + builder.Append(""); return builder.ToString(); @@ -246,7 +265,12 @@ public List GetRecordedAttributes() List generatedActivityTagsForBaselineXmls = new(); List collectedActivities = new List(CustomListener.CollectedActivities); - collectedActivities.ForEach(activity => generatedActivityTagsForBaselineXmls.Add(this.GenerateTagForBaselineTest(activity))); + collectedActivities.OrderBy(act => act.OperationName); + + foreach (Activity activity in collectedActivities) + { + generatedActivityTagsForBaselineXmls.Add(this.GenerateTagForBaselineTest(activity)); + } List outputList = new List(); if(generatedActivityTagsForBaselineXmls != null && generatedActivityTagsForBaselineXmls.Count > 0) From 612337cfbd445a95042457b672819e36e0a6319e Mon Sep 17 00:00:00 2001 From: Arthur Augsten Date: Wed, 11 Jan 2023 10:24:53 -0500 Subject: [PATCH 037/240] Documentation: Fixes CosmosClientBuilder.WithConnectionModeGateway parameter description (#3643) * Fixed CosmosClientBuilder.WithConnectionModeGateway documentation * Update Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs Co-authored-by: Ruben Bartelink Co-authored-by: Augsten Co-authored-by: Ruben Bartelink --- Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs index 4621e13557..d47f168764 100644 --- a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs +++ b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs @@ -438,7 +438,7 @@ internal CosmosClientBuilder WithDistributingTracing(DistributedTracingOptions o /// /// Sets the connection mode to Gateway. This is used by the client when connecting to the Azure Cosmos DB service. /// - /// The number specifies the time to wait for response to come back from network peer. Default is 60 connections + /// The number specifies the number of connections that may be opened simultaneously. Default is 50 connections /// Get or set the proxy information used for web requests. /// /// For more information, see Connection policy: Use direct connection mode. From 55f9ce8a5f07a99209b8b6a8d633d8ed15b14d5b Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Wed, 11 Jan 2023 13:07:42 -0800 Subject: [PATCH 038/240] Upgrade Resiliency: Refactors Implementation for Opening Rntbd Connections to Backend Replicas in Direct Mode. (#3640) * Code changes to refactor implementations for opening connections to all replicas. Fixed test failures due to Direct package upgrade. * Code changes to add poland central region as a part of Regions.cs * Code changes to update contract to reflect new regions. * Revert "Code changes to update contract to reflect new regions." This reverts commit f171b3c1c9889043556ddf96bcd33ccd79565ad9. * Revert "Code changes to add poland central region as a part of Regions.cs" This reverts commit 1aafbf18f6d80e9a92baa301b6b23cf065e4b155. --- Directory.Build.props | 2 +- .../src/Routing/GatewayAddressCache.cs | 46 +-- .../src/Routing/GlobalAddressResolver.cs | 24 +- .../src/Routing/IAddressCache.cs | 7 + .../CosmosHeaderTests.cs | 9 +- .../TransportWrapperTests.cs | 25 +- .../TraceWriterBaselineTests.TraceData.xml | 94 +----- .../ClientRetryPolicyTests.cs | 7 +- .../GatewayAddressCacheTests.cs | 268 +++++++++++++----- .../StoreReaderTest.cs | 2 +- ...entSideRequestStatisticsTraceDatumTests.cs | 21 +- .../Tracing/TraceTests.cs | 29 +- .../Tracing/TraceWriterBaselineTests.cs | 42 +-- 13 files changed, 266 insertions(+), 310 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 651e1f89e5..658186357b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,7 +4,7 @@ 3.31.2 3.31.2 preview - 3.29.4 + 3.30.0 2.0.0 2.0.0 preview diff --git a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs index 210e5951fe..7c6355591e 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs @@ -50,6 +50,7 @@ internal class GatewayAddressCache : IAddressCache, IDisposable private Tuple masterPartitionAddressCache; private DateTime suboptimalMasterPartitionTimestamp; private bool disposedValue; + private IOpenConnectionsHandler openConnectionsHandler; public GatewayAddressCache( Uri serviceEndpoint, @@ -57,6 +58,7 @@ public GatewayAddressCache( ICosmosAuthorizationTokenProvider tokenProvider, IServiceConfigurationReader serviceConfigReader, CosmosHttpClient httpClient, + IOpenConnectionsHandler openConnectionsHandler, long suboptimalPartitionForceRefreshIntervalInSeconds = 600, bool enableTcpConnectionEndpointRediscovery = false) { @@ -80,6 +82,8 @@ public GatewayAddressCache( GatewayAddressCache.protocolFilterFormat, Constants.Properties.Protocol, GatewayAddressCache.ProtocolString(this.protocol)); + + this.openConnectionsHandler = openConnectionsHandler; } public Uri ServiceEndpoint => this.serviceEndpoint; @@ -88,7 +92,7 @@ public async Task OpenConnectionsAsync( string databaseName, ContainerProperties collection, IReadOnlyList partitionKeyRangeIdentities, - Func openConnectionHandler, + bool shouldOpenRntbdChannels, CancellationToken cancellationToken) { List>> tasks = new (); @@ -157,47 +161,21 @@ public async Task OpenConnectionsAsync( new PartitionKeyRangeIdentity(collection.ResourceId, addressInfo.Item1.PartitionKeyRangeId), addressInfo.Item2); - if (openConnectionHandler != null) + if (this.openConnectionsHandler != null && shouldOpenRntbdChannels) { - await this.OpenRntbdChannelsAsync( - addressInfo, - openConnectionHandler); + await this.openConnectionsHandler + .TryOpenRntbdChannelsAsync( + addresses: addressInfo.Item2.Get(Protocol.Tcp)?.ReplicaTransportAddressUris); } } } } } - /// - /// Invokes the transport client delegate to open the Rntbd connection - /// and establish Rntbd context negotiation to the backend replica nodes. - /// - /// An instance of containing the partition key id - /// and it's corresponding address information. - /// The transport client callback delegate to be invoked at a - /// later point of time. - private async Task OpenRntbdChannelsAsync( - Tuple addressInfo, - Func openConnectionHandlerAsync) + /// + public void SetOpenConnectionsHandler(IOpenConnectionsHandler openConnectionsHandler) { - foreach (AddressInformation address in addressInfo.Item2.AllAddresses) - { - DefaultTrace.TraceVerbose("Attempting to open Rntbd connection to backend uri: {0}. '{1}'", - address.PhysicalUri, - System.Diagnostics.Trace.CorrelationManager.ActivityId); - try - { - await openConnectionHandlerAsync( - new Uri(address.PhysicalUri)); - } - catch (Exception ex) - { - DefaultTrace.TraceWarning("Failed to open Rntbd connection to backend uri: {0} with exception: {1}. '{2}'", - address.PhysicalUri, - ex, - System.Diagnostics.Trace.CorrelationManager.ActivityId); - } - } + this.openConnectionsHandler = openConnectionsHandler; } public async Task TryGetAddressesAsync( diff --git a/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs b/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs index 4e31b0fb40..51a6c6d2f3 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs @@ -39,6 +39,7 @@ internal sealed class GlobalAddressResolver : IAddressResolverExtension, IDispos private readonly CosmosHttpClient httpClient; private readonly ConcurrentDictionary addressCacheByEndpoint; private readonly bool enableTcpConnectionEndpointRediscovery; + private IOpenConnectionsHandler openConnectionsHandler; public GlobalAddressResolver( GlobalEndpointManager endpointManager, @@ -108,7 +109,7 @@ public async Task OpenAsync( databaseName: databaseName, collection: collection, partitionKeyRangeIdentities: ranges, - openConnectionHandler: null, + shouldOpenRntbdChannels: false, cancellationToken: cancellationToken)); } @@ -116,16 +117,14 @@ public async Task OpenAsync( } /// - /// Invokes the gateway address cache and passes the deligate to be invoked from the same. + /// Invokes the gateway address cache to open the rntbd connections to the backend replicas. /// /// A string containing the name of the database. /// A string containing the container's link uri. - /// The transport client callback delegate to be invoked at a later point of time. /// An Instance of the . public async Task OpenConnectionsToAllReplicasAsync( string databaseName, string containerLinkUri, - Func openConnectionHandlerAsync, CancellationToken cancellationToken = default) { try @@ -180,7 +179,7 @@ await this.addressCacheByEndpoint[firstPreferredReadRegion] databaseName: databaseName, collection: collection, partitionKeyRangeIdentities: partitionKeyRangeIdentities, - openConnectionHandler: openConnectionHandlerAsync, + shouldOpenRntbdChannels: true, cancellationToken: cancellationToken); } @@ -197,6 +196,20 @@ await this.addressCacheByEndpoint[firstPreferredReadRegion] } } + /// + public void SetOpenConnectionsHandler(IOpenConnectionsHandler openConnectionsHandler) + { + this.openConnectionsHandler = openConnectionsHandler; + + // Sets the openConnectionsHandler for the existing address cache. + // For the new address caches added later, the openConnectionsHandler + // will be set through the constructor. + foreach (EndpointCache endpointCache in this.addressCacheByEndpoint.Values) + { + endpointCache.AddressCache.SetOpenConnectionsHandler(openConnectionsHandler); + } + } + public async Task ResolveAsync( DocumentServiceRequest request, bool forceRefresh, @@ -284,6 +297,7 @@ private EndpointCache GetOrAddEndpoint(Uri endpoint) this.tokenProvider, this.serviceConfigReader, this.httpClient, + this.openConnectionsHandler, enableTcpConnectionEndpointRediscovery: this.enableTcpConnectionEndpointRediscovery); string location = this.endpointManager.GetLocation(endpoint); diff --git a/Microsoft.Azure.Cosmos/src/Routing/IAddressCache.cs b/Microsoft.Azure.Cosmos/src/Routing/IAddressCache.cs index e8a6ade3ba..35d10fa622 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/IAddressCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/IAddressCache.cs @@ -29,5 +29,12 @@ Task TryGetAddressesAsync( ServiceIdentity serviceIdentity, bool forceRefreshPartitionAddresses, CancellationToken cancellationToken); + + /// + /// Sets the instance to a global readonly + /// field for invoking the open connection request at a later point of time. + /// + /// An instance of . + void SetOpenConnectionsHandler(IOpenConnectionsHandler openConnectionsHandler); } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs index 95501d0b91..4bc35b105c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosHeaderTests.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests { using System; using System.Collections.Generic; + using System.Linq; using System.Net; using System.Reflection; using System.Threading; @@ -102,13 +103,13 @@ public override async Task SendAsync(RequestMessage request, Ca private void ValidateLazyHeadersAreNotCreated(CosmosMessageHeadersInternal internalHeaders) { RequestNameValueCollection storeRequestHeaders = (RequestNameValueCollection)internalHeaders.INameValueCollection; - FieldInfo lazyHeaders = typeof(Documents.Collections.RequestNameValueCollection).GetField("lazyNotCommonHeaders", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); - Lazy> lazyNotCommonHeaders = (Lazy>)lazyHeaders.GetValue(storeRequestHeaders); + FieldInfo fieldInfo = storeRequestHeaders.GetType().GetField("notCommonHeaders", BindingFlags.Instance | BindingFlags.NonPublic); + Dictionary notCommonHeaders = (Dictionary)fieldInfo.GetValue(storeRequestHeaders); // Use the if instead of Assert.IsFalse to avoid creating the dictionary in the error message - if (lazyNotCommonHeaders.IsValueCreated) + if (notCommonHeaders != null && notCommonHeaders.Any()) { - Assert.Fail($"The lazy dictionary should not be created. Please add the following headers to the {nameof(Documents.Collections.RequestNameValueCollection)}: {JsonConvert.SerializeObject(lazyNotCommonHeaders.Value)}"); + Assert.Fail($"The lazy dictionary should not be created. Please add the following headers to the {nameof(Documents.Collections.RequestNameValueCollection)}: {JsonConvert.SerializeObject(notCommonHeaders)}"); } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/TransportWrapperTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/TransportWrapperTests.cs index d90e23a397..720f37375c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/TransportWrapperTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/TransportWrapperTests.cs @@ -144,33 +144,10 @@ private static void ThrowTransportExceptionOnItemOperation( userPayload: true, payloadSent: false); - DocumentClientException documentClientException = new DocumentClientException( - message: "Exception", - innerException: transportException, - statusCode: System.Net.HttpStatusCode.Gone); IClientSideRequestStatistics requestStatistics = request.RequestContext.ClientRequestStatistics; requestStatistics.RecordResponse( request, - new StoreResult( - storeResponse: null, - exception: documentClientException, - partitionKeyRangeId: "PkRange", - lsn: 42, - quorumAckedLsn: 4242, - requestCharge: 9000.42, - currentReplicaSetSize: 3, - currentWriteQuorum: 4, - isValid: true, - storePhysicalAddress: physicalAddress, - globalCommittedLSN: 2, - numberOfReadRegions: 1, - itemLSN: 5, - sessionToken: null, - usingLocalLSN: true, - activityId: Guid.NewGuid().ToString(), - backendRequestDurationInMs: "0", - retryAfterInMs: "42", - transportRequestStats: new TransportRequestStats()), + StoreResult.CreateForTesting(transportRequestStats: new TransportRequestStats()).Target, DateTime.MinValue, DateTime.MaxValue); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml index f38fc77bb8..96c67772e6 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml @@ -214,26 +214,7 @@ StoreResponseStatistics storeResponseStatistics = new StoreResponseStatistics( DateTime.MinValue, DateTime.MaxValue, - new Documents.StoreResult( - storeResponse: new StoreResponse(), - exception: null, - partitionKeyRangeId: 42.ToString(), - lsn: 1337, - quorumAckedLsn: 23, - requestCharge: 3.14, - currentReplicaSetSize: 4, - currentWriteQuorum: 3, - isValid: true, - storePhysicalAddress: new Uri("http://storephysicaladdress.com"), - globalCommittedLSN: 1234, - numberOfReadRegions: 13, - itemLSN: 15, - sessionToken: new SimpleSessionToken(42), - usingLocalLSN: true, - activityId: Guid.Empty.ToString(), - backendRequestDurationInMs: "4.2", - retryAfterInMs: "42", - transportRequestStats: TraceWriterBaselineTests.CreateTransportRequestStats()), + StoreResult.CreateForTesting(transportRequestStats: TraceWriterBaselineTests.CreateTransportRequestStats()).Target, ResourceType.Document, OperationType.Query, "42", @@ -357,7 +338,7 @@ "IsValid": true, "StorePhysicalAddress": "http://storephysicaladdress.com/", "RequestCharge": 3.14, - "RetryAfterInMs": "42", + "RetryAfterInMs": "9000", "BELatencyInMs": "4.2", "transportRequestTimeline": { "requestTimeline": [ @@ -439,26 +420,7 @@ StoreResponseStatistics storeResponseStatistics = new StoreResponseStatistics( requestStartTime: default, requestResponseTime: default, - new Documents.StoreResult( - storeResponse: new StoreResponse(), - exception: default, - partitionKeyRangeId: default, - lsn: default, - quorumAckedLsn: default, - requestCharge: default, - currentReplicaSetSize: default, - currentWriteQuorum: default, - isValid: default, - storePhysicalAddress: default, - globalCommittedLSN: default, - numberOfReadRegions: default, - itemLSN: default, - sessionToken: default, - usingLocalLSN: default, - activityId: default, - retryAfterInMs: default, - backendRequestDurationInMs: default, - transportRequestStats: TraceWriterBaselineTests.CreateTransportRequestStats()), + StoreResult.CreateForTesting(storeResponse: new StoreResponse()).Target, resourceType: default, operationType: default, requestSessionToken: default, @@ -567,55 +529,7 @@ "RequestCharge": 0, "RetryAfterInMs": null, "BELatencyInMs": null, - "transportRequestTimeline": { - "requestTimeline": [ - { - "event": "Created", - "startTimeUtc": "2021-12-31T23:59:59.059Z", - "durationInMs": 1 - }, - { - "event": "ChannelAcquisitionStarted", - "startTimeUtc": "2021-12-31T23:59:59.06Z", - "durationInMs": 0 - }, - { - "event": "Pipelined", - "startTimeUtc": "2021-12-31T23:59:59.06Z", - "durationInMs": 0 - }, - { - "event": "Transit Time", - "startTimeUtc": "2021-12-31T23:59:59.06Z", - "durationInMs": 0 - }, - { - "event": "Received", - "startTimeUtc": "2021-12-31T23:59:59.06Z", - "durationInMs": 0 - }, - { - "event": "Completed", - "startTimeUtc": "2021-12-31T23:59:59.06Z", - "durationInMs": 0 - } - ], - "serviceEndpointStats": { - "inflightRequests": 2, - "openConnections": 1 - }, - "connectionStats": { - "waitforConnectionInit": "True", - "callsPendingReceive": 1, - "lastSendAttempt": "2021-12-31T23:59:59.059Z", - "lastSend": "2021-12-31T23:59:59.059Z", - "lastReceive": "2021-12-31T23:59:59.059Z" - }, - "requestSizeInBytes": 2, - "requestBodySizeInBytes": 1, - "responseMetadataSizeInBytes": 1, - "responseBodySizeInBytes": 1 - }, + "transportRequestTimeline": null, "TransportException": null } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientRetryPolicyTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientRetryPolicyTests.cs index 7faeba2a35..a41f08afa1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientRetryPolicyTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientRetryPolicyTests.cs @@ -521,7 +521,6 @@ public Task UpdateAsync(IReadOnlyList addressCacheTokens, Can public Task OpenConnectionsToAllReplicasAsync( string databaseName, string containerLinkUri, - Func openConnectionHandlerAsync, CancellationToken cancellationToken = default) { throw new NotImplementedException(); @@ -531,6 +530,12 @@ public Task UpdateAsync(Documents.Rntbd.ServerKey serverKey, CancellationToken c { throw new NotImplementedException(); } + + public void SetOpenConnectionsHandler( + IOpenConnectionsHandler openConnectionHandler) + { + throw new NotImplementedException(); + } } private class MockTransportClient : TransportClient diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs index 46dbbc609e..3954b4ae8f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs @@ -81,6 +81,7 @@ public void TestGatewayAddressCacheAutoRefreshOnSuboptimalPartition() this.mockTokenProvider.Object, this.mockServiceConfigReader.Object, MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), + openConnectionsHandler: null, suboptimalPartitionForceRefreshIntervalInSeconds: 2); int initialAddressesCount = cache.TryGetAddressesAsync( @@ -116,6 +117,7 @@ public async Task TestGatewayAddressCacheUpdateOnConnectionResetAsync() this.mockTokenProvider.Object, this.mockServiceConfigReader.Object, MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), + openConnectionsHandler: null, suboptimalPartitionForceRefreshIntervalInSeconds: 2, enableTcpConnectionEndpointRediscovery: true); @@ -173,6 +175,7 @@ public async Task TestGatewayAddressCacheAvoidCacheRefresWhenAlreadyUpdatedAsync this.mockTokenProvider.Object, this.mockServiceConfigReader.Object, MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), + openConnectionsHandler: null, suboptimalPartitionForceRefreshIntervalInSeconds: 2, enableTcpConnectionEndpointRediscovery: true); @@ -224,7 +227,6 @@ public async Task TestGatewayAddressCacheAvoidCacheRefresWhenAlreadyUpdatedAsync mockHttpHandler.VerifyAll(); } - [TestMethod] [Timeout(2000)] public void GlobalAddressResolverUpdateAsyncSynchronizationTest() @@ -287,6 +289,7 @@ public async Task GatewayAddressCacheInNetworkRequestTestAsync() this.mockTokenProvider.Object, this.mockServiceConfigReader.Object, MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), + openConnectionsHandler: null, suboptimalPartitionForceRefreshIntervalInSeconds: 2, enableTcpConnectionEndpointRediscovery: true); @@ -323,15 +326,15 @@ public async Task GatewayAddressCacheInNetworkRequestTestAsync() /// /// Test to validate that when is called with a - /// valid open connection handler callback delegate, the delegate method is indeed invoked. + /// valid open connection handler, the handler method is indeed invoked. /// [TestMethod] [Owner("dkunda")] - public async Task OpenConnectionsAsync_WithValidOpenConnectionHandlerDelegate_ShouldInvokeDelegateMethod() + public async Task OpenConnectionsAsync_WithValidOpenConnectionHandler_ShouldInvokeHandlerMethod() { // Arrange. FakeMessageHandler messageHandler = new (); - FakeTransportClient transportClient = new (shouldFailTransport: false); + FakeOpenConnectionHandler fakeOpenConnectionHandler = new (failingIndexes: new HashSet()); ContainerProperties containerProperties = ContainerProperties.CreateWithResourceId("ccZ1ANCszwk="); containerProperties.Id = "TestId"; containerProperties.PartitionKeyPath = "/pk"; @@ -346,6 +349,7 @@ public async Task OpenConnectionsAsync_WithValidOpenConnectionHandlerDelegate_Sh this.mockTokenProvider.Object, this.mockServiceConfigReader.Object, MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), + openConnectionsHandler: fakeOpenConnectionHandler, suboptimalPartitionForceRefreshIntervalInSeconds: 2); // Act. @@ -356,26 +360,30 @@ await cache.OpenConnectionsAsync( { this.testPartitionKeyRangeIdentity }, - openConnectionHandler: transportClient.OpenConnectionAsync, + shouldOpenRntbdChannels: true, cancellationToken: CancellationToken.None); // Assert. - Assert.AreEqual(0, transportClient.GetExceptionCount()); - Assert.AreEqual(3, transportClient.GetSuccessfulInvocationCount()); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedExceptionCount: 0, + expectedMethodInvocationCount: 1, + expectedReceivedAddressesCount: 3, + expectedSuccessCount: 3); } /// /// Test to validate that when is invoked with a - /// open connection handler callback delegate that throws an exception, the delegate method is indeed invoked + /// open connection handler that throws an exception, the handler method is indeed invoked /// and the exception is handled in such a way that the cosmos client initialization does not fail. /// [TestMethod] [Owner("dkunda")] - public async Task OpenConnectionsAsync_WhenConnectionHandlerDelegateThrowsException_ShouldNotFailInitialization() + public async Task OpenConnectionsAsync_WhenConnectionHandlerThrowsException_ShouldNotFailInitialization() { // Arrange. FakeMessageHandler messageHandler = new (); - FakeTransportClient transportClient = new (shouldFailTransport: true); + FakeOpenConnectionHandler fakeOpenConnectionHandler = new(failingIndexes: new HashSet() { 0, 1, 2}); ContainerProperties containerProperties = ContainerProperties.CreateWithResourceId("ccZ1ANCszwk="); containerProperties.Id = "TestId"; containerProperties.PartitionKeyPath = "/pk"; @@ -387,6 +395,7 @@ public async Task OpenConnectionsAsync_WhenConnectionHandlerDelegateThrowsExcept this.mockTokenProvider.Object, this.mockServiceConfigReader.Object, MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), + openConnectionsHandler: fakeOpenConnectionHandler, suboptimalPartitionForceRefreshIntervalInSeconds: 2); // Act. @@ -397,26 +406,30 @@ await cache.OpenConnectionsAsync( { this.testPartitionKeyRangeIdentity }, - openConnectionHandler: transportClient.OpenConnectionAsync, + shouldOpenRntbdChannels: true, cancellationToken: CancellationToken.None); // Assert. - Assert.AreEqual(3, transportClient.GetExceptionCount()); - Assert.AreEqual(0, transportClient.GetSuccessfulInvocationCount()); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedExceptionCount: 3, + expectedMethodInvocationCount: 1, + expectedReceivedAddressesCount: 3, + expectedSuccessCount: 0); } /// /// Test to validate that when is invoked with a null - /// open connection handler callback delegate, the delegate is never invoked, thus no attempt to open connection + /// open connection handler, the handler method is never invoked, thus no attempt to open connections /// to the backend replica happens. /// [TestMethod] [Owner("dkunda")] - public async Task OpenConnectionsAsync_WithNullOpenConnectionHandlerDelegate_ShouldNotInvokeDelegateMethod() + public async Task OpenConnectionsAsync_WithNullOpenConnectionHandler_ShouldNotInvokeHandlerMethod() { // Arrange. FakeMessageHandler messageHandler = new (); - FakeTransportClient transportClient = new(shouldFailTransport: false); + FakeOpenConnectionHandler fakeOpenConnectionHandler = new (failingIndexes: new HashSet()); ContainerProperties containerProperties = ContainerProperties.CreateWithResourceId("ccZ1ANCszwk="); containerProperties.Id = "TestId"; containerProperties.PartitionKeyPath = "/pk"; @@ -431,6 +444,7 @@ public async Task OpenConnectionsAsync_WithNullOpenConnectionHandlerDelegate_Sho this.mockTokenProvider.Object, this.mockServiceConfigReader.Object, MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), + openConnectionsHandler: null, suboptimalPartitionForceRefreshIntervalInSeconds: 2); // Act. @@ -441,25 +455,29 @@ await cache.OpenConnectionsAsync( { this.testPartitionKeyRangeIdentity }, - openConnectionHandler: null, + shouldOpenRntbdChannels: true, cancellationToken: CancellationToken.None); // Assert. - Assert.AreEqual(0, transportClient.GetExceptionCount()); - Assert.AreEqual(0, transportClient.GetSuccessfulInvocationCount()); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedExceptionCount: 0, + expectedMethodInvocationCount: 0, + expectedReceivedAddressesCount: 0, + expectedSuccessCount: 0); } /// /// Test to validate that when is called with a - /// valid open connection handler callback delegate, the delegate method is indeed invoked and an attempt is made to open + /// valid open connection handler, the handler method is indeed invoked and an attempt is made to open /// the connections to the backend replicas. /// [TestMethod] [Owner("dkunda")] - public async Task GlobalAddressResolver_OpenConnectionsToAllReplicasAsync_WithValidHandlerDelegate_ShouldOpenConnectionsToBackend() + public async Task GlobalAddressResolver_OpenConnectionsToAllReplicasAsync_WithValidHandler_ShouldOpenConnectionsToBackend() { // Arrange. - FakeTransportClient transportClient = new (shouldFailTransport: false); + FakeOpenConnectionHandler fakeOpenConnectionHandler = new (failingIndexes: new HashSet()); UserAgentContainer container = new (clientId: 0); FakeMessageHandler messageHandler = new (); AccountProperties databaseAccount = new (); @@ -509,29 +527,35 @@ public async Task GlobalAddressResolver_OpenConnectionsToAllReplicasAsync_WithVa connectionPolicy: connectionPolicy, httpClient: MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(messageHandler))); + globalAddressResolver.SetOpenConnectionsHandler( + openConnectionsHandler: fakeOpenConnectionHandler); + // Act. await globalAddressResolver.OpenConnectionsToAllReplicasAsync( databaseName: "test-db", containerLinkUri: "https://test.uri.cosmos.com", - openConnectionHandlerAsync: transportClient.OpenConnectionAsync, CancellationToken.None); // Assert. - Assert.AreEqual(0, transportClient.GetExceptionCount()); - Assert.AreEqual(3, transportClient.GetSuccessfulInvocationCount()); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedExceptionCount: 0, + expectedMethodInvocationCount: 1, + expectedReceivedAddressesCount: 3, + expectedSuccessCount: 3); } /// /// Test to validate that when is called with a - /// open connection handler callback delegate that throws an exception, the delegate method is indeed invoked and the - /// exception is handled in such a way that the cosmos client initialization does not fail. + /// open connection handler that throws an exception, the handler method is indeed invoked and the exception is handled + /// in such a way that the cosmos client initialization does not fail. /// [TestMethod] [Owner("dkunda")] public async Task GlobalAddressResolver_OpenConnectionsToAllReplicasAsync_WhenHandlerDelegateThrowsException_ShouldNotFailInitialization() { // Arrange. - FakeTransportClient transportClient = new(shouldFailTransport: true); + FakeOpenConnectionHandler fakeOpenConnectionHandler = new (failingIndexes: new HashSet() { 0, 2}); UserAgentContainer container = new(clientId: 0); FakeMessageHandler messageHandler = new(); AccountProperties databaseAccount = new(); @@ -581,16 +605,22 @@ public async Task GlobalAddressResolver_OpenConnectionsToAllReplicasAsync_WhenHa connectionPolicy: connectionPolicy, httpClient: MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(messageHandler))); + globalAddressResolver.SetOpenConnectionsHandler( + openConnectionsHandler: fakeOpenConnectionHandler); + // Act. await globalAddressResolver.OpenConnectionsToAllReplicasAsync( databaseName: "test-db", containerLinkUri: "https://test.uri.cosmos.com", - openConnectionHandlerAsync: transportClient.OpenConnectionAsync, CancellationToken.None); // Assert. - Assert.AreEqual(3, transportClient.GetExceptionCount()); - Assert.AreEqual(0, transportClient.GetSuccessfulInvocationCount()); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedExceptionCount: 2, + expectedMethodInvocationCount: 1, + expectedReceivedAddressesCount: 3, + expectedSuccessCount: 1); } /// @@ -603,7 +633,7 @@ await globalAddressResolver.OpenConnectionsToAllReplicasAsync( public async Task GlobalAddressResolver_OpenConnectionsToAllReplicasAsync_WhenInternalExceptionThrownApartFromTransportError_ShouldThrowException() { // Arrange. - FakeTransportClient transportClient = new(shouldFailTransport: false); + FakeOpenConnectionHandler fakeOpenConnectionHandler = new (failingIndexes: new HashSet()); UserAgentContainer container = new(clientId: 0); FakeMessageHandler messageHandler = new(); AccountProperties databaseAccount = new(); @@ -664,18 +694,24 @@ public async Task GlobalAddressResolver_OpenConnectionsToAllReplicasAsync_WhenIn connectionPolicy: connectionPolicy, httpClient: MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(messageHandler))); + globalAddressResolver.SetOpenConnectionsHandler( + openConnectionsHandler: fakeOpenConnectionHandler); + // Act. Exception ex = await Assert.ThrowsExceptionAsync(() => globalAddressResolver.OpenConnectionsToAllReplicasAsync( databaseName: "test-db", containerLinkUri: "https://test.uri.cosmos.com", - openConnectionHandlerAsync: transportClient.OpenConnectionAsync, CancellationToken.None)); // Assert. Assert.IsNotNull(ex); Assert.AreEqual(exceptionMessage, ex.Message); - Assert.AreEqual(0, transportClient.GetExceptionCount()); - Assert.AreEqual(0, transportClient.GetSuccessfulInvocationCount()); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedExceptionCount: 0, + expectedMethodInvocationCount: 0, + expectedReceivedAddressesCount: 0, + expectedSuccessCount: 0); } /// @@ -688,7 +724,7 @@ public async Task GlobalAddressResolver_OpenConnectionsToAllReplicasAsync_WhenIn public async Task GlobalAddressResolver_OpenConnectionsToAllReplicasAsync_WhenNullCollectionReturned_ShouldThrowException() { // Arrange. - FakeTransportClient transportClient = new (shouldFailTransport: false); + FakeOpenConnectionHandler fakeOpenConnectionHandler = new (failingIndexes: new HashSet()); UserAgentContainer container = new (clientId: 0); FakeMessageHandler messageHandler = new (); AccountProperties databaseAccount = new (); @@ -734,33 +770,39 @@ public async Task GlobalAddressResolver_OpenConnectionsToAllReplicasAsync_WhenNu connectionPolicy: connectionPolicy, httpClient: MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(messageHandler))); + globalAddressResolver.SetOpenConnectionsHandler( + openConnectionsHandler: fakeOpenConnectionHandler); + // Act. CosmosException ce = await Assert.ThrowsExceptionAsync(() => globalAddressResolver.OpenConnectionsToAllReplicasAsync( databaseName: "test-db", containerLinkUri: "https://test.uri.cosmos.com", - openConnectionHandlerAsync: transportClient.OpenConnectionAsync, CancellationToken.None)); // Assert. Assert.IsNotNull(ce); Assert.IsTrue(ce.Message.Contains("Could not resolve the collection")); - Assert.AreEqual(0, transportClient.GetExceptionCount()); - Assert.AreEqual(0, transportClient.GetSuccessfulInvocationCount()); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedExceptionCount: 0, + expectedMethodInvocationCount: 0, + expectedReceivedAddressesCount: 0, + expectedSuccessCount: 0); } /// /// Test to validate that when is called with a - /// valid open connection handler callback delegate and some of the address resolving fails with exception, - /// then the GatewayAddressCache should ignore the failed addresses and the delegate method is indeed invoked + /// valid open connection handler and some of the address resolving fails with exception, then the + /// GatewayAddressCache should ignore the failed addresses and the handler method is indeed invoked /// for all resolved addresses. /// [TestMethod] [Owner("dkunda")] - public async Task OpenConnectionsAsync_WhenSomeAddressResolvingFailsWithException_ShouldIgnoreExceptionsAndInvokeDelegateMethodForOtherAddresses() + public async Task OpenConnectionsAsync_WhenSomeAddressResolvingFailsWithException_ShouldIgnoreExceptionsAndInvokeHandlerMethodForOtherAddresses() { // Arrange. FakeMessageHandler messageHandler = new (); - FakeTransportClient transportClient = new (shouldFailTransport: false); + FakeOpenConnectionHandler fakeOpenConnectionHandler = new (failingIndexes: new HashSet()); ContainerProperties containerProperties = ContainerProperties.CreateWithResourceId("ccZ1ANCszwk="); containerProperties.Id = "TestId"; containerProperties.PartitionKeyPath = "/pk"; @@ -810,6 +852,7 @@ public async Task OpenConnectionsAsync_WhenSomeAddressResolvingFailsWithExceptio this.mockTokenProvider.Object, this.mockServiceConfigReader.Object, mockHttpClient.Object, + openConnectionsHandler: fakeOpenConnectionHandler, suboptimalPartitionForceRefreshIntervalInSeconds: 2); // Act. @@ -817,12 +860,38 @@ await cache.OpenConnectionsAsync( databaseName: "test-database", collection: containerProperties, partitionKeyRangeIdentities: partitionKeyRangeIdentities, - openConnectionHandler: transportClient.OpenConnectionAsync, + shouldOpenRntbdChannels: true, cancellationToken: CancellationToken.None); // Assert. - Assert.AreEqual(0, transportClient.GetExceptionCount()); - Assert.AreEqual(addresses.Count, transportClient.GetSuccessfulInvocationCount()); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedExceptionCount: 0, + expectedMethodInvocationCount: 1, + expectedReceivedAddressesCount: addresses.Count, + expectedSuccessCount: addresses.Count); + } + + /// + /// Helper method to assert on the class attributes + /// to match with that of the expected ones. + /// + /// An instance of the . + /// The expected exception count for the test. + /// The expected method invocation count for the test. + /// The expected received addresses count for the test. + /// The expected successful messages count for the test. + private static void AssertOpenConnectionHandlerAttributes( + FakeOpenConnectionHandler fakeOpenConnectionHandler, + int expectedExceptionCount, + int expectedMethodInvocationCount, + int expectedReceivedAddressesCount, + int expectedSuccessCount) + { + Assert.AreEqual(expectedExceptionCount, fakeOpenConnectionHandler.GetExceptionCount()); + Assert.AreEqual(expectedMethodInvocationCount, fakeOpenConnectionHandler.GetMethodInvocationCount()); + Assert.AreEqual(expectedReceivedAddressesCount, fakeOpenConnectionHandler.GetReceivedAddressesCount()); + Assert.AreEqual(expectedSuccessCount, fakeOpenConnectionHandler.GetSuccessfulInvocationCount()); } private class FakeMessageHandler : HttpMessageHandler @@ -911,44 +980,111 @@ public override void Post(SendOrPostCallback d, object state) } } - public class FakeTransportClient + public class FakeOpenConnectionHandler : IOpenConnectionsHandler { private int exceptionCounter = 0; + private int methodInvocationCounter = 0; private int successInvocationCounter = 0; - private readonly bool shouldFailTransport; + private int totalReceivedAddressesCounter = 0; + private readonly HashSet failingIndexes; + private readonly bool useAttemptBasedFailingIndexs; + private readonly ManualResetEvent manualResetEvent; + private readonly Dictionary> failIndexesByAttempts; + + public FakeOpenConnectionHandler( + HashSet failingIndexes, + ManualResetEvent manualResetEvent = null) + { + this.failingIndexes = failingIndexes; + this.manualResetEvent = manualResetEvent; + } + + public FakeOpenConnectionHandler( + Dictionary> failIndexesByAttempts, + ManualResetEvent manualResetEvent = null) + { + this.useAttemptBasedFailingIndexs = true; + this.failIndexesByAttempts = failIndexesByAttempts; + this.manualResetEvent = manualResetEvent; + } + + public int GetSuccessfulInvocationCount() + { + return this.successInvocationCounter; + } + + public int GetExceptionCount() + { + return this.exceptionCounter; + } - public FakeTransportClient(bool shouldFailTransport) + public int GetReceivedAddressesCount() { - this.shouldFailTransport = shouldFailTransport; + return this.totalReceivedAddressesCounter; } - public Task OpenConnectionAsync(Uri physicalAddress) + public int GetMethodInvocationCount() { - if (this.shouldFailTransport) + return this.methodInvocationCounter; + } + + Task IOpenConnectionsHandler.TryOpenRntbdChannelsAsync( + IReadOnlyList addresses) + { + this.totalReceivedAddressesCounter = addresses.Count; + for (int i = 0; i < addresses.Count; i++) { - this.exceptionCounter++; - throw new TransportException( - errorCode: TransportErrorCode.ConnectionBroken, - innerException: new Exception("Transport Error Occurred."), - activityId: Guid.NewGuid(), - requestUri: physicalAddress, - sourceDescription: "SourceDescription", - userPayload: true, - payloadSent: false); + if (this.useAttemptBasedFailingIndexs) + { + if (this.failIndexesByAttempts.ContainsKey(i) && this.failIndexesByAttempts[i].Contains(this.methodInvocationCounter)) + { + this.ExecuteFailureCondition( + addresses: addresses, + index: i); + } + else + { + this.ExecuteSuccessCondition( + addresses: addresses, + index: i); + } + } + else + { + if (this.failingIndexes.Contains(i)) + { + this.ExecuteFailureCondition( + addresses: addresses, + index: i); + } + else + { + this.ExecuteSuccessCondition( + addresses: addresses, + index: i); + } + } } - this.successInvocationCounter++; + this.methodInvocationCounter++; + this.manualResetEvent?.Set(); return Task.CompletedTask; } - public int GetSuccessfulInvocationCount() + private void ExecuteSuccessCondition( + IReadOnlyList addresses, + int index) { - return this.successInvocationCounter; + addresses[index].SetConnected(); + this.successInvocationCounter++; } - public int GetExceptionCount() + private void ExecuteFailureCondition( + IReadOnlyList addresses, + int index) { - return this.exceptionCounter; + addresses[index].SetUnhealthy(); + this.exceptionCounter++; } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/StoreReaderTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/StoreReaderTest.cs index 7251848ea7..b92ca3c804 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/StoreReaderTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/StoreReaderTest.cs @@ -541,7 +541,7 @@ public void StoreReaderBarrierTest() // reads always go to read quorum (2) replicas int replicaCountToRead = 2; - IList result = storeReader.ReadMultipleReplicaAsync( + IList> result = storeReader.ReadMultipleReplicaAsync( entity, false /*includePrimary*/, replicaCountToRead, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ClientSideRequestStatisticsTraceDatumTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ClientSideRequestStatisticsTraceDatumTests.cs index aac19174c9..2ec6e9db62 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ClientSideRequestStatisticsTraceDatumTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ClientSideRequestStatisticsTraceDatumTests.cs @@ -21,26 +21,7 @@ public class ClientSideRequestStatisticsTraceDatumTests private static readonly HttpRequestMessage request = new HttpRequestMessage(); private static readonly Uri uri = new Uri("http://someUri1.com"); private static readonly DocumentServiceRequest requestDsr = DocumentServiceRequest.Create(OperationType.Read, resourceType: ResourceType.Document, authorizationTokenType: AuthorizationTokenType.PrimaryMasterKey); - private static readonly StoreResult storeResult = new Documents.StoreResult( - storeResponse: new StoreResponse(), - exception: null, - partitionKeyRangeId: 42.ToString(), - lsn: 1337, - quorumAckedLsn: 23, - requestCharge: 3.14, - currentReplicaSetSize: 4, - currentWriteQuorum: 3, - isValid: true, - storePhysicalAddress: new Uri("http://storephysicaladdress.com"), - globalCommittedLSN: 1234, - numberOfReadRegions: 13, - itemLSN: 15, - sessionToken: new SimpleSessionToken(42), - usingLocalLSN: true, - activityId: Guid.Empty.ToString(), - backendRequestDurationInMs: "4.2", - retryAfterInMs: "42", - transportRequestStats: TraceWriterBaselineTests.CreateTransportRequestStats()); + private static readonly StoreResult storeResult = StoreResult.CreateForTesting(storeResponse: new StoreResponse()).Target; /// /// This test is needed because different parts of the SDK use the same ClientSideRequestStatisticsTraceDatum across multiple diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs index 3a883d2456..f747d35d22 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs @@ -100,31 +100,12 @@ public void ValidateStoreResultSerialization() ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()); trace.AddDatum(datumKey, datum); - StoreResult storeResult = new StoreResult( - storeResponse: new StoreResponse(), - exception: null, - partitionKeyRangeId: 42.ToString(), - lsn: 1337, - quorumAckedLsn: 23, - requestCharge: 3.14, - currentReplicaSetSize: 4, - currentWriteQuorum: 3, - isValid: true, - storePhysicalAddress: new Uri("http://storephysicaladdress.com"), - globalCommittedLSN: 1234, - numberOfReadRegions: 13, - itemLSN: 15, - sessionToken: new SimpleSessionToken(42), - usingLocalLSN: true, - activityId: Guid.Empty.ToString(), - backendRequestDurationInMs: "4.2", - retryAfterInMs: "42", - transportRequestStats: TraceWriterBaselineTests.CreateTransportRequestStats()); + ReferenceCountedDisposable storeResult = StoreResult.CreateForTesting(storeResponse: new StoreResponse()); StoreResponseStatistics storeResponseStatistics = new StoreResponseStatistics( DateTime.MinValue, DateTime.MaxValue, - storeResult, + storeResult.Target, ResourceType.Document, OperationType.Query, "42", @@ -139,11 +120,11 @@ public void ValidateStoreResultSerialization() List jsonPropertyNames = storeResultJObject.Properties().Select(p => p.Name).ToList(); storeResultProperties.Add("BELatencyInMs"); - storeResultProperties.Remove(nameof(storeResult.BackendRequestDurationInMs)); + storeResultProperties.Remove(nameof(storeResult.Target.BackendRequestDurationInMs)); storeResultProperties.Add("TransportException"); - storeResultProperties.Remove(nameof(storeResult.Exception)); + storeResultProperties.Remove(nameof(storeResult.Target.Exception)); storeResultProperties.Add("transportRequestTimeline"); - storeResultProperties.Remove(nameof(storeResult.TransportRequestStats)); + storeResultProperties.Remove(nameof(storeResult.Target.TransportRequestStats)); foreach (string key in jsonPropertyNames) { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs index eace2eb9df..67bafdbf56 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs @@ -363,26 +363,7 @@ public void TraceData() StoreResponseStatistics storeResponseStatistics = new StoreResponseStatistics( DateTime.MinValue, DateTime.MaxValue, - new Documents.StoreResult( - storeResponse: new StoreResponse(), - exception: null, - partitionKeyRangeId: 42.ToString(), - lsn: 1337, - quorumAckedLsn: 23, - requestCharge: 3.14, - currentReplicaSetSize: 4, - currentWriteQuorum: 3, - isValid: true, - storePhysicalAddress: new Uri("http://storephysicaladdress.com"), - globalCommittedLSN: 1234, - numberOfReadRegions: 13, - itemLSN: 15, - sessionToken: new SimpleSessionToken(42), - usingLocalLSN: true, - activityId: Guid.Empty.ToString(), - backendRequestDurationInMs: "4.2", - retryAfterInMs: "42", - transportRequestStats: TraceWriterBaselineTests.CreateTransportRequestStats()), + StoreResult.CreateForTesting(transportRequestStats: TraceWriterBaselineTests.CreateTransportRequestStats()).Target, ResourceType.Document, OperationType.Query, "42", @@ -416,26 +397,7 @@ public void TraceData() StoreResponseStatistics storeResponseStatistics = new StoreResponseStatistics( requestStartTime: default, requestResponseTime: default, - new Documents.StoreResult( - storeResponse: new StoreResponse(), - exception: default, - partitionKeyRangeId: default, - lsn: default, - quorumAckedLsn: default, - requestCharge: default, - currentReplicaSetSize: default, - currentWriteQuorum: default, - isValid: default, - storePhysicalAddress: default, - globalCommittedLSN: default, - numberOfReadRegions: default, - itemLSN: default, - sessionToken: default, - usingLocalLSN: default, - activityId: default, - retryAfterInMs: default, - backendRequestDurationInMs: default, - transportRequestStats: TraceWriterBaselineTests.CreateTransportRequestStats()), + StoreResult.CreateForTesting(storeResponse: new StoreResponse()).Target, resourceType: default, operationType: default, requestSessionToken: default, From 9dde99e697eacc9c61b6272fb0ea3b761ca041d6 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Fri, 13 Jan 2023 01:45:47 +0530 Subject: [PATCH 039/240] [Preview] AI integration: Adds IsDistributedTracingEnabled flag as public API to enable/disable this feature (#3598) * make api public for preview * add null check * fix tests * singleton listener initialization * assign null to listeners * fix test * concurrent bag in listener * renamed to LatencyThresholdForDiagnosticEvent * renamed to IsDistributedTracingEnabled * updated xml * update contract * made latency threshold flag internal * fix test * regeneratebaselines * update documentation * rename builder api * add docs * updated contracts and all * doc update * import cleanup Co-authored-by: Sourabh Jain --- .../src/CosmosClientOptions.cs | 20 ++++- .../src/Fluent/CosmosClientBuilder.cs | 24 ++++- .../DistributedTracingOptions.cs | 9 +- .../Filters/DiagnosticsFilterHelper.cs | 4 +- .../OpenTelemetryRecorderFactory.cs | 11 +-- ...riterBaselineTests.BulkOperationsAsync.xml | 10 +-- ...neTests.PointOperationsExceptionsAsync.xml | 15 ++-- .../Tracing/AssertActivity.cs | 20 +++-- .../Tracing/CustomListener.cs | 10 +-- .../EndToEndTraceWriterBaselineTests.cs | 89 +++++++------------ .../Utils/TestCommon.cs | 11 ++- .../Utils/TransportClientHelper.cs | 19 ++-- .../Utils/Util.cs | 38 ++++++++ .../Contracts/DotNetPreviewSDKAPI.json | 36 ++++++++ .../CosmosClientOptionsUnitTests.cs | 8 +- .../Telemetry/DiagnosticsFilterHelperTest.cs | 8 +- 16 files changed, 213 insertions(+), 119 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs index 21df876c68..a75b508e3b 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs @@ -988,17 +988,29 @@ public override bool CanConvert(Type objectType) return objectType == typeof(DateTime); } } - + /// /// Distributed Tracing Options. /// + /// Applicable only when Operation level distributed tracing is enabled through internal DistributedTracingOptions DistributedTracingOptions { get; set; } /// - /// Gets or sets value indicating whether distributed tracing activities () are going to be created for the SDK methods calls and HTTP calls. - /// By default true for Preview package + /// Gets or sets the flag to generate operation level for methods calls using the Source Name "Azure.Cosmos.Operation". /// - internal bool EnableDistributedTracing { get; set; } + /// + /// The default value is true (for preview package). + /// + /// This flag is there to disable it from source. Please Refer https://opentelemetry.io/docs/instrumentation/net/exporters/ to know more about open telemetry exporters +#if PREVIEW + public +#else + internal +#endif + bool IsDistributedTracingEnabled { get; set; } +#if PREVIEW + = true; +#endif } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs index d47f168764..44c38ec51b 100644 --- a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs +++ b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs @@ -424,12 +424,30 @@ public CosmosClientBuilder WithConsistencyLevel(Cosmos.ConsistencyLevel consiste } /// - /// If Open Telemetry listener is subscribed for Azure.Cosmos namespace, There are you can leverage to control it.

+ /// Sets whether Distributed Tracing for "Azure.Cosmos.Operation" source is enabled. ///
- /// Tracing Options + /// Whether is enabled. /// The current . - internal CosmosClientBuilder WithDistributingTracing(DistributedTracingOptions options) +#if PREVIEW + public +#else + internal +#endif + CosmosClientBuilder WithDistributedTracing(bool isEnabled = true) + { + this.clientOptions.IsDistributedTracingEnabled = isEnabled; + return this; + } + + /// + /// Enables Distributed Tracing with a Configuration ref. + /// + /// . + /// The current .] + /// Refer https://opentelemetry.io/docs/instrumentation/net/exporters/ to know more about open telemetry exporters + internal CosmosClientBuilder WithDistributedTracingOptions(DistributedTracingOptions options) { + this.clientOptions.IsDistributedTracingEnabled = true; this.clientOptions.DistributedTracingOptions = options; return this; diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/DistributedTracingOptions.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/DistributedTracingOptions.cs index 652b6b9e3f..6c44f06bf2 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/DistributedTracingOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/DistributedTracingOptions.cs @@ -7,8 +7,7 @@ namespace Microsoft.Azure.Cosmos using System; /// - /// Open Telemetry Configuration - /// It needs to be public once AppInsight is ready + /// Options for configuring the distributed tracing and event tracing /// internal sealed class DistributedTracingOptions { @@ -23,9 +22,9 @@ internal sealed class DistributedTracingOptions internal static readonly TimeSpan DefaultQueryTimeoutThreshold = TimeSpan.FromMilliseconds(500); /// - /// Latency Threshold to generate () with Request diagnostics in distributing Tracing.

- /// If it is not set then by default it will generate () for query operation which are taking more than 500 ms and non-query operations taking more than 100 ms. + /// SDK generates (Event Source Name is "Azure-Cosmos-Operation-Request-Diagnostics") with Request Diagnostics String, If Operation level distributed tracing is not disabled i.e. ///
- public TimeSpan? DiagnosticsLatencyThreshold { get; set; } + /// If it is not set then, by default, it will generate for query operation which are taking more than 500 ms and non-query operations taking more than 100 ms. + public TimeSpan? LatencyThresholdForDiagnosticEvent { get; set; } } } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs index e4db97bc3f..7649977fa0 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs @@ -22,9 +22,9 @@ public static bool IsTracingNeeded( { TimeSpan latencyThreshold; - if (config?.DiagnosticsLatencyThreshold != null) + if (config?.LatencyThresholdForDiagnosticEvent != null) { - latencyThreshold = config.DiagnosticsLatencyThreshold.Value; + latencyThreshold = config.LatencyThresholdForDiagnosticEvent.Value; } else { diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs index 2cd6e3a481..6c88b3d5db 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs @@ -4,6 +4,7 @@ namespace Microsoft.Azure.Cosmos.Telemetry { + using System; using global::Azure.Core.Pipeline; /// @@ -15,7 +16,7 @@ internal static class OpenTelemetryRecorderFactory /// Singleton to make sure we only have one instance of the DiagnosticScopeFactory and pattern matching of listener happens only once /// private static DiagnosticScopeFactory ScopeFactory { get; set; } - + public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, string containerName, string databaseName, @@ -23,11 +24,11 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, RequestOptions requestOptions, CosmosClientContext clientContext) { - if (clientContext is { ClientOptions.EnableDistributedTracing: true }) + if (clientContext is { ClientOptions.IsDistributedTracingEnabled: true }) { - ScopeFactory = new DiagnosticScopeFactory(clientNamespace: OpenTelemetryAttributeKeys.DiagnosticNamespace, - resourceProviderNamespace: OpenTelemetryAttributeKeys.ResourceProviderNamespace, - isActivityEnabled: true); + OpenTelemetryRecorderFactory.ScopeFactory ??= new DiagnosticScopeFactory(clientNamespace: OpenTelemetryAttributeKeys.DiagnosticNamespace, + resourceProviderNamespace: OpenTelemetryAttributeKeys.ResourceProviderNamespace, + isActivityEnabled: true); // If there is no source then it will return default otherwise a valid diagnostic scope DiagnosticScope scope = OpenTelemetryRecorderFactory diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index 6fd72499bb..e79fa6d301 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -1590,6 +1590,10 @@ maxRetryWaitTimeOnThrottledRequests: TimeSpan.FromSeconds(1), maxRetryAttemptsOnThrottledRequests: 3) .WithBulkExecution(true) + .WithDistributedTracingOptions(new DistributedTracingOptions() + { + LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) + }) .WithTransportClientHandlerFactory(transportClient => new TransportClientWrapper( transportClient, (uri, resourceOperation, request) => TransportClientHelper.ReturnThrottledStoreResponseOnItemOperation( @@ -1599,12 +1603,6 @@ exceptionActivityId, errorMessage)))); - throttleClient.ClientOptions.EnableDistributedTracing = true; - throttleClient.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() - { - DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(0) - }; - ItemRequestOptions requestOptions = new ItemRequestOptions(); Container containerWithThrottleException = throttleClient.GetContainer( database.Id, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml index 7d6a68adca..2a3b1439ae 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml @@ -160,7 +160,12 @@ string errorMessage = "Mock throttle exception" + Guid.NewGuid().ToString(); Guid exceptionActivityId = Guid.NewGuid(); using CosmosClient throttleClient = TestCommon.CreateCosmosClient(builder => - builder.WithThrottlingRetryOptions( + builder + .WithDistributedTracingOptions(new DistributedTracingOptions() + { + LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) + }) + .WithThrottlingRetryOptions( maxRetryWaitTimeOnThrottledRequests: TimeSpan.FromSeconds(1), maxRetryAttemptsOnThrottledRequests: 3) .WithTransportClientHandlerFactory(transportClient => new TransportClientWrapper( @@ -171,13 +176,7 @@ request, exceptionActivityId, errorMessage)))); - - throttleClient.ClientOptions.EnableDistributedTracing = true; - throttleClient.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() - { - DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(0) - }; - + ItemRequestOptions requestOptions = new ItemRequestOptions(); Container containerWithThrottleException = throttleClient.GetContainer( database.Id, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs index b0c605839e..d19b330d98 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs @@ -1,4 +1,8 @@ -namespace Microsoft.Azure.Cosmos.Tracing +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Tracing { using System.Collections.Generic; using System.Diagnostics; @@ -13,14 +17,16 @@ internal static class AssertActivity public static void IsValid(Activity activity) { Assert.IsTrue(activity.OperationName == activity.DisplayName); - Assert.IsNotNull(activity.GetTagItem("db.cosmosdb.connection_mode")); + + Assert.IsFalse(string.IsNullOrEmpty(activity.GetTagItem("db.cosmosdb.connection_mode").ToString()), $"connection mode is emtpy for {activity.OperationName}"); + if (activity.GetTagItem("db.cosmosdb.connection_mode").ToString() == ConnectionMode.Gateway.ToString()) { - Assert.AreEqual(ActivityKind.Internal, activity.Kind); + Assert.AreEqual(ActivityKind.Internal, activity.Kind, $" Actual Kind is {activity.Kind} but expected is {ActivityKind.Internal} for {activity.OperationName}"); } - else + else if (activity.GetTagItem("db.cosmosdb.connection_mode").ToString() == ConnectionMode.Direct.ToString()) { - Assert.AreEqual(ActivityKind.Client, activity.Kind); + Assert.AreEqual(ActivityKind.Client, activity.Kind, $" Actual Kind is {activity.Kind} but expected is {ActivityKind.Client} for {activity.OperationName}"); } IList expectedTags = new List @@ -73,8 +79,10 @@ private static void AssertDatabaseAndContainerName(string name, KeyValuePair exceptionsForContainerAttribute = new List { "Operation.CreateDatabaseAsync", + "Operation.CreateDatabaseIfNotExistsAsync", "Operation.ReadAsync", - "Operation.DeleteAsync" + "Operation.DeleteAsync", + "Operation.DeleteStreamAsync" }; if ((tag.Key == OpenTelemetryAttributeKeys.ContainerName && !exceptionsForContainerAttribute.Contains(name)) || diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs index c46d8578b0..410843f3d2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Cosmos.Tests /// /// It is a custom listener for Activities and Event. It is used to validate the Activities generated by cosmosDb SDK. /// - public class CustomListener : + internal class CustomListener : EventListener, // Override Event Listener to capture Event source events IObserver>, // Override IObserver to capture Activity events IObserver, @@ -27,8 +27,8 @@ public class CustomListener : private readonly Func sourceNameFilter; private readonly string eventName; - private List subscriptions = new(); - private List Scopes { get; } = new(); + private ConcurrentBag subscriptions = new(); + private ConcurrentBag Scopes { get; } = new(); public static ConcurrentBag CollectedActivities { private set; get; } = new(); private static ConcurrentBag CollectedEvents { set; get; } = new(); @@ -75,7 +75,7 @@ public void OnNext(KeyValuePair value) string startSuffix = ".Start"; string stopSuffix = ".Stop"; string exceptionSuffix = ".Exception"; - + if (value.Key.EndsWith(startSuffix)) { string name = value.Key[..^startSuffix.Length]; @@ -181,7 +181,7 @@ public override void Dispose() return; } - List subscriptions; + ConcurrentBag subscriptions; lock (this.Scopes) { subscriptions = this.subscriptions; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs index b91fc76b8b..22b4be1814 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs @@ -1,4 +1,8 @@ -namespace Microsoft.Azure.Cosmos.EmulatorTests.Tracing +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.EmulatorTests.Tracing { using System; using System.Collections.Generic; @@ -19,10 +23,7 @@ using Microsoft.Azure.Cosmos.Tracing; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json.Linq; - using OpenTelemetry; - using Telemetry; using static Microsoft.Azure.Cosmos.SDK.EmulatorTests.TransportClientHelper; - using OpenTelemetry.Trace; [VisualStudio.TestTools.UnitTesting.TestClass] [TestCategory("UpdateContract")] @@ -34,55 +35,35 @@ public sealed class EndToEndTraceWriterBaselineTests : BaselineTests builder - .WithBulkExecution(true)); + .WithBulkExecution(true) + .WithDistributedTracingOptions(new DistributedTracingOptions() + { + LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) + })); // Set a small retry count to reduce test time miscCosmosClient = TestCommon.CreateCosmosClient(builder => builder - .AddCustomHandlers(requestHandler)); - - client.ClientOptions.EnableDistributedTracing = true; - bulkClient.ClientOptions.EnableDistributedTracing = true; - miscCosmosClient.ClientOptions.EnableDistributedTracing = true; - - client.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() - { - DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(0) - }; - - bulkClient.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() - { - DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(0) - }; + .AddCustomHandlers(requestHandler) + .WithDistributedTracingOptions(new DistributedTracingOptions() + { + LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) + })); - miscCosmosClient.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() - { - DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(0) - }; - EndToEndTraceWriterBaselineTests.database = await client.CreateDatabaseAsync( Guid.NewGuid().ToString(), cancellationToken: default); @@ -114,8 +95,7 @@ public static async Task ClassCleanupAsync() await EndToEndTraceWriterBaselineTests.database.DeleteStreamAsync(); } - oTelTracerProvider?.Dispose(); - testListener?.Dispose(); + Util.DisposeOpenTelemetryAndCustomListeners(); await Task.Delay(5000); } @@ -994,7 +974,12 @@ public async Task PointOperationsExceptionsAsync() string errorMessage = "Mock throttle exception" + Guid.NewGuid().ToString(); Guid exceptionActivityId = Guid.NewGuid(); using CosmosClient throttleClient = TestCommon.CreateCosmosClient(builder => - builder.WithThrottlingRetryOptions( + builder + .WithDistributedTracingOptions(new DistributedTracingOptions() + { + LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) + }) + .WithThrottlingRetryOptions( maxRetryWaitTimeOnThrottledRequests: TimeSpan.FromSeconds(1), maxRetryAttemptsOnThrottledRequests: 3) .WithTransportClientHandlerFactory(transportClient => new TransportClientWrapper( @@ -1005,13 +990,7 @@ public async Task PointOperationsExceptionsAsync() request, exceptionActivityId, errorMessage)))); - - throttleClient.ClientOptions.EnableDistributedTracing = true; - throttleClient.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() - { - DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(0) - }; - + ItemRequestOptions requestOptions = new ItemRequestOptions(); Container containerWithThrottleException = throttleClient.GetContainer( database.Id, @@ -1284,6 +1263,10 @@ public async Task BulkOperationsAsync() maxRetryWaitTimeOnThrottledRequests: TimeSpan.FromSeconds(1), maxRetryAttemptsOnThrottledRequests: 3) .WithBulkExecution(true) + .WithDistributedTracingOptions(new DistributedTracingOptions() + { + LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) + }) .WithTransportClientHandlerFactory(transportClient => new TransportClientWrapper( transportClient, (uri, resourceOperation, request) => TransportClientHelper.ReturnThrottledStoreResponseOnItemOperation( @@ -1293,12 +1276,6 @@ public async Task BulkOperationsAsync() exceptionActivityId, errorMessage)))); - throttleClient.ClientOptions.EnableDistributedTracing = true; - throttleClient.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() - { - DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(0) - }; - ItemRequestOptions requestOptions = new ItemRequestOptions(); Container containerWithThrottleException = throttleClient.GetContainer( database.Id, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs index 265e9542ef..8cfa5be33b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs @@ -130,7 +130,8 @@ internal static CosmosClient CreateCosmosClient( internal static CosmosClient CreateCosmosClient( bool useGateway, - Action customizeClientBuilder = null) + Action customizeClientBuilder = null, + bool enableDistributingTracing = false) { CosmosClientBuilder cosmosClientBuilder = GetDefaultConfiguration(); @@ -140,6 +141,14 @@ internal static CosmosClient CreateCosmosClient( { cosmosClientBuilder.WithConnectionModeGateway(); } + + if(enableDistributingTracing) + { + cosmosClientBuilder.WithDistributedTracingOptions(new DistributedTracingOptions() + { + LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) + }); + } return cosmosClientBuilder.Build(); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TransportClientHelper.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TransportClientHelper.cs index d701c069c0..f34135b695 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TransportClientHelper.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TransportClientHelper.cs @@ -81,21 +81,20 @@ internal static Container GetContainerWithIntercepter( builder.WithSessionContainer(sessionContainer); } + if (enableDistributingTracing) + { + builder.WithDistributedTracingOptions(new DistributedTracingOptions() + { + LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(.0001) + }); + } + builder.WithTransportClientHandlerFactory(transportClient => new TransportClientWrapper( transportClient, interceptor, interceptorWithStoreResult)); }); - - if(enableDistributingTracing) - { - clientWithIntercepter.ClientOptions.EnableDistributedTracing = true; - clientWithIntercepter.ClientOptions.DistributedTracingOptions = new DistributedTracingOptions() - { - DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(.0001) - }; - } - + return clientWithIntercepter.GetContainer(databaseId, containerId); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs index 4533b2b562..bdb688673d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs @@ -14,10 +14,14 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Services.Management.Tests; using Microsoft.Azure.Cosmos.Telemetry; + using Microsoft.Azure.Cosmos.Tests; + using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; using Microsoft.Azure.Documents.Client; using Microsoft.Azure.Documents.Collections; using Microsoft.VisualStudio.TestTools.UnitTesting; + using OpenTelemetry; + using OpenTelemetry.Trace; internal enum DocumentClientType { @@ -533,6 +537,40 @@ internal static void DisableClientTelemetryEnvironmentVariables() Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, null); } + private static TracerProvider OTelTracerProvider; + private static CustomListener TestListener; + + internal static CustomListener ConfigureOpenTelemetryAndCustomListeners() + { + AppContext.SetSwitch("Azure.Experimental.EnableActivitySource", true); + + // Open Telemetry Listener + Util.OTelTracerProvider = Sdk.CreateTracerProviderBuilder() + .AddCustomOtelExporter() // use any exporter here + .AddSource($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.*") // Right now, it will capture only "Azure.Cosmos.Operation" + .Build(); + + // Custom Listener + Util.TestListener = new CustomListener($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.*", "Azure-Cosmos-Operation-Request-Diagnostics"); + + return Util.TestListener; + + } + + internal static void DisposeOpenTelemetryAndCustomListeners() + { + // Open Telemetry Listener + Util.OTelTracerProvider?.Dispose(); + + // Custom Listener + Util.TestListener?.Dispose(); + + Util.OTelTracerProvider = null; + Util.TestListener = null; + + AppContext.SetSwitch("Azure.Experimental.EnableActivitySource", false); + } + /// /// Enables traces for local debugging /// diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index add1fce30e..c5bb91849b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -314,6 +314,31 @@ }, "NestedTypes": {} }, + "Microsoft.Azure.Cosmos.CosmosClientOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "Boolean get_IsDistributedTracingEnabled()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Boolean get_IsDistributedTracingEnabled();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean IsDistributedTracingEnabled": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Boolean IsDistributedTracingEnabled;CanRead:True;CanWrite:True;Boolean get_IsDistributedTracingEnabled();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_IsDistributedTracingEnabled(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_IsDistributedTracingEnabled(Boolean)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_IsDistributedTracingEnabled(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.Fluent.ChangeFeedPolicyDefinition;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { @@ -336,6 +361,17 @@ }, "NestedTypes": {} }, + "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder WithDistributedTracing(Boolean)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder WithDistributedTracing(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.Linq.CosmosLinqExtensions;System.Object;IsAbstract:True;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs index e39bb8d0f3..986b9cc997 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs @@ -159,9 +159,9 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() portReuseMode, enableTcpConnectionEndpointRediscovery) .WithApplicationPreferredRegions(preferredLocations) - .WithDistributingTracing(new DistributedTracingOptions + .WithDistributedTracingOptions(new DistributedTracingOptions { - DiagnosticsLatencyThreshold = TimeSpan.FromMilliseconds(100) + LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(100) }); cosmosClient = cosmosClientBuilder.Build(new MockDocumentClient()); @@ -174,8 +174,8 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() Assert.AreEqual(portReuseMode, clientOptions.PortReuseMode); Assert.IsTrue(clientOptions.EnableTcpConnectionEndpointRediscovery); CollectionAssert.AreEqual(preferredLocations.ToArray(), clientOptions.ApplicationPreferredRegions.ToArray()); - Assert.AreEqual(TimeSpan.FromMilliseconds(100), clientOptions.DistributedTracingOptions.DiagnosticsLatencyThreshold); - Assert.IsFalse(clientOptions.EnableDistributedTracing); + Assert.AreEqual(TimeSpan.FromMilliseconds(100), clientOptions.DistributedTracingOptions.LatencyThresholdForDiagnosticEvent); + Assert.IsTrue(clientOptions.IsDistributedTracingEnabled); //Verify GetConnectionPolicy returns the correct values policy = clientOptions.GetConnectionPolicy(clientId: 0); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs index 98f4d62954..698b99524e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs @@ -38,7 +38,7 @@ public void CheckReturnFalseOnSuccessAndLowerLatencyThanConfiguredConfig() DistributedTracingOptions distributedTracingOptions = new DistributedTracingOptions { - DiagnosticsLatencyThreshold = this.rootTrace.Duration.Add(TimeSpan.FromSeconds(1)) + LatencyThresholdForDiagnosticEvent = this.rootTrace.Duration.Add(TimeSpan.FromSeconds(1)) }; OpenTelemetryAttributes response = new OpenTelemetryAttributes @@ -51,7 +51,7 @@ public void CheckReturnFalseOnSuccessAndLowerLatencyThanConfiguredConfig() DiagnosticsFilterHelper .IsTracingNeeded(distributedTracingOptions, OperationType.Read, response), $" Response time is {response.Diagnostics.GetClientElapsedTime().Milliseconds}ms " + - $"and Configured threshold value is {distributedTracingOptions.DiagnosticsLatencyThreshold.Value.Milliseconds}ms " + + $"and Configured threshold value is {distributedTracingOptions.LatencyThresholdForDiagnosticEvent.Value.Milliseconds}ms " + $"and Is response Success : {response.StatusCode.IsSuccess()}" ); } @@ -63,7 +63,7 @@ public void CheckReturnTrueOnFailedStatusCode() DistributedTracingOptions distributedTracingOptions = new DistributedTracingOptions { - DiagnosticsLatencyThreshold = this.rootTrace.Duration.Add(TimeSpan.FromSeconds(1)) + LatencyThresholdForDiagnosticEvent = this.rootTrace.Duration.Add(TimeSpan.FromSeconds(1)) }; OpenTelemetryAttributes response = new OpenTelemetryAttributes @@ -76,7 +76,7 @@ public void CheckReturnTrueOnFailedStatusCode() DiagnosticsFilterHelper .IsTracingNeeded(distributedTracingOptions, OperationType.Read, response), $" Response time is {response.Diagnostics.GetClientElapsedTime().Milliseconds}ms " + - $"and Configured threshold value is {distributedTracingOptions.DiagnosticsLatencyThreshold.Value.Milliseconds}ms " + + $"and Configured threshold value is {distributedTracingOptions.LatencyThresholdForDiagnosticEvent.Value.Milliseconds}ms " + $"and Is response Success : {response.StatusCode.IsSuccess()}"); } From 36d0e0f4f8e9919f2512d7520f6f159a9cec0825 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Fri, 13 Jan 2023 07:41:33 -0800 Subject: [PATCH 040/240] Change Feed Processor: Fixes behavior with StartTime on Local (#3645) * To UTC * Test --- .../ChangeFeedProcessorOptions.cs | 2 +- .../ChangeFeedProcessorBuilderTests.cs | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/Configuration/ChangeFeedProcessorOptions.cs b/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/Configuration/ChangeFeedProcessorOptions.cs index 81e38dde16..3c9223a02e 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/Configuration/ChangeFeedProcessorOptions.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/Configuration/ChangeFeedProcessorOptions.cs @@ -66,7 +66,7 @@ public DateTime? StartTime throw new ArgumentException("StartTime cannot have DateTimeKind.Unspecified", nameof(value)); } - this.startTime = value; + this.startTime = value.HasValue && value.Value.Kind == DateTimeKind.Local ? value.Value.ToUniversalTime() : value; } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedProcessorBuilderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedProcessorBuilderTests.cs index 939bfdec8c..ae44b20d71 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedProcessorBuilderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/ChangeFeedProcessorBuilderTests.cs @@ -220,6 +220,41 @@ public void CanBuildWithInMemoryContainer() Assert.IsInstanceOfType(builder.Build(), typeof(ChangeFeedProcessor)); } + [TestMethod] + public void ConvertsToUTC() + { + DateTime localTime = DateTime.Now; + + Assert.AreEqual(DateTimeKind.Local, localTime.Kind); + + Action verifier = (DocumentServiceLeaseStoreManager leaseStoreManager, + Container leaseContainer, + string instanceName, + ChangeFeedLeaseOptions changeFeedLeaseOptions, + ChangeFeedProcessorOptions changeFeedProcessorOptions, + Container monitoredContainer) => + { + Assert.AreEqual(DateTimeKind.Utc, changeFeedProcessorOptions.StartTime.Value.Kind); + Assert.AreEqual(localTime.ToUniversalTime(), changeFeedProcessorOptions.StartTime.Value); + }; + + ChangeFeedProcessorBuilder builder = new ChangeFeedProcessorBuilder("workflowName", + ChangeFeedProcessorBuilderTests.GetMockedContainer(), + ChangeFeedProcessorBuilderTests.GetMockedProcessor(), + verifier); + + builder.WithLeaseContainer(ChangeFeedProcessorBuilderTests.GetMockedContainer()); + + builder.WithStartTime(localTime); + + Assert.IsInstanceOfType(builder.Build(), typeof(ChangeFeedProcessor)); + } + private static ContainerInternal GetMockedContainer(string containerName = null) { Mock mockedContainer = MockCosmosUtil.CreateMockContainer(containerName: containerName); From bdd059d1bf60af19442cbc4b879f093581d871a3 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 17 Jan 2023 20:42:26 +0530 Subject: [PATCH 041/240] [Internal] Client Telemetry: Refactors code to use base useragent string (#3653) --- Microsoft.Azure.Cosmos/src/DocumentClient.cs | 2 +- .../ClientTelemetryTests.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/DocumentClient.cs b/Microsoft.Azure.Cosmos/src/DocumentClient.cs index 8aafec61fc..61e7c99665 100644 --- a/Microsoft.Azure.Cosmos/src/DocumentClient.cs +++ b/Microsoft.Azure.Cosmos/src/DocumentClient.cs @@ -1036,7 +1036,7 @@ private void InitializeClientTelemetry() this.clientTelemetry = ClientTelemetry.CreateAndStartBackgroundTelemetry( clientId: this.clientId, httpClient: this.httpClient, - userAgent: this.ConnectionPolicy.UserAgentContainer.UserAgent, + userAgent: this.ConnectionPolicy.UserAgentContainer.BaseUserAgent, connectionMode: this.ConnectionPolicy.ConnectionMode, authorizationTokenProvider: this.cosmosAuthorization, diagnosticsHelper: DiagnosticsHandlerHelper.Instance, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs index 961c5d25d1..737be92e05 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs @@ -974,6 +974,7 @@ private static void AssertAccountLevelInformation( Assert.IsNotNull(telemetryInfo.ProcessId); Assert.AreEqual(HashingExtension.ComputeHash(System.Diagnostics.Process.GetCurrentProcess().ProcessName), telemetryInfo.ProcessId); Assert.IsNotNull(telemetryInfo.UserAgent); + Assert.IsFalse(telemetryInfo.UserAgent.Contains("userAgentSuffix"), "Useragent should not have suffix appended"); // Useragent should not contain useragentsuffix as it can have PII Assert.IsNotNull(telemetryInfo.ConnectionMode); if(!string.IsNullOrEmpty(telemetryInfo.MachineId)) @@ -1090,7 +1091,8 @@ private async Task CreateClientAndContainer(ConnectionMode mode, } this.cosmosClientBuilder = this.cosmosClientBuilder - .WithHttpClientFactory(() => new HttpClient(handlerHelper)); + .WithHttpClientFactory(() => new HttpClient(handlerHelper)) + .WithApplicationName("userAgentSuffix"); this.cosmosClient = mode == ConnectionMode.Gateway ? this.cosmosClientBuilder.WithConnectionModeGateway().Build() From b3cf7dfb0a156d3e4fdfbb6a8832339d07241b8f Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Wed, 18 Jan 2023 00:24:51 +0530 Subject: [PATCH 042/240] [Internal] AI Integration: Refactors code to rename event name (#3648) * first draft * rename event name * updated xmls * update files --- .../OpenTelemetry/CosmosDbEventSource.cs | 14 +- ...iterBaselineTests.BatchOperationsAsync.xml | 2 +- ...riterBaselineTests.BulkOperationsAsync.xml | 208 +++++++++--------- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 44 ++-- ...eWriterBaselineTests.MiscellanousAsync.xml | 8 +- ...neTests.PointOperationsExceptionsAsync.xml | 20 +- ...EndTraceWriterBaselineTests.QueryAsync.xml | 56 ++--- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 32 +-- ...TraceWriterBaselineTests.ReadManyAsync.xml | 14 +- ...selineTests.StreamPointOperationsAsync.xml | 8 +- ...aselineTests.TypedPointOperationsAsync.xml | 8 +- .../Tracing/CustomListener.cs | 5 +- .../EndToEndTraceWriterBaselineTests.cs | 100 ++++----- 13 files changed, 257 insertions(+), 262 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs index af1115367f..091373b0de 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs @@ -40,7 +40,7 @@ public static void RecordDiagnosticsForRequests( operationType: operationType, response: response) && CosmosDbEventSource.IsEnabled(EventLevel.Warning)) { - CosmosDbEventSource.Singleton.WriteWarningEvent(response.Diagnostics.ToString()); + CosmosDbEventSource.Singleton.LatencyOverThreshold(response.Diagnostics.ToString()); } } @@ -49,26 +49,20 @@ public static void RecordDiagnosticsForExceptions(CosmosDiagnostics diagnostics) { if (CosmosDbEventSource.IsEnabled(EventLevel.Error)) { - CosmosDbEventSource.Singleton.WriteErrorEvent(diagnostics.ToString()); + CosmosDbEventSource.Singleton.Exception(diagnostics.ToString()); } } [Event(1, Level = EventLevel.Error)] - private void WriteErrorEvent(string message) + private void Exception(string message) { this.WriteEvent(1, message); } [Event(2, Level = EventLevel.Warning)] - private void WriteWarningEvent(string message) + private void LatencyOverThreshold(string message) { this.WriteEvent(2, message); } - - [Event(3, Level = EventLevel.Informational)] - private void WriteInfoEvent(string message) - { - this.WriteEvent(3, message); - } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index a6683679f7..0bee1cd007 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -130,7 +130,7 @@ ] }]]> Operation.ExecuteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationExecuteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index e79fa6d301..b99e457c3b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -144,16 +144,16 @@ Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -302,16 +302,16 @@ Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -460,16 +460,16 @@ Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -618,16 +618,16 @@ Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -776,16 +776,16 @@ Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -934,16 +934,16 @@ Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1092,16 +1092,16 @@ Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1250,16 +1250,16 @@ Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1408,16 +1408,16 @@ Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1566,16 +1566,16 @@ Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1591,9 +1591,9 @@ maxRetryAttemptsOnThrottledRequests: 3) .WithBulkExecution(true) .WithDistributedTracingOptions(new DistributedTracingOptions() - { - LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) - }) + { + LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) + }) .WithTransportClientHandlerFactory(transportClient => new TransportClientWrapper( transportClient, (uri, resourceOperation, request) => TransportClientHelper.ReturnThrottledStoreResponseOnItemOperation( @@ -2287,7 +2287,7 @@ ] }]]> Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.messagedb.cosmosdb.operation_typeCreate -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml index c04d573153..1415343fc9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml @@ -957,11 +957,11 @@ Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1574,11 +1574,11 @@ Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2172,11 +2172,11 @@ Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2790,11 +2790,11 @@ Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3068,8 +3068,8 @@ }]]> Operation.Change Feed Estimator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Estimator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml index cd053b58e2..a6a935fe01 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml @@ -109,8 +109,8 @@ }]]> Operation.DeleteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateDatabaseAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateDatabaseAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -209,8 +209,8 @@ }]]> Operation.DeleteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted Operation.CreateDatabaseAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateDatabaseAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml index 2a3b1439ae..c409236892 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml @@ -149,7 +149,7 @@ ] }]]> Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -161,10 +161,10 @@ Guid exceptionActivityId = Guid.NewGuid(); using CosmosClient throttleClient = TestCommon.CreateCosmosClient(builder => builder - .WithDistributedTracingOptions(new DistributedTracingOptions() - { - LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) - }) + .WithDistributedTracingOptions(new DistributedTracingOptions() + { + LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) + }) .WithThrottlingRetryOptions( maxRetryWaitTimeOnThrottledRequests: TimeSpan.FromSeconds(1), maxRetryAttemptsOnThrottledRequests: 3) @@ -391,7 +391,7 @@ ] }]]> Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -616,7 +616,7 @@ ] }]]> Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -873,7 +873,7 @@ ] }]]> Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1194,7 +1194,7 @@ ] }]]> Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1348,7 +1348,7 @@ ] }]]> Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml index 21db429e27..ba77a115a1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml @@ -578,10 +578,10 @@ Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1184,10 +1184,10 @@ Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1771,10 +1771,10 @@ Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2378,10 +2378,10 @@ Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3052,10 +3052,10 @@ Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3648,10 +3648,10 @@ Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -4264,10 +4264,10 @@ Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml index 070da7032d..be14de122e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml @@ -540,10 +540,10 @@ Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1108,10 +1108,10 @@ Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1657,10 +1657,10 @@ Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2226,10 +2226,10 @@ Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml index dd99e1694b..5b8f8e29a0 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml @@ -548,12 +548,12 @@ Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1113,7 +1113,7 @@ ] }]]> Operation.ReadManyItemsAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadManyItemsAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml index 6172446645..8f2ad00f94 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml @@ -90,7 +90,7 @@ ] }]]> Operation.CreateItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -179,7 +179,7 @@ ] }]]> Operation.ReadItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -276,7 +276,7 @@ ] }]]> Operation.ReplaceItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReplaceItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -368,7 +368,7 @@ ] }]]> Operation.DeleteItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml index 2aeaf80b15..603fec2b24 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml @@ -110,7 +110,7 @@ ] }]]> Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -204,7 +204,7 @@ ] }]]> Operation.ReadItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -311,7 +311,7 @@ ] }]]> Operation.ReplaceItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReplaceItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -407,7 +407,7 @@ ] }]]> Operation.DeleteItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Ideally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. +LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs index 410843f3d2..1f192bb086 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs @@ -160,10 +160,11 @@ protected override void OnEventWritten(EventWrittenEventArgs eventData) { StringBuilder builder = new StringBuilder(); builder.Append("") - .Append("Ideally, this should contain request diagnostics but request diagnostics is " + + .Append("").Append(eventData.EventName).Append("") + .Append("Ideally, this should contain request diagnostics but request diagnostics is " + "subject to change with each request as it contains few unique id. " + "So just putting this tag with this static text to make sure event is getting generated" + - " for each test.") + " for each test.") .Append(""); CustomListener.CollectedEvents.Add(builder.ToString()); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs index 22b4be1814..bb46c0f3f3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs @@ -35,9 +35,9 @@ public sealed class EndToEndTraceWriterBaselineTests : BaselineTests builder .WithBulkExecution(true) .WithDistributedTracingOptions(new DistributedTracingOptions() - { + { LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) - })); + })); + // Set a small retry count to reduce test time miscCosmosClient = TestCommon.CreateCosmosClient(builder => builder @@ -63,7 +64,7 @@ public static async Task ClassInitAsync(TestContext context) { LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) })); - + EndToEndTraceWriterBaselineTests.database = await client.CreateDatabaseAsync( Guid.NewGuid().ToString(), cancellationToken: default); @@ -105,10 +106,9 @@ private static void AssertAndResetActivityInformation() AssertActivity.AreEqualAcrossListeners(); CustomOtelExporter.CollectedActivities = new(); - testListener.ResetAttributes(); + testListener?.ResetAttributes(); } - [TestMethod] public async Task ReadFeedAsync() { @@ -143,7 +143,7 @@ public async Task ReadFeedAsync() trace: traceForest, startLineNumber: startLineNumber, endLineNumber: endLineNumber, - oTelActivities: testListener.GetRecordedAttributes())); + oTelActivities: testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); @@ -174,7 +174,7 @@ public async Task ReadFeedAsync() trace: traceForest, startLineNumber: startLineNumber, endLineNumber: endLineNumber, - oTelActivities: testListener.GetRecordedAttributes())); + oTelActivities: testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -205,7 +205,7 @@ public async Task ReadFeedAsync() trace: traceForest, startLineNumber: startLineNumber, endLineNumber: endLineNumber, - oTelActivities: testListener.GetRecordedAttributes())); + oTelActivities: testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -231,7 +231,7 @@ public async Task ReadFeedAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("ReadFeed Public API Typed", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("ReadFeed Public API Typed", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -273,7 +273,7 @@ public async Task ChangeFeedAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("ChangeFeed", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("ChangeFeed", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -305,7 +305,7 @@ public async Task ChangeFeedAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("ChangeFeed Typed", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("ChangeFeed Typed", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -338,7 +338,7 @@ public async Task ChangeFeedAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("ChangeFeed Public API", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("ChangeFeed Public API", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -371,7 +371,7 @@ public async Task ChangeFeedAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("ChangeFeed Public API Typed", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("ChangeFeed Public API Typed", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -432,7 +432,7 @@ public async Task ChangeFeedAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Change Feed Estimator", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Change Feed Estimator", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -468,7 +468,7 @@ public async Task QueryAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Query", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Query", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -493,7 +493,7 @@ public async Task QueryAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Query Typed", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Query Typed", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -519,7 +519,7 @@ public async Task QueryAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Query Public API", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Query Public API", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -545,7 +545,7 @@ public async Task QueryAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Query Public API Typed", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Query Public API Typed", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -574,7 +574,7 @@ public async Task QueryAsync() Documents.ServiceInteropWrapper.AssembliesExist = currentLazy; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Query - Without ServiceInterop", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Query - Without ServiceInterop", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -602,7 +602,7 @@ public async Task QueryAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Query Public API with FeedRanges", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Query Public API with FeedRanges", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -630,7 +630,7 @@ public async Task QueryAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Query Public API Typed with FeedRanges", traceForest, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Query Public API Typed with FeedRanges", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -701,7 +701,7 @@ public async Task TypedPointOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Write", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Point Write", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -719,7 +719,7 @@ public async Task TypedPointOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Read", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Point Read", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -745,7 +745,7 @@ public async Task TypedPointOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Replace", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Point Replace", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -787,7 +787,7 @@ public async Task TypedPointOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Delete", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Point Delete", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -822,7 +822,7 @@ public async Task StreamPointOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Write", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Point Write", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -840,7 +840,7 @@ public async Task StreamPointOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Read", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Point Read", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -866,7 +866,7 @@ public async Task StreamPointOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Replace", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Point Replace", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -911,7 +911,7 @@ public async Task StreamPointOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Delete", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Point Delete", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -960,7 +960,7 @@ public async Task PointOperationsExceptionsAsync() } endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Operation with Request Timeout", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Point Operation with Request Timeout", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -975,10 +975,10 @@ public async Task PointOperationsExceptionsAsync() Guid exceptionActivityId = Guid.NewGuid(); using CosmosClient throttleClient = TestCommon.CreateCosmosClient(builder => builder - .WithDistributedTracingOptions(new DistributedTracingOptions() - { - LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) - }) + .WithDistributedTracingOptions(new DistributedTracingOptions() + { + LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) + }) .WithThrottlingRetryOptions( maxRetryWaitTimeOnThrottledRequests: TimeSpan.FromSeconds(1), maxRetryAttemptsOnThrottledRequests: 3) @@ -1012,7 +1012,7 @@ public async Task PointOperationsExceptionsAsync() } endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Operation With Throttle", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Point Operation With Throttle", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -1143,7 +1143,7 @@ void interceptor(Uri uri, Documents.ResourceOperation operation, Documents.Docum } endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Operation with Service Unavailable", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Point Operation with Service Unavailable", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -1194,7 +1194,7 @@ public async Task BatchOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)response.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Batch Operation", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Batch Operation", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -1244,7 +1244,7 @@ public async Task BulkOperationsAsync() foreach (ITrace trace in traces) { - inputs.Add(new Input("Bulk Operation", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Bulk Operation", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); } EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); @@ -1264,9 +1264,9 @@ public async Task BulkOperationsAsync() maxRetryAttemptsOnThrottledRequests: 3) .WithBulkExecution(true) .WithDistributedTracingOptions(new DistributedTracingOptions() - { - LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) - }) + { + LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) + }) .WithTransportClientHandlerFactory(transportClient => new TransportClientWrapper( transportClient, (uri, resourceOperation, request) => TransportClientHelper.ReturnThrottledStoreResponseOnItemOperation( @@ -1298,7 +1298,7 @@ public async Task BulkOperationsAsync() endLineNumber = GetLineNumber(); - inputs.Add(new Input("Bulk Operation With Throttle", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Bulk Operation With Throttle", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -1330,7 +1330,7 @@ public async Task MiscellanousAsync() await databaseResponse.Database.DeleteAsync(); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Custom Handler", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Custom Handler", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -1349,7 +1349,7 @@ public async Task MiscellanousAsync() await databaseResponse.Database.DeleteAsync(); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Custom Handler", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Custom Handler", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -1390,7 +1390,7 @@ public async Task ReadManyAsync() } endLineNumber = GetLineNumber(); - inputs.Add(new Input("Read Many Stream Api", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Read Many Stream Api", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -1405,7 +1405,7 @@ public async Task ReadManyAsync() ITrace trace = ((CosmosTraceDiagnostics)feedResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Read Many Typed Api", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input("Read Many Typed Api", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } From 4b77519162968e8b7fe29c04ccdfa3dcb403888c Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Tue, 17 Jan 2023 14:17:22 -0800 Subject: [PATCH 043/240] Region Availability: Adds Poland Central Region For Public Usage (#3656) --- Directory.Build.props | 2 +- Microsoft.Azure.Cosmos/src/Regions.cs | 5 +++++ .../Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 658186357b..b163dedaac 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,7 +4,7 @@ 3.31.2 3.31.2 preview - 3.30.0 + 3.30.1 2.0.0 2.0.0 preview diff --git a/Microsoft.Azure.Cosmos/src/Regions.cs b/Microsoft.Azure.Cosmos/src/Regions.cs index f08bbf4c91..853bc48267 100644 --- a/Microsoft.Azure.Cosmos/src/Regions.cs +++ b/Microsoft.Azure.Cosmos/src/Regions.cs @@ -344,5 +344,10 @@ public static class Regions /// Name of the Azure China East 3 region in the Azure Cosmos DB service. ///
public const string ChinaEast3 = "China East 3"; + + /// + /// Name of the Azure Poland Central region in the Azure Cosmos DB service. + /// + public const string PolandCentral = "Poland Central"; } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 4e18b8084b..70e4a5d780 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -6570,6 +6570,11 @@ "Attributes": [], "MethodInfo": "System.String NorwayWest;IsInitOnly:False;IsStatic:True;" }, + "System.String PolandCentral": { + "Type": "Field", + "Attributes": [], + "MethodInfo": "System.String PolandCentral;IsInitOnly:False;IsStatic:True;" + }, "System.String QatarCentral": { "Type": "Field", "Attributes": [], From 171011567abbffac60cf1e61f9fa4bb7ad081ad6 Mon Sep 17 00:00:00 2001 From: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com> Date: Thu, 19 Jan 2023 20:02:16 +0530 Subject: [PATCH 044/240] Client Encryption: Adds validation code to check if the Key Vault URI provided in wrap metadata is a valid key identifier. (#3642) * Check if the key vault uri provided is a valid Kid * test fix. * update changelog and build props * Update Directory.Build.props * Update Microsoft.Azure.Cosmos.Encryption.csproj * Fixed preview version * Refactor * Update EncryptionDatabaseExtensions.cs --- Directory.Build.props | 5 +- .../changelog.md | 10 +++ .../src/EncryptionDatabaseExtensions.cs | 22 +++++++ .../Microsoft.Azure.Cosmos.Encryption.csproj | 4 +- .../tests/EmulatorTests/MdeEncryptionTests.cs | 63 +++++++++++++++++++ 5 files changed, 99 insertions(+), 5 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index b163dedaac..2891c05569 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,12 +1,11 @@ - 3.31.2 3.31.2 preview 3.30.1 - 2.0.0 - 2.0.0 + 2.0.1 + 2.0.1 preview 1.0.0-preview04 1.1.0-preview3 diff --git a/Microsoft.Azure.Cosmos.Encryption/changelog.md b/Microsoft.Azure.Cosmos.Encryption/changelog.md index e3274bce7e..a5e7101074 100644 --- a/Microsoft.Azure.Cosmos.Encryption/changelog.md +++ b/Microsoft.Azure.Cosmos.Encryption/changelog.md @@ -3,6 +3,16 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [2.0.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.1) - 2023-03-11 + +#### Added +- [#3642](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3642) Adds validation code to check if the Key Vault URI provided in wrap metadata is a valid key identifier. + +### [2.0.1-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.1-preview) - 2023-01-11 + +#### Added +- [#3642](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3642) Adds validation code to check if the Key Vault URI provided in wrap metadata is a valid key identifier. + ### [2.0.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.0) - 2022-06-28 #### Added diff --git a/Microsoft.Azure.Cosmos.Encryption/src/EncryptionDatabaseExtensions.cs b/Microsoft.Azure.Cosmos.Encryption/src/EncryptionDatabaseExtensions.cs index 47a68b38ae..f867921946 100644 --- a/Microsoft.Azure.Cosmos.Encryption/src/EncryptionDatabaseExtensions.cs +++ b/Microsoft.Azure.Cosmos.Encryption/src/EncryptionDatabaseExtensions.cs @@ -91,6 +91,17 @@ public static async Task CreateClientEncryptionKeyA + " Please refer to https://aka.ms/CosmosClientEncryption for more details."); } + if (string.Equals(encryptionCosmosClient.KeyEncryptionKeyResolverName, KeyEncryptionKeyResolverName.AzureKeyVault)) + { + // https://KEYVAULTNAME.vault.azure.net/keys/KEYNAME/KEYVERSION + string[] keyVaultUriSegments = new Uri(encryptionKeyWrapMetadata.Value).Segments; + + if (keyVaultUriSegments.Length != 4 || !string.Equals(keyVaultUriSegments[1], "keys/", StringComparison.InvariantCultureIgnoreCase)) + { + throw new ArgumentException($"Invalid Key Vault URI'{encryptionKeyWrapMetadata.Value}' passed. Pass the complete Azure keyvault key identifier. Please refer to https://aka.ms/CosmosClientEncryption for more details."); + } + } + KeyEncryptionKey keyEncryptionKey = KeyEncryptionKey.GetOrCreate( encryptionKeyWrapMetadata.Name, encryptionKeyWrapMetadata.Value, @@ -192,6 +203,17 @@ public static async Task RewrapClientEncryptionKeyA + " Please refer to https://aka.ms/CosmosClientEncryption for more details."); } + if (string.Equals(encryptionCosmosClient.KeyEncryptionKeyResolverName, KeyEncryptionKeyResolverName.AzureKeyVault)) + { + // https://KEYVAULTNAME.vault.azure.net/keys/KEYNAME/KEYVERSION + string[] keyVaultUriSegments = new Uri(newEncryptionKeyWrapMetadata.Value).Segments; + + if (keyVaultUriSegments.Length != 4 || !string.Equals(keyVaultUriSegments[1], "keys/", StringComparison.InvariantCultureIgnoreCase)) + { + throw new ArgumentException($"Invalid Key Vault URI'{newEncryptionKeyWrapMetadata.Value}' passed. Pass the complete Azure keyvault key identifier. Please refer to https://aka.ms/CosmosClientEncryption for more details."); + } + } + ClientEncryptionKeyProperties clientEncryptionKeyProperties = await clientEncryptionKey.ReadAsync(cancellationToken: cancellationToken); RequestOptions requestOptions = new RequestOptions diff --git a/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj b/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj index 6aa1f85932..9fe41b765f 100644 --- a/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj +++ b/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj @@ -28,11 +28,11 @@ - + - + diff --git a/Microsoft.Azure.Cosmos.Encryption/tests/EmulatorTests/MdeEncryptionTests.cs b/Microsoft.Azure.Cosmos.Encryption/tests/EmulatorTests/MdeEncryptionTests.cs index 6ab6d8c333..65efd425aa 100644 --- a/Microsoft.Azure.Cosmos.Encryption/tests/EmulatorTests/MdeEncryptionTests.cs +++ b/Microsoft.Azure.Cosmos.Encryption/tests/EmulatorTests/MdeEncryptionTests.cs @@ -296,6 +296,69 @@ await MdeEncryptionTests.CreateClientEncryptionKeyAsync( if (ex is CosmosException cosmosException) Assert.AreEqual(HttpStatusCode.Conflict, cosmosException.StatusCode); } + + cekId = "testAkvKid"; + CosmosClient client = TestCommon.CreateCosmosClient(); + TestKeyEncryptionKeyResolver testKeyEncryptionKeyResolver = new TestKeyEncryptionKeyResolver(); + + EncryptionKeyWrapMetadata metadata = MdeEncryptionTests.CreateEncryptionKeyWrapMetadata(KeyEncryptionKeyResolverName.AzureKeyVault, "key1", "https://testkeyvault.vault.azure.net/keys/testkey/12345678"); + + CosmosClient encryptionCosmosClient = client.WithEncryption( + testKeyEncryptionKeyResolver, + KeyEncryptionKeyResolverName.AzureKeyVault, + TimeSpan.Zero); + + Database database = await encryptionCosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString()); + + ClientEncryptionKeyResponse clientEncrytionKeyResponse = await database.CreateClientEncryptionKeyAsync( + cekId, + DataEncryptionAlgorithm.AeadAes256CbcHmacSha256, + metadata); + + Assert.AreEqual(HttpStatusCode.Created, clientEncrytionKeyResponse.StatusCode); + + metadata = MdeEncryptionTests.CreateEncryptionKeyWrapMetadata(KeyEncryptionKeyResolverName.AzureKeyVault, "key1", "https://testkeyvault.vault.azure.net/keys/testkey/9101112"); + + clientEncrytionKeyResponse = await database.RewrapClientEncryptionKeyAsync( + cekId, + metadata); + + Assert.AreEqual(HttpStatusCode.OK, clientEncrytionKeyResponse.StatusCode); + + // complete key identifier not passed + metadata = MdeEncryptionTests.CreateEncryptionKeyWrapMetadata(KeyEncryptionKeyResolverName.AzureKeyVault, "key1", "https://testkeyvault.vault.azure.net/keys/testkey"); + + try + { + clientEncrytionKeyResponse = await database.CreateClientEncryptionKeyAsync( + cekId, + DataEncryptionAlgorithm.AeadAes256CbcHmacSha256, + metadata); + + Assert.Fail("Key creation should have failed."); + + } + catch(Exception ex) + { + Assert.AreEqual(true, ex.Message.Contains("Invalid Key Vault URI")); + } + + // rewrap old key with new key vault uri without complete key identifier + try + { + clientEncrytionKeyResponse = await database.RewrapClientEncryptionKeyAsync( + cekId, + metadata); + + Assert.Fail("Key rewrap should have failed."); + + } + catch (Exception ex) + { + Assert.AreEqual(true, ex.Message.Contains("Invalid Key Vault URI")); + } + + encryptionCosmosClient.Dispose(); } [TestMethod] From e383d83946bf7c9eddeb161cd577b18609e2ac19 Mon Sep 17 00:00:00 2001 From: akotalwar <94020786+akotalwar@users.noreply.github.com> Date: Thu, 19 Jan 2023 17:32:54 -0800 Subject: [PATCH 045/240] [Internal] Query: Adds Split Support for Ode (#3572) * Added tests to test different aspects of merge/split support with OptimisticDirectExecution pipeline. Tests check for gone exception handling, pipeline switching etc. * Added gone exception simulation tests. * Added new tests and improved test infra * Removed ParalleContEvocation test. Fixed comments * Removed CreateParallelCrossPartitionPipelineStateAsync() as it is not being used anymore * Removed while loop in CreateDocumentContainerAsync() * Fixed comments. * Updated ExecuteGoneExceptionOnODEPipeline() * Added type Assert for ExecuteGoneExceptionOnODEPipeline() * Replaced try-catch with if statement in MoveNextAsync() * Added delegate to access TryCreateCoreContextAsync() * Added check to confirm Ode pipeline is not called in fallback plan * Updated method name from OptimisticDirectExecutionContext() to TryCreateOptimisticDirectExecutionContext() * Using delegate instead of Func<>. * Ode fallback plan always calls Specialized pipeline * Using ServiceInterop/Gateway to get QueryPlan for Specialized Pipeline * Added new test to check handling of failing fallback pipeline * Code cleanup * Added logic for handling non ODE continuation tokens * Moved delegate away from member variables * Added tests for Merge case * Updated method names * Added checks for tryCatch * Updated SetCancellationToken() to use Try * Updated TryUnwrapContinuationToken() * Removed changes in FlakyDocumentContainer.cs * Removed unused imports * Updated comments * Fixed comments and cleaned up test code * Added CosmosElement null check in TryUnwrapContinuationToken() * Removed FlakyDocumentContainer.cs from pull request * Removed unused imports * Updated TryUnwrapContinuationToken() * Update MoveNextAsync() call in OptimisticDirectExecutionQueryBaselineTests.cs * Made MergeTestUtil.IsFailedFallbackPipelineTest a readonly property * Added IsPartitionSplitException() overload to take CosmosElement * Fixed bug regarding syntax error queries --- .../Query/Core/Monads/TryCatch{TResult}.cs | 32 + .../Pipeline/CosmosExceptionExtensions.cs | 28 + .../CosmosQueryExecutionContextFactory.cs | 339 ++++++++--- ...OrderByCrossPartitionQueryPipelineStage.cs | 4 +- ...imisticDirectExecutionContinuationToken.cs | 6 +- ...misticDirectExecutionQueryPipelineStage.cs | 316 ++++++---- ...egativeOptimisticDirectExecutionOutput.xml | 26 + ...ositiveOptimisticDirectExecutionOutput.xml | 26 + ...misticDirectExecutionQueryBaselineTests.cs | 553 +++++++++++------- 9 files changed, 929 insertions(+), 401 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosExceptionExtensions.cs diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Monads/TryCatch{TResult}.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Monads/TryCatch{TResult}.cs index 8d9c43b036..38d0f4d1fc 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Monads/TryCatch{TResult}.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Monads/TryCatch{TResult}.cs @@ -126,6 +126,38 @@ public async Task> TryAsync( return matchResult; } + public async ValueTask> TryAsync( + Func> onSuccess) + { + TryCatch matchResult; + if (this.Succeeded) + { + matchResult = TryCatch.FromResult(await onSuccess(this.either.FromRight(default))); + } + else + { + matchResult = TryCatch.FromException(this.either.FromLeft(default)); + } + + return matchResult; + } + + public TryCatch Try( + Func> onSuccess) + { + TryCatch matchResult; + if (this.Succeeded) + { + matchResult = onSuccess(this.either.FromRight(default)); + } + else + { + matchResult = TryCatch.FromException(this.either.FromLeft(default)); + } + + return matchResult; + } + public TryCatch Catch( Action onError) { diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosExceptionExtensions.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosExceptionExtensions.cs new file mode 100644 index 0000000000..dca1ef488d --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosExceptionExtensions.cs @@ -0,0 +1,28 @@ +// ------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// ------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.Pipeline +{ + using System; + + internal static class CosmosExceptionExtensions + { + public static bool IsPartitionSplitException(this Exception ex) + { + if (ex != null) + { + return IsPartitionSplitException(ex as CosmosException); + } + + return false; + } + + public static bool IsPartitionSplitException(this CosmosException ex) + { + return ex is CosmosException cosmosException + && (cosmosException.StatusCode == System.Net.HttpStatusCode.Gone) + && (cosmosException.SubStatusCode == (int)Documents.SubStatusCodes.PartitionKeyRangeGone); + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs index 36e14d78bd..371391386e 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs @@ -136,23 +136,24 @@ private static async Task> TryCreateCoreContextAsy cancellationToken); cosmosQueryContext.ContainerResourceId = containerQueryProperties.ResourceId; - Documents.PartitionKeyRange targetRange = await GetTargetRangeOptimisticDirectExecutionAsync( - inputParameters, - queryPlanFromContinuationToken, - cosmosQueryContext, - containerQueryProperties, + Documents.PartitionKeyRange targetRange = await TryGetTargetRangeOptimisticDirectExecutionAsync( + inputParameters, + queryPlanFromContinuationToken, + cosmosQueryContext, + containerQueryProperties, trace); - + if (targetRange != null) { - // Test code added to confirm the correct pipeline is being utilized - SetTestInjectionPipelineType(inputParameters, OptimisticDirectExecution); - - return OptimisticDirectExecutionContext( - documentContainer, - inputParameters, - targetRange, - cancellationToken); + return await TryCreateExecutionContextAsync( + documentContainer, + partitionedQueryExecutionInfo: null, + cosmosQueryContext, + containerQueryProperties, + inputParameters, + targetRange, + trace, + cancellationToken); } PartitionedQueryExecutionInfo partitionedQueryExecutionInfo; @@ -226,33 +227,12 @@ private static async Task> TryCreateCoreContextAsy } } - if (cosmosQueryContext.QueryClient.ByPassQueryParsing()) - { - // For non-Windows platforms(like Linux and OSX) in .NET Core SDK, we cannot use ServiceInterop, so need to bypass in that case. - // We are also now bypassing this for 32 bit host process running even on Windows as there are many 32 bit apps that will not work without this - partitionedQueryExecutionInfo = await QueryPlanRetriever.GetQueryPlanThroughGatewayAsync( - cosmosQueryContext, - inputParameters.SqlQuerySpec, - cosmosQueryContext.ResourceLink, - inputParameters.PartitionKey, - createQueryPipelineTrace, - cancellationToken); - } - else - { - Documents.PartitionKeyDefinition partitionKeyDefinition = GetPartitionKeyDefinition(inputParameters, containerQueryProperties); - - partitionedQueryExecutionInfo = await QueryPlanRetriever.GetQueryPlanWithServiceInteropAsync( - cosmosQueryContext.QueryClient, - inputParameters.SqlQuerySpec, - cosmosQueryContext.ResourceTypeEnum, - partitionKeyDefinition, - inputParameters.PartitionKey != null, - containerQueryProperties.GeospatialType, - cosmosQueryContext.UseSystemPrefix, - createQueryPipelineTrace, - cancellationToken); - } + partitionedQueryExecutionInfo = await GetPartitionedQueryExecutionInfoAsync( + cosmosQueryContext, + inputParameters, + containerQueryProperties, + createQueryPipelineTrace, + cancellationToken); } return await TryCreateFromPartitionedQueryExecutionInfoAsync( @@ -306,79 +286,187 @@ private static async Task> TryCreateFromPartitione TryCatch tryCreatePipelineStage; - Documents.PartitionKeyRange targetRange = await GetTargetRangeOptimisticDirectExecutionAsync( + Documents.PartitionKeyRange targetRange = await TryGetTargetRangeOptimisticDirectExecutionAsync( inputParameters, partitionedQueryExecutionInfo, cosmosQueryContext, - containerQueryProperties, + containerQueryProperties, trace); if (targetRange != null) { - SetTestInjectionPipelineType(inputParameters, OptimisticDirectExecution); - - tryCreatePipelineStage = CosmosQueryExecutionContextFactory.OptimisticDirectExecutionContext( + tryCreatePipelineStage = await TryCreateExecutionContextAsync( documentContainer, + partitionedQueryExecutionInfo, + cosmosQueryContext, + containerQueryProperties, inputParameters, targetRange, + trace, cancellationToken); - - return tryCreatePipelineStage; } - - if (createPassthroughQuery) + else { - SetTestInjectionPipelineType(inputParameters, Passthrough); + if (createPassthroughQuery) + { + SetTestInjectionPipelineType(inputParameters, Passthrough); - tryCreatePipelineStage = CosmosQueryExecutionContextFactory.TryCreatePassthroughQueryExecutionContext( - documentContainer, - inputParameters, - targetRanges, - cancellationToken); + tryCreatePipelineStage = CosmosQueryExecutionContextFactory.TryCreatePassthroughQueryExecutionContext( + documentContainer, + inputParameters, + targetRanges, + cancellationToken); + } + else + { + tryCreatePipelineStage = TryCreateSpecializedDocumentQueryExecutionContext(documentContainer, cosmosQueryContext, inputParameters, targetRanges, partitionedQueryExecutionInfo, cancellationToken); + } } - else + + return tryCreatePipelineStage; + } + + private static async Task> TryCreateExecutionContextAsync( + DocumentContainer documentContainer, + PartitionedQueryExecutionInfo partitionedQueryExecutionInfo, + CosmosQueryContext cosmosQueryContext, + ContainerQueryProperties containerQueryProperties, + InputParameters inputParameters, + Documents.PartitionKeyRange targetRange, + ITrace trace, + CancellationToken cancellationToken) + { + // Test code added to confirm the correct pipeline is being utilized + SetTestInjectionPipelineType(inputParameters, OptimisticDirectExecution); + + TryCatch tryCreatePipelineStage = CosmosQueryExecutionContextFactory.TryCreateOptimisticDirectExecutionContext( + documentContainer, + cosmosQueryContext, + containerQueryProperties, + inputParameters, + targetRange, + cancellationToken); + + // A malformed continuation token exception would happen for 2 reasons here + // 1. the token is actually malformed + // 2. Its a non Ode continuation token + // In both cases, Ode pipeline delegates the work to the Specialized pipeline + // as Ode pipeline should not take over execution while some other pipeline is already handling it + if (tryCreatePipelineStage.Failed && tryCreatePipelineStage.InnerMostException is MalformedContinuationTokenException) { SetTestInjectionPipelineType(inputParameters, Specialized); - if (!string.IsNullOrEmpty(partitionedQueryExecutionInfo.QueryInfo.RewrittenQuery)) + if (partitionedQueryExecutionInfo != null) { - // We need pass down the rewritten query. - SqlQuerySpec rewrittenQuerySpec = new SqlQuerySpec() + List targetRanges = new List { - QueryText = partitionedQueryExecutionInfo.QueryInfo.RewrittenQuery, - Parameters = inputParameters.SqlQuerySpec.Parameters + targetRange }; - inputParameters = new InputParameters( - rewrittenQuerySpec, - inputParameters.InitialUserContinuationToken, - inputParameters.InitialFeedRange, - inputParameters.MaxConcurrency, - inputParameters.MaxItemCount, - inputParameters.MaxBufferedItemCount, - inputParameters.PartitionKey, - inputParameters.Properties, - inputParameters.PartitionedQueryExecutionInfo, - inputParameters.ExecutionEnvironment, - inputParameters.ReturnResultsInDeterministicOrder, - inputParameters.ForcePassthrough, - inputParameters.TestInjections); + tryCreatePipelineStage = TryCreateSpecializedDocumentQueryExecutionContext( + documentContainer, + cosmosQueryContext, + inputParameters, + targetRanges, + partitionedQueryExecutionInfo, + cancellationToken); + } + else + { + tryCreatePipelineStage = await TryCreateSpecializedDocumentQueryExecutionContextAsync( + documentContainer, + cosmosQueryContext, + containerQueryProperties, + inputParameters, + trace, + cancellationToken); } - - tryCreatePipelineStage = CosmosQueryExecutionContextFactory.TryCreateSpecializedDocumentQueryExecutionContext( - documentContainer, - cosmosQueryContext, - inputParameters, - partitionedQueryExecutionInfo, - targetRanges, - cancellationToken); } return tryCreatePipelineStage; } - - private static TryCatch OptimisticDirectExecutionContext( + + private static TryCatch TryCreateSpecializedDocumentQueryExecutionContext( DocumentContainer documentContainer, + CosmosQueryContext cosmosQueryContext, + InputParameters inputParameters, + List targetRanges, + PartitionedQueryExecutionInfo partitionedQueryExecutionInfo, + CancellationToken cancellationToken) + { + SetTestInjectionPipelineType(inputParameters, Specialized); + + if (!string.IsNullOrEmpty(partitionedQueryExecutionInfo.QueryInfo.RewrittenQuery)) + { + // We need pass down the rewritten query. + SqlQuerySpec rewrittenQuerySpec = new SqlQuerySpec() + { + QueryText = partitionedQueryExecutionInfo.QueryInfo.RewrittenQuery, + Parameters = inputParameters.SqlQuerySpec.Parameters + }; + + inputParameters = new InputParameters( + rewrittenQuerySpec, + inputParameters.InitialUserContinuationToken, + inputParameters.InitialFeedRange, + inputParameters.MaxConcurrency, + inputParameters.MaxItemCount, + inputParameters.MaxBufferedItemCount, + inputParameters.PartitionKey, + inputParameters.Properties, + inputParameters.PartitionedQueryExecutionInfo, + inputParameters.ExecutionEnvironment, + inputParameters.ReturnResultsInDeterministicOrder, + inputParameters.ForcePassthrough, + inputParameters.TestInjections); + } + + return CosmosQueryExecutionContextFactory.TryCreateSpecializedDocumentQueryExecutionContext( + documentContainer, + cosmosQueryContext, + inputParameters, + partitionedQueryExecutionInfo, + targetRanges, + cancellationToken); + } + + private static async Task> TryCreateSpecializedDocumentQueryExecutionContextAsync( + DocumentContainer documentContainer, + CosmosQueryContext cosmosQueryContext, + ContainerQueryProperties containerQueryProperties, + InputParameters inputParameters, + ITrace trace, + CancellationToken cancellationToken) + { + PartitionedQueryExecutionInfo partitionedQueryExecutionInfo = await GetPartitionedQueryExecutionInfoAsync( + cosmosQueryContext, + inputParameters, + containerQueryProperties, + trace, + cancellationToken); + + List targetRanges = await CosmosQueryExecutionContextFactory.GetTargetPartitionKeyRangesAsync( + cosmosQueryContext.QueryClient, + cosmosQueryContext.ResourceLink, + partitionedQueryExecutionInfo, + containerQueryProperties, + inputParameters.Properties, + inputParameters.InitialFeedRange, + trace); + + return TryCreateSpecializedDocumentQueryExecutionContext( + documentContainer, + cosmosQueryContext, + inputParameters, + targetRanges, + partitionedQueryExecutionInfo, + cancellationToken); + } + + private static TryCatch TryCreateOptimisticDirectExecutionContext( + DocumentContainer documentContainer, + CosmosQueryContext cosmosQueryContext, + ContainerQueryProperties containerQueryProperties, InputParameters inputParameters, Documents.PartitionKeyRange targetRange, CancellationToken cancellationToken) @@ -386,14 +474,26 @@ private static TryCatch OptimisticDirectExecutionContext( // Return a OptimisticDirectExecution context return OptimisticDirectExecutionQueryPipelineStage.MonadicCreate( documentContainer: documentContainer, - sqlQuerySpec: inputParameters.SqlQuerySpec, + inputParameters: inputParameters, targetRange: new FeedRangeEpk(targetRange.ToRange()), queryPaginationOptions: new QueryPaginationOptions(pageSizeHint: inputParameters.MaxItemCount), - partitionKey: inputParameters.PartitionKey, - continuationToken: inputParameters.InitialUserContinuationToken, + fallbackQueryPipelineStageFactory: (continuationToken) => + { + // In fallback scenario, the Specialized pipeline is always invoked + Task> tryCreateContext = + CosmosQueryExecutionContextFactory.TryCreateSpecializedDocumentQueryExecutionContextAsync( + documentContainer, + cosmosQueryContext, + containerQueryProperties, + inputParameters.WithContinuationToken(continuationToken), + NoOpTrace.Singleton, + default); + + return tryCreateContext; + }, cancellationToken: cancellationToken); } - + private static TryCatch TryCreatePassthroughQueryExecutionContext( DocumentContainer documentContainer, InputParameters inputParameters, @@ -478,6 +578,45 @@ private static TryCatch TryCreateSpecializedDocumentQueryEx requestCancellationToken: cancellationToken); } + private static async Task GetPartitionedQueryExecutionInfoAsync( + CosmosQueryContext cosmosQueryContext, + InputParameters inputParameters, + ContainerQueryProperties containerQueryProperties, + ITrace trace, + CancellationToken cancellationToken) + { + PartitionedQueryExecutionInfo partitionedQueryExecutionInfo; + if (cosmosQueryContext.QueryClient.ByPassQueryParsing()) + { + // For non-Windows platforms(like Linux and OSX) in .NET Core SDK, we cannot use ServiceInterop, so need to bypass in that case. + // We are also now bypassing this for 32 bit host process running even on Windows as there are many 32 bit apps that will not work without this + partitionedQueryExecutionInfo = await QueryPlanRetriever.GetQueryPlanThroughGatewayAsync( + cosmosQueryContext, + inputParameters.SqlQuerySpec, + cosmosQueryContext.ResourceLink, + inputParameters.PartitionKey, + trace, + cancellationToken); + } + else + { + Documents.PartitionKeyDefinition partitionKeyDefinition = GetPartitionKeyDefinition(inputParameters, containerQueryProperties); + + partitionedQueryExecutionInfo = await QueryPlanRetriever.GetQueryPlanWithServiceInteropAsync( + cosmosQueryContext.QueryClient, + inputParameters.SqlQuerySpec, + cosmosQueryContext.ResourceTypeEnum, + partitionKeyDefinition, + inputParameters.PartitionKey != null, + containerQueryProperties.GeospatialType, + cosmosQueryContext.UseSystemPrefix, + trace, + cancellationToken); + } + + return partitionedQueryExecutionInfo; + } + /// /// Gets the list of partition key ranges. /// 1. Check partition key range id @@ -606,7 +745,7 @@ private static Documents.PartitionKeyDefinition GetPartitionKeyDefinition(InputP return partitionKeyDefinition; } - private static async Task GetTargetRangeOptimisticDirectExecutionAsync( + private static async Task TryGetTargetRangeOptimisticDirectExecutionAsync( InputParameters inputParameters, PartitionedQueryExecutionInfo partitionedQueryExecutionInfo, CosmosQueryContext cosmosQueryContext, @@ -734,6 +873,24 @@ public InputParameters( public bool ReturnResultsInDeterministicOrder { get; } public TestInjections TestInjections { get; } public bool ForcePassthrough { get; } + + public InputParameters WithContinuationToken(CosmosElement token) + { + return new InputParameters( + this.SqlQuerySpec, + token, + this.InitialFeedRange, + this.MaxConcurrency, + this.MaxItemCount, + this.MaxBufferedItemCount, + this.PartitionKey, + this.Properties, + this.PartitionedQueryExecutionInfo, + this.ExecutionEnvironment, + this.ReturnResultsInDeterministicOrder, + this.ForcePassthrough, + this.TestInjections); + } } internal sealed class AggregateProjectionDetector diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs index bbd3d7be4e..10c3b0ee5e 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CrossPartition/OrderBy/OrderByCrossPartitionQueryPipelineStage.cs @@ -1153,9 +1153,7 @@ private static bool IsSplitException(Exception exception) exception = exception.InnerException; } - return exception is CosmosException cosmosException - && (cosmosException.StatusCode == HttpStatusCode.Gone) - && (cosmosException.SubStatusCode == (int)Documents.SubStatusCodes.PartitionKeyRangeGone); + return exception.IsPartitionSplitException(); } public void SetCancellationToken(CancellationToken cancellationToken) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionContinuationToken.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionContinuationToken.cs index c81c378029..59f87295f3 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionContinuationToken.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionContinuationToken.cs @@ -43,11 +43,11 @@ public static CosmosElement ToCosmosElement(OptimisticDirectExecutionContinuatio public static TryCatch TryCreateFromCosmosElement(CosmosElement cosmosElement) { CosmosObject cosmosObjectContinuationToken = cosmosElement as CosmosObject; - if (cosmosObjectContinuationToken == null) + if (cosmosObjectContinuationToken == null || !cosmosObjectContinuationToken.ContainsKey(OptimisticDirectExecutionToken)) { return TryCatch.FromException( - new MalformedChangeFeedContinuationTokenException( - message: $"Malformed Continuation Token")); + new MalformedContinuationTokenException( + message: $"Malformed Continuation Token: Expected OptimisticDirectExecutionToken\r\n")); } TryCatch inner = ParallelContinuationToken.TryCreateFromCosmosElement(cosmosObjectContinuationToken[OptimisticDirectExecutionToken]); diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionQueryPipelineStage.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionQueryPipelineStage.cs index 9f86b0ad8b..0664603024 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionQueryPipelineStage.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionQueryPipelineStage.cs @@ -12,168 +12,268 @@ namespace Microsoft.Azure.Cosmos.Query.Core.Pipeline.OptimisticDirectExecutionQu using System.Threading.Tasks; using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.Pagination; - using Microsoft.Azure.Cosmos.Query.Core.Exceptions; + using Microsoft.Azure.Cosmos.Query.Core.ExecutionContext; using Microsoft.Azure.Cosmos.Query.Core.Monads; using Microsoft.Azure.Cosmos.Query.Core.Pipeline; using Microsoft.Azure.Cosmos.Query.Core.Pipeline.CrossPartition; using Microsoft.Azure.Cosmos.Query.Core.Pipeline.CrossPartition.Parallel; using Microsoft.Azure.Cosmos.Query.Core.Pipeline.Pagination; using Microsoft.Azure.Cosmos.Tracing; - using static Microsoft.Azure.Cosmos.Query.Core.Pipeline.CrossPartition.PartitionMapper; internal sealed class OptimisticDirectExecutionQueryPipelineStage : IQueryPipelineStage { - private readonly QueryPartitionRangePageAsyncEnumerator queryPartitionRangePageAsyncEnumerator; - - private OptimisticDirectExecutionQueryPipelineStage( - QueryPartitionRangePageAsyncEnumerator queryPartitionRangePageAsyncEnumerator) + private enum ExecutionState { - this.queryPartitionRangePageAsyncEnumerator = queryPartitionRangePageAsyncEnumerator ?? throw new ArgumentNullException(nameof(queryPartitionRangePageAsyncEnumerator)); + OptimisticDirectExecution, + SpecializedDocumentQueryExecution, } - public TryCatch Current { get; private set; } + private const string optimisticDirectExecutionToken = "OptimisticDirectExecutionToken"; + private readonly FallbackQueryPipelineStageFactory queryPipelineStageFactory; + private TryCatch inner; + private CosmosElement continuationToken; + private ExecutionState executionState; - public ValueTask DisposeAsync() + private OptimisticDirectExecutionQueryPipelineStage(TryCatch inner, FallbackQueryPipelineStageFactory queryPipelineStageFactory, CosmosElement continuationToken) { - return this.queryPartitionRangePageAsyncEnumerator.DisposeAsync(); + this.inner = inner; + this.queryPipelineStageFactory = queryPipelineStageFactory; + this.continuationToken = continuationToken; + this.executionState = ExecutionState.OptimisticDirectExecution; } - public void SetCancellationToken(CancellationToken cancellationToken) + public delegate Task> FallbackQueryPipelineStageFactory(CosmosElement continuationToken); + + public TryCatch Current => this.inner.Try(pipelineStage => pipelineStage.Current); + + public ValueTask DisposeAsync() { - this.queryPartitionRangePageAsyncEnumerator.SetCancellationToken(cancellationToken); + return this.inner.Failed ? default : this.inner.Result.DisposeAsync(); } public async ValueTask MoveNextAsync(ITrace trace) { - if (trace == null) - { - throw new ArgumentNullException(nameof(trace)); - } + TryCatch hasNext = await this.inner.TryAsync(pipelineStage => pipelineStage.MoveNextAsync(trace)); + bool success = hasNext.Succeeded && hasNext.Result; + bool isPartitionSplitException = hasNext.Succeeded && this.Current.Failed && this.Current.InnerMostException.IsPartitionSplitException(); - if (!await this.queryPartitionRangePageAsyncEnumerator.MoveNextAsync(trace)) + if (success && !isPartitionSplitException) { - this.Current = default; - return false; + this.continuationToken = this.Current.Succeeded ? this.Current.Result.State?.Value : null; } - - TryCatch partitionPage = this.queryPartitionRangePageAsyncEnumerator.Current; - if (partitionPage.Failed) + else if (isPartitionSplitException && this.executionState == ExecutionState.OptimisticDirectExecution) { - this.Current = partitionPage; - return true; + this.inner = await this.queryPipelineStageFactory(this.TryUnwrapContinuationToken()); + this.executionState = ExecutionState.SpecializedDocumentQueryExecution; + if (this.inner.Failed) + { + return false; + } + + success = await this.inner.Result.MoveNextAsync(trace); } - QueryPage backendQueryPage = partitionPage.Result; + return success; + } - QueryState queryState; - if (backendQueryPage.State == null) - { - queryState = null; - } - else + public void SetCancellationToken(CancellationToken cancellationToken) + { + this.inner.Try(pipelineStage => pipelineStage.SetCancellationToken(cancellationToken)); + } + + private CosmosElement TryUnwrapContinuationToken() + { + if (this.continuationToken != null) { - QueryState backendQueryState = backendQueryPage.State; - ParallelContinuationToken parallelContinuationToken = new ParallelContinuationToken( - token: (backendQueryState?.Value as CosmosString)?.Value, - range: ((FeedRangeEpk)this.queryPartitionRangePageAsyncEnumerator.FeedRangeState.FeedRange).Range); - - OptimisticDirectExecutionContinuationToken optimisticDirectExecutionContinuationToken = new OptimisticDirectExecutionContinuationToken(parallelContinuationToken); - CosmosElement cosmosElementContinuationToken = OptimisticDirectExecutionContinuationToken.ToCosmosElement(optimisticDirectExecutionContinuationToken); - queryState = new QueryState(cosmosElementContinuationToken); + CosmosObject cosmosObject = this.continuationToken as CosmosObject; + CosmosElement backendContinuationToken = cosmosObject[optimisticDirectExecutionToken]; + Debug.Assert(backendContinuationToken != null); + return CosmosArray.Create(backendContinuationToken); } - QueryPage queryPage = new QueryPage( - backendQueryPage.Documents, - backendQueryPage.RequestCharge, - backendQueryPage.ActivityId, - backendQueryPage.ResponseLengthInBytes, - backendQueryPage.CosmosQueryExecutionInfo, - disallowContinuationTokenMessage: null, - backendQueryPage.AdditionalHeaders, - queryState); - - this.Current = TryCatch.FromResult(queryPage); - return true; + return null; } public static TryCatch MonadicCreate( - IDocumentContainer documentContainer, - SqlQuerySpec sqlQuerySpec, - FeedRangeEpk targetRange, - Cosmos.PartitionKey? partitionKey, - QueryPaginationOptions queryPaginationOptions, - CosmosElement continuationToken, - CancellationToken cancellationToken) + DocumentContainer documentContainer, + CosmosQueryExecutionContextFactory.InputParameters inputParameters, + FeedRangeEpk targetRange, + QueryPaginationOptions queryPaginationOptions, + FallbackQueryPipelineStageFactory fallbackQueryPipelineStageFactory, + CancellationToken cancellationToken) { - if (targetRange == null) + TryCatch pipelineStage = OptimisticDirectExecutionQueryPipelineImpl.MonadicCreate( + documentContainer: documentContainer, + sqlQuerySpec: inputParameters.SqlQuerySpec, + targetRange: targetRange, + queryPaginationOptions: queryPaginationOptions, + partitionKey: inputParameters.PartitionKey, + continuationToken: inputParameters.InitialUserContinuationToken, + cancellationToken: cancellationToken); + + if (pipelineStage.Failed) { - throw new ArgumentNullException(nameof(targetRange)); + return pipelineStage; } - - TryCatch> monadicExtractState; - if (continuationToken == null) + + OptimisticDirectExecutionQueryPipelineStage odePipelineStageMonadicCreate = new OptimisticDirectExecutionQueryPipelineStage(pipelineStage, fallbackQueryPipelineStageFactory, inputParameters.InitialUserContinuationToken); + return TryCatch.FromResult(odePipelineStageMonadicCreate); + } + + private class OptimisticDirectExecutionQueryPipelineImpl : IQueryPipelineStage + { + private readonly QueryPartitionRangePageAsyncEnumerator queryPartitionRangePageAsyncEnumerator; + + private OptimisticDirectExecutionQueryPipelineImpl( + QueryPartitionRangePageAsyncEnumerator queryPartitionRangePageAsyncEnumerator) { - FeedRangeState getState = new (targetRange, (QueryState)null); - monadicExtractState = TryCatch>.FromResult(getState); + this.queryPartitionRangePageAsyncEnumerator = queryPartitionRangePageAsyncEnumerator ?? throw new ArgumentNullException(nameof(queryPartitionRangePageAsyncEnumerator)); } - else + + public TryCatch Current { get; private set; } + + public ValueTask DisposeAsync() { - monadicExtractState = MonadicExtractState(continuationToken, targetRange); + return this.queryPartitionRangePageAsyncEnumerator.DisposeAsync(); } - - if (monadicExtractState.Failed) + + public void SetCancellationToken(CancellationToken cancellationToken) { - return TryCatch.FromException(monadicExtractState.Exception); + this.queryPartitionRangePageAsyncEnumerator.SetCancellationToken(cancellationToken); } - FeedRangeState feedRangeState = monadicExtractState.Result; + public async ValueTask MoveNextAsync(ITrace trace) + { + if (trace == null) + { + throw new ArgumentNullException(nameof(trace)); + } - QueryPartitionRangePageAsyncEnumerator partitionPageEnumerator = new QueryPartitionRangePageAsyncEnumerator( - documentContainer, - sqlQuerySpec, - feedRangeState, - partitionKey, - queryPaginationOptions, - cancellationToken); + if (!await this.queryPartitionRangePageAsyncEnumerator.MoveNextAsync(trace)) + { + this.Current = default; + return false; + } - OptimisticDirectExecutionQueryPipelineStage stage = new OptimisticDirectExecutionQueryPipelineStage(partitionPageEnumerator); - return TryCatch.FromResult(stage); - } + TryCatch partitionPage = this.queryPartitionRangePageAsyncEnumerator.Current; + if (partitionPage.Failed) + { + this.Current = TryCatch.FromException(partitionPage.Exception); + return true; + } - private static TryCatch> MonadicExtractState( - CosmosElement continuationToken, - FeedRangeEpk range) - { - if (continuationToken == null) - { - throw new ArgumentNullException(nameof(continuationToken)); + QueryPage backendQueryPage = partitionPage.Result; + + QueryState queryState; + if (backendQueryPage.State == null) + { + queryState = null; + } + else + { + QueryState backendQueryState = backendQueryPage.State; + ParallelContinuationToken parallelContinuationToken = new ParallelContinuationToken( + token: (backendQueryState?.Value as CosmosString)?.Value, + range: ((FeedRangeEpk)this.queryPartitionRangePageAsyncEnumerator.FeedRangeState.FeedRange).Range); + + OptimisticDirectExecutionContinuationToken optimisticDirectExecutionContinuationToken = new OptimisticDirectExecutionContinuationToken(parallelContinuationToken); + CosmosElement cosmosElementContinuationToken = OptimisticDirectExecutionContinuationToken.ToCosmosElement(optimisticDirectExecutionContinuationToken); + queryState = new QueryState(cosmosElementContinuationToken); + } + + QueryPage queryPage = new QueryPage( + backendQueryPage.Documents, + backendQueryPage.RequestCharge, + backendQueryPage.ActivityId, + backendQueryPage.ResponseLengthInBytes, + backendQueryPage.CosmosQueryExecutionInfo, + disallowContinuationTokenMessage: null, + backendQueryPage.AdditionalHeaders, + queryState); + + this.Current = TryCatch.FromResult(queryPage); + return true; } - TryCatch tryCreateContinuationToken = OptimisticDirectExecutionContinuationToken.TryCreateFromCosmosElement(continuationToken); - if (tryCreateContinuationToken.Failed) + public static TryCatch MonadicCreate( + IDocumentContainer documentContainer, + SqlQuerySpec sqlQuerySpec, + FeedRangeEpk targetRange, + Cosmos.PartitionKey? partitionKey, + QueryPaginationOptions queryPaginationOptions, + CosmosElement continuationToken, + CancellationToken cancellationToken) { - return TryCatch>.FromException(tryCreateContinuationToken.Exception); - } + if (targetRange == null) + { + throw new ArgumentNullException(nameof(targetRange)); + } - TryCatch> partitionMappingMonad = PartitionMapper.MonadicGetPartitionMapping( - range, - tryCreateContinuationToken.Result); + TryCatch> monadicExtractState; + if (continuationToken == null) + { + FeedRangeState getState = new (targetRange, (QueryState)null); + monadicExtractState = TryCatch>.FromResult(getState); + } + else + { + monadicExtractState = MonadicExtractState(continuationToken, targetRange); + } - if (partitionMappingMonad.Failed) + if (monadicExtractState.Failed) + { + return TryCatch.FromException(monadicExtractState.Exception); + } + + FeedRangeState feedRangeState = monadicExtractState.Result; + + QueryPartitionRangePageAsyncEnumerator partitionPageEnumerator = new QueryPartitionRangePageAsyncEnumerator( + documentContainer, + sqlQuerySpec, + feedRangeState, + partitionKey, + queryPaginationOptions, + cancellationToken); + + OptimisticDirectExecutionQueryPipelineImpl stage = new OptimisticDirectExecutionQueryPipelineImpl(partitionPageEnumerator); + return TryCatch.FromResult(stage); + } + + private static TryCatch> MonadicExtractState( + CosmosElement continuationToken, + FeedRangeEpk range) { - return TryCatch>.FromException( - partitionMappingMonad.Exception); + if (continuationToken == null) + { + throw new ArgumentNullException(nameof(continuationToken)); + } + + TryCatch tryCreateContinuationToken = OptimisticDirectExecutionContinuationToken.TryCreateFromCosmosElement(continuationToken); + if (tryCreateContinuationToken.Failed) + { + return TryCatch>.FromException(tryCreateContinuationToken.Exception); + } + + TryCatch> partitionMappingMonad = PartitionMapper.MonadicGetPartitionMapping( + range, + tryCreateContinuationToken.Result); + + if (partitionMappingMonad.Failed) + { + return TryCatch>.FromException( + partitionMappingMonad.Exception); + } + + PartitionMapper.PartitionMapping partitionMapping = partitionMappingMonad.Result; + + KeyValuePair kvpRange = new KeyValuePair( + partitionMapping.TargetMapping.Keys.First(), + partitionMapping.TargetMapping.Values.First()); + + FeedRangeState feedRangeState = new FeedRangeState(kvpRange.Key, kvpRange.Value?.Token != null ? new QueryState(CosmosString.Create(kvpRange.Value.Token.Token)) : null); + + return TryCatch>.FromResult(feedRangeState); } - - PartitionMapping partitionMapping = partitionMappingMonad.Result; - - KeyValuePair kvpRange = new KeyValuePair( - partitionMapping.TargetMapping.Keys.First(), - partitionMapping.TargetMapping.Values.First()); - - FeedRangeState feedRangeState = new FeedRangeState(kvpRange.Key, kvpRange.Value?.Token != null ? new QueryState(CosmosString.Create(kvpRange.Value.Token.Token)) : null); - - return TryCatch>.FromResult(feedRangeState); } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.NegativeOptimisticDirectExecutionOutput.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.NegativeOptimisticDirectExecutionOutput.xml index b56c470469..7a8259eefc 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.NegativeOptimisticDirectExecutionOutput.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.NegativeOptimisticDirectExecutionOutput.xml @@ -38,4 +38,30 @@ false + + + Single Partition Key with Parallel continuation token + SELECT * FROM c + + /pk + + Hash + + + false + + + + + Single Partition Key with OrderBy continuation token + SELECT * FROM c ORDER BY c._ts + + /pk + + Hash + + + false + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml index 7d4f7ce18d..2482925bd8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml @@ -38,4 +38,30 @@ true + + + Single Partition Key and Value Field + SELECT * FROM c + + /pk + + Hash + + + true + + + + + Single Partition Key and Ode continuation token + SELECT * FROM c + + /pk + + Hash + + + true + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs index f849a04913..6737a3d338 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs @@ -3,33 +3,31 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; - using System.Xml; - using Microsoft.Azure.Documents; - using Microsoft.Azure.Documents.Routing; - using Microsoft.Azure.Cosmos.Query.Core; - using Microsoft.Azure.Cosmos.Test.BaselineTest; - using Microsoft.VisualStudio.TestTools.UnitTesting; - using Newtonsoft.Json; - using Microsoft.Azure.Cosmos.Query.Core.QueryPlan; - using Microsoft.Azure.Cosmos.Query.Core.Monads; - using Microsoft.Azure.Cosmos.Query.Core.ExecutionContext; + using System.IO; + using System.Linq; + using System.Net; + using System.Threading; using System.Threading.Tasks; + using System.Xml; using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.Pagination; - using Microsoft.Azure.Cosmos.Tests.Pagination; - using Microsoft.Azure.Cosmos.Tracing; - using Microsoft.Azure.Cosmos.Query.Core.QueryClient; - using Moq; using Microsoft.Azure.Cosmos.Query; + using Microsoft.Azure.Cosmos.Query.Core; + using Microsoft.Azure.Cosmos.Query.Core.ExecutionContext; + using Microsoft.Azure.Cosmos.Query.Core.Monads; using Microsoft.Azure.Cosmos.Query.Core.Pipeline; - using Microsoft.Azure.Cosmos.Routing; - using System.Threading; - using System.Linq; - using Microsoft.Azure.Cosmos.Query.Core.Pipeline.Pagination; - using System.IO; - using Microsoft.Azure.Cosmos.Query.Core.Pipeline.OptimisticDirectExecutionQuery; + using Microsoft.Azure.Cosmos.Query.Core.Pipeline.CrossPartition.OrderBy; using Microsoft.Azure.Cosmos.Query.Core.Pipeline.CrossPartition.Parallel; - using Microsoft.IdentityModel.Tokens; + using Microsoft.Azure.Cosmos.Query.Core.Pipeline.Pagination; + using Microsoft.Azure.Cosmos.Query.Core.QueryClient; + using Microsoft.Azure.Cosmos.Query.Core.QueryPlan; + using Microsoft.Azure.Cosmos.Test.BaselineTest; + using Microsoft.Azure.Cosmos.Tests.Pagination; + using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Documents; + using Microsoft.Azure.Documents.Routing; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using Newtonsoft.Json; [TestClass] public class OptimisticDirectExecutionQueryBaselineTests : BaselineTests @@ -38,6 +36,10 @@ public class OptimisticDirectExecutionQueryBaselineTests : BaselineTests testVariations = new List { CreateInput( @@ -60,6 +62,22 @@ public void PositiveOptimisticDirectExecutionOutput() expectedOptimisticDirectExecution: true, partitionKeyPath: @"/pk", partitionKeyValue: @"value"), + + CreateInput( + description: @"Single Partition Key and Value Field", + query: "SELECT * FROM c", + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: "a", + continuationToken: null), + + CreateInput( + description: @"Single Partition Key and Ode continuation token", + query: "SELECT * FROM c", + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: "a", + continuationToken: cosmosElementOdeContinuationToken), }; this.ExecuteTestSuite(testVariations); } @@ -68,6 +86,23 @@ public void PositiveOptimisticDirectExecutionOutput() [Owner("akotalwar")] public void NegativeOptimisticDirectExecutionOutput() { + ParallelContinuationToken parallelContinuationToken = new ParallelContinuationToken( + token: Guid.NewGuid().ToString(), + range: new Documents.Routing.Range("A", "B", true, false)); + + OrderByContinuationToken orderByContinuationToken = new OrderByContinuationToken( + parallelContinuationToken, + new List() { new OrderByItem(CosmosObject.Create(new Dictionary() { { "item", CosmosString.Create("asdf") } })) }, + rid: "43223532", + skipCount: 42, + filter: "filter"); + + CosmosElement cosmosElementOrderByContinuationToken = CosmosArray.Create( + new List() + { + OrderByContinuationToken.ToCosmosElement(orderByContinuationToken) + }); + List testVariations = new List { CreateInput( @@ -90,58 +125,67 @@ public void NegativeOptimisticDirectExecutionOutput() expectedOptimisticDirectExecution: false, partitionKeyPath: @"/pk", partitionKeyValue: null), + + CreateInput( + description: @"Single Partition Key with Parallel continuation token", + query: "SELECT * FROM c", + expectedOptimisticDirectExecution: false, + partitionKeyPath: @"/pk", + partitionKeyValue: "a", + continuationToken: CosmosArray.Create(new List() { ParallelContinuationToken.ToCosmosElement(parallelContinuationToken) })), + + CreateInput( + description: @"Single Partition Key with OrderBy continuation token", + query: "SELECT * FROM c ORDER BY c._ts", + expectedOptimisticDirectExecution: false, + partitionKeyPath: @"/pk", + partitionKeyValue: "a", + continuationToken: cosmosElementOrderByContinuationToken), }; this.ExecuteTestSuite(testVariations); } - + // This test confirms that TestInjection.EnableOptimisticDirectExection is set to false from default. // Check test "TestPipelineForDistributedQueryAsync" to understand why this is done [TestMethod] - public async Task TestDefaultTestInjectionSettings() + public async Task TestDefaultTestInjectionSettingsAsync() { TestInjections testInjection = new TestInjections(simulate429s: false, simulateEmptyPages: false); Assert.AreEqual(testInjection.EnableOptimisticDirectExecution, false); } - [TestMethod] - [Owner("akotalwar")] - public async Task TestMonadicCreateOdePipeline() - { - int numItems = 10; - bool multiPartition = false; - string query = "SELECT * FROM c"; - - // null continuation token - Assert.IsTrue(await TryMonadicCreate(numItems, multiPartition, query, targetRange: FeedRangeEpk.FullRange, continuationToken: null)); - - CosmosElement cosmosElementContinuationToken = CosmosElement.Parse( - "{\"OptimisticDirectExecutionToken\":{\"token\":\"{\\\"resourceId\\\":\\\"AQAAAMmFOw8LAAAAAAAAAA==\\\",\\\"skipCount\\\":1}\"," + - "\"range\":{\"min\":\"\",\"max\":\"FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF\"}}}"); - Range range = new Documents.Routing.Range("", "FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF", isMinInclusive: true, isMaxInclusive: false); - - // single continuation token - Assert.IsTrue(await TryMonadicCreate(numItems, multiPartition, query, targetRange: new FeedRangeEpk(range), continuationToken: cosmosElementContinuationToken)); - - //TODO: Add non Ode continuation token case - } - - // test checks that the pipeline can take a query to the backend and returns its associated document(s). + // test checks that the pipeline can take a query to the backend and returns its associated document(s). [TestMethod] public async Task TestPipelineForBackendDocumentsOnSinglePartitionAsync() { int numItems = 100; - string query = "SELECT VALUE COUNT(1) FROM c"; + OptimisticDirectExecutionTestInput input = CreateInput( + description: @"Single Partition Key and Value Field", + query: "SELECT VALUE COUNT(1) FROM c", + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: "a"); + + QueryRequestOptions queryRequestOptions = GetQueryRequestOptions(enableOptimisticDirectExecution: true); + DocumentContainer inMemoryCollection = await CreateDocumentContainerAsync(numItems, multiPartition: false); - IQueryPipelineStage queryPipelineStage = await CreateOptimisticDirectExecutionPipelineStateAsync(inMemoryCollection, query, continuationToken: null); + IQueryPipelineStage queryPipelineStage = await GetOdePipelineAsync(input, inMemoryCollection, queryRequestOptions); int documentCountInSinglePartition = 0; while (await queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton)) { + Assert.AreEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); + TryCatch tryGetPage = queryPipelineStage.Current; tryGetPage.ThrowIfFailed(); documentCountInSinglePartition += Int32.Parse(tryGetPage.Result.Documents[0].ToString()); + + if (tryGetPage.Result.State == null) + { + break; + } } Assert.AreEqual(100, documentCountInSinglePartition); @@ -152,10 +196,17 @@ public async Task TestPipelineForBackendDocumentsOnSinglePartitionAsync() public async Task TestPipelineForContinuationTokenOnSinglePartitionAsync() { int numItems = 100; - int result = await this.CreateOptimisticPipelineAndDrainAsync( - numItems: numItems, - isMultiPartition: false, - query: "SELECT * FROM c", + OptimisticDirectExecutionTestInput input = CreateInput( + description: @"Single Partition Key and Value Field", + query: "SELECT * FROM c", + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: "a"); + + int result = await this.GetPipelineAndDrainAsync( + input, + numItems: numItems, + isMultiPartition: false, expectedContinuationTokenCount: 10); Assert.AreEqual(numItems, result); @@ -165,9 +216,18 @@ public async Task TestPipelineForContinuationTokenOnSinglePartitionAsync() [TestMethod] public async Task TestPipelineForGoneExceptionOnSingleAndMultiplePartitionAsync() { - Assert.IsTrue(await ExecuteGoneExceptionOnOdePipeline(isMultiPartition: false)); + Assert.IsTrue(await ExecuteGoneExceptionOnODEPipeline(isMultiPartition: false)); + + Assert.IsTrue(await ExecuteGoneExceptionOnODEPipeline(isMultiPartition: true)); + } + + // test to check if failing fallback pipeline is handled properly + [TestMethod] + public async Task TestHandlingOfFailedFallbackPipelineOnSingleAndMultiplePartitionAsync() + { + Assert.IsTrue(await TestHandlingOfFailedFallbackPipeline(isMultiPartition: false)); - Assert.IsTrue(await ExecuteGoneExceptionOnOdePipeline(isMultiPartition: true)); + Assert.IsTrue(await TestHandlingOfFailedFallbackPipeline(isMultiPartition: true)); } // The reason we have the below test is to show the missing capabilities of the OptimisticDirectExecution pipeline. @@ -177,66 +237,126 @@ public async Task TestPipelineForGoneExceptionOnSingleAndMultiplePartitionAsync( public async Task TestPipelineForDistributedQueryAsync() { int numItems = 100; - int result = await this.CreateOptimisticPipelineAndDrainAsync( - numItems: numItems, - isMultiPartition: false, - query: "SELECT AVG(c) FROM c", + OptimisticDirectExecutionTestInput input = CreateInput( + description: @"Single Partition Key and Value Field", + query: "SELECT AVG(c) FROM c", + expectedOptimisticDirectExecution: false, + partitionKeyPath: @"/pk", + partitionKeyValue: "a"); + + int result = await this.GetPipelineAndDrainAsync( + input, + numItems: numItems, + isMultiPartition: false, expectedContinuationTokenCount: 0); //TODO: Add validation for actual value of average Assert.AreEqual(1, result); } - private static async Task TryMonadicCreate(int numItems, bool multiPartition, string query, FeedRangeEpk targetRange, CosmosElement continuationToken) + // Creates a gone exception after the first MoveNexyAsync() call. This allows for the pipeline to return some documents before failing + private static async Task ExecuteGoneExceptionOnODEPipeline(bool isMultiPartition) + { + int numItems = 100; + List documents = new List(); + QueryRequestOptions queryRequestOptions = GetQueryRequestOptions(enableOptimisticDirectExecution: true); + (MergeTestUtil mergeTest, IQueryPipelineStage queryPipelineStage) = await CreateFallbackPipelineTestInfrastructure(numItems, isFailedFallbackPipelineTest: false, isMultiPartition, queryRequestOptions); + + while (await queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton)) + { + if (mergeTest.MoveNextCounter == 1) + { + Assert.AreEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); + } + else + { + Assert.AreNotEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); + } + + TryCatch tryGetPage = queryPipelineStage.Current; + + if (tryGetPage.Failed) + { + // failure should never come till here. Should be handled before + Assert.Fail("Unexpected error. Gone Exception should not reach till here"); + } + + documents.AddRange(tryGetPage.Result.Documents); + } + + Assert.AreEqual(numItems, documents.Count); + return true; + } + + private static async Task TestHandlingOfFailedFallbackPipeline(bool isMultiPartition) { - DocumentContainer inMemoryCollection = await CreateDocumentContainerAsync(numItems, multiPartition); + int numItems = 100; + List documents = new List(); + QueryRequestOptions queryRequestOptions = GetQueryRequestOptions(enableOptimisticDirectExecution: true); + (MergeTestUtil mergeTest, IQueryPipelineStage queryPipelineStage) = await CreateFallbackPipelineTestInfrastructure(numItems, isFailedFallbackPipelineTest: true, isMultiPartition, queryRequestOptions); + + while (await queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton)) + { + TryCatch tryGetPage = queryPipelineStage.Current; + if (tryGetPage.Failed) + { + if (mergeTest.MoveNextCounter == 3) + { + Assert.IsTrue(tryGetPage.InnerMostException.Message.Equals("Injected failure")); + Assert.AreNotEqual(numItems, documents.Count); + return true; + } + else + { + Assert.Fail("Fallback pipeline failure not handled correctly"); + return false; + } + } - TryCatch monadicQueryPipelineStage = OptimisticDirectExecutionQueryPipelineStage.MonadicCreate( - documentContainer: inMemoryCollection, - sqlQuerySpec: new SqlQuerySpec(query), - targetRange: targetRange, - queryPaginationOptions: new QueryPaginationOptions(pageSizeHint: 10), - partitionKey: null, - cancellationToken: default, - continuationToken: continuationToken); + documents.AddRange(tryGetPage.Result.Documents); + } - return monadicQueryPipelineStage.Succeeded; + return false; } - private static async Task CreateOptimisticDirectExecutionPipelineStateAsync(DocumentContainer documentContainer, string query, CosmosElement continuationToken) + private static async Task<(MergeTestUtil, IQueryPipelineStage)> CreateFallbackPipelineTestInfrastructure(int numItems, bool isFailedFallbackPipelineTest, bool isMultiPartition, QueryRequestOptions queryRequestOptions) { - List targetRanges = await documentContainer.GetFeedRangesAsync( - trace: NoOpTrace.Singleton, - cancellationToken: default); + List documents = new List(); + MergeTestUtil mergeTest = new MergeTestUtil(isFailedFallbackPipelineTest); - // only one range is taken because Ode pipeline can only accept one range - FeedRangeEpk firstRange = targetRanges[0]; + OptimisticDirectExecutionTestInput input = CreateInput( + description: @"Single Partition Key and Value Field", + query: "SELECT * FROM c", + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: "a"); - TryCatch monadicQueryPipelineStage = OptimisticDirectExecutionQueryPipelineStage.MonadicCreate( - documentContainer: documentContainer, - sqlQuerySpec: new SqlQuerySpec(query), - targetRange: firstRange, - queryPaginationOptions: new QueryPaginationOptions(pageSizeHint: 10), - partitionKey: null, - continuationToken: continuationToken, - cancellationToken: default); + DocumentContainer inMemoryCollection = await CreateDocumentContainerAsync( + numItems, + multiPartition: isMultiPartition, + failureConfigs: new FlakyDocumentContainer.FailureConfigs( + inject429s: false, + injectEmptyPages: false, + shouldReturnFailure: mergeTest.ShouldReturnFailure)); - Assert.IsTrue(monadicQueryPipelineStage.Succeeded); - IQueryPipelineStage queryPipelineStage = monadicQueryPipelineStage.Result; + IQueryPipelineStage queryPipelineStage = await GetOdePipelineAsync(input, inMemoryCollection, queryRequestOptions); - return queryPipelineStage; + return (mergeTest, queryPipelineStage); } - private async Task CreateOptimisticPipelineAndDrainAsync(int numItems, bool isMultiPartition, string query, int expectedContinuationTokenCount) + private async Task GetPipelineAndDrainAsync(OptimisticDirectExecutionTestInput input, int numItems, bool isMultiPartition, int expectedContinuationTokenCount) { + QueryRequestOptions queryRequestOptions = GetQueryRequestOptions(enableOptimisticDirectExecution: true); DocumentContainer inMemoryCollection = await CreateDocumentContainerAsync(numItems, multiPartition: isMultiPartition); - IQueryPipelineStage queryPipelineStage = await CreateOptimisticDirectExecutionPipelineStateAsync(inMemoryCollection, query, continuationToken: null); - + IQueryPipelineStage queryPipelineStage = await GetOdePipelineAsync(input, inMemoryCollection, queryRequestOptions); + List documents = new List(); int continuationTokenCount = 0; while (await queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton)) { + Assert.AreEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); + TryCatch tryGetPage = queryPipelineStage.Current; tryGetPage.ThrowIfFailed(); @@ -248,7 +368,15 @@ private async Task CreateOptimisticPipelineAndDrainAsync(int numItems, bool } else { - queryPipelineStage = await CreateOptimisticDirectExecutionPipelineStateAsync(inMemoryCollection, query, continuationToken: tryGetPage.Result.State.Value); + input = CreateInput( + description: input.Description, + query: input.Query, + expectedOptimisticDirectExecution: input.ExpectedOptimisticDirectExecution, + partitionKeyPath: @"/pk", + partitionKeyValue: input.PartitionKeyValue, + continuationToken: tryGetPage.Result.State.Value); + + queryPipelineStage = await GetOdePipelineAsync(input, inMemoryCollection, queryRequestOptions); } continuationTokenCount++; @@ -258,57 +386,34 @@ private async Task CreateOptimisticPipelineAndDrainAsync(int numItems, bool return documents.Count; } - // it creates a gone exception after the first MoveNexyAsync() call. This allows for the pipeline to return some documents before failing - // TODO: With the addition of the merge/split support, this queryPipelineStage should be able to return all documents regardless of a gone exception happening - private static async Task ExecuteGoneExceptionOnOdePipeline(bool isMultiPartition) + internal static PartitionedQueryExecutionInfo GetPartitionedQueryExecutionInfo(string querySpecJsonString, PartitionKeyDefinition pkDefinition) { - int numItems = 100; - string query = "SELECT * FROM c"; - List documents = new List(); - string goneExceptionMessage = $"Epk Range: Partition does not exist at the given range."; - CosmosException goneException = new CosmosException( - message: goneExceptionMessage, - statusCode: System.Net.HttpStatusCode.Gone, - subStatusCode: (int)SubStatusCodes.PartitionKeyRangeGone, - activityId: "0f8fad5b-d9cb-469f-a165-70867728950e", - requestCharge: default); - - int moveNextAsyncCounter = 0; - bool caughtGoneException = false; - DocumentContainer inMemoryCollection = await CreateDocumentContainerAsync( - numItems, - multiPartition: isMultiPartition, - failureConfigs: new FlakyDocumentContainer.FailureConfigs( - inject429s: false, - injectEmptyPages: false, - shouldReturnFailure: () => Task.FromResult(moveNextAsyncCounter == 1 ? goneException : null))); - - IQueryPipelineStage queryPipelineStage = await CreateOptimisticDirectExecutionPipelineStateAsync(inMemoryCollection, query, continuationToken: null); - while (await queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton)) - { - moveNextAsyncCounter++; - TryCatch tryGetPage = queryPipelineStage.Current; - - if (tryGetPage.Failed == true) - { - string errorRecieved = tryGetPage.Exception.InnerException.Message; - Assert.AreEqual(goneException.GetType(), tryGetPage.Exception.InnerException.GetType()); + TryCatch tryGetQueryPlan = QueryPartitionProviderTestInstance.Object.TryGetPartitionedQueryExecutionInfo( + querySpecJsonString: querySpecJsonString, + partitionKeyDefinition: pkDefinition, + requireFormattableOrderByQuery: true, + isContinuationExpected: true, + allowNonValueAggregateQuery: true, + hasLogicalPartitionKey: false, + allowDCount: true, + useSystemPrefix: false, + geospatialType: Cosmos.GeospatialType.Geography); - if (errorRecieved.Equals(goneExceptionMessage)) - { - caughtGoneException = true; - break; - } - } + return tryGetQueryPlan.Result; + } - documents.AddRange(tryGetPage.Result.Documents); - } + private static async Task GetOdePipelineAsync(OptimisticDirectExecutionTestInput input, DocumentContainer documentContainer, QueryRequestOptions queryRequestOptions) + { + (CosmosQueryExecutionContextFactory.InputParameters inputParameters, CosmosQueryContextCore cosmosQueryContextCore) = CreateInputParamsAndQueryContext(input, queryRequestOptions); - // Once fallback plan is implemented, this test should be able to return all 100 documents - Assert.AreEqual(10, documents.Count); - Assert.IsTrue(caughtGoneException); + IQueryPipelineStage queryPipelineStage = CosmosQueryExecutionContextFactory.Create( + documentContainer, + cosmosQueryContextCore, + inputParameters, + NoOpTrace.Singleton); - return true; + Assert.IsNotNull(queryPipelineStage); + return queryPipelineStage; } private static async Task CreateDocumentContainerAsync( @@ -335,7 +440,7 @@ private static async Task CreateDocumentContainerAsync( DocumentContainer documentContainer = new DocumentContainer(monadicDocumentContainer); // a value of 2 would lead to 4 partitions (2 * 2). 4 partitions are used because they're easy to manage + demonstrates multi partition use case - int exponentPartitionKeyRanges = 2; + int exponentPartitionKeyRanges = 2; IReadOnlyList ranges; @@ -359,7 +464,7 @@ private static async Task CreateDocumentContainerAsync( ranges = await documentContainer.GetFeedRangesAsync( trace: NoOpTrace.Singleton, cancellationToken: default); - + int rangeCount = multiPartition ? 4 : 1; Assert.AreEqual(rangeCount, ranges.Count); @@ -367,7 +472,7 @@ private static async Task CreateDocumentContainerAsync( for (int i = 0; i < numItems; i++) { // Insert an item - CosmosObject item = CosmosObject.Parse($"{{\"pk\" : {i} }}"); + CosmosObject item = CosmosObject.Parse($"{{\"pk\" : \"a\" }}"); TryCatch monadicCreateRecord = await documentContainer.MonadicCreateItemAsync(item, cancellationToken: default); Assert.IsTrue(monadicCreateRecord.Succeeded); } @@ -400,52 +505,43 @@ private static OptimisticDirectExecutionTestInput CreateInput( return new OptimisticDirectExecutionTestInput(description, query, new SqlQuerySpec(query), expectedOptimisticDirectExecution, partitionKeyPath, partitionKeyValue, continuationToken); } - private static PartitionedQueryExecutionInfo GetPartitionedQueryExecutionInfo(string querySpecJsonString, PartitionKeyDefinition pkDefinition) - { - TryCatch tryGetQueryPlan = QueryPartitionProviderTestInstance.Object.TryGetPartitionedQueryExecutionInfo( - querySpecJsonString: querySpecJsonString, - partitionKeyDefinition: pkDefinition, - requireFormattableOrderByQuery: true, - isContinuationExpected: true, - allowNonValueAggregateQuery: true, - hasLogicalPartitionKey: false, - allowDCount: true, - useSystemPrefix: false, - geospatialType: Cosmos.GeospatialType.Geography); - - return tryGetQueryPlan.Result; - } - public override OptimisticDirectExecutionTestOutput ExecuteTest(OptimisticDirectExecutionTestInput input) { // gets DocumentContainer IMonadicDocumentContainer monadicDocumentContainer = new InMemoryContainer(input.PartitionKeyDefinition); DocumentContainer documentContainer = new DocumentContainer(monadicDocumentContainer); - SqlQuerySpec sqlQuerySpec = new SqlQuerySpec(input.Query); + QueryRequestOptions queryRequestOptions = GetQueryRequestOptions(enableOptimisticDirectExecution: true); - // gets query context - string databaseId = "db1234"; - string resourceLink = $"dbs/{databaseId}/colls"; - CosmosQueryContextCore cosmosQueryContextCore = new CosmosQueryContextCore( - client: new TestCosmosQueryClient(), - resourceTypeEnum: Documents.ResourceType.Document, - operationType: Documents.OperationType.Query, - resourceType: typeof(QueryResponseCore), - resourceLink: resourceLink, - isContinuationExpected: true, - allowNonValueAggregateQuery: true, - useSystemPrefix: false, - correlatedActivityId: Guid.NewGuid()); + (CosmosQueryExecutionContextFactory.InputParameters inputParameters, CosmosQueryContextCore cosmosQueryContextCore) = CreateInputParamsAndQueryContext(input, queryRequestOptions); - // gets input parameters - QueryRequestOptions queryRequestOptions = new QueryRequestOptions + IQueryPipelineStage queryPipelineStage = CosmosQueryExecutionContextFactory.Create( + documentContainer, + cosmosQueryContextCore, + inputParameters, + NoOpTrace.Singleton); + + bool result = queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton).AsTask().GetAwaiter().GetResult(); + + if (input.ExpectedOptimisticDirectExecution) { - TestSettings = new TestInjections(simulate429s: true, simulateEmptyPages: false, enableOptimisticDirectExecution: true, new TestInjections.ResponseStats()) - }; + Assert.AreEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); + } + else + { + Assert.AreNotEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); + } + + Assert.IsNotNull(queryPipelineStage); + Assert.IsTrue(result); + return new OptimisticDirectExecutionTestOutput(input.ExpectedOptimisticDirectExecution); + } + + private static Tuple CreateInputParamsAndQueryContext(OptimisticDirectExecutionTestInput input, QueryRequestOptions queryRequestOptions) + { CosmosSerializerCore serializerCore = new(); - using StreamReader streamReader = new(serializerCore.ToStreamSqlQuerySpec(sqlQuerySpec, Documents.ResourceType.Document)); + using StreamReader streamReader = new(serializerCore.ToStreamSqlQuerySpec(new SqlQuerySpec(input.Query), Documents.ResourceType.Document)); string sqlQuerySpecJsonString = streamReader.ReadToEnd(); PartitionedQueryExecutionInfo partitionedQueryExecutionInfo = GetPartitionedQueryExecutionInfo(sqlQuerySpecJsonString, input.PartitionKeyDefinition); @@ -455,7 +551,7 @@ public override OptimisticDirectExecutionTestOutput ExecuteTest(OptimisticDirect } CosmosQueryExecutionContextFactory.InputParameters inputParameters = new CosmosQueryExecutionContextFactory.InputParameters( - sqlQuerySpec: sqlQuerySpec, + sqlQuerySpec: new SqlQuerySpec(input.Query), initialUserContinuationToken: input.ContinuationToken, initialFeedRange: null, maxConcurrency: queryRequestOptions.MaxConcurrency, @@ -466,30 +562,81 @@ public override OptimisticDirectExecutionTestOutput ExecuteTest(OptimisticDirect partitionedQueryExecutionInfo: partitionedQueryExecutionInfo, executionEnvironment: null, returnResultsInDeterministicOrder: null, - forcePassthrough: true, + forcePassthrough: false, testInjections: queryRequestOptions.TestSettings); - IQueryPipelineStage queryPipelineStage = CosmosQueryExecutionContextFactory.Create( - documentContainer, - cosmosQueryContextCore, - inputParameters, - NoOpTrace.Singleton); + string databaseId = "db1234"; + string resourceLink = $"dbs/{databaseId}/colls"; + CosmosQueryContextCore cosmosQueryContextCore = new CosmosQueryContextCore( + client: new TestCosmosQueryClient(), + resourceTypeEnum: Documents.ResourceType.Document, + operationType: Documents.OperationType.Query, + resourceType: typeof(QueryResponseCore), + resourceLink: resourceLink, + isContinuationExpected: true, + allowNonValueAggregateQuery: true, + useSystemPrefix: false, + correlatedActivityId: Guid.NewGuid()); - bool result = queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton).Result; + return Tuple.Create(inputParameters, cosmosQueryContextCore); + } - if (input.ExpectedOptimisticDirectExecution) + private static QueryRequestOptions GetQueryRequestOptions(bool enableOptimisticDirectExecution) + { + return new QueryRequestOptions { - Assert.AreEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); + MaxConcurrency = 0, + MaxItemCount = 10, + TestSettings = new TestInjections(simulate429s: true, simulateEmptyPages: false, enableOptimisticDirectExecution: enableOptimisticDirectExecution, new TestInjections.ResponseStats()), + Properties = new Dictionary() + { + { HttpConstants.HttpHeaders.EnumerationDirection, ""}, } - else + }; + } + + private class MergeTestUtil + { + public int MoveNextCounter { get; private set; } + + public bool GoneExceptionCreated { get; private set; } + + public bool TooManyRequestsFailureCreated { get; private set; } + + public bool IsFailedFallbackPipelineTest { get; } + + public MergeTestUtil(bool isFailedFallbackPipelineTest) { - Assert.AreNotEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); + this.IsFailedFallbackPipelineTest = isFailedFallbackPipelineTest; } - Assert.IsNotNull(queryPipelineStage); - Assert.IsTrue(result); + public async Task ShouldReturnFailure() + { + this.MoveNextCounter++; + if (this.MoveNextCounter == 2 && !this.GoneExceptionCreated) + { + this.GoneExceptionCreated = true; + return new CosmosException( + message: $"Epk Range: Partition does not exist at the given range.", + statusCode: System.Net.HttpStatusCode.Gone, + subStatusCode: (int)SubStatusCodes.PartitionKeyRangeGone, + activityId: "0f8fad5b-d9cb-469f-a165-70867728950e", + requestCharge: default); + } + + if (this.IsFailedFallbackPipelineTest && this.GoneExceptionCreated && !this.TooManyRequestsFailureCreated) + { + this.TooManyRequestsFailureCreated = true; + return new CosmosException( + message: "Injected failure", + statusCode: HttpStatusCode.TooManyRequests, + subStatusCode: 3200, + activityId: "111fad5b-d9cb-469f-a165-70867728950e", + requestCharge: 0); + } - return new OptimisticDirectExecutionTestOutput(input.ExpectedOptimisticDirectExecution); + return null; + } } } @@ -578,14 +725,14 @@ public override void SerializeAsXml(XmlWriter xmlWriter) } } } - + internal class TestCosmosQueryClient : CosmosQueryClient { public override Action OnExecuteScalarQueryCallback => throw new NotImplementedException(); public override bool ByPassQueryParsing() { - throw new NotImplementedException(); + return false; } public override void ClearSessionTokenCache(string collectionFullName) @@ -610,7 +757,11 @@ public override Task ForceRefreshCollectionCacheAsync(string collectionLink, Can public override Task GetCachedContainerQueryPropertiesAsync(string containerLink, Cosmos.PartitionKey? partitionKey, ITrace trace, CancellationToken cancellationToken) { - return Task.FromResult(new ContainerQueryProperties()); + return Task.FromResult(new ContainerQueryProperties( + "test", + WFConstants.BackendHeaders.EffectivePartitionKeyString, + new PartitionKeyDefinition(), + Cosmos.GeospatialType.Geometry)); } public override Task> GetTargetPartitionKeyRangeByFeedRangeAsync(string resourceLink, string collectionResourceId, PartitionKeyDefinition partitionKeyDefinition, FeedRangeInternal feedRangeInternal, bool forceRefresh, ITrace trace) @@ -630,7 +781,12 @@ public override Task> GetTargetPartitionKeyRangesAsync(s public override Task> GetTargetPartitionKeyRangesByEpkStringAsync(string resourceLink, string collectionResourceId, string effectivePartitionKeyString, bool forceRefresh, ITrace trace) { - throw new NotImplementedException(); + return Task.FromResult(new List{new PartitionKeyRange() + { + MinInclusive = PartitionKeyInternal.MinimumInclusiveEffectivePartitionKey, + MaxExclusive = PartitionKeyInternal.MaximumExclusiveEffectivePartitionKey + } + }); } public override Task> TryGetOverlappingRangesAsync(string collectionResourceId, Range range, bool forceRefresh = false) @@ -638,9 +794,14 @@ public override Task> TryGetOverlappingRangesAs throw new NotImplementedException(); } - public override Task> TryGetPartitionedQueryExecutionInfoAsync(SqlQuerySpec sqlQuerySpec, ResourceType resourceType, PartitionKeyDefinition partitionKeyDefinition, bool requireFormattableOrderByQuery, bool isContinuationExpected, bool allowNonValueAggregateQuery, bool hasLogicalPartitionKey, bool allowDCount, bool useSystemPrefix, Cosmos.GeospatialType geospatialType, CancellationToken cancellationToken) - { - throw new NotImplementedException(); + public override async Task> TryGetPartitionedQueryExecutionInfoAsync(SqlQuerySpec sqlQuerySpec, ResourceType resourceType, PartitionKeyDefinition partitionKeyDefinition, bool requireFormattableOrderByQuery, bool isContinuationExpected, bool allowNonValueAggregateQuery, bool hasLogicalPartitionKey, bool allowDCount, bool useSystemPrefix, Cosmos.GeospatialType geospatialType, CancellationToken cancellationToken) + { + CosmosSerializerCore serializerCore = new(); + using StreamReader streamReader = new(serializerCore.ToStreamSqlQuerySpec(sqlQuerySpec, Documents.ResourceType.Document)); + string sqlQuerySpecJsonString = streamReader.ReadToEnd(); + + PartitionedQueryExecutionInfo partitionedQueryExecutionInfo = OptimisticDirectExecutionQueryBaselineTests.GetPartitionedQueryExecutionInfo(sqlQuerySpecJsonString, partitionKeyDefinition); + return TryCatch.FromResult(partitionedQueryExecutionInfo); } } } From ccaf8fb9dd8517295044e32f1af43b7d0437c64b Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Mon, 23 Jan 2023 20:58:16 +0530 Subject: [PATCH 046/240] [Internal] AI Integration : Fixes operation type for batch (#3660) * fix op type * fix conflict --- Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs | 2 +- .../EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs b/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs index e211117d6f..35aad1be10 100644 --- a/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs +++ b/Microsoft.Azure.Cosmos/src/Batch/BatchCore.cs @@ -222,7 +222,7 @@ public override Task ExecuteAsync( operationName: nameof(ExecuteAsync), containerName: this.container.Id, databaseName: this.container.Database.Id, - operationType: Documents.OperationType.Replace, + operationType: Documents.OperationType.Batch, requestOptions: requestOptions, task: (trace) => { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index 0bee1cd007..59a5eabf76 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -129,7 +129,7 @@ } ] }]]> - Operation.ExecuteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationExecuteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.ExecuteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationExecuteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeBatchdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. From c29abfedcbd98edf5ac49c9e58c3befc21dd9c3e Mon Sep 17 00:00:00 2001 From: aavasthy <113193425+aavasthy@users.noreply.github.com> Date: Tue, 24 Jan 2023 11:52:53 -0500 Subject: [PATCH 047/240] CosmosClientOptions: Adds ServerCertificateCustomValidationCallback for Http and TCP (#3636) * Adding ServerCertificateCustomValidationCallback in clientoptions * Adding Server callback for Http and fixing tests * Fixing failing E2Etests * Resolving merge conflicts * Running update contracts script * Running Update contracts script * Running Update contracts script * Reverting the v3 version change * Update based on review comments * Added unit tests * Added remarks for callback delegate * Ran update contracts script * Update based on review comments * Ran update contracts script * Updated unit tests * Making ssl validation function private * Updating test files * Update remarks for sslvalidation public contract * Added emulator tests for server validation Co-authored-by: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> --- .../src/ConnectionPolicy.cs | 13 +++++- .../src/CosmosClientOptions.cs | 15 +++++- Microsoft.Azure.Cosmos/src/DocumentClient.cs | 18 ++++++-- .../src/HttpClient/CosmosHttpClientCore.cs | 11 ++++- .../src/Resource/ClientContextCore.cs | 13 +++++- .../ClientTests.cs | 37 ++++++++++++++- .../Contracts/DotNetPreviewSDKAPI.json | 10 ++-- .../Contracts/DotNetSDKAPI.json | 19 ++++++++ .../CosmosClientResourceUnitTests.cs | 46 ++++++++++++++++++- 9 files changed, 164 insertions(+), 18 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs b/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs index dca46a883f..172aac4fbb 100644 --- a/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs @@ -8,6 +8,8 @@ namespace Microsoft.Azure.Cosmos using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Net.Http; + using System.Net.Security; + using System.Security.Cryptography.X509Certificates; using Microsoft.Azure.Cosmos.Telemetry; using Microsoft.Azure.Documents; using Microsoft.Azure.Documents.Client; @@ -46,8 +48,8 @@ public ConnectionPolicy() this.MaxConnectionLimit = defaultMaxConcurrentConnectionLimit; this.RetryOptions = new RetryOptions(); this.EnableReadRequestsFallback = null; - this.EnableClientTelemetry = ClientTelemetryOptions.IsClientTelemetryEnabled(); + this.ServerCertificateCustomValidationCallback = null; } /// @@ -295,6 +297,15 @@ public bool EnablePartitionLevelFailover set; } + /// + /// Gets or sets the certificate validation callback. + /// + internal Func ServerCertificateCustomValidationCallback + { + get; + set; + } + /// /// Gets or sets the flag to enable writes on any locations (regions) for geo-replicated database accounts in the Azure Cosmos DB service. /// diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs index a75b508e3b..fec7f4ac2f 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs @@ -12,6 +12,8 @@ namespace Microsoft.Azure.Cosmos using System.Net; using System.Net.Http; using System.Net.Http.Headers; + using System.Net.Security; + using System.Security.Cryptography.X509Certificates; using Microsoft.Azure.Cosmos.Fluent; using Microsoft.Azure.Documents; using Microsoft.Azure.Documents.Client; @@ -633,6 +635,16 @@ internal Protocol ConnectionProtocol /// internal Func TransportClientHandlerFactory { get; set; } + /// + /// A callback delegate to do custom certificate validation for both HTTP and TCP. + /// + /// + /// + /// Customizing SSL verification is not recommended in production environments. + /// + /// + public Func ServerCertificateCustomValidationCallback { get; set; } + /// /// API type for the account /// @@ -746,7 +758,8 @@ internal virtual ConnectionPolicy GetConnectionPolicy(int clientId) EnablePartitionLevelFailover = this.EnablePartitionLevelFailover, PortReuseMode = this.portReuseMode, EnableTcpConnectionEndpointRediscovery = this.EnableTcpConnectionEndpointRediscovery, - HttpClientFactory = this.httpClientFactory + HttpClientFactory = this.httpClientFactory, + ServerCertificateCustomValidationCallback = this.ServerCertificateCustomValidationCallback }; if (this.EnableClientTelemetry.HasValue) diff --git a/Microsoft.Azure.Cosmos/src/DocumentClient.cs b/Microsoft.Azure.Cosmos/src/DocumentClient.cs index 61e7c99665..c7504d312c 100644 --- a/Microsoft.Azure.Cosmos/src/DocumentClient.cs +++ b/Microsoft.Azure.Cosmos/src/DocumentClient.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Cosmos using System.Linq; using System.Net; using System.Net.Http; + using System.Net.Security; using System.Security; using System.Text; using System.Threading; @@ -163,6 +164,9 @@ internal partial class DocumentClient : IDisposable, IAuthorizationTokenProvider //Trace Id. private int traceId; + //RemoteCertificateValidationCallback + internal RemoteCertificateValidationCallback remoteCertificateValidationCallback; + //SessionContainer. internal ISessionContainer sessionContainer; @@ -421,6 +425,7 @@ internal DocumentClient(Uri serviceEndpoint, /// Factory that creates store clients sharing the same transport client to optimize network resource reuse across multiple document clients in the same process. /// Flag to allow Quorum Read with Eventual Consistency Account /// + /// This delegate responsible for validating the third party certificate. /// /// The service endpoint can be obtained from the Azure Management Portal. /// If you are connecting using one of the Master Keys, these can be obtained along with the endpoint from the Azure Management Portal @@ -446,7 +451,8 @@ internal DocumentClient(Uri serviceEndpoint, Func transportClientHandlerFactory = null, IStoreClientFactory storeClientFactory = null, bool isLocalQuorumConsistency = false, - string cosmosClientId = null) + string cosmosClientId = null, + RemoteCertificateValidationCallback remoteCertificateValidationCallback = null) { if (sendingRequestEventArgs != null) { @@ -478,7 +484,8 @@ internal DocumentClient(Uri serviceEndpoint, sessionContainer: sessionContainer, enableCpuMonitor: enableCpuMonitor, storeClientFactory: storeClientFactory, - cosmosClientId: cosmosClientId); + cosmosClientId: cosmosClientId, + remoteCertificateValidationCallback: remoteCertificateValidationCallback); } /// @@ -660,7 +667,8 @@ internal virtual void Initialize(Uri serviceEndpoint, bool? enableCpuMonitor = null, IStoreClientFactory storeClientFactory = null, TokenCredential tokenCredential = null, - string cosmosClientId = null) + string cosmosClientId = null, + RemoteCertificateValidationCallback remoteCertificateValidationCallback = null) { if (serviceEndpoint == null) { @@ -668,6 +676,7 @@ internal virtual void Initialize(Uri serviceEndpoint, } this.clientId = cosmosClientId; + this.remoteCertificateValidationCallback = remoteCertificateValidationCallback; this.queryPartitionProvider = new AsyncLazy(async () => { @@ -6648,7 +6657,8 @@ private void InitializeDirectConnectivity(IStoreClientFactory storeClientFactory retryWithConfiguration: this.ConnectionPolicy.RetryOptions?.GetRetryWithConfiguration(), enableTcpConnectionEndpointRediscovery: this.ConnectionPolicy.EnableTcpConnectionEndpointRediscovery, addressResolver: this.AddressResolver, - rntbdMaxConcurrentOpeningConnectionCount: this.rntbdMaxConcurrentOpeningConnectionCount); + rntbdMaxConcurrentOpeningConnectionCount: this.rntbdMaxConcurrentOpeningConnectionCount, + remoteCertificateValidationCallback: this.remoteCertificateValidationCallback ); if (this.transportClientHandlerFactory != null) { diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs b/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs index f86bd6b183..a48666f16d 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs @@ -10,6 +10,8 @@ namespace Microsoft.Azure.Cosmos using System.Net; using System.Net.Http; using System.Net.Http.Headers; + using System.Net.Security; + using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Resource.CosmosExceptions; @@ -73,7 +75,8 @@ public static CosmosHttpClient CreateWithConnectionPolicy( { httpMessageHandler = CosmosHttpClientCore.CreateHttpClientHandler( gatewayModeMaxConnectionLimit: connectionPolicy.MaxConnectionLimit, - webProxy: null); + webProxy: null, + serverCertificateCustomValidationCallback: connectionPolicy.ServerCertificateCustomValidationCallback); } if (sendingRequestEventArgs != null || @@ -96,7 +99,7 @@ public static CosmosHttpClient CreateWithConnectionPolicy( eventSource: eventSource); } - public static HttpMessageHandler CreateHttpClientHandler(int gatewayModeMaxConnectionLimit, IWebProxy webProxy) + public static HttpMessageHandler CreateHttpClientHandler(int gatewayModeMaxConnectionLimit, IWebProxy webProxy, Func serverCertificateCustomValidationCallback) { HttpClientHandler httpClientHandler = new HttpClientHandler(); @@ -110,6 +113,10 @@ public static HttpMessageHandler CreateHttpClientHandler(int gatewayModeMaxConne try { httpClientHandler.MaxConnectionsPerServer = gatewayModeMaxConnectionLimit; + if (serverCertificateCustomValidationCallback != null) + { + httpClientHandler.ServerCertificateCustomValidationCallback = (_, certificate2, x509Chain, sslPolicyErrors) => serverCertificateCustomValidationCallback(certificate2, x509Chain, sslPolicyErrors); + } } // MaxConnectionsPerServer is not supported on some platforms. catch (PlatformNotSupportedException) diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index 191399943f..a9c475615a 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -8,6 +8,8 @@ namespace Microsoft.Azure.Cosmos using System.Diagnostics; using System.IO; using System.Net.Http; + using System.Net.Security; + using System.Security.Cryptography.X509Certificates; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -65,7 +67,8 @@ internal static CosmosClientContext Create( clientOptions = ClientContextCore.CreateOrCloneClientOptions(clientOptions); HttpMessageHandler httpMessageHandler = CosmosHttpClientCore.CreateHttpClientHandler( clientOptions.GatewayModeMaxConnectionLimit, - clientOptions.WebProxy); + clientOptions.WebProxy, + clientOptions.ServerCertificateCustomValidationCallback); DocumentClient documentClient = new DocumentClient( cosmosClient.Endpoint, @@ -79,7 +82,8 @@ internal static CosmosClientContext Create( desiredConsistencyLevel: clientOptions.GetDocumentsConsistencyLevel(), handler: httpMessageHandler, sessionContainer: clientOptions.SessionContainer, - cosmosClientId: cosmosClient.Id); + cosmosClientId: cosmosClient.Id, + remoteCertificateValidationCallback: ClientContextCore.SslCustomValidationCallBack(clientOptions.ServerCertificateCustomValidationCallback)); return ClientContextCore.Create( cosmosClient, @@ -87,6 +91,11 @@ internal static CosmosClientContext Create( clientOptions); } + private static RemoteCertificateValidationCallback SslCustomValidationCallBack(Func serverCertificateCustomValidationCallback) + { + return serverCertificateCustomValidationCallback == null ? null : (_, cert, chain, policy) => serverCertificateCustomValidationCallback((X509Certificate2)cert, chain, policy); + } + internal static CosmosClientContext Create( CosmosClient cosmosClient, DocumentClient documentClient, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs index c6a7bc16f7..2c9bf3325c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs @@ -7,13 +7,13 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System; using System.Collections.Generic; using System.Diagnostics; - using System.Formats.Asn1; using System.IO; using System.Linq; using System.Net; using System.Net.Http; - using System.Net.NetworkInformation; + using System.Net.Security; using System.Reflection; + using System.Security.Cryptography.X509Certificates; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -446,6 +446,39 @@ internal async Task TestEtagOnUpsertOperation(bool useGateway, Protocol protocol } } } + + [TestMethod] + public async Task Verify_CertificateCallBackGetsCalled_ForTCP_HTTP() + { + string authKey = ConfigurationManager.AppSettings["MasterKey"]; + string endpoint = ConfigurationManager.AppSettings["GatewayEndpoint"]; + int counter = 0; + AzureKeyCredential masterKeyCredential = new AzureKeyCredential(authKey); + CosmosClient cosmosClient = new CosmosClient( + endpoint, + masterKeyCredential, + new CosmosClientOptions() + { + ConnectionMode = ConnectionMode.Direct, + ConnectionProtocol = Protocol.Tcp, + ServerCertificateCustomValidationCallback = (X509Certificate2 cerf, X509Chain chain, SslPolicyErrors error) => { counter ++; return true; } + }); + + string databaseName = Guid.NewGuid().ToString(); + string databaseId = Guid.NewGuid().ToString(); + Cosmos.Database database = null; + //HTTP callback + database = await cosmosClient.CreateDatabaseAsync(databaseId); + + Cosmos.Container container = await database.CreateContainerAsync(Guid.NewGuid().ToString(), "/id"); + + //TCP callback + ToDoActivity item = ToDoActivity.CreateRandomToDoActivity(); + ResponseMessage responseMessage = await container.CreateItemStreamAsync(TestCommon.SerializerCore.ToStream(item), new Cosmos.PartitionKey(item.id)); + + Assert.IsTrue(counter >= 2); + + } [TestMethod] public void SqlQuerySpecSerializationTest() diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index c5bb91849b..43801584fe 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -165,11 +165,6 @@ "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode AllVersionsAndDeletes;CanRead:True;CanWrite:False;Microsoft.Azure.Cosmos.ChangeFeedMode get_AllVersionsAndDeletes();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, - "Microsoft.Azure.Cosmos.ChangeFeedMode LatestVersion": { - "Type": "Property", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode LatestVersion;CanRead:True;CanWrite:False;Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, "Microsoft.Azure.Cosmos.ChangeFeedMode get_AllVersionsAndDeletes()": { "Type": "Method", "Attributes": [], @@ -179,6 +174,11 @@ "Type": "Method", "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.ChangeFeedMode LatestVersion": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode LatestVersion;CanRead:True;CanWrite:False;Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 70e4a5d780..9edd8d6de1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -2764,6 +2764,18 @@ ], "MethodInfo": "System.Func`1[System.Net.Http.HttpClient] HttpClientFactory;CanRead:True;CanWrite:True;System.Func`1[System.Net.Http.HttpClient] get_HttpClientFactory();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_HttpClientFactory(System.Func`1[System.Net.Http.HttpClient]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "System.Func`4[System.Security.Cryptography.X509Certificates.X509Certificate2,System.Security.Cryptography.X509Certificates.X509Chain,System.Net.Security.SslPolicyErrors,System.Boolean] get_ServerCertificateCustomValidationCallback()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.Func`4[System.Security.Cryptography.X509Certificates.X509Certificate2,System.Security.Cryptography.X509Certificates.X509Chain,System.Net.Security.SslPolicyErrors,System.Boolean] get_ServerCertificateCustomValidationCallback();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Func`4[System.Security.Cryptography.X509Certificates.X509Certificate2,System.Security.Cryptography.X509Certificates.X509Chain,System.Net.Security.SslPolicyErrors,System.Boolean] ServerCertificateCustomValidationCallback": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.Func`4[System.Security.Cryptography.X509Certificates.X509Certificate2,System.Security.Cryptography.X509Certificates.X509Chain,System.Net.Security.SslPolicyErrors,System.Boolean] ServerCertificateCustomValidationCallback;CanRead:True;CanWrite:True;System.Func`4[System.Security.Cryptography.X509Certificates.X509Certificate2,System.Security.Cryptography.X509Certificates.X509Chain,System.Net.Security.SslPolicyErrors,System.Boolean] get_ServerCertificateCustomValidationCallback();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_ServerCertificateCustomValidationCallback(System.Func`4[System.Security.Cryptography.X509Certificates.X509Certificate2,System.Security.Cryptography.X509Certificates.X509Chain,System.Net.Security.SslPolicyErrors,System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "System.Net.IWebProxy get_WebProxy()": { "Type": "Method", "Attributes": [], @@ -3050,6 +3062,13 @@ "Attributes": [], "MethodInfo": "Void set_SerializerOptions(Microsoft.Azure.Cosmos.CosmosSerializationOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Void set_ServerCertificateCustomValidationCallback(System.Func`4[System.Security.Cryptography.X509Certificates.X509Certificate2,System.Security.Cryptography.X509Certificates.X509Chain,System.Net.Security.SslPolicyErrors,System.Boolean])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_ServerCertificateCustomValidationCallback(System.Func`4[System.Security.Cryptography.X509Certificates.X509Certificate2,System.Security.Cryptography.X509Certificates.X509Chain,System.Net.Security.SslPolicyErrors,System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Void set_TokenCredentialBackgroundRefreshInterval(System.Nullable`1[System.TimeSpan])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientResourceUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientResourceUnitTests.cs index 8ca17376ed..8d3f53edfb 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientResourceUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientResourceUnitTests.cs @@ -7,10 +7,16 @@ namespace Microsoft.Azure.Cosmos.Core.Tests using System; using System.Collections.Generic; using System.Net.Http; + using System.Net.Security; + using System.Security.Cryptography.X509Certificates; + using System.Security.Cryptography; using Microsoft.Azure.Cosmos.Tests; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; + using System.Globalization; + using System.Threading.Tasks; + using Microsoft.Azure.Documents.Collections; [TestClass] public class CosmosClientResourceUnitTests @@ -132,6 +138,44 @@ public void InitializeBatchExecutorForContainer_NotNull_WhenAllowBulk_True() Assert.IsNotNull(container.BatchExecutor); } + [TestMethod] + public void WithServerCertificateAddedClientOptions_CreateContext_RemoteCertificateCallbackReturnsTrue() + { + //Arrange + X509Certificate2 x509Certificate2 = new CertificateRequest("cn=www.test", ECDsa.Create(), HashAlgorithmName.SHA256).CreateSelfSigned(DateTime.Now, DateTime.Now.AddYears(1)); + X509Chain x509Chain = new X509Chain(); + SslPolicyErrors sslPolicyErrors = new SslPolicyErrors(); + + string authKeyValue = "MockAuthKey"; + Mock mockAuth = new Mock(MockBehavior.Strict); + mockAuth.Setup(x => x.Dispose()); + mockAuth.Setup(x => x.AddAuthorizationHeaderAsync( + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny())) + .Callback( + (headers, uri, verb, tokenType) => headers.Add(Documents.HttpConstants.HttpHeaders.Authorization, authKeyValue)) + .Returns(() => new ValueTask()); + + CosmosClient client = new CosmosClient( + "https://localhost:8081", + authorizationTokenProvider: mockAuth.Object, + new CosmosClientOptions() + { + ServerCertificateCustomValidationCallback = (X509Certificate2 cerf, X509Chain chain, SslPolicyErrors error) => true + }); + + //Act + CosmosClientContext context = ClientContextCore.Create( + client, + client.ClientOptions); + + //Assert + Assert.IsTrue(context.DocumentClient.remoteCertificateValidationCallback(new object(), x509Certificate2, x509Chain, sslPolicyErrors)); + + } + private CosmosClientContext CreateMockClientContext(bool allowBulkExecution = false) { Mock mockClient = new Mock(); @@ -141,6 +185,6 @@ private CosmosClientContext CreateMockClientContext(bool allowBulkExecution = fa mockClient.Object, new MockDocumentClient(), new CosmosClientOptions() { AllowBulkExecution = allowBulkExecution }); - } + } } } From 2608d4af7c45ffb417b72c11d711bca2c570a739 Mon Sep 17 00:00:00 2001 From: akotalwar <94020786+akotalwar@users.noreply.github.com> Date: Thu, 26 Jan 2023 11:36:56 -0800 Subject: [PATCH 048/240] Query: Adds EnableOptimisticDirectExecution flag to QueryRequestOptions (#3664) * Added new flag to QueryRequestOptions to allow customers to use Ode pipeline * Updated comments in QueryRequestOptions.cs * Renamed enabledOde to enableOde * Removed default setting for EnableOptimisticDirectExecution --- .../CosmosQueryExecutionContextFactory.cs | 7 +++++- .../src/Query/Core/TestInjections.cs | 5 +--- .../src/Query/v3Query/QueryIterator.cs | 1 + .../src/RequestOptions/QueryRequestOptions.cs | 8 +++++++ .../OptimisticDirectExecutionQueryTests.cs | 23 ++++++------------- .../Query/QueryTestsBase.cs | 1 + ...misticDirectExecutionQueryBaselineTests.cs | 11 +++++---- 7 files changed, 31 insertions(+), 25 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs index 371391386e..d8a885a07b 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs @@ -418,6 +418,7 @@ private static TryCatch TryCreateSpecializedDocumentQueryEx inputParameters.ExecutionEnvironment, inputParameters.ReturnResultsInDeterministicOrder, inputParameters.ForcePassthrough, + inputParameters.EnableOptimisticDirectExecution, inputParameters.TestInjections); } @@ -752,7 +753,7 @@ private static Documents.PartitionKeyDefinition GetPartitionKeyDefinition(InputP ContainerQueryProperties containerQueryProperties, ITrace trace) { - if (inputParameters.TestInjections == null || !inputParameters.TestInjections.EnableOptimisticDirectExecution) return null; + if (!inputParameters.EnableOptimisticDirectExecution) return null; // case 1: Is query going to a single partition bool hasPartitionKey = inputParameters.PartitionKey.HasValue @@ -824,6 +825,7 @@ public InputParameters( ExecutionEnvironment? executionEnvironment, bool? returnResultsInDeterministicOrder, bool forcePassthrough, + bool enableOptimisticDirectExecution, TestInjections testInjections) { this.SqlQuerySpec = sqlQuerySpec ?? throw new ArgumentNullException(nameof(sqlQuerySpec)); @@ -857,6 +859,7 @@ public InputParameters( this.ExecutionEnvironment = executionEnvironment.GetValueOrDefault(InputParameters.DefaultExecutionEnvironment); this.ReturnResultsInDeterministicOrder = returnResultsInDeterministicOrder.GetValueOrDefault(InputParameters.DefaultReturnResultsInDeterministicOrder); this.ForcePassthrough = forcePassthrough; + this.EnableOptimisticDirectExecution = enableOptimisticDirectExecution; this.TestInjections = testInjections; } @@ -873,6 +876,7 @@ public InputParameters( public bool ReturnResultsInDeterministicOrder { get; } public TestInjections TestInjections { get; } public bool ForcePassthrough { get; } + public bool EnableOptimisticDirectExecution { get; } public InputParameters WithContinuationToken(CosmosElement token) { @@ -889,6 +893,7 @@ public InputParameters WithContinuationToken(CosmosElement token) this.ExecutionEnvironment, this.ReturnResultsInDeterministicOrder, this.ForcePassthrough, + this.EnableOptimisticDirectExecution, this.TestInjections); } } diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/TestInjections.cs b/Microsoft.Azure.Cosmos/src/Query/Core/TestInjections.cs index 7ee877bd14..1328d4dbab 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/TestInjections.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/TestInjections.cs @@ -13,16 +13,13 @@ public enum PipelineType OptimisticDirectExecution, } - public TestInjections(bool simulate429s, bool simulateEmptyPages, bool enableOptimisticDirectExecution = false, ResponseStats responseStats = null) + public TestInjections(bool simulate429s, bool simulateEmptyPages, ResponseStats responseStats = null) { this.SimulateThrottles = simulate429s; this.SimulateEmptyPages = simulateEmptyPages; this.Stats = responseStats; - this.EnableOptimisticDirectExecution = enableOptimisticDirectExecution; } - public bool EnableOptimisticDirectExecution { get; } - public bool SimulateThrottles { get; } public bool SimulateEmptyPages { get; } diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs index 01a4e1b12e..a820a0a49a 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs @@ -144,6 +144,7 @@ public static QueryIterator Create( executionEnvironment: queryRequestOptions.ExecutionEnvironment, returnResultsInDeterministicOrder: queryRequestOptions.ReturnResultsInDeterministicOrder, forcePassthrough: forcePassthrough, + enableOptimisticDirectExecution: queryRequestOptions.EnableOptimisticDirectExecution, testInjections: queryRequestOptions.TestSettings); return new QueryIterator( diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs index 9e478c96b9..8711836191 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs @@ -43,6 +43,14 @@ public class QueryRequestOptions : RequestOptions /// public bool? EnableLowPrecisionOrderBy { get; set; } + /// + /// Gets or sets the option for customers to opt in for direct (optimistic) execution of the query.. + /// + /// + /// Direct (optimistic) execution offers improved performance for several kinds of queries such as a single partition streaming query. + /// + internal bool EnableOptimisticDirectExecution { get; set; } + /// /// Gets or sets the maximum number of items that can be buffered client side during /// parallel query execution in the Azure Cosmos DB service. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs index acdb4d92de..9d89f6362a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs @@ -67,7 +67,8 @@ private static async Task TestPositiveOptimisticDirectExecutionOutput( QueryRequestOptions feedOptions = new QueryRequestOptions { MaxItemCount = -1, - TestSettings = GetTestInjections(simulate429s:false, simulateEmptyPages:false, enableOptimisticDirectExecution:true) + EnableOptimisticDirectExecution = true, + TestSettings = new TestInjections(simulate429s: false, simulateEmptyPages: false, new TestInjections.ResponseStats()) }; // check if pipeline returns empty continuation token @@ -172,13 +173,11 @@ private static async Task TestPositiveOptimisticDirectExecutionOutput( feedOptions = new QueryRequestOptions { MaxItemCount = pageSizeOptions[i], - PartitionKey = queryAndResults[j].PartitionKey == null + PartitionKey = queryAndResults[j].PartitionKey == null ? null : new Cosmos.PartitionKey(queryAndResults[j].PartitionKey), - TestSettings = GetTestInjections( - simulate429s: false, - simulateEmptyPages: false, - enableOptimisticDirectExecution: queryAndResults[j].EnableOptimisticDirectExecution) + EnableOptimisticDirectExecution = queryAndResults[j].EnableOptimisticDirectExecution, + TestSettings = new TestInjections(simulate429s: false, simulateEmptyPages: false, new TestInjections.ResponseStats()) }; List items = await RunQueryAsync( @@ -208,7 +207,8 @@ private static async Task TestNegativeOptimisticDirectExecutionOutput( QueryRequestOptions feedOptions = new QueryRequestOptions { PartitionKey = new Cosmos.PartitionKey("/value"), - TestSettings = GetTestInjections(simulate429s: false, simulateEmptyPages: false, enableOptimisticDirectExecution: true) + EnableOptimisticDirectExecution = true, + TestSettings = new TestInjections(simulate429s: false, simulateEmptyPages: false, new TestInjections.ResponseStats()) }; // check if bad continuation queries and syntax error queries are handled by pipeline @@ -241,15 +241,6 @@ await container.GetItemQueryIterator( } } - private static TestInjections GetTestInjections(bool simulate429s, bool simulateEmptyPages, bool enableOptimisticDirectExecution) - { - return new TestInjections( - simulate429s, - simulateEmptyPages, - enableOptimisticDirectExecution, - new TestInjections.ResponseStats()); - } - private struct SinglePartitionWithContinuationsArgs { public int NumberOfDocuments; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/QueryTestsBase.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/QueryTestsBase.cs index 4775716efa..c196af9d44 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/QueryTestsBase.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/QueryTestsBase.cs @@ -597,6 +597,7 @@ internal static async Task> QueryWithCosmosElementContinuationTokenAsync Properties = queryRequestOptions.Properties, IsEffectivePartitionKeyRouting = queryRequestOptions.IsEffectivePartitionKeyRouting, CosmosElementContinuationToken = queryRequestOptions.CosmosElementContinuationToken, + EnableOptimisticDirectExecution = queryRequestOptions.EnableOptimisticDirectExecution, TestSettings = queryRequestOptions.TestSettings, }; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs index 6737a3d338..b6a78c111d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs @@ -148,11 +148,12 @@ public void NegativeOptimisticDirectExecutionOutput() // This test confirms that TestInjection.EnableOptimisticDirectExection is set to false from default. // Check test "TestPipelineForDistributedQueryAsync" to understand why this is done [TestMethod] - public async Task TestDefaultTestInjectionSettingsAsync() + public async Task TestDefaultQueryRequestOptionsSettings() { - TestInjections testInjection = new TestInjections(simulate429s: false, simulateEmptyPages: false); - Assert.AreEqual(testInjection.EnableOptimisticDirectExecution, false); + QueryRequestOptions requestOptions = new QueryRequestOptions(); + + Assert.AreEqual(requestOptions.EnableOptimisticDirectExecution, false); } // test checks that the pipeline can take a query to the backend and returns its associated document(s). @@ -563,6 +564,7 @@ public override OptimisticDirectExecutionTestOutput ExecuteTest(OptimisticDirect executionEnvironment: null, returnResultsInDeterministicOrder: null, forcePassthrough: false, + enableOptimisticDirectExecution: queryRequestOptions.EnableOptimisticDirectExecution, testInjections: queryRequestOptions.TestSettings); string databaseId = "db1234"; @@ -587,7 +589,8 @@ private static QueryRequestOptions GetQueryRequestOptions(bool enableOptimisticD { MaxConcurrency = 0, MaxItemCount = 10, - TestSettings = new TestInjections(simulate429s: true, simulateEmptyPages: false, enableOptimisticDirectExecution: enableOptimisticDirectExecution, new TestInjections.ResponseStats()), + EnableOptimisticDirectExecution = enableOptimisticDirectExecution, + TestSettings = new TestInjections(simulate429s: true, simulateEmptyPages: false, new TestInjections.ResponseStats()), Properties = new Dictionary() { { HttpConstants.HttpHeaders.EnumerationDirection, ""}, From d6a439f3ef766a911b569fdaf901f422cd50720a Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Wed, 1 Feb 2023 16:09:03 -0800 Subject: [PATCH 049/240] [Internal] Tests: Removes Direct/HTTPS emulator tests (#3679) * Removing direct/https tests * mppreference --- .../ClientTests.cs | 6 -- .../GatewayTests.cs | 35 ----------- .../HeadersValidationTests.cs | 63 ------------------- .../NameRoutingTests.cs | 60 ------------------ .../QueryTests.cs | 6 -- .../SmokeTests.cs | 35 ----------- .../Utils/Util.cs | 6 +- templates/emulator-setup.yml | 1 + 8 files changed, 3 insertions(+), 209 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs index 2c9bf3325c..a2fcc1f598 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs @@ -384,12 +384,6 @@ public async Task TestHeadersPassedinByClient() Assert.AreEqual((ulong)SDKSupportedCapabilities.PartitionMerge, capability & (ulong)SDKSupportedCapabilities.PartitionMerge,$" received header value as {sdkSupportedCapability}"); } - [TestMethod] - public async Task TestEtagOnUpsertOperationForHttpsClient() - { - await this.TestEtagOnUpsertOperation(false, Protocol.Https); - } - [TestMethod] public async Task TestEtagOnUpsertOperationForGatewayClient() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayTests.cs index d0366cf9b8..0d7eaa7ea5 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayTests.cs @@ -285,13 +285,6 @@ await this.ValidateStoredProcedureCrudAsync(ConsistencyLevel.Session, new ConnectionPolicy { ConnectionMode = ConnectionMode.Direct, ConnectionProtocol = Protocol.Tcp }); } - [TestMethod] - public async Task ValidateStoredProcedureCrud_SessionDirectHttps() - { - await this.ValidateStoredProcedureCrudAsync(ConsistencyLevel.Session, - new ConnectionPolicy { ConnectionMode = ConnectionMode.Direct, ConnectionProtocol = Protocol.Https }); - } - internal async Task ValidateStoredProcedureCrudAsync(ConsistencyLevel consistencyLevel, ConnectionPolicy connectionPolicy) { DocumentClient client = TestCommon.CreateClient(connectionPolicy.ConnectionMode == ConnectionMode.Gateway, @@ -432,13 +425,6 @@ public void ValidateTriggerCrud_SessionDirectTcp() new ConnectionPolicy { ConnectionMode = ConnectionMode.Direct, ConnectionProtocol = Protocol.Tcp }); } - [TestMethod] - public void ValidateTriggerCrud_SessionDirectHttps() - { - this.ValidateTriggerCrud(ConsistencyLevel.Session, - new ConnectionPolicy { ConnectionMode = ConnectionMode.Direct, ConnectionProtocol = Protocol.Https }); - } - internal void ValidateTriggerCrud(ConsistencyLevel consistencyLevel, ConnectionPolicy connectionPolicy) { DocumentClient client = TestCommon.CreateClient(connectionPolicy.ConnectionMode == ConnectionMode.Gateway, @@ -566,14 +552,6 @@ public void ValidateUserDefinedFunctionCrud_SessionDirectTcp() new ConnectionPolicy { ConnectionMode = ConnectionMode.Direct, ConnectionProtocol = Protocol.Tcp }); } - [TestMethod] - - public void ValidateUserDefinedFunctionCrud_SessionDirectHttps() - { - this.ValidateUserDefinedFunctionCrud(ConsistencyLevel.Session, - new ConnectionPolicy { ConnectionMode = ConnectionMode.Direct, ConnectionProtocol = Protocol.Https }); - } - [TestMethod] public void ValidateUserDefinedFunctionTimeout() { @@ -1501,7 +1479,6 @@ public async Task ValidateSystemSproc() await this.ValidateSystemSprocInternal(true); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - ValidateSystemSprocInternal(false, Protocol.Https); ValidateSystemSprocInternal(false, Protocol.Tcp); #endif } @@ -2183,7 +2160,6 @@ public async Task ValidateReadOnlyStoredProcedureExecution() #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator await ValidateReadOnlyStoredProcedureExecutionInternal(false, Protocol.Tcp); - await ValidateReadOnlyStoredProcedureExecutionInternal(false, Protocol.Https); #endif } @@ -2559,7 +2535,6 @@ public async Task ValidateChangeFeedIfNoneMatch() await this.ValidateChangeFeedIfNoneMatchHelper(true); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - await ValidateChangeFeedIfNoneMatchHelper(false, Protocol.Https); await ValidateChangeFeedIfNoneMatchHelper(false, Protocol.Tcp); #endif } @@ -2709,7 +2684,6 @@ public async Task ValidateChangeFeedIfModifiedSince() await this.ValidateChangeFeedIfModifiedSinceHelper(true); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - await ValidateChangeFeedIfModifiedSinceHelper(false, Protocol.Https); await ValidateChangeFeedIfModifiedSinceHelper(false, Protocol.Tcp); #endif } @@ -2822,7 +2796,6 @@ private async Task ValidateChangeFeedIfModifiedSinceHelper(bool useGateway, Prot public async Task ValidateChangeFeedWithPartitionKey() { await this.ValidateChangeFeedWithPartitionKeyHelper(true); - await this.ValidateChangeFeedWithPartitionKeyHelper(false, Protocol.Https); await this.ValidateChangeFeedWithPartitionKeyHelper(false, Protocol.Tcp); } @@ -2999,7 +2972,6 @@ public async Task ValidateReadPartitionKeyRange() await this.ValidateReadPartitionKeyRangeHelper(true); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - await ValidateReadPartitionKeyRangeHelper(false, Protocol.Https); await ValidateReadPartitionKeyRangeHelper(false, Protocol.Tcp); #endif } @@ -3109,13 +3081,6 @@ public void ValidateGenericReadDocumentDirectTcp() this.ValidateGenericReadDocumentFromResource(false, Protocol.Tcp).Wait(); } - [TestMethod] - public void ValidateGenericReadDocumentDirectHttps() - { - this.ValidateGenericReadDocument(false, Protocol.Https).Wait(); - this.ValidateGenericReadDocumentFromResource(false, Protocol.Tcp).Wait(); - } - private async Task ValidateGenericReadDocument(bool useGateway, Protocol protocol) { CosmosClient client = TestCommon.CreateCosmosClient(useGateway); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/HeadersValidationTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/HeadersValidationTests.cs index d8cf36f5de..be83b0e1fd 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/HeadersValidationTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/HeadersValidationTests.cs @@ -57,14 +57,6 @@ public void TestCleanup() HttpConstants.Versions.CurrentVersionUTF8 = this.currentVersionUTF8; } - [TestMethod] - public void ValidatePageSizeHttps() - { - var client = TestCommon.CreateClient(false, Protocol.Https); - ValidatePageSize(client); - ValidatePageSize(client); - } - [TestMethod] public void ValidatePageSizeRntbd() { @@ -182,13 +174,6 @@ public async Task ValidateConsistencyLevelRntbd() await ValidateCosistencyLevel(client); } - [TestMethod] - public async Task ValidateConsistencyLevelHttps() - { - DocumentClient client = TestCommon.CreateClient(false, Protocol.Https); - await ValidateCosistencyLevel(client); - } - private async Task ValidateCosistencyLevel(DocumentClient client) { DocumentCollection collection = TestCommon.CreateOrGetDocumentCollection(client); @@ -232,13 +217,6 @@ public void ValidateJsonSerializationFormatRntbd() ValidateJsonSerializationFormat(client); } - [TestMethod] - public void ValidateJsonSerializationFormatHttps() - { - var client = TestCommon.CreateClient(false, Protocol.Https); - ValidateJsonSerializationFormat(client); - } - private void ValidateJsonSerializationFormat(DocumentClient client) { DocumentCollection collection = TestCommon.CreateOrGetDocumentCollection(client); @@ -342,14 +320,6 @@ public void ValidateIndexingDirectiveRntbd() ValidateIndexingDirective(client); } - [TestMethod] - public void ValidateIndexingDirectiveHttps() - { - //var client = TestCommon.CreateClient(false, Protocol.Https); - var client = TestCommon.CreateClient(true, Protocol.Https); - ValidateIndexingDirective(client); - } - private void ValidateIndexingDirective(DocumentClient client) { // Number out of range. @@ -407,13 +377,6 @@ public void ValidateEnableScanInQueryRntbd() ValidateEnableScanInQuery(client); } - [TestMethod] - public void ValidateEnableScanInQueryHttps() - { - var client = TestCommon.CreateClient(false, Protocol.Https); - ValidateEnableScanInQuery(client); - } - private void ValidateEnableScanInQuery(DocumentClient client, bool isHttps = false) { // Value not boolean @@ -460,14 +423,6 @@ public void ValidateEnableLowPrecisionOrderByRntbd() ValidateEnableLowPrecisionOrderBy(client); } - [TestMethod] - - public void ValidateEnableLowPrecisionOrderByHttps() - { - var client = TestCommon.CreateClient(false, Protocol.Https); - ValidateEnableLowPrecisionOrderBy(client, true); - } - private void ValidateEnableLowPrecisionOrderBy(DocumentClient client, bool isHttps = false) { // Value not boolean @@ -516,13 +471,6 @@ public void ValidateEmitVerboseTracesInQueryRntbd() ValidateEmitVerboseTracesInQuery(client); } - [TestMethod] - public void ValidateEmitVerboseTracesInQueryHttps() - { - var client = TestCommon.CreateClient(false, Protocol.Https); - ValidateEmitVerboseTracesInQuery(client, true); - } - private void ValidateEmitVerboseTracesInQuery(DocumentClient client, bool isHttps = false) { // Value not boolean @@ -562,12 +510,6 @@ public void ValidateIfNonMatchGateway() ValidateIfNonMatch(client); } - [TestMethod] - public void ValidateIfNonMatchHttps() - { - var client = TestCommon.CreateClient(false, Protocol.Https); - ValidateIfNonMatch(client); - } [TestMethod] public void ValidateIfNonMatchRntbd() @@ -719,11 +661,6 @@ public async Task ValidateCollectionIndexProgressHeaders() await ValidateCollectionIndexProgressHeadersAsync(client, isElasticCollection: true); } - using (var client = TestCommon.CreateClient(false, Protocol.Https)) - { - await ValidateCollectionIndexProgressHeadersAsync(client, isElasticCollection: true); - } - using (var client = TestCommon.CreateClient(false, Protocol.Tcp)) { await ValidateCollectionIndexProgressHeadersAsync(client, isElasticCollection: true); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/NameRoutingTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/NameRoutingTests.cs index c17c310fdb..6c29791783 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/NameRoutingTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/NameRoutingTests.cs @@ -40,15 +40,6 @@ public async Task NameRoutingSmokeGatewayTest() #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - [TestMethod] - public void NameRoutingSmokeDirectHttpsTest() - { - DocumentClient client; - client = TestCommon.CreateClient(false, Protocol.Https, 10, ConsistencyLevel.Session); - - this.NameRoutingSmokeTestPrivateAsync(client).Wait(); - } - [TestMethod] public void NameRoutingSmokeDirectTcpTest() { @@ -436,8 +427,6 @@ public void ReplaceDocumentWithUri() this.ReplaceDocumentWithUriPrivateAsync(client).Wait(); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - client = TestCommon.CreateClient(false, Protocol.Https); - this.ReplaceDocumentWithUriPrivateAsync(client).Wait(); client = TestCommon.CreateClient(false, Protocol.Tcp); this.ReplaceDocumentWithUriPrivateAsync(client).Wait(); @@ -501,10 +490,6 @@ public async Task CollectionDeleteAndCreateWithSameNameTest() #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - client = TestCommon.CreateClient(false, Protocol.Https); - await this.CollectionDeleteAndCreateWithSameNameTestPrivateAsync(client); - - client = TestCommon.CreateClient(false, Protocol.Tcp); await this.CollectionDeleteAndCreateWithSameNameTestPrivateAsync(client); #endif @@ -606,14 +591,6 @@ private async Task CollectionDeleteAndCreateWithSameNameTestPrivateAsync(Documen // 11. Now it succeed. #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - - [TestMethod] - public void VerifyGatewayNameIdCacheRefreshDirectHttp() - { - DocumentClient client = TestCommon.CreateClient(false, Protocol.Https); - this.VerifyGatewayNameIdCacheRefreshPrivateAsync(client).Wait(); - } - [TestMethod] public void VerifyGatewayNameIdCacheRefreshDirectTcp() { @@ -760,9 +737,6 @@ public void VerifyInvalidPartitionException() this.VerifyInvalidPartitionExceptionPrivateAsync(client).Wait(); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - client = TestCommon.CreateClient(false, Protocol.Https); - this.VerifyInvalidPartitionExceptionPrivateAsync(client).Wait(); - client = TestCommon.CreateClient(false, Protocol.Tcp); this.VerifyInvalidPartitionExceptionPrivateAsync(client).Wait(); #endif @@ -797,9 +771,6 @@ public async Task VerifyInvalidPartitionExceptionWithPopulateQuotaInfo() await this.VerifyInvalidPartitionExceptionWithPopulateQuotaInfo(client); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - client = TestCommon.CreateClient(false, Protocol.Https); - await this.VerifyInvalidPartitionExceptionWithPopulateQuotaInfo(client); - client = TestCommon.CreateClient(false, Protocol.Tcp); await this.VerifyInvalidPartitionExceptionWithPopulateQuotaInfo(client); #endif @@ -850,9 +821,6 @@ public void VerifyNameIdCacheTaskReuse() this.VerifyNameIdCacheTaskReusePrivateAsync(client).Wait(); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - client = TestCommon.CreateClient(false, Protocol.Https); - this.VerifyNameIdCacheTaskReusePrivateAsync(client).Wait(); - client = TestCommon.CreateClient(false, Protocol.Tcp); this.VerifyNameIdCacheTaskReusePrivateAsync(client).Wait(); #endif @@ -903,10 +871,6 @@ public void CrazyNameTest() #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - - client = TestCommon.CreateClient(false, Protocol.Https); - this.CrazyNameTestPrivateAsync(client, false).Wait(); - client = TestCommon.CreateClient(false, Protocol.Tcp); this.CrazyNameTestPrivateAsync(client, false, true).Wait(); #endif @@ -1019,9 +983,6 @@ public void NameRoutingBadUrlTest() this.NameRoutingBadUrlTestPrivateAsync(client, false).Wait(); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - client = TestCommon.CreateClient(false, Protocol.Https); - this.NameRoutingBadUrlTestPrivateAsync(client, false).Wait(); - client = TestCommon.CreateClient(false, Protocol.Tcp); this.NameRoutingBadUrlTestPrivateAsync(client, false, true).Wait(); #endif @@ -1106,8 +1067,6 @@ public void VerifyInvalidNameTest() this.VerifyInvalidNameTestPrivateAsync(client).Wait(); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - client = TestCommon.CreateClient(false, Protocol.Https); - this.VerifyInvalidNameTestPrivateAsync(client).Wait(); client = TestCommon.CreateClient(false, Protocol.Tcp); this.VerifyInvalidNameTestPrivateAsync(client).Wait(); @@ -1249,14 +1208,6 @@ public void NameParsingTest() #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - [TestMethod] - [TestCategory("Ignore")] - public void VerifyMasterNodeThrottlingDirectHttp() - { - DocumentClient client = TestCommon.CreateClient(false, Protocol.Https); - this.VerifyMasterNodeThrottlingPrivateAsync(client).Wait(); - } - [TestMethod] public void VerifyMasterNodeThrottlingDirectTcp() { @@ -1271,9 +1222,6 @@ public async Task VerifyNameBasedCollectionCRUDOperations() await this.VerifyNameBasedCollectionCRUDOperationsAsync(client); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - client = TestCommon.CreateClient(false, Protocol.Https); - await this.VerifyNameBasedCollectionCRUDOperationsAsync(client); - client = TestCommon.CreateClient(false, Protocol.Tcp); await this.VerifyNameBasedCollectionCRUDOperationsAsync(client); #endif @@ -1291,7 +1239,6 @@ public async Task TestPartitionKeyDefinitionOnCollectionRecreate() #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator await this.TestPartitionKeyDefinitionOnCollectionRecreate(TestCommon.CreateClient(false, protocol: Protocol.Tcp)); - await this.TestPartitionKeyDefinitionOnCollectionRecreate(TestCommon.CreateClient(false, protocol: Protocol.Https)); #endif } @@ -1328,7 +1275,6 @@ public async Task TestPartitionKeyDefinitionOnContainerRecreateFromDifferentPart #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator await this.TestPartitionKeyDefinitionOnContainerRecreateFromDifferentPartitionKeyPath(TestCommon.CreateClient(false, protocol: Protocol.Tcp)); - await this.TestPartitionKeyDefinitionOnContainerRecreateFromDifferentPartitionKeyPath(TestCommon.CreateClient(false, protocol: Protocol.Https)); #endif } @@ -1426,7 +1372,6 @@ public async Task TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartition #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator await this.TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartitionedToPartitionedForQuery(TestCommon.CreateClient(false, protocol: Protocol.Tcp)); - await this.TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartitionedToPartitionedForQuery(TestCommon.CreateClient(false, protocol: Protocol.Https)); #endif } @@ -1484,7 +1429,6 @@ public async Task TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartition #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator await this.TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartitionedToPartitionedForParallelQuery(TestCommon.CreateClient(false, protocol: Protocol.Tcp)); - await this.TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartitionedToPartitionedForParallelQuery(TestCommon.CreateClient(false, protocol: Protocol.Https)); #endif } @@ -1537,7 +1481,6 @@ public async Task TestCollectionRecreateFromMultipartitionToSinglePartitionedFor { await this.TestCollectionRecreateFromMultipartitionToSinglePartitionedForQuery(TestCommon.CreateClient(true)); await this.TestCollectionRecreateFromMultipartitionToSinglePartitionedForQuery(TestCommon.CreateClient(false, protocol: Protocol.Tcp)); - await this.TestCollectionRecreateFromMultipartitionToSinglePartitionedForQuery(TestCommon.CreateClient(false, protocol: Protocol.Https)); } internal async Task TestCollectionRecreateFromMultipartitionToSinglePartitionedForQuery(DocumentClient client) @@ -1584,7 +1527,6 @@ public async Task TestRouteToNonExistentRangeAfterCollectionRecreate() #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator await this.TestRouteToNonExistentRangeAfterCollectionRecreate(TestCommon.CreateClient(false, protocol: Protocol.Tcp)); - await this.TestRouteToNonExistentRangeAfterCollectionRecreate(TestCommon.CreateClient(false, protocol: Protocol.Https)); #endif } @@ -1657,7 +1599,6 @@ public async Task TestRouteToExistentRangeAfterCollectionRecreate() #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator await this.TestRouteToExistentRangeAfterCollectionRecreate(TestCommon.CreateClient(false, protocol: Protocol.Tcp)); - await this.TestRouteToExistentRangeAfterCollectionRecreate(TestCommon.CreateClient(false, protocol: Protocol.Https)); #endif } @@ -1736,7 +1677,6 @@ public async Task TestPartitionKeyDefinitionOnCollectionRecreateFromPartitionedT #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator await this.TestPartitionKeyDefinitionOnCollectionRecreateFromPartitionedToNonPartitionedForQuery(TestCommon.CreateClient(false, protocol: Protocol.Tcp)); - await this.TestPartitionKeyDefinitionOnCollectionRecreateFromPartitionedToNonPartitionedForQuery(TestCommon.CreateClient(false, protocol: Protocol.Https)); #endif } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs index ebf90f2fd1..6d6484e5a9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs @@ -777,12 +777,6 @@ public void TestQueryUnicodeDocumentHttpsGateway() this.TestQueryUnicodeDocument(useGateway: true, protocol: Protocol.Https); } - [TestMethod] - public void TestQueryUnicodeDocumentHttpsDirect() - { - this.TestQueryUnicodeDocument(useGateway: false, protocol: Protocol.Https); - } - private void TestQueryUnicodeDocument(bool useGateway, Protocol protocol) { try diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SmokeTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SmokeTests.cs index a222e232f9..6aa1b2ca16 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SmokeTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SmokeTests.cs @@ -67,13 +67,6 @@ public async Task DocumentInsertsTest_GatewayHttps() await this.DocumentInsertsTest(); } - [TestMethod] - public async Task DocumentInsertsTest_DirectHttps() - { - this.client = this.GetDocumentClient(ConnectionMode.Direct, Documents.Client.Protocol.Https); - await this.DocumentInsertsTest(); - } - [TestMethod] public async Task DocumentInsertsTest_DirectTcp() { @@ -107,13 +100,6 @@ public async Task QueryWithPaginationTest_GatewayHttps() await this.QueryWithPagination(); } - [TestMethod] - public async Task QueryWithPaginationTest_DirectHttps() - { - this.client = this.GetDocumentClient(ConnectionMode.Direct, Documents.Client.Protocol.Https); - await this.QueryWithPagination(); - } - [TestMethod] public async Task QueryWithPaginationTest_DirectTcp() { @@ -173,13 +159,6 @@ public async Task CrossPartitionQueries_GatewayHttps() await this.CrossPartitionQueries(); } - [TestMethod] - public async Task CrossPartitionQueries_DirectHttps() - { - this.client = this.GetDocumentClient(ConnectionMode.Direct, Documents.Client.Protocol.Https); - await this.CrossPartitionQueries(); - } - [TestMethod] public async Task CrossPartitionQueries_DirectTcp() { @@ -220,13 +199,6 @@ public async Task CreateDatabaseIfNotExists_GatewayHttps() await this.CreateDatabaseIfNotExists(this.client); } - [TestMethod] - public async Task CreateDatabaseIfNotExists_DirectHttps() - { - this.client = this.GetDocumentClient(ConnectionMode.Direct, Documents.Client.Protocol.Https); - await this.CreateDatabaseIfNotExists(this.client); - } - [TestMethod] public async Task CreateDatabaseIfNotExists_DirectTcp() { @@ -266,13 +238,6 @@ public async Task CreateDocumentCollectionIfNotExists_GatewayHttps() await this.CreateDocumentCollectionIfNotExists(); } - [TestMethod] - public async Task CreateDocumentCollectionIfNotExists_DirectHttps() - { - this.client = this.GetDocumentClient(ConnectionMode.Direct, Documents.Client.Protocol.Https); - await this.CreateDocumentCollectionIfNotExists(); - } - [TestMethod] public async Task CreateDocumentCollectionIfNotExists_DirectTcp() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs index bdb688673d..8c71a6b168 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs @@ -112,8 +112,7 @@ internal static void TestForEachClient( new Dictionary { {DocumentClientType.Gateway, TestCommon.CreateClient(true, tokenType: authTokenType, defaultConsistencyLevel: consistencyLevel)}, - {DocumentClientType.DirectTcp, TestCommon.CreateClient(false, Protocol.Tcp, tokenType: authTokenType, defaultConsistencyLevel: consistencyLevel)}, - {DocumentClientType.DirectHttps, TestCommon.CreateClient(false, Protocol.Https, tokenType: authTokenType, defaultConsistencyLevel: consistencyLevel)} + {DocumentClientType.DirectTcp, TestCommon.CreateClient(false, Protocol.Tcp, tokenType: authTokenType, defaultConsistencyLevel: consistencyLevel)} }; foreach (KeyValuePair clientEntry in clients) @@ -149,8 +148,7 @@ internal static void TestForAnyClient( new Dictionary { {DocumentClientType.Gateway, TestCommon.CreateClient(true, tokenType: authTokenType, defaultConsistencyLevel: consistencyLevel)}, - {DocumentClientType.DirectTcp, TestCommon.CreateClient(false, Protocol.Tcp, tokenType: authTokenType, defaultConsistencyLevel: consistencyLevel)}, - {DocumentClientType.DirectHttps, TestCommon.CreateClient(false, Protocol.Https, tokenType: authTokenType, defaultConsistencyLevel: consistencyLevel)} + {DocumentClientType.DirectTcp, TestCommon.CreateClient(false, Protocol.Tcp, tokenType: authTokenType, defaultConsistencyLevel: consistencyLevel)} }; int seed = (int)DateTime.Now.Ticks; diff --git a/templates/emulator-setup.yml b/templates/emulator-setup.yml index 10b5664d82..56ba69b98b 100644 --- a/templates/emulator-setup.yml +++ b/templates/emulator-setup.yml @@ -11,6 +11,7 @@ steps: mkdir "$env:temp\Azure Cosmos DB Emulator" lessmsi x "$env:temp\azure-cosmosdb-emulator.msi" "$env:temp\Azure Cosmos DB Emulator\" Write-Host "Starting Comsos DB Emulator" -ForegroundColor green + Add-MpPreference -ExclusionPath "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator" Start-Process "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe" "/NoExplorer /NoUI /DisableRateLimiting /PartitionCount=100 /Consistency=Strong /enableRio /EnablePreview /EnableAadAuthentication /EnableSqlComputeEndpoint" -Verb RunAs Import-Module "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator" Get-Item env:* | Sort-Object -Property Name From 393ae2396c2ef7f34dae6ebf221339780c800c8c Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Thu, 2 Feb 2023 06:16:37 +0530 Subject: [PATCH 050/240] [Internal] Benchmark : Fixes issue with dependency on Cosmos Project (#3673) * users/sourabhjain/benchmarkfix * update pipeline * Revert "users/sourabhjain/benchmarkfix" This reverts commit 81b48f0e47aed7a75540c2c83f62cea98d86824f. * fix compilation error * add parama for preview pkg also --------- Co-authored-by: Matias Quaranta --- .../Tools/Benchmark/BenchmarkConfig.cs | 2 +- templates/build-benchmark.yml | 2 +- templates/build-preview.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs index b9235d2232..6f89776370 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs @@ -224,7 +224,7 @@ internal Microsoft.Azure.Cosmos.CosmosClient CreateCosmosClient(string accountKe clientOptions.ConsistencyLevel = (Microsoft.Azure.Cosmos.ConsistencyLevel)Enum.Parse(typeof(Microsoft.Azure.Cosmos.ConsistencyLevel), this.ConsistencyLevel, ignoreCase: true); } - clientOptions.EnableDistributedTracing = this.EnableDistributedTracing; + clientOptions.IsDistributedTracingEnabled = this.EnableDistributedTracing; return new Microsoft.Azure.Cosmos.CosmosClient( this.EndPoint, diff --git a/templates/build-benchmark.yml b/templates/build-benchmark.yml index a072c5cb81..7e73842ee1 100644 --- a/templates/build-benchmark.yml +++ b/templates/build-benchmark.yml @@ -30,5 +30,5 @@ jobs: configuration: $(parameters.BuildConfiguration) nugetConfigPath: NuGet.config projects: 'Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmark.sln' - arguments: -p:Optimize=true + arguments: -p:Optimize=true -p:OSSProjectRef=true versioningScheme: OFF \ No newline at end of file diff --git a/templates/build-preview.yml b/templates/build-preview.yml index 05387989c6..e9919878ff 100644 --- a/templates/build-preview.yml +++ b/templates/build-preview.yml @@ -167,5 +167,5 @@ jobs: configuration: $(parameters.BuildConfiguration) nugetConfigPath: NuGet.config projects: 'Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmark.sln' - arguments: -p:Optimize=true -p:IsPreview=true + arguments: -p:Optimize=true -p:IsPreview=true -p:OSSProjectRef=true versioningScheme: OFF \ No newline at end of file From 122bc561e606c52168614694b824520cd6530013 Mon Sep 17 00:00:00 2001 From: pravengithub <124255233+pravengithub@users.noreply.github.com> Date: Fri, 3 Feb 2023 06:41:28 -0800 Subject: [PATCH 051/240] LocalQuorum: Adds Quorum reads on Consistent Prefix Accounts (#3680) Co-authored-by: DESKTOP-ED57J7H\Prashanth Venkataram --- .../src/CosmosClientOptions.cs | 2 +- .../src/Fluent/CosmosClientBuilder.cs | 2 +- .../src/ValidationHelpers.cs | 15 ++-- .../ValidationHelpersTests.cs | 72 +++++++++++++++++++ 4 files changed, 82 insertions(+), 9 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ValidationHelpersTests.cs diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs index fec7f4ac2f..c826bb90d1 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs @@ -600,7 +600,7 @@ public Func HttpClientFactory internal bool EnablePartitionLevelFailover { get; set; } = false; /// - /// Quorum Read allowed with eventual consistency account + /// Quorum Read allowed with eventual consistency account or consistent prefix account. /// internal bool EnableUpgradeConsistencyToLocalQuorum { get; set; } = false; diff --git a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs index 44c38ec51b..692d5b498a 100644 --- a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs +++ b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs @@ -698,7 +698,7 @@ internal CosmosClientBuilder WithPartitionLevelFailoverEnabled() } /// - /// To enable LocalQuorum Consistency, i.e. Allow Quorum read with Eventual Consistency Account + /// To enable LocalQuorum Consistency, i.e. Allows Quorum read with Eventual Consistency Account or with Consistent Prefix Account. /// Use By Compute Only /// internal CosmosClientBuilder AllowUpgradeConsistencyToLocalQuorum() diff --git a/Microsoft.Azure.Cosmos/src/ValidationHelpers.cs b/Microsoft.Azure.Cosmos/src/ValidationHelpers.cs index 14256919c6..58a7a55ddb 100644 --- a/Microsoft.Azure.Cosmos/src/ValidationHelpers.cs +++ b/Microsoft.Azure.Cosmos/src/ValidationHelpers.cs @@ -10,12 +10,12 @@ namespace Microsoft.Azure.Cosmos internal static class ValidationHelpers { /// - /// If isLocalQuorumConsistency flag is true, it allows only "Quorum Read with Eventual Consistency Account". + /// If isLocalQuorumConsistency flag is true, it allows only "Quorum Read with either an Eventual Consistency Account or a Consistent Prefix Account". /// It goes through a validation where it doesn't allow strong consistency over weaker consistency. /// /// Account Level Consistency /// Request/Client Level Consistency - /// Allows Quorum Read with Eventual Account + /// Allows Quorum Read with Eventual or Consistent Prefix Account /// /// /// true/false @@ -36,12 +36,12 @@ public static bool IsValidConsistencyLevelOverwrite( } /// - /// If isLocalQuorumConsistency flag is true, it allows only "Quorum Read with Eventual Consistency Account". + /// If isLocalQuorumConsistency flag is true, it allows only "Quorum Read with either an Eventual Consistency Account or a Consistent Prefix Account". /// It goes through a validation where it doesn't allow strong consistency over weaker consistency. /// /// Account Level Consistency /// Request/Client Level Consistency - /// Allows Quorum Read with Eventual Account + /// Allows Quorum Read with Eventual or Consistent Prefix Account /// /// /// true/false @@ -107,7 +107,7 @@ private static bool IsValidConsistencyLevelOverwrite( } /// - /// Condition to check Quorum(i.e. Strong) read with eventual account + /// Condition to check Quorum(i.e. Strong) read with either an eventual consistency account or a consistent prefix account. /// /// /// @@ -119,7 +119,7 @@ private static bool IsLocalQuorumConsistency(Documents.ConsistencyLevel backendC OperationType? operationType, ResourceType? resourceType) { - if (backendConsistency != Documents.ConsistencyLevel.Eventual) + if (backendConsistency != Documents.ConsistencyLevel.Eventual && backendConsistency != Documents.ConsistencyLevel.ConsistentPrefix) { return false; } @@ -136,7 +136,8 @@ private static bool IsLocalQuorumConsistency(Documents.ConsistencyLevel backendC } if (!operationType.HasValue || - (operationType.HasValue && !(operationType == OperationType.Read || operationType == OperationType.ReadFeed))) + (operationType.HasValue && + !(operationType == OperationType.Read || operationType == OperationType.ReadFeed || operationType == OperationType.SqlQuery || operationType == OperationType.Query))) { return false; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ValidationHelpersTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ValidationHelpersTests.cs new file mode 100644 index 0000000000..2c9db33cec --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ValidationHelpersTests.cs @@ -0,0 +1,72 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Tests +{ + using System.Data; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + [TestClass] + public class ValidationHelpersTest + { + [TestMethod] + [DataRow(true, ConsistencyLevel.Eventual, ConsistencyLevel.Strong)] + [DataRow(true, ConsistencyLevel.ConsistentPrefix, ConsistencyLevel.Strong)] + [DataRow(false, ConsistencyLevel.Eventual, ConsistencyLevel.BoundedStaleness)] + [DataRow(false, ConsistencyLevel.ConsistentPrefix, ConsistencyLevel.BoundedStaleness)] + [DataRow(false, ConsistencyLevel.Session, ConsistencyLevel.Strong)] + [DataRow(false, ConsistencyLevel.BoundedStaleness, ConsistencyLevel.Strong)] + public void TestIsValidConsistencyLevelOverwrite(bool isValidConsistencyLevelOverwrite, + ConsistencyLevel backendConsistencyLevel, + ConsistencyLevel desiredConsistencyLevel) + { + bool result = ValidationHelpers.IsValidConsistencyLevelOverwrite(backendConsistencyLevel, + desiredConsistencyLevel, + true, + Documents.OperationType.Read, + Documents.ResourceType.Document); + + Assert.AreEqual(isValidConsistencyLevelOverwrite, result); + } + + [TestMethod] + [DataRow(false, ConsistencyLevel.Eventual, ConsistencyLevel.Strong)] + [DataRow(false, ConsistencyLevel.ConsistentPrefix, ConsistencyLevel.Strong)] + public void TestIsValidConsistencyLevelOverwrite_OnlyWhenSpecifyingExplicitOverwrite(bool isValidConsistencyLevelOverwrite, + ConsistencyLevel backendConsistencyLevel, + ConsistencyLevel desiredConsistencyLevel) + { + bool result = ValidationHelpers.IsValidConsistencyLevelOverwrite(backendConsistencyLevel, + desiredConsistencyLevel, + false, + Documents.OperationType.Read, + Documents.ResourceType.Document); + + Assert.AreEqual(isValidConsistencyLevelOverwrite, result); + } + + [TestMethod] + [DataRow(true, ConsistencyLevel.Eventual, ConsistencyLevel.Strong, Documents.OperationType.Read)] + [DataRow(true, ConsistencyLevel.Eventual, ConsistencyLevel.Strong, Documents.OperationType.ReadFeed)] + [DataRow(true, ConsistencyLevel.ConsistentPrefix, ConsistencyLevel.Strong, Documents.OperationType.Query)] + [DataRow(true, ConsistencyLevel.ConsistentPrefix, ConsistencyLevel.Strong, Documents.OperationType.SqlQuery)] + [DataRow(false, ConsistencyLevel.Eventual, ConsistencyLevel.Strong, Documents.OperationType.QueryPlan)] + [DataRow(false, ConsistencyLevel.ConsistentPrefix, ConsistencyLevel.Strong, Documents.OperationType.Create)] + [DataRow(false, ConsistencyLevel.ConsistentPrefix, ConsistencyLevel.Strong, Documents.OperationType.Batch)] + public void TestIsValidConsistencyLevelOverwrite_OnlyAllowedForCertainOperationTypes( + bool isValidConsistencyLevelOverwrite, + ConsistencyLevel backendConsistencyLevel, + ConsistencyLevel desiredConsistencyLevel, + dynamic operationType) + { + bool result = ValidationHelpers.IsValidConsistencyLevelOverwrite(backendConsistencyLevel, + desiredConsistencyLevel, + true, + (Documents.OperationType) operationType, + Documents.ResourceType.Document); + + Assert.AreEqual(isValidConsistencyLevelOverwrite, result); + } + } +} \ No newline at end of file From 8a537ce93a8ee3074e3eb35a5339675a6b93a90c Mon Sep 17 00:00:00 2001 From: aavasthy <113193425+aavasthy@users.noreply.github.com> Date: Mon, 6 Feb 2023 10:39:11 -0800 Subject: [PATCH 052/240] 3.32.0: Adds new SDK version and contract files (#3687) * 3.32.0: Adds new SDK version and contract files * 3.32.0: Adds new SDK version and contract files * Updating changelog version * Updating changelog version * Added more commits to changelog and updated release contract * Added documentation tags PR in changelog * Updated changelog based on reviews * Updated PR decsription in changelog * Update changelog.md Updated full fidelity change description Co-authored-by: Matias Quaranta --------- Co-authored-by: Matias Quaranta --- Directory.Build.props | 4 +- .../contracts/API_3.32.0-preview.txt | 1531 +++++++++++++++++ .../contracts/API_3.32.0.txt | 1478 ++++++++++++++++ changelog.md | 34 + 4 files changed, 3045 insertions(+), 2 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.32.0-preview.txt create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.32.0.txt diff --git a/Directory.Build.props b/Directory.Build.props index 2891c05569..887ca2d334 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 3.31.2 - 3.31.2 + 3.32.0 + 3.32.0 preview 3.30.1 2.0.1 diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.32.0-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.32.0-preview.txt new file mode 100644 index 0000000000..69b7a4b83e --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.32.0-preview.txt @@ -0,0 +1,1531 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool IsDistributedTracingEnabled { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithDistributedTracing(bool isEnabled=true); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsPrimitive(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.32.0.txt b/Microsoft.Azure.Cosmos/contracts/API_3.32.0.txt new file mode 100644 index 0000000000..5218206b0e --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.32.0.txt @@ -0,0 +1,1478 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsPrimitive(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/changelog.md b/changelog.md index add5a1de66..aa2aaad67d 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,40 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [3.32.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.32.0) - 2023-02-03 +#### Fixed +- [#3466](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3466) ClientRetryPolicy: Fixes behavior to Meta-data write operations in multimaster accounts +- [#3498](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3498) PartitionKey: Fixes NullRef in toString handling for None for PartitionKey.ToString() +- [#3385](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3385) Query: Fixes LINQ ToString got absorbed during translation +- [#3406](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3406) Query: Fixes LINQ to use custom serializer to serialize constant values in Query +- [#3496](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3496) Documentation: Adds XML comment to Database.ReadThroughputAsync definition +- [#3508](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3508), [#3640](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3640) CosmosClient Initialization: Refactors implementation for opening Rntbd connections to backend replica nodes in Direct mode +- [#3519](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3519) Diagnostics: Removes unused properties and reduces size +- [#3495](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3495) Query: Fixes partition range evaluation for spatial queries +- [#3399](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3399) Query: Fixes default to BadRequestException in case of internal errors in ServiceInterop +- [#3574](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3574) Query: Fixes incorrect FeedResponse.Count when result contains undefined elements +- [#3577](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3577) Trace: Fixes Tracing/diagnostics hour-times to 24Hours +- [#3632](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3632) Query: Fixes handling of CosmosUndefined, CosmosGuid and CosmosBinary in unordered DISTINCT +- [#3640](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3640) Token expiration: Fixes token expired errors happening on some environments +- [#3645](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3645) Change Feed Processor: Fixes behavior with StartTime on Local +- [#3643](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3643) Documentation: Fixed CosmosClientBuilder.WithConnectionModeGateway documentation +- [#3579](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3579) Documentation: Fixes EUAP in Comments + +#### Added +- [#3566](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3566) Change Feed Processor: Adds support for Resource Tokens +- [#3555](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3555) Availability: Adds HTTP timeouts with request-level cross-region retry +- [#3509](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3509) Query: Adds ALL Scalar Expression +- [#3656](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3656) Region Availability: Adds Poland Central Region For Public Usage. +- [#3636](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3636) CosmosClientOptions: Adds ServerCertificateCustomValidationCallback for Http and TCP + +### [3.32.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.32.0-preview) - 2023-02-03 + +#### Added +- [#3596](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3596) Full Fidelity Change Feed: Adds new LatestVersion to ChangeFeedMode. `FullFidelity` is now renamed to `AllVersionsAndDeletes`. +- [#3598](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3598) AI integration: Adds Distributed Tracing support. Enabled by default, which can be disabled through + `CosmosClientOptions.IsDistributedTracingEnabled` + + ### [3.31.2](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.31.2) - 2022-11-03 ### [3.31.2-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.31.2-preview) - 2022-11-03 From bf9a6d499579fc9f9e46804ae99f13eb00fc3eba Mon Sep 17 00:00:00 2001 From: Justine Cocchi Date: Thu, 9 Feb 2023 08:40:18 -0800 Subject: [PATCH 053/240] [Internal] Samples: Adds change feed pull model samples (#3646) * add change feed pull samples * refactor appsettings validation * addressing pr comments * move task delay * update sample to use latest change feed mode names --------- Co-authored-by: Matias Quaranta --- ...FPullModelAllVersionsAndDeletesMode.csproj | 21 ++ .../Program.cs | 225 ++++++++++++++++++ .../CFPullModelLatestVersionMode.csproj | 21 ++ .../CFPullModelLatestVersionMode/Program.cs | 155 ++++++++++++ .../Usage/Cosmos.Samples.Usage.sln | 16 +- 5 files changed, 436 insertions(+), 2 deletions(-) create mode 100644 Microsoft.Azure.Cosmos.Samples/Usage/CFPullModelAllVersionsAndDeletesMode/CFPullModelAllVersionsAndDeletesMode.csproj create mode 100644 Microsoft.Azure.Cosmos.Samples/Usage/CFPullModelAllVersionsAndDeletesMode/Program.cs create mode 100644 Microsoft.Azure.Cosmos.Samples/Usage/CFPullModelLatestVersionMode/CFPullModelLatestVersionMode.csproj create mode 100644 Microsoft.Azure.Cosmos.Samples/Usage/CFPullModelLatestVersionMode/Program.cs diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/CFPullModelAllVersionsAndDeletesMode/CFPullModelAllVersionsAndDeletesMode.csproj b/Microsoft.Azure.Cosmos.Samples/Usage/CFPullModelAllVersionsAndDeletesMode/CFPullModelAllVersionsAndDeletesMode.csproj new file mode 100644 index 0000000000..4cea61605d --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/CFPullModelAllVersionsAndDeletesMode/CFPullModelAllVersionsAndDeletesMode.csproj @@ -0,0 +1,21 @@ + + + + Exe + net6.0 + Cosmos.Samples.CFPullModelAllVersionsAndDeletesMode + Cosmos.Samples.CFPullModelAllVersionsAndDeletesMode + latest + + + + + + + + + + PreserveNewest + + + diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/CFPullModelAllVersionsAndDeletesMode/Program.cs b/Microsoft.Azure.Cosmos.Samples/Usage/CFPullModelAllVersionsAndDeletesMode/Program.cs new file mode 100644 index 0000000000..69d28cbfae --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/CFPullModelAllVersionsAndDeletesMode/Program.cs @@ -0,0 +1,225 @@ +namespace CFPullModelAllVersionsAndDeletesMode +{ + using System; + using System.Net; + using System.Threading.Tasks; + using Microsoft.Azure.Cosmos; + using Microsoft.Extensions.Configuration; + using Newtonsoft.Json; + + class Program + { + private static readonly string databaseName = "db"; + private static readonly string containerName = "container"; + + static async Task Main() + { + try + { + IConfigurationRoot configuration = new ConfigurationBuilder() + .AddJsonFile("appSettings.json") + .Build(); + + string endpoint = configuration["EndPointUrl"]; + if (string.IsNullOrEmpty(endpoint)) + { + throw new ArgumentNullException("Please specify a valid EndPointUrl in the appSettings.json"); + } + + string authKey = configuration["AuthorizationKey"]; + if (string.IsNullOrEmpty(authKey) || string.Equals(authKey, "Super secret key")) + { + throw new ArgumentException("Please specify a valid AuthorizationKey in the appSettings.json"); + } + + using (CosmosClient client = new CosmosClient(endpoint, authKey)) + { + Console.WriteLine($"Getting container reference for {containerName}."); + + ContainerProperties properties = new ContainerProperties(containerName, partitionKeyPath: "/id"); + + await client.CreateDatabaseIfNotExistsAsync(databaseName); + Container container = await client.GetDatabase(databaseName).CreateContainerIfNotExistsAsync(properties); + + string allVersionsContinuationToken = await CreateAllVersionsAndDeletesChangeFeedIterator(container); + + await IngestData(container); + await DeleteData(container); + + await ReadAllVersionsAndDeletesChangeFeed(container, allVersionsContinuationToken); + } + } + finally + { + Console.WriteLine("End of demo."); + } + } + + static async Task CreateAllVersionsAndDeletesChangeFeedIterator(Container container) + { + Console.WriteLine("Creating ChangeFeedIterator to read the change feed in All Versions and Deletes mode."); + + // + using (FeedIterator allVersionsIterator = container + .GetChangeFeedIterator(ChangeFeedStartFrom.Now(), ChangeFeedMode.AllVersionsAndDeletes)) + { + while (allVersionsIterator.HasMoreResults) + { + FeedResponse response = await allVersionsIterator.ReadNextAsync(); + + if (response.StatusCode == HttpStatusCode.NotModified) + { + return response.ContinuationToken; + } + } + } + // + + return null; + } + + static async Task IngestData(Container container) + { + Console.Clear(); + + Console.WriteLine("Press any key to begin ingesting data."); + Console.ReadKey(true); + + Console.WriteLine("Press any key to stop."); + + while (!Console.KeyAvailable) + { + Item item = GenerateItem(); + await container.UpsertItemAsync(item, new PartitionKey(item.Id)); + Console.Write("*"); + } + } + + static async Task DeleteData(Container container) + { + Console.ReadKey(true); + Console.Clear(); + + Console.WriteLine("Press any key to begin deleting data."); + Console.ReadKey(true); + + Console.WriteLine("Press any key to stop"); + + int deleteItemCounter = 0; + while (!Console.KeyAvailable) + { + deleteItemCounter++; + try + { + await container.DeleteItemAsync( + partitionKey: new PartitionKey(deleteItemCounter.ToString()), + id: deleteItemCounter.ToString()); + Console.Write("-"); + } + catch (CosmosException cosmosException) when (cosmosException.StatusCode == HttpStatusCode.NotFound) + { + // Deleting by a random id that might not exist in the container will likely throw errors that are safe to ignore for this purpose + } + } + } + + static async Task ReadAllVersionsAndDeletesChangeFeed(Container container, string allVersionsContinuationToken) + { + Console.ReadKey(true); + Console.Clear(); + + Console.WriteLine("Press any key to start reading the change feed in All Versions and Deletes mode."); + Console.ReadKey(true); + + Console.WriteLine("Press any key to stop."); + + // + using (FeedIterator allVersionsIterator = container.GetChangeFeedIterator(ChangeFeedStartFrom.ContinuationToken(allVersionsContinuationToken), ChangeFeedMode.AllVersionsAndDeletes, new ChangeFeedRequestOptions { PageSizeHint = 10 })) + { + while (allVersionsIterator.HasMoreResults) + { + FeedResponse response = await allVersionsIterator.ReadNextAsync(); + + if (response.StatusCode == HttpStatusCode.NotModified) + { + Console.WriteLine($"No new changes"); + await Task.Delay(1000); + } + else + { + foreach (AllVersionsAndDeletesCFResponse r in response) + { + // if operaiton is delete + if (r.Metadata.OperationType == "delete") + { + Item item = r.Previous; + + if (r.Metadata.TimeToLiveExpired == true) + { + Console.WriteLine($"Operation: {r.Metadata.OperationType} (due to TTL). Item id: {item.Id}. Previous value: {item.Value}"); + } + else + { + Console.WriteLine($"Operation: {r.Metadata.OperationType} (not due to TTL). Item id: {item.Id}. Previous value: {item.Value}"); + } + } + // if operation is create or replace + else + { + Item item = r.Current; + + Console.WriteLine($"Operation: {r.Metadata.OperationType}. Item id: {item.Id}. Current value: {item.Value}"); + } + } + } + + if (Console.KeyAvailable) + { + break; + } + } + } + // + } + + private static Item GenerateItem() + { + Random random = new Random(); + + return new Item + { + Id = random.Next(1, 999).ToString(), + Value = random.Next(1, 100000), + }; + } + } + + internal class AllVersionsAndDeletesCFResponse + { + [JsonProperty("current")] + public Item Current { get; set; } + + [JsonProperty("previous")] + public Item Previous { get; set; } + + [JsonProperty("metadata")] + public Metadata Metadata { get; set; } + } + + internal class Item + { + [JsonProperty("id")] + public string Id { get; set; } + + public double Value { get; set; } + } + + internal class Metadata + { + [JsonProperty("operationType")] + public string OperationType { get; set; } + + [JsonProperty("timeToLiveExpired")] + public Boolean TimeToLiveExpired { get; set; } + } +} diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/CFPullModelLatestVersionMode/CFPullModelLatestVersionMode.csproj b/Microsoft.Azure.Cosmos.Samples/Usage/CFPullModelLatestVersionMode/CFPullModelLatestVersionMode.csproj new file mode 100644 index 0000000000..66a155278d --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/CFPullModelLatestVersionMode/CFPullModelLatestVersionMode.csproj @@ -0,0 +1,21 @@ + + + + Exe + net6.0 + Cosmos.Samples.CFPullModelLatestVersionMode + Cosmos.Samples.CFPullModelLatestVersionMode + latest + + + + + + + + + + PreserveNewest + + + diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/CFPullModelLatestVersionMode/Program.cs b/Microsoft.Azure.Cosmos.Samples/Usage/CFPullModelLatestVersionMode/Program.cs new file mode 100644 index 0000000000..f87a0e1eff --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/CFPullModelLatestVersionMode/Program.cs @@ -0,0 +1,155 @@ +namespace CFPullModelLatestVersionMode +{ + using System; + using System.Collections.Generic; + using System.Net; + using System.Threading; + using System.Threading.Tasks; + using Microsoft.Azure.Cosmos; + using Microsoft.Extensions.Configuration; + using Newtonsoft.Json; + + class Program + { + private static readonly string databaseName = "db"; + private static readonly string containerName = "container"; + + static async Task Main() + { + try + { + IConfigurationRoot configuration = new ConfigurationBuilder() + .AddJsonFile("appSettings.json") + .Build(); + + string endpoint = configuration["EndPointUrl"]; + if (string.IsNullOrEmpty(endpoint)) + { + throw new ArgumentNullException("Please specify a valid EndPointUrl in the appSettings.json"); + } + + string authKey = configuration["AuthorizationKey"]; + if (string.IsNullOrEmpty(authKey) || string.Equals(authKey, "Super secret key")) + { + throw new ArgumentException("Please specify a valid AuthorizationKey in the appSettings.json"); + } + + using (CosmosClient client = new CosmosClient(endpoint, authKey)) + { + Console.WriteLine($"Getting container reference for {containerName}."); + + ContainerProperties properties = new ContainerProperties(containerName, partitionKeyPath: "/id"); + + await client.CreateDatabaseIfNotExistsAsync(databaseName); + Container container = await client.GetDatabase(databaseName).CreateContainerIfNotExistsAsync(properties); + + string latestVersionContinuationToken = await CreateLatestVersionChangeFeedIterator(container); + + await IngestData(container); + await ReadLatestVersionChangeFeed(container, latestVersionContinuationToken); + } + } + finally + { + Console.WriteLine("End of demo."); + } + } + + static async Task CreateLatestVersionChangeFeedIterator(Container container) + { + Console.WriteLine("Creating ChangeFeedIterator to read the change feed in Latest Version mode."); + + // + using (FeedIterator latestVersionIterator = container.GetChangeFeedIterator(ChangeFeedStartFrom.Now(), ChangeFeedMode.LatestVersion)) + { + while (latestVersionIterator.HasMoreResults) + { + FeedResponse response = await latestVersionIterator.ReadNextAsync(); + + if (response.StatusCode == HttpStatusCode.NotModified) + { + return response.ContinuationToken; + } + } + } + // + + return null; + } + + static async Task ReadLatestVersionChangeFeed(Container container, string latestVersionContinuationToken) + { + Console.ReadKey(true); + Console.Clear(); + + Console.WriteLine("Press any key to begin reading the change feed in Latest Version mode."); + Console.ReadKey(true); + + Console.WriteLine("Press any key to stop."); + + // + using (FeedIterator latestVersionIterator = container.GetChangeFeedIterator(ChangeFeedStartFrom.ContinuationToken(latestVersionContinuationToken), ChangeFeedMode.LatestVersion, new ChangeFeedRequestOptions { PageSizeHint = 10 })) + { + while (latestVersionIterator.HasMoreResults) + { + FeedResponse response = await latestVersionIterator.ReadNextAsync(); + + if (response.StatusCode == HttpStatusCode.NotModified) + { + Console.WriteLine($"No new changes"); + await Task.Delay(1000); + } + else + { + foreach (Item item in response) + { + Console.WriteLine($"Change in item: {item.Id}. New value: {item.Value}."); + } + } + + if (Console.KeyAvailable) + { + break; + } + } + } + // + } + + static async Task IngestData(Container container) + { + Console.Clear(); + + Console.WriteLine("Press any key to begin ingesting data."); + Console.ReadKey(true); + + Console.WriteLine("Press any key to stop."); + + while (!Console.KeyAvailable) + { + Item item = GenerateItem(); + await container.UpsertItemAsync(item, new PartitionKey(item.Id)); + Console.Write("*"); + } + } + + private static Item GenerateItem() + { + Random random = new Random(); + + return new Item + { + Id = random.Next(1, 999).ToString(), + Value = random.Next(1, 100000), + }; + } + } + + internal class Item + { + [JsonProperty("id")] + public string Id { get; set; } + + public double Value { get; set; } + } +} diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/Cosmos.Samples.Usage.sln b/Microsoft.Azure.Cosmos.Samples/Usage/Cosmos.Samples.Usage.sln index 954c0c606a..de1e1f4731 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/Cosmos.Samples.Usage.sln +++ b/Microsoft.Azure.Cosmos.Samples/Usage/Cosmos.Samples.Usage.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29411.108 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33205.214 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DatabaseManagement", "DatabaseManagement\DatabaseManagement.csproj", "{F972386A-B03D-4453-88C7-948CB107C029}" EndProject @@ -47,6 +47,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SystemTextJson", "SystemTex EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReEncryption", "ReEncryption\ReEncryption.csproj", "{AD6DEC94-EF8E-4C42-8A99-B98E101F933D}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CFPullModelAllVersionsAndDeletesMode", "CFPullModelAllVersionsAndDeletesMode\CFPullModelAllVersionsAndDeletesMode.csproj", "{7D808579-73BD-4D60-A7A5-D88FFF568C37}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CFPullModelLatestVersionMode", "CFPullModelLatestVersionMode\CFPullModelLatestVersionMode.csproj", "{985B0E0A-D480-4C3C-A1FC-589F2EC4BBF6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -141,6 +145,14 @@ Global {AD6DEC94-EF8E-4C42-8A99-B98E101F933D}.Debug|Any CPU.Build.0 = Debug|Any CPU {AD6DEC94-EF8E-4C42-8A99-B98E101F933D}.Release|Any CPU.ActiveCfg = Release|Any CPU {AD6DEC94-EF8E-4C42-8A99-B98E101F933D}.Release|Any CPU.Build.0 = Release|Any CPU + {7D808579-73BD-4D60-A7A5-D88FFF568C37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7D808579-73BD-4D60-A7A5-D88FFF568C37}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7D808579-73BD-4D60-A7A5-D88FFF568C37}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7D808579-73BD-4D60-A7A5-D88FFF568C37}.Release|Any CPU.Build.0 = Release|Any CPU + {985B0E0A-D480-4C3C-A1FC-589F2EC4BBF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {985B0E0A-D480-4C3C-A1FC-589F2EC4BBF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {985B0E0A-D480-4C3C-A1FC-589F2EC4BBF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {985B0E0A-D480-4C3C-A1FC-589F2EC4BBF6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 16caa1b9d40ab639085d932ec887474a8498aeb2 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Mon, 13 Feb 2023 09:44:12 -0800 Subject: [PATCH 054/240] [Internal] Tests: Refactors emulator CI (#3688) --- .../Batch/BatchSinglePartitionKeyTests.cs | 8 +- .../Batch/BatchTestBase.cs | 52 ++-- .../Batch/CosmosItemBulkTests.cs | 6 +- .../ChangeFeed/BaseChangeFeedClientHelper.cs | 2 +- .../ChangeFeed/DynamicStreamTests.cs | 2 +- .../ChangeFeed/DynamicTests.cs | 2 +- .../ChangeFeed/EstimatorTests.cs | 2 +- .../ChangeFeed/SmokeTests.cs | 2 +- .../ClientCreateAndInitializeTest.cs | 23 +- .../ClientTelemetryTests.cs | 6 +- .../ClientTests.cs | 91 +++--- .../CosmosAadTests.cs | 150 ++++----- .../CosmosBasicQueryTests.cs | 37 ++- .../CosmosContainerTests.cs | 90 +++--- .../CosmosContentResponseTests.cs | 24 +- .../CosmosDatabaseTests.cs | 64 ++-- .../CosmosItemIdEncodingTestsBase.cs | 6 +- .../CosmosItemSessionTokenTests.cs | 2 +- .../CosmosItemTests.cs | 23 +- .../CosmosMultiHashTest.cs | 8 +- .../CosmosNotFoundTests.cs | 3 +- .../CosmosPermissionTests.cs | 52 ++-- .../CosmosReadFeedTests.cs | 2 +- .../CosmosReadManyItemsTests.cs | 10 +- .../CosmosUserTests.cs | 44 +-- .../DocumentClientUnitTests.cs | 19 +- .../FeedToken/ChangeFeedIteratorCoreTests.cs | 12 +- .../FeedToken/QueryFeedTokenTests.cs | 2 +- .../Fluent/ContainerSettingsTests.cs | 4 +- .../GatewayClientSideRequestStatsTests.cs | 1 - .../GatewayTests.cs | 218 ++++++------- .../HeadersValidationTests.cs | 49 ++- .../IndexMetricsParserBaselineTest.cs | 2 + .../InternalFriendsTest.cs | 8 +- .../LinqAggregateFunctionsBaselineTests.cs | 2 + .../LinqAttributeContractBaselineTests.cs | 6 +- .../LinqGeneralBaselineTests.cs | 2 + .../LinqSQLTranslationBaselineTests.cs | 2 + .../LinqTranslationBaselineTests.cs | 2 + ...TranslationWithCustomSerializerBaseline.cs | 2 + .../MultiRegionStrongTests.cs | 286 ------------------ .../NameRoutingTests.cs | 47 +-- .../OfferTests.cs | 8 +- .../PartitionKeyRangeCacheTests.cs | 18 +- .../Query/QueryTestsBase.cs | 20 +- .../QueryTests.cs | 10 + .../SmokeTests.cs | 7 + .../SpatialTest.cs | 12 +- .../StoredProcedureTests.cs | 9 +- .../SummaryDiagnosticsTests.cs | 1 + .../EndToEndTraceWriterBaselineTests.cs | 4 + .../TransportWrapperTests.cs | 9 +- .../TriggersTests.cs | 4 +- .../UniqueIndexTests.cs | 2 + .../UserDefinedFunctionsTests.cs | 4 +- .../Utils/BaseCosmosClientHelper.cs | 48 ++- templates/emulator-setup.yml | 66 ++-- 57 files changed, 689 insertions(+), 908 deletions(-) delete mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/MultiRegionStrongTests.cs diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchSinglePartitionKeyTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchSinglePartitionKeyTests.cs index d8cc17966d..675ed6b20e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchSinglePartitionKeyTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchSinglePartitionKeyTests.cs @@ -19,15 +19,15 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests public class BatchSinglePartitionKeyTests : BatchTestBase { [ClassInitialize] - public static void ClassInitialize(TestContext context) + public static async Task ClassInitialize(TestContext context) { - BatchTestBase.ClassInit(context); + await BatchTestBase.ClassInitAsync(context); } [ClassCleanup] - public static void ClassCleanup() + public static async Task ClassCleanup() { - BatchTestBase.ClassClean(); + await BatchTestBase.ClassCleanAsync(); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchTestBase.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchTestBase.cs index 89b00f8c57..929ed2cfa9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchTestBase.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchTestBase.cs @@ -63,41 +63,40 @@ public class BatchTestBase protected TestDoc TestDocPk1ExistingD { get; set; } protected TestDoc TestDocPk1ExistingE { get; set; } - public static void ClassInit(TestContext context) + public static async Task ClassInitAsync(TestContext context) { - InitializeDirectContainers(); + await InitializeDirectContainers(); InitializeGatewayContainers(); - InitializeSharedThroughputContainer(); + await InitializeSharedThroughputContainer(); } - private static void InitializeDirectContainers() + private static async Task InitializeDirectContainers() { - + BatchTestBase.Client = TestCommon.CreateCosmosClient(builder => builder.WithConsistencyLevel(Cosmos.ConsistencyLevel.Session)); - BatchTestBase.Database = BatchTestBase.Client.CreateDatabaseAsync(Guid.NewGuid().ToString()) - .GetAwaiter().GetResult().Database; + BatchTestBase.Database = await BatchTestBase.Client.CreateDatabaseAsync(Guid.NewGuid().ToString()); PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition(); partitionKeyDefinition.Paths.Add("/Status"); - BatchTestBase.LowThroughputJsonContainer = BatchTestBase.Database.CreateContainerAsync( + BatchTestBase.LowThroughputJsonContainer = (await BatchTestBase.Database.CreateContainerAsync( new ContainerProperties() { Id = Guid.NewGuid().ToString(), PartitionKey = partitionKeyDefinition }, - throughput: 400).GetAwaiter().GetResult().Container; + throughput: 400)).Container; - BatchTestBase.PartitionKeyDefinition = ((ContainerInternal)(ContainerInlineCore)BatchTestBase.LowThroughputJsonContainer).GetPartitionKeyDefinitionAsync(CancellationToken.None).GetAwaiter().GetResult(); + BatchTestBase.PartitionKeyDefinition = await ((ContainerInternal)(ContainerInlineCore)BatchTestBase.LowThroughputJsonContainer).GetPartitionKeyDefinitionAsync(CancellationToken.None); // Create a container with at least 2 physical partitions for effective cross-partition testing - BatchTestBase.JsonContainer = BatchTestBase.Database.CreateContainerAsync( + BatchTestBase.JsonContainer = (await BatchTestBase.Database.CreateContainerAsync( new ContainerProperties() { Id = Guid.NewGuid().ToString(), PartitionKey = BatchTestBase.PartitionKeyDefinition }, - throughput: 12000).GetAwaiter().GetResult().Container; + throughput: 12000)).Container; Serialization.HybridRow.Schemas.Schema testSchema = TestDoc.GetSchema(); Namespace testNamespace = new Namespace() @@ -127,9 +126,9 @@ private static void InitializeDirectContainers() schematizedContainerProperties.SchemaPolicy = schemaPolicy; - BatchTestBase.SchematizedContainer = BatchTestBase.Database.CreateContainerAsync( + BatchTestBase.SchematizedContainer = (await BatchTestBase.Database.CreateContainerAsync( schematizedContainerProperties, - throughput: 12000).GetAwaiter().GetResult().Container; + throughput: 12000)).Container; } private static void InitializeGatewayContainers() @@ -142,20 +141,18 @@ private static void InitializeGatewayContainers() BatchTestBase.GatewaySchematizedContainer = BatchTestBase.GatewayDatabase.GetContainer(BatchTestBase.SchematizedContainer.Id); } - private static void InitializeSharedThroughputContainer() + private static async Task InitializeSharedThroughputContainer() { - CosmosClient client = TestCommon.CreateCosmosClient(); - Cosmos.Database db = client.CreateDatabaseAsync(string.Format("Shared_{0}", Guid.NewGuid().ToString("N")), throughput: 20000).GetAwaiter().GetResult().Database; + Cosmos.Database db = (await BatchTestBase.Client.CreateDatabaseAsync(string.Format("Shared_{0}", Guid.NewGuid().ToString("N")), throughput: 20000)).Database; for (int index = 0; index < 5; index++) { - ContainerResponse containerResponse = db.CreateContainerAsync( + ContainerResponse containerResponse = await db.CreateContainerAsync( new ContainerProperties { Id = Guid.NewGuid().ToString(), PartitionKey = BatchTestBase.PartitionKeyDefinition - }) - .GetAwaiter().GetResult(); + }); Assert.AreEqual(true, bool.Parse(containerResponse.Headers.Get(WFConstants.BackendHeaders.ShareThroughput))); @@ -168,24 +165,25 @@ private static void InitializeSharedThroughputContainer() BatchTestBase.SharedThroughputDatabase = db; } - public static void ClassClean() + public static async Task ClassCleanAsync() { - if (BatchTestBase.Client == null) + if (BatchTestBase.Database != null) { - return; + await BatchTestBase.Database.DeleteStreamAsync(); } - if (BatchTestBase.Database != null) + if (BatchTestBase.GatewayDatabase != null) { - BatchTestBase.Database.DeleteStreamAsync().GetAwaiter().GetResult(); + await BatchTestBase.GatewayDatabase.DeleteStreamAsync(); } if (BatchTestBase.SharedThroughputDatabase != null) { - BatchTestBase.SharedThroughputDatabase.DeleteStreamAsync().GetAwaiter().GetResult(); + await BatchTestBase.SharedThroughputDatabase.DeleteStreamAsync(); } - BatchTestBase.Client.Dispose(); + BatchTestBase.Client?.Dispose(); + BatchTestBase.GatewayClient?.Dispose(); } protected virtual async Task CreateJsonTestDocsAsync(Container container) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/CosmosItemBulkTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/CosmosItemBulkTests.cs index 0e818611a8..2658b00dfc 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/CosmosItemBulkTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/CosmosItemBulkTests.cs @@ -18,6 +18,7 @@ public class CosmosItemBulkTests { private Container container; private Database database; + private CosmosClient client; [TestInitialize] public async Task TestInitialize() @@ -26,9 +27,9 @@ public async Task TestInitialize() { AllowBulkExecution = true }; - CosmosClient client = TestCommon.CreateCosmosClient(clientOptions); + this.client = TestCommon.CreateCosmosClient(clientOptions); - DatabaseResponse response = await client.CreateDatabaseIfNotExistsAsync(Guid.NewGuid().ToString()); + DatabaseResponse response = await this.client.CreateDatabaseIfNotExistsAsync(Guid.NewGuid().ToString()); this.database = response.Database; ContainerResponse containerResponse = await this.database.CreateContainerAsync(Guid.NewGuid().ToString(), "/pk", 10000); @@ -39,6 +40,7 @@ public async Task TestInitialize() public async Task Cleanup() { await this.database.DeleteAsync(); + this.client?.Dispose(); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/BaseChangeFeedClientHelper.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/BaseChangeFeedClientHelper.cs index 14c362ee90..12cd3768ee 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/BaseChangeFeedClientHelper.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/BaseChangeFeedClientHelper.cs @@ -16,7 +16,7 @@ public class BaseChangeFeedClientHelper : BaseCosmosClientHelper public async Task ChangeFeedTestInit(string leaseContainerPk = "/id") { - await base.TestInit(customizeClientBuilder: (builder) => builder.WithContentResponseOnWrite(false)); + await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, customizeClientBuilder: (builder) => builder.WithContentResponseOnWrite(false)); ContainerResponse response = await this.database.CreateContainerAsync( new ContainerProperties(id: "leases", partitionKeyPath: leaseContainerPk), diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicStreamTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicStreamTests.cs index dba803d10b..f63ef4dbda 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicStreamTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicStreamTests.cs @@ -147,7 +147,7 @@ await NonPartitionedContainerHelper.CreateNonPartitionedContainer( this.database, "fixedLeases"); - Container fixedLeasesContainer = this.cosmosClient.GetContainer(this.database.Id, "fixedLeases"); + Container fixedLeasesContainer = this.GetClient().GetContainer(this.database.Id, "fixedLeases"); try { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicTests.cs index d7bf0d12f5..cefb823caa 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/DynamicTests.cs @@ -168,7 +168,7 @@ await NonPartitionedContainerHelper.CreateNonPartitionedContainer( this.database, "fixedLeases"); - Container fixedLeasesContainer = this.cosmosClient.GetContainer(this.database.Id, "fixedLeases"); + Container fixedLeasesContainer = this.GetClient().GetContainer(this.database.Id, "fixedLeases"); try { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/EstimatorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/EstimatorTests.cs index ce139a47a4..7c92ef80c2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/EstimatorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/EstimatorTests.cs @@ -58,7 +58,7 @@ public async Task WhenNoLeasesExist() [TestMethod] public async Task StartAsync_ShouldThrowIfContainerDoesNotExist() { - ChangeFeedProcessor estimator = this.cosmosClient.GetContainer(this.database.Id, "DoesNotExist") + ChangeFeedProcessor estimator = this.GetClient().GetContainer(this.database.Id, "DoesNotExist") .GetChangeFeedEstimatorBuilder("test", (long estimation, CancellationToken token) => { return Task.CompletedTask; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/SmokeTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/SmokeTests.cs index b4460b6ad6..1291cc0b57 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/SmokeTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ChangeFeed/SmokeTests.cs @@ -322,7 +322,7 @@ public async Task Schema_OnV2MigrationMaintainPartitionId() [TestMethod] public async Task NotExistentLeaseContainer() { - Container notFoundContainer = this.cosmosClient.GetContainer(this.database.Id, "NonExistent"); + Container notFoundContainer = this.GetClient().GetContainer(this.database.Id, "NonExistent"); ChangeFeedProcessor processor = this.Container .GetChangeFeedProcessorBuilder("test", (IReadOnlyCollection docs, CancellationToken token) => Task.CompletedTask) .WithInstanceName("random") diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs index 0ea1e4d6fd..e977a8b459 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs @@ -23,9 +23,8 @@ public class ClientCreateAndInitializeTest : BaseCosmosClientHelper [TestInitialize] public async Task TestInitialize() { - this.cosmosClient = TestCommon.CreateCosmosClient(useGateway: false); - this.database = await this.cosmosClient.CreateDatabaseAsync( - id: "ClientCreateAndInitializeDatabase"); + await this.TestInit(); + ContainerResponse response = await this.database.CreateContainerAsync( new ContainerProperties(id: "ClientCreateAndInitializeContainer", partitionKeyPath: PartitionKey), throughput: 20000, @@ -67,7 +66,7 @@ public async Task CreateAndInitializeTest() (string endpoint, string authKey) = TestCommon.GetAccountInfo(); List<(string, string)> containers = new List<(string, string)> - { ("ClientCreateAndInitializeDatabase", "ClientCreateAndInitializeContainer")}; + { (this.database.Id, "ClientCreateAndInitializeContainer")}; CosmosClientOptions cosmosClientOptions = new CosmosClientOptions { @@ -78,7 +77,7 @@ public async Task CreateAndInitializeTest() Assert.IsNotNull(cosmosClient); int httpCallsMadeAfterCreation = httpCallsMade; - ContainerInternal container = (ContainerInternal)cosmosClient.GetContainer("ClientCreateAndInitializeDatabase", "ClientCreateAndInitializeContainer"); + ContainerInternal container = (ContainerInternal)cosmosClient.GetContainer(this.database.Id, "ClientCreateAndInitializeContainer"); ItemResponse readResponse = await container.ReadItemAsync("1", new Cosmos.PartitionKey("Status1")); string diagnostics = readResponse.Diagnostics.ToString(); Assert.IsTrue(diagnostics.Contains("\"ConnectionMode\":\"Direct\"")); @@ -101,14 +100,14 @@ public async Task CreateAndInitializeWithCosmosClientBuilderTest() (string endpoint, string authKey) = TestCommon.GetAccountInfo(); List<(string, string)> containers = new List<(string, string)> - { ("ClientCreateAndInitializeDatabase", "ClientCreateAndInitializeContainer")}; + { (this.database.Id, "ClientCreateAndInitializeContainer")}; CosmosClientBuilder builder = new CosmosClientBuilder(endpoint, authKey).WithHttpClientFactory(() => new HttpClient(httpClientHandlerHelper)); CosmosClient cosmosClient = await builder.BuildAndInitializeAsync(containers); Assert.IsNotNull(cosmosClient); int httpCallsMadeAfterCreation = httpCallsMade; - ContainerInternal container = (ContainerInternal)cosmosClient.GetContainer("ClientCreateAndInitializeDatabase", "ClientCreateAndInitializeContainer"); + ContainerInternal container = (ContainerInternal)cosmosClient.GetContainer(this.database.Id, "ClientCreateAndInitializeContainer"); ItemResponse readResponse = await container.ReadItemAsync("1", new Cosmos.PartitionKey("Status1")); Assert.AreEqual(httpCallsMade, httpCallsMadeAfterCreation); cosmosClient.Dispose(); @@ -119,7 +118,7 @@ public async Task CreateAndInitializeWithCosmosClientBuilderTest() public async Task AuthIncorrectTest() { List<(string databaseId, string containerId)> containers = new List<(string databaseId, string containerId)> - { ("ClientCreateAndInitializeDatabase", "ClientCreateAndInitializeContainer")}; + { (this.database.Id, "ClientCreateAndInitializeContainer")}; string authKey = TestCommon.GetAccountInfo().authKey; CosmosClient cosmosClient = await CosmosClient.CreateAndInitializeAsync("https://127.0.0.1:0000/", authKey, containers); cosmosClient.Dispose(); @@ -148,7 +147,7 @@ public async Task DatabaseIncorrectTest() public async Task ContainerIncorrectTest() { List<(string databaseId, string containerId)> containers = new List<(string databaseId, string containerId)> - { ("ClientCreateAndInitializeDatabase", "IncorrectContainer")}; + { (this.database.Id, "IncorrectContainer")}; (string endpoint, string authKey) = TestCommon.GetAccountInfo(); try { @@ -218,7 +217,7 @@ public async Task CreateAndInitializeAsync_WithValidDatabaseAndContainer_ShouldO List<(string, string)> containers = new () { ( - "ClientCreateAndInitializeDatabase", + this.database.Id, "ClientCreateAndInitializeContainer" ) }; @@ -306,7 +305,7 @@ public async Task CreateAndInitializeAsync_WithGatewayModeEnabled_ShouldNotOpenC List<(string, string)> containers = new() { ( - "ClientCreateAndInitializeDatabase", + this.database.Id, "ClientCreateAndInitializeContainer" ) }; @@ -343,7 +342,7 @@ public async Task CreateAndInitializeAsync_WithValidDatabaseAndInvalidContainer_ List<(string, string)> containers = new() { ( - "ClientCreateAndInitializeDatabase", + this.database.Id, "ClientCreateAndInitializeInvalidContainer" ) }; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs index 737be92e05..d9bd416530 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs @@ -1094,11 +1094,11 @@ private async Task CreateClientAndContainer(ConnectionMode mode, .WithHttpClientFactory(() => new HttpClient(handlerHelper)) .WithApplicationName("userAgentSuffix"); - this.cosmosClient = mode == ConnectionMode.Gateway + this.SetClient(mode == ConnectionMode.Gateway ? this.cosmosClientBuilder.WithConnectionModeGateway().Build() - : this.cosmosClientBuilder.Build(); + : this.cosmosClientBuilder.Build()); - this.database = await this.cosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString()); + this.database = await this.GetClient().CreateDatabaseAsync(Guid.NewGuid().ToString()); return await this.database.CreateContainerAsync( id: Guid.NewGuid().ToString(), diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs index a2fcc1f598..1f419c4eb8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs @@ -401,42 +401,49 @@ internal async Task TestEtagOnUpsertOperation(bool useGateway, Protocol protocol using (DocumentClient client = TestCommon.CreateClient(false, Protocol.Tcp)) { Database db = (await client.CreateDatabaseAsync(new Database() { Id = Guid.NewGuid().ToString() })).Resource; - DocumentCollection coll = await TestCommon.CreateCollectionAsync(client, db, new DocumentCollection() + try { - Id = Guid.NewGuid().ToString(), - PartitionKey = new PartitionKeyDefinition() + DocumentCollection coll = await TestCommon.CreateCollectionAsync(client, db, new DocumentCollection() { - Paths = new System.Collections.ObjectModel.Collection() { "/id" } - } - }); + Id = Guid.NewGuid().ToString(), + PartitionKey = new PartitionKeyDefinition() + { + Paths = new System.Collections.ObjectModel.Collection() { "/id" } + } + }); - LinqGeneralBaselineTests.Book myBook = new LinqGeneralBaselineTests.Book(); - myBook.Id = Guid.NewGuid().ToString(); - myBook.Title = "Azure DocumentDB 101"; + LinqGeneralBaselineTests.Book myBook = new LinqGeneralBaselineTests.Book(); + myBook.Id = Guid.NewGuid().ToString(); + myBook.Title = "Azure DocumentDB 101"; - Document doc = (await client.CreateDocumentAsync(coll.SelfLink, myBook)).Resource; + Document doc = (await client.CreateDocumentAsync(coll.SelfLink, myBook)).Resource; - myBook.Title = "Azure DocumentDB 201"; - await client.ReplaceDocumentAsync(doc.SelfLink, myBook); + myBook.Title = "Azure DocumentDB 201"; + await client.ReplaceDocumentAsync(doc.SelfLink, myBook); - AccessCondition condition = new AccessCondition(); - condition.Type = AccessConditionType.IfMatch; - condition.Condition = doc.ETag; + AccessCondition condition = new AccessCondition(); + condition.Type = AccessConditionType.IfMatch; + condition.Condition = doc.ETag; - RequestOptions requestOptions = new RequestOptions(); - requestOptions.AccessCondition = condition; + RequestOptions requestOptions = new RequestOptions(); + requestOptions.AccessCondition = condition; - myBook.Title = "Azure DocumentDB 301"; + myBook.Title = "Azure DocumentDB 301"; - try - { - await client.UpsertDocumentAsync(coll.SelfLink, myBook, requestOptions); - Assert.Fail("Upsert Document should fail since the Etag is not matching."); + try + { + await client.UpsertDocumentAsync(coll.SelfLink, myBook, requestOptions); + Assert.Fail("Upsert Document should fail since the Etag is not matching."); + } + catch (Exception ex) + { + DocumentClientException innerException = ex as DocumentClientException; + Assert.AreEqual(HttpStatusCode.PreconditionFailed, innerException.StatusCode, "Invalid status code"); + } } - catch (Exception ex) + finally { - DocumentClientException innerException = ex as DocumentClientException; - Assert.AreEqual(HttpStatusCode.PreconditionFailed, innerException.StatusCode, "Invalid status code"); + await client.DeleteDatabaseAsync(db); } } } @@ -448,7 +455,7 @@ public async Task Verify_CertificateCallBackGetsCalled_ForTCP_HTTP() string endpoint = ConfigurationManager.AppSettings["GatewayEndpoint"]; int counter = 0; AzureKeyCredential masterKeyCredential = new AzureKeyCredential(authKey); - CosmosClient cosmosClient = new CosmosClient( + using CosmosClient cosmosClient = new CosmosClient( endpoint, masterKeyCredential, new CosmosClientOptions() @@ -458,19 +465,27 @@ public async Task Verify_CertificateCallBackGetsCalled_ForTCP_HTTP() ServerCertificateCustomValidationCallback = (X509Certificate2 cerf, X509Chain chain, SslPolicyErrors error) => { counter ++; return true; } }); - string databaseName = Guid.NewGuid().ToString(); - string databaseId = Guid.NewGuid().ToString(); Cosmos.Database database = null; - //HTTP callback - database = await cosmosClient.CreateDatabaseAsync(databaseId); - - Cosmos.Container container = await database.CreateContainerAsync(Guid.NewGuid().ToString(), "/id"); + try + { + string databaseName = Guid.NewGuid().ToString(); + string databaseId = Guid.NewGuid().ToString(); + + //HTTP callback + database = await cosmosClient.CreateDatabaseAsync(databaseId); + + Cosmos.Container container = await database.CreateContainerAsync(Guid.NewGuid().ToString(), "/id"); - //TCP callback - ToDoActivity item = ToDoActivity.CreateRandomToDoActivity(); - ResponseMessage responseMessage = await container.CreateItemStreamAsync(TestCommon.SerializerCore.ToStream(item), new Cosmos.PartitionKey(item.id)); + //TCP callback + ToDoActivity item = ToDoActivity.CreateRandomToDoActivity(); + ResponseMessage responseMessage = await container.CreateItemStreamAsync(TestCommon.SerializerCore.ToStream(item), new Cosmos.PartitionKey(item.id)); - Assert.IsTrue(counter >= 2); + Assert.IsTrue(counter >= 2); + } + finally + { + await database?.DeleteStreamAsync(); + } } @@ -786,6 +801,7 @@ await Assert.ThrowsExceptionAsync(async () => proxy = new TestWebProxy { Credentials = new NetworkCredential("test", "test") }; + cosmosClient.Dispose(); cosmosClient = new CosmosClient( endpoint, ConfigurationManager.AppSettings["MasterKey"], @@ -801,6 +817,7 @@ await Assert.ThrowsExceptionAsync(async () => { DatabaseResponse databaseResponse = await cosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString()); }); + cosmosClient.Dispose(); } [TestMethod] @@ -809,7 +826,7 @@ public async Task HttpClientFactorySmokeTest() HttpClient client = new HttpClient(); Mock> factory = new Mock>(); factory.Setup(f => f()).Returns(client); - CosmosClient cosmosClient = new CosmosClient( + using CosmosClient cosmosClient = new CosmosClient( ConfigurationManager.AppSettings["GatewayEndpoint"], ConfigurationManager.AppSettings["MasterKey"], new CosmosClientOptions diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAadTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAadTests.cs index c8ffd8cf29..01ffcdc674 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAadTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAadTests.cs @@ -29,98 +29,102 @@ public async Task AadMockTest(ConnectionMode connectionMode) int requestCount = 0; string databaseId = Guid.NewGuid().ToString(); string containerId = Guid.NewGuid().ToString(); - using (CosmosClient cosmosClient = TestCommon.CreateCosmosClient()) - { - Database database = await cosmosClient.CreateDatabaseAsync(databaseId); - Container container = await database.CreateContainerAsync( - containerId, - "/id"); - } + using CosmosClient cosmosClient = TestCommon.CreateCosmosClient(); + Database database = await cosmosClient.CreateDatabaseAsync(databaseId); + Container container = await database.CreateContainerAsync( + containerId, + "/id"); - - (string endpoint, string authKey) = TestCommon.GetAccountInfo(); - LocalEmulatorTokenCredential simpleEmulatorTokenCredential = new LocalEmulatorTokenCredential(authKey); - CosmosClientOptions clientOptions = new CosmosClientOptions() + try { - ConnectionMode = connectionMode, - ConnectionProtocol = connectionMode == ConnectionMode.Direct ? Protocol.Tcp : Protocol.Https, - }; + (string endpoint, string authKey) = TestCommon.GetAccountInfo(); + LocalEmulatorTokenCredential simpleEmulatorTokenCredential = new LocalEmulatorTokenCredential(authKey); + CosmosClientOptions clientOptions = new CosmosClientOptions() + { + ConnectionMode = connectionMode, + ConnectionProtocol = connectionMode == ConnectionMode.Direct ? Protocol.Tcp : Protocol.Https, + }; - if (connectionMode == ConnectionMode.Direct) - { - long lsn = 2; - clientOptions.TransportClientHandlerFactory = (transport) => new TransportClientWrapper(transport, - interceptorAfterResult: (request, storeResponse) => - { - // Force a barrier request on create item. - // There needs to be 2 regions and the GlobalCommittedLSN must be behind the LSN. - if (storeResponse.StatusCode == HttpStatusCode.Created) + if (connectionMode == ConnectionMode.Direct) + { + long lsn = 2; + clientOptions.TransportClientHandlerFactory = (transport) => new TransportClientWrapper(transport, + interceptorAfterResult: (request, storeResponse) => { - if (requestCount == 0) + // Force a barrier request on create item. + // There needs to be 2 regions and the GlobalCommittedLSN must be behind the LSN. + if (storeResponse.StatusCode == HttpStatusCode.Created) { - requestCount++; - lsn = storeResponse.LSN; - storeResponse.Headers.Set(Documents.WFConstants.BackendHeaders.NumberOfReadRegions, "2"); - storeResponse.Headers.Set(Documents.WFConstants.BackendHeaders.GlobalCommittedLSN, "0"); + if (requestCount == 0) + { + requestCount++; + lsn = storeResponse.LSN; + storeResponse.Headers.Set(Documents.WFConstants.BackendHeaders.NumberOfReadRegions, "2"); + storeResponse.Headers.Set(Documents.WFConstants.BackendHeaders.GlobalCommittedLSN, "0"); + } } - } - // Head request is the barrier request - // The GlobalCommittedLSN is set to -1 because the local emulator doesn't have geo-dr so it has to be - // overridden for the validation to succeed. - if (request.OperationType == Documents.OperationType.Head) - { - if (requestCount == 1) + // Head request is the barrier request + // The GlobalCommittedLSN is set to -1 because the local emulator doesn't have geo-dr so it has to be + // overridden for the validation to succeed. + if (request.OperationType == Documents.OperationType.Head) { - requestCount++; - storeResponse.Headers.Set(Documents.WFConstants.BackendHeaders.NumberOfReadRegions, "2"); - storeResponse.Headers.Set(Documents.WFConstants.BackendHeaders.GlobalCommittedLSN, lsn.ToString(CultureInfo.InvariantCulture)); + if (requestCount == 1) + { + requestCount++; + storeResponse.Headers.Set(Documents.WFConstants.BackendHeaders.NumberOfReadRegions, "2"); + storeResponse.Headers.Set(Documents.WFConstants.BackendHeaders.GlobalCommittedLSN, lsn.ToString(CultureInfo.InvariantCulture)); + } } - } - return storeResponse; - }); - } + return storeResponse; + }); + } - using CosmosClient aadClient = new CosmosClient( - endpoint, - simpleEmulatorTokenCredential, - clientOptions); + using CosmosClient aadClient = new CosmosClient( + endpoint, + simpleEmulatorTokenCredential, + clientOptions); - TokenCredentialCache tokenCredentialCache = ((AuthorizationTokenProviderTokenCredential)aadClient.AuthorizationTokenProvider).tokenCredentialCache; + TokenCredentialCache tokenCredentialCache = ((AuthorizationTokenProviderTokenCredential)aadClient.AuthorizationTokenProvider).tokenCredentialCache; - // The refresh interval changes slightly based on how fast machine calculate the interval based on the expire time. - Assert.IsTrue(15 <= tokenCredentialCache.BackgroundTokenCredentialRefreshInterval.Value.TotalMinutes, "Default background refresh should be 25% of the token life which is defaulted to 1hr"); - Assert.IsTrue(tokenCredentialCache.BackgroundTokenCredentialRefreshInterval.Value.TotalMinutes > 14.7 , "Default background refresh should be 25% of the token life which is defaulted to 1hr"); + // The refresh interval changes slightly based on how fast machine calculate the interval based on the expire time. + Assert.IsTrue(15 <= tokenCredentialCache.BackgroundTokenCredentialRefreshInterval.Value.TotalMinutes, "Default background refresh should be 25% of the token life which is defaulted to 1hr"); + Assert.IsTrue(tokenCredentialCache.BackgroundTokenCredentialRefreshInterval.Value.TotalMinutes > 14.7, "Default background refresh should be 25% of the token life which is defaulted to 1hr"); - Database aadDatabase = await aadClient.GetDatabase(databaseId).ReadAsync(); - Container aadContainer = await aadDatabase.GetContainer(containerId).ReadContainerAsync(); - ToDoActivity toDoActivity = ToDoActivity.CreateRandomToDoActivity(); - ItemResponse itemResponse = await aadContainer.CreateItemAsync( - toDoActivity, - new PartitionKey(toDoActivity.id)); + Database aadDatabase = await aadClient.GetDatabase(databaseId).ReadAsync(); + Container aadContainer = await aadDatabase.GetContainer(containerId).ReadContainerAsync(); + ToDoActivity toDoActivity = ToDoActivity.CreateRandomToDoActivity(); + ItemResponse itemResponse = await aadContainer.CreateItemAsync( + toDoActivity, + new PartitionKey(toDoActivity.id)); - // Gateway does the barrier requests so only direct mode needs to be validated. - if (connectionMode == ConnectionMode.Direct) - { - Assert.AreEqual(2, requestCount, "The barrier request was never called."); - } + // Gateway does the barrier requests so only direct mode needs to be validated. + if (connectionMode == ConnectionMode.Direct) + { + Assert.AreEqual(2, requestCount, "The barrier request was never called."); + } - toDoActivity.cost = 42.42; - await aadContainer.ReplaceItemAsync( - toDoActivity, - toDoActivity.id, - new PartitionKey(toDoActivity.id)); + toDoActivity.cost = 42.42; + await aadContainer.ReplaceItemAsync( + toDoActivity, + toDoActivity.id, + new PartitionKey(toDoActivity.id)); - await aadContainer.ReadItemAsync( - toDoActivity.id, - new PartitionKey(toDoActivity.id)); + await aadContainer.ReadItemAsync( + toDoActivity.id, + new PartitionKey(toDoActivity.id)); - await aadContainer.UpsertItemAsync(toDoActivity); + await aadContainer.UpsertItemAsync(toDoActivity); - await aadContainer.DeleteItemAsync( - toDoActivity.id, - new PartitionKey(toDoActivity.id)); + await aadContainer.DeleteItemAsync( + toDoActivity.id, + new PartitionKey(toDoActivity.id)); + } + finally + { + await database?.DeleteStreamAsync(); + } } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosBasicQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosBasicQueryTests.cs index 0f55c04ba8..7ae2b28cc6 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosBasicQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosBasicQueryTests.cs @@ -930,25 +930,32 @@ public async Task InvalidRangesOnQuery() DatabaseResponse databaseResponse = await cosmosClient.CreateDatabaseIfNotExistsAsync(DatabaseName, Throughput); Database database = databaseResponse.Database; - Container container = await database.DefineContainer(TestCollection, $"/{DefaultKey}") - .WithUniqueKey().Path($"/{DefaultKey}").Attach().CreateIfNotExistsAsync(); + try + { + Container container = await database.DefineContainer(TestCollection, $"/{DefaultKey}") + .WithUniqueKey().Path($"/{DefaultKey}").Attach().CreateIfNotExistsAsync(); - List queryKeys = new List(); + List queryKeys = new List(); - List testCollectionObjects = JsonConvert.DeserializeObject>( - "[{\"id\":\"70627503-7cb2-4a79-bcec-5e55765aa080\",\"objectKey\":\"message~phone~u058da564bfaa66cb031606db664dbfda~phone~ud75ce020af5f8bfb75a9097a66d452f2~Chat~20190927000042Z\",\"text\":null,\"text2\":null},{\"id\":\"507079b7-a5be-4da4-9158-16fc961cd474\",\"objectKey\":\"message~phone~u058da564bfaa66cb031606db664dbfda~phone~ud75ce020af5f8bfb75a9097a66d452f2~Chat~20190927125742Z\",\"text\":null,\"text2\":null}]"); - foreach (TestCollectionObject testCollectionObject in testCollectionObjects) - { - await WriteDocument(container, testCollectionObject); - queryKeys.Add(testCollectionObject.ObjectKey); - } + List testCollectionObjects = JsonConvert.DeserializeObject>( + "[{\"id\":\"70627503-7cb2-4a79-bcec-5e55765aa080\",\"objectKey\":\"message~phone~u058da564bfaa66cb031606db664dbfda~phone~ud75ce020af5f8bfb75a9097a66d452f2~Chat~20190927000042Z\",\"text\":null,\"text2\":null},{\"id\":\"507079b7-a5be-4da4-9158-16fc961cd474\",\"objectKey\":\"message~phone~u058da564bfaa66cb031606db664dbfda~phone~ud75ce020af5f8bfb75a9097a66d452f2~Chat~20190927125742Z\",\"text\":null,\"text2\":null}]"); + foreach (TestCollectionObject testCollectionObject in testCollectionObjects) + { + await WriteDocument(container, testCollectionObject); + queryKeys.Add(testCollectionObject.ObjectKey); + } - List results = container - .GetItemLinqQueryable(true, requestOptions: RunInParallelOptions()) - .Where(r => queryKeys.Contains(r.ObjectKey)) - .ToList(); // ERROR OCCURS WHEN QUERY IS EXECUTED + List results = container + .GetItemLinqQueryable(true, requestOptions: RunInParallelOptions()) + .Where(r => queryKeys.Contains(r.ObjectKey)) + .ToList(); // ERROR OCCURS WHEN QUERY IS EXECUTED - Console.WriteLine($"[\"{string.Join("\", \n\"", results.Select(r => r.ObjectKey))}\"]"); + Console.WriteLine($"[\"{string.Join("\", \n\"", results.Select(r => r.ObjectKey))}\"]"); + } + finally + { + await database.DeleteAsync(); + } } private static async Task WriteDocument(Container container, TestCollectionObject testData) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs index 208b08ec11..07cb6a4dca 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs @@ -1167,62 +1167,68 @@ public async Task ReadReplaceThroughputResponseTests() (x) => toStreamCount++); //Create a new cosmos client with the mocked cosmos json serializer - CosmosClient client = TestCommon.CreateCosmosClient( + using CosmosClient client = TestCommon.CreateCosmosClient( (cosmosClientBuilder) => cosmosClientBuilder.WithCustomSerializer(mockJsonSerializer)); int databaseThroughput = 10000; Cosmos.Database databaseNoThroughput = await client.CreateDatabaseAsync(Guid.NewGuid().ToString(), throughput: null); Cosmos.Database databaseWithThroughput = await client.CreateDatabaseAsync(Guid.NewGuid().ToString(), databaseThroughput, null); - - string containerId = Guid.NewGuid().ToString(); - string partitionPath = "/users"; - Container containerNoThroughput = await databaseWithThroughput.CreateContainerAsync(containerId, partitionPath, throughput: null); try { - await containerNoThroughput.ReadThroughputAsync(new RequestOptions()); - Assert.Fail("Should through not found exception as throughput is not configured"); - } - catch (CosmosException exception) - { - Assert.AreEqual(HttpStatusCode.NotFound, exception.StatusCode); - } + string containerId = Guid.NewGuid().ToString(); + string partitionPath = "/users"; + Container containerNoThroughput = await databaseWithThroughput.CreateContainerAsync(containerId, partitionPath, throughput: null); + try + { + await containerNoThroughput.ReadThroughputAsync(new RequestOptions()); + Assert.Fail("Should through not found exception as throughput is not configured"); + } + catch (CosmosException exception) + { + Assert.AreEqual(HttpStatusCode.NotFound, exception.StatusCode); + } - try - { - await containerNoThroughput.ReplaceThroughputAsync(2000, new RequestOptions()); - Assert.Fail("Should through not found exception as throughput is not configured"); - } - catch (CosmosException exception) - { - Assert.AreEqual(HttpStatusCode.NotFound, exception.StatusCode); - } + try + { + await containerNoThroughput.ReplaceThroughputAsync(2000, new RequestOptions()); + Assert.Fail("Should through not found exception as throughput is not configured"); + } + catch (CosmosException exception) + { + Assert.AreEqual(HttpStatusCode.NotFound, exception.StatusCode); + } - int containerThroughput = 1000; - Container container = await databaseNoThroughput.CreateContainerAsync(Guid.NewGuid().ToString(), "/id", throughput: containerThroughput); + int containerThroughput = 1000; + Container container = await databaseNoThroughput.CreateContainerAsync(Guid.NewGuid().ToString(), "/id", throughput: containerThroughput); - int? containerResponseThroughput = await container.ReadThroughputAsync(); - Assert.AreEqual(containerThroughput, containerResponseThroughput); + int? containerResponseThroughput = await container.ReadThroughputAsync(); + Assert.AreEqual(containerThroughput, containerResponseThroughput); - ThroughputResponse containerThroughputResponse = await container.ReadThroughputAsync(new RequestOptions()); - Assert.IsNotNull(containerThroughputResponse); - Assert.IsNotNull(containerThroughputResponse.Resource); - Assert.IsNotNull(containerThroughputResponse.MinThroughput); - Assert.IsNotNull(containerThroughputResponse.Resource.Throughput); - Assert.AreEqual(containerThroughput, containerThroughputResponse.Resource.Throughput.Value); - SelflinkValidator.ValidateTroughputSelfLink(containerThroughputResponse.Resource.SelfLink); + ThroughputResponse containerThroughputResponse = await container.ReadThroughputAsync(new RequestOptions()); + Assert.IsNotNull(containerThroughputResponse); + Assert.IsNotNull(containerThroughputResponse.Resource); + Assert.IsNotNull(containerThroughputResponse.MinThroughput); + Assert.IsNotNull(containerThroughputResponse.Resource.Throughput); + Assert.AreEqual(containerThroughput, containerThroughputResponse.Resource.Throughput.Value); + SelflinkValidator.ValidateTroughputSelfLink(containerThroughputResponse.Resource.SelfLink); - containerThroughput += 500; - containerThroughputResponse = await container.ReplaceThroughputAsync(containerThroughput, new RequestOptions()); - Assert.IsNotNull(containerThroughputResponse); - Assert.IsNotNull(containerThroughputResponse.Resource); - Assert.IsNotNull(containerThroughputResponse.Resource.Throughput); - Assert.AreEqual(containerThroughput, containerThroughputResponse.Resource.Throughput.Value); - SelflinkValidator.ValidateTroughputSelfLink(containerThroughputResponse.Resource.SelfLink); + containerThroughput += 500; + containerThroughputResponse = await container.ReplaceThroughputAsync(containerThroughput, new RequestOptions()); + Assert.IsNotNull(containerThroughputResponse); + Assert.IsNotNull(containerThroughputResponse.Resource); + Assert.IsNotNull(containerThroughputResponse.Resource.Throughput); + Assert.AreEqual(containerThroughput, containerThroughputResponse.Resource.Throughput.Value); + SelflinkValidator.ValidateTroughputSelfLink(containerThroughputResponse.Resource.SelfLink); - Assert.AreEqual(0, toStreamCount, "Custom serializer to stream should not be used for offer operations"); - Assert.AreEqual(0, fromStreamCount, "Custom serializer from stream should not be used for offer operations"); - await databaseNoThroughput.DeleteAsync(); + Assert.AreEqual(0, toStreamCount, "Custom serializer to stream should not be used for offer operations"); + Assert.AreEqual(0, fromStreamCount, "Custom serializer from stream should not be used for offer operations"); + } + finally + { + await databaseNoThroughput.DeleteAsync(); + await databaseWithThroughput.DeleteAsync(); + } } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContentResponseTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContentResponseTests.cs index fd3f8bf175..ecc7faffd6 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContentResponseTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContentResponseTests.cs @@ -6,28 +6,20 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests { using System; using System.Collections.Generic; - using System.Linq; using System.Net; - using System.Threading; using System.Threading.Tasks; - using Microsoft.Azure.Cosmos.Core.Trace; - using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] - public class CosmosContentResponseTests + public class CosmosContentResponseTests : BaseCosmosClientHelper { - private CosmosClient cosmosClient; - private Database database; private Container container; private ContainerInternal containerInternal; [TestInitialize] - public async Task TestInit() + public async Task TestInitialize() { - this.cosmosClient = TestCommon.CreateCosmosClient(); - this.database = await this.cosmosClient.CreateDatabaseAsync( - id: Guid.NewGuid().ToString()); + await base.TestInit(); this.container = await this.database.CreateContainerAsync( id: "ItemNoResponseTest", @@ -36,15 +28,9 @@ public async Task TestInit() } [TestCleanup] - public async Task TestCleanup() + public async Task TestCleanUp() { - if (this.cosmosClient == null) - { - return; - } - - using (await this.database.DeleteStreamAsync()) { } - this.cosmosClient.Dispose(); + await base.TestCleanup(); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosDatabaseTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosDatabaseTests.cs index 9370345d81..ba6d33d55e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosDatabaseTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosDatabaseTests.cs @@ -10,42 +10,26 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Linq; using System.Net; using System.Security.Cryptography; - using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Core.Trace; - using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.Resource.CosmosExceptions; - using Microsoft.Azure.Cosmos.Tracing; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using Newtonsoft.Json.Linq; [TestClass] - public class CosmosDatabaseTests + public class CosmosDatabaseTests : BaseCosmosClientHelper { - protected CosmosClient cosmosClient = null; - protected CancellationTokenSource cancellationTokenSource = null; - protected CancellationToken cancellationToken; - [TestInitialize] - public void TestInit() + public async Task TestInitialize() { - this.cancellationTokenSource = new CancellationTokenSource(); - this.cancellationToken = this.cancellationTokenSource.Token; - - this.cosmosClient = TestCommon.CreateCosmosClient(); + await base.TestInit(); } [TestCleanup] - public void TestCleanup() + public async Task TestCleanUp() { - if (this.cosmosClient == null) - { - return; - } - - this.cancellationTokenSource?.Cancel(); - this.cosmosClient.Dispose(); + await base.TestCleanup(); } [TestMethod] @@ -121,7 +105,7 @@ public async Task StreamCreateConflictTestAsync() Id = Guid.NewGuid().ToString() }; - using (ResponseMessage response = await this.cosmosClient.CreateDatabaseStreamAsync(databaseSettings)) + using (ResponseMessage response = await this.GetClient().CreateDatabaseStreamAsync(databaseSettings)) { Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); Assert.IsNotNull(response.Headers); @@ -129,14 +113,14 @@ public async Task StreamCreateConflictTestAsync() } // Stream operations do not throw exceptions. - using (ResponseMessage response = await this.cosmosClient.CreateDatabaseStreamAsync(databaseSettings)) + using (ResponseMessage response = await this.GetClient().CreateDatabaseStreamAsync(databaseSettings)) { Assert.AreEqual(HttpStatusCode.Conflict, response.StatusCode); Assert.IsNotNull(response.Headers); Assert.IsTrue(response.Headers.RequestCharge > 0); } - using (ResponseMessage response = await this.cosmosClient.GetDatabase(databaseSettings.Id).DeleteStreamAsync()) + using (ResponseMessage response = await this.GetClient().GetDatabase(databaseSettings.Id).DeleteStreamAsync()) { Assert.AreEqual(HttpStatusCode.NoContent, response.StatusCode); Assert.IsNotNull(response.Headers); @@ -185,7 +169,7 @@ public async Task DropNonExistingDatabase() { try { - DatabaseResponse response = await this.cosmosClient.GetDatabase(Guid.NewGuid().ToString()).DeleteAsync(cancellationToken: this.cancellationToken); + DatabaseResponse response = await this.GetClient().GetDatabase(Guid.NewGuid().ToString()).DeleteAsync(cancellationToken: this.cancellationToken); Assert.Fail(); } catch (CosmosException ex) @@ -218,7 +202,7 @@ public async Task CreateIfNotExists() RequestChargeHandlerHelper requestChargeHandler = new RequestChargeHandlerHelper(); RequestHandlerHelper requestHandlerHelper = new RequestHandlerHelper(); - CosmosClient client = TestCommon.CreateCosmosClient(x => x.AddCustomHandlers(requestChargeHandler, requestHandlerHelper)); + using CosmosClient client = TestCommon.CreateCosmosClient(x => x.AddCustomHandlers(requestChargeHandler, requestHandlerHelper)); // Create a new database requestChargeHandler.TotalRequestCharges = 0; @@ -292,7 +276,7 @@ public async Task ReadReplaceThroughputResponseTests() (x) => toStreamCount++); //Create a new cosmos client with the mocked cosmos json serializer - CosmosClient client = TestCommon.CreateCosmosClient( + using CosmosClient client = TestCommon.CreateCosmosClient( (cosmosClientBuilder) => cosmosClientBuilder.WithCustomSerializer(mockJsonSerializer)); string databaseId = Guid.NewGuid().ToString(); @@ -372,7 +356,7 @@ public async Task DatabaseIterator() databaseIds.Add(createResponse.Resource.Id); } - FeedIterator feedIterator = this.cosmosClient.GetDatabaseQueryIterator( + FeedIterator feedIterator = this.GetClient().GetDatabaseQueryIterator( queryDefinition: null, continuationToken: null, requestOptions: new QueryRequestOptions() { MaxItemCount = 2 }); @@ -420,7 +404,7 @@ public async Task EncryptionCreateReplaceCek() cekProperties.EncryptionKeyWrapMetadata); // Use a different client instance to avoid (unintentional) cache impact - ClientEncryptionKeyProperties readProperties = await ((DatabaseInlineCore)this.cosmosClient.GetDatabase(response.Database.Id)).GetClientEncryptionKey(cekId).ReadAsync(); + ClientEncryptionKeyProperties readProperties = await ((DatabaseInlineCore)this.GetClient().GetDatabase(response.Database.Id)).GetClientEncryptionKey(cekId).ReadAsync(); Assert.AreEqual(cekProperties, readProperties); // Replace @@ -438,7 +422,7 @@ public async Task EncryptionCreateReplaceCek() // Use a different client instance to avoid (unintentional) cache impact readProperties = - await ((DatabaseCore)(DatabaseInlineCore)this.cosmosClient.GetDatabase(response.Database.Id)).GetClientEncryptionKey(cekId).ReadAsync(); + await ((DatabaseCore)(DatabaseInlineCore)this.GetClient().GetDatabase(response.Database.Id)).GetClientEncryptionKey(cekId).ReadAsync(); Assert.AreEqual(cekProperties, readProperties); response = await response.Database.DeleteAsync(cancellationToken: this.cancellationToken); @@ -558,15 +542,15 @@ public async Task DatabaseQueryIterator() string secondDb = "Bcdefgh"; string thirdDb = "Zoo"; - DatabaseResponse createResponse2 = await this.cosmosClient.CreateDatabaseIfNotExistsAsync(secondDb); + DatabaseResponse createResponse2 = await this.GetClient().CreateDatabaseIfNotExistsAsync(secondDb); deleteList.Add(createResponse2.Database); - DatabaseResponse createResponse = await this.cosmosClient.CreateDatabaseIfNotExistsAsync(firstDb); + DatabaseResponse createResponse = await this.GetClient().CreateDatabaseIfNotExistsAsync(firstDb); deleteList.Add(createResponse.Database); - DatabaseResponse createResponse3 = await this.cosmosClient.CreateDatabaseIfNotExistsAsync(thirdDb); + DatabaseResponse createResponse3 = await this.GetClient().CreateDatabaseIfNotExistsAsync(thirdDb); deleteList.Add(createResponse3.Database); using (FeedIterator feedIterator = - this.cosmosClient.GetDatabaseQueryIterator( + this.GetClient().GetDatabaseQueryIterator( new QueryDefinition("select c.id From c where c.id = @id ") .WithParameter("@id", createResponse.Database.Id), requestOptions: new QueryRequestOptions() { MaxItemCount = 1 })) @@ -579,7 +563,7 @@ public async Task DatabaseQueryIterator() } using (FeedIterator feedIterator = - this.cosmosClient.GetDatabaseQueryStreamIterator( + this.GetClient().GetDatabaseQueryStreamIterator( "select value c.id From c ")) { while (feedIterator.HasMoreResults) @@ -603,7 +587,7 @@ public async Task DatabaseQueryIterator() List ids = new List(); using (FeedIterator feedIterator = - this.cosmosClient.GetDatabaseQueryIterator( + this.GetClient().GetDatabaseQueryIterator( "select value c.id From c ")) { while (feedIterator.HasMoreResults) @@ -637,14 +621,14 @@ private async Task CreateDatabaseHelper( DatabaseResponse response = null; if (databaseExists) { - response = await this.cosmosClient.CreateDatabaseIfNotExistsAsync( + response = await this.GetClient().CreateDatabaseIfNotExistsAsync( databaseId, throughput, cancellationToken: this.cancellationToken); } else { - response = await this.cosmosClient.CreateDatabaseAsync( + response = await this.GetClient().CreateDatabaseAsync( databaseId, throughput, cancellationToken: this.cancellationToken); @@ -673,7 +657,7 @@ private async Task CreateDatabaseHelper( } DatabaseProperties databaseSettings = new DatabaseProperties() { Id = databaseId }; - ResponseMessage response = await this.cosmosClient.CreateDatabaseStreamAsync( + ResponseMessage response = await this.GetClient().CreateDatabaseStreamAsync( databaseSettings, throughput: 400); @@ -683,7 +667,7 @@ private async Task CreateDatabaseHelper( Assert.IsTrue(response.StatusCode == HttpStatusCode.OK || (response.StatusCode == HttpStatusCode.Created && !databaseExists)); - return this.cosmosClient.GetDatabase(databaseId); + return this.GetClient().GetDatabase(databaseId); } private void ValidateHeaders(DatabaseResponse cosmosDatabaseResponse) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemIdEncodingTestsBase.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemIdEncodingTestsBase.cs index aef4323045..257c1ba0d3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemIdEncodingTestsBase.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemIdEncodingTestsBase.cs @@ -588,9 +588,9 @@ public async Task IdWithLineFeed() private async Task ExecuteTestCase(TestScenario scenario) { TestScenarioExpectations expected = - this.cosmosClient.ClientOptions.ConnectionMode == ConnectionMode.Direct ? + this.GetClient().ClientOptions.ConnectionMode == ConnectionMode.Direct ? scenario.Direct : - this.cosmosClient.Endpoint.Port == computeGatewayPort ? + this.GetClient().Endpoint.Port == computeGatewayPort ? scenario.ComputeGateway ?? scenario.Gateway : scenario.Gateway; Console.WriteLine($"Scenario: {scenario.Name}, Id: \"{scenario.Id}\""); @@ -638,7 +638,7 @@ await CreateItemPayload(scenario.Id), Assert.AreEqual(expected.ExpectedDeleteStatusCode, response.StatusCode); if (response.IsSuccessStatusCode) { - if (this.cosmosClient.ClientOptions.ConnectionMode == ConnectionMode.Gateway) + if (this.GetClient().ClientOptions.ConnectionMode == ConnectionMode.Gateway) { await ValidateEmptyPayload(response.Content); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemSessionTokenTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemSessionTokenTests.cs index 652cb01441..f815eba08e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemSessionTokenTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemSessionTokenTests.cs @@ -237,7 +237,7 @@ public async Task NoSessionTokenCaptureForThrottledUpsertRequestsTest() return throttledResponse; }, - this.cosmosClient.DocumentClient.sessionContainer); + this.GetClient().DocumentClient.sessionContainer); try { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs index 50bc71f276..c5d6347dd1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs @@ -69,7 +69,7 @@ public async Task Cleanup() public void ParentResourceTest() { Assert.AreEqual(this.database, this.Container.Database); - Assert.AreEqual(this.cosmosClient, this.Container.Database.Client); + Assert.AreEqual(this.GetClient(), this.Container.Database.Client); } [TestMethod] @@ -96,7 +96,7 @@ public async Task CreateDropItemWithInvalidIdCharactersTest() string[] selfLinkSegments = containerProperties.SelfLink.Split('/'); string databaseRid = selfLinkSegments[1]; string containerRid = selfLinkSegments[3]; - Container containerByRid = this.cosmosClient.GetContainer(databaseRid, containerRid); + Container containerByRid = this.GetClient().GetContainer(databaseRid, containerRid); // List of invalid characters are listed here. //https://docs.microsoft.com/dotnet/api/microsoft.azure.documents.resource.id?view=azure-dotnet#remarks @@ -416,7 +416,7 @@ public async Task ReadCollectionNotExists() // Item -> Container -> Database contract string dbName = Guid.NewGuid().ToString(); - testContainer = this.cosmosClient.GetDatabase(dbName).GetContainer(collectionName); + testContainer = this.GetClient().GetDatabase(dbName).GetContainer(collectionName); await CosmosItemTests.TestNonePKForNonExistingContainer(testContainer); } @@ -424,7 +424,7 @@ public async Task ReadCollectionNotExists() public async Task NonPartitionKeyLookupCacheTest() { int count = 0; - CosmosClient client = TestCommon.CreateCosmosClient(builder => + using CosmosClient client = TestCommon.CreateCosmosClient(builder => { builder.WithConnectionModeDirect(); builder.WithSendingRequestEventArgs((sender, e) => @@ -509,6 +509,8 @@ public async Task NonPartitionKeyLookupCacheTest() // OkRagnes should be fetched only once. // Possible to make multiple calls for ranges Assert.AreEqual(expected, count); + + await db.DeleteStreamAsync(); } [TestMethod] @@ -767,11 +769,10 @@ public async Task PartitionKeyDeleteTestForSubpartitionedContainer() { string currentVersion = HttpConstants.Versions.CurrentVersion; HttpConstants.Versions.CurrentVersion = "2020-07-15"; + using CosmosClient client = TestCommon.CreateCosmosClient(true); Cosmos.Database database = null; try { - CosmosClient client = TestCommon.CreateCosmosClient(true); - database = await client.CreateDatabaseIfNotExistsAsync("mydb"); ContainerProperties containerProperties = new ContainerProperties("subpartitionedcontainer", new List { "/Country", "/City" }); @@ -1575,7 +1576,7 @@ public async Task ItemEpkQuerySingleKeyRangeValidation() container = (ContainerInlineCore)containerResponse; // Get all the partition key ranges to verify there is more than one partition - IRoutingMapProvider routingMapProvider = await this.cosmosClient.DocumentClient.GetPartitionKeyRangeCacheAsync(NoOpTrace.Singleton); + IRoutingMapProvider routingMapProvider = await this.GetClient().DocumentClient.GetPartitionKeyRangeCacheAsync(NoOpTrace.Singleton); IReadOnlyList ranges = await routingMapProvider.TryGetOverlappingRangesAsync( containerResponse.Resource.ResourceId, new Documents.Routing.Range("00", "FF", isMaxInclusive: true, isMinInclusive: true), @@ -2692,7 +2693,7 @@ public async Task MigrateDataInNonPartitionContainer() [TestCategory("Quarantine") /* Gated runs emulator as rate limiting disabled */] public async Task VerifyToManyRequestTest(bool isQuery) { - CosmosClient client = TestCommon.CreateCosmosClient(); + using CosmosClient client = TestCommon.CreateCosmosClient(); Cosmos.Database db = await client.CreateDatabaseIfNotExistsAsync("LoadTest"); Container container = await db.CreateContainerIfNotExistsAsync("LoadContainer", "/pk"); @@ -2755,7 +2756,7 @@ public async Task VerifySessionTokenPassThrough() [TestMethod] public async Task VerifySessionNotFoundStatistics() { - CosmosClient cosmosClient = TestCommon.CreateCosmosClient(new CosmosClientOptions() { ConsistencyLevel = Cosmos.ConsistencyLevel.Session }); + using CosmosClient cosmosClient = TestCommon.CreateCosmosClient(new CosmosClientOptions() { ConsistencyLevel = Cosmos.ConsistencyLevel.Session }); DatabaseResponse database = await cosmosClient.CreateDatabaseIfNotExistsAsync("NoSession"); Container container = await database.Database.CreateContainerIfNotExistsAsync("NoSession", "/pk"); @@ -2815,8 +2816,8 @@ public async Task ContainterReCreateStatelessTest(bool operationBetweenRecreate, operation = ExecuteReadFeedAsync; } - CosmosClient cc1 = TestCommon.CreateCosmosClient(); - CosmosClient cc2 = TestCommon.CreateCosmosClient(); + using CosmosClient cc1 = TestCommon.CreateCosmosClient(); + using CosmosClient cc2 = TestCommon.CreateCosmosClient(); Cosmos.Database db1 = null; try { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs index d069e87935..c77352d07f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs @@ -14,7 +14,8 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests public class CosmosMultiHashTest { private Cosmos.Database database = null; - + + private CosmosClient client = null; private Container container = null; private ContainerProperties containerProperties = null; @@ -25,8 +26,8 @@ public class CosmosMultiHashTest public async Task TestInitialize() { HttpConstants.Versions.CurrentVersion = "2020-07-15"; - CosmosClient client = TestCommon.CreateCosmosClient(true); - this.database = await client.CreateDatabaseIfNotExistsAsync("mydb"); + this.client = TestCommon.CreateCosmosClient(true); + this.database = await this.client.CreateDatabaseIfNotExistsAsync("mydb"); this.containerProperties = new ContainerProperties("mycoll", new List { "/ZipCode", "/Address" }); this.container = await this.database.CreateContainerAsync(this.containerProperties); @@ -37,6 +38,7 @@ public async Task Cleanup() { await this.database.DeleteAsync(); HttpConstants.Versions.CurrentVersion = this.currentVersion; + this.client.Dispose(); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosNotFoundTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosNotFoundTests.cs index a136cfe4b3..1903a04861 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosNotFoundTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosNotFoundTests.cs @@ -39,6 +39,7 @@ public async Task ValidateContainerNotFoundResponse() Database dbExists = await client.CreateDatabaseAsync("NotFoundTest" + Guid.NewGuid().ToString()); await this.ContainerOperations(database: dbExists, dbNotExist: false); + await dbExists.DeleteStreamAsync(); } [TestMethod] @@ -76,7 +77,7 @@ public async Task ValidateQueryNotFoundResponse() { // Recreate the collection with the same name on a different client. - CosmosClient newClient = TestCommon.CreateCosmosClient(); + using CosmosClient newClient = TestCommon.CreateCosmosClient(); Database db2 = newClient.GetDatabase(db.Id); Container container2 = await db2.CreateContainerAsync( id: container.Id, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosPermissionTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosPermissionTests.cs index 003ca8690b..753fe93899 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosPermissionTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosPermissionTests.cs @@ -13,45 +13,29 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] - public class CosmosPermissionTests + public class CosmosPermissionTests : BaseCosmosClientHelper { - private CosmosClient cosmosClient = null; - private Database cosmosDatabase = null; - [TestInitialize] - public async Task TestInit() + public async Task TestInitialize() { - this.cosmosClient = TestCommon.CreateCosmosClient(); - - string databaseName = Guid.NewGuid().ToString(); - DatabaseResponse cosmosDatabaseResponse = await this.cosmosClient.CreateDatabaseIfNotExistsAsync(databaseName); - this.cosmosDatabase = cosmosDatabaseResponse; + await base.TestInit(); } [TestCleanup] - public async Task TestCleanup() + public async Task Cleanup() { - if (this.cosmosClient == null) - { - return; - } - - if (this.cosmosDatabase != null) - { - await this.cosmosDatabase.DeleteStreamAsync(); - } - this.cosmosClient.Dispose(); + await base.TestCleanup(); } [TestMethod] public async Task CRUDTest() { string containerId = Guid.NewGuid().ToString(); - ContainerResponse containerResponse = await this.cosmosDatabase.CreateContainerAsync(containerId, "/id"); + ContainerResponse containerResponse = await this.database.CreateContainerAsync(containerId, "/id"); Assert.AreEqual(HttpStatusCode.Created, containerResponse.StatusCode); string userId = Guid.NewGuid().ToString(); - UserResponse userResponse = await this.cosmosDatabase.CreateUserAsync(userId); + UserResponse userResponse = await this.database.CreateUserAsync(userId); User user = userResponse.User; Assert.AreEqual(HttpStatusCode.Created, userResponse.StatusCode); Assert.AreEqual(userId, user.Id); @@ -118,14 +102,14 @@ public async Task ContainerResourcePermissionTest(ConnectionMode mode) //create user string userId = Guid.NewGuid().ToString(); - UserResponse userResponse = await this.cosmosDatabase.CreateUserAsync(userId); + UserResponse userResponse = await this.database.CreateUserAsync(userId); Assert.AreEqual(HttpStatusCode.Created, userResponse.StatusCode); Assert.AreEqual(userId, userResponse.Resource.Id); User user = userResponse.User; //create resource string containerId = Guid.NewGuid().ToString(); - ContainerResponse containerResponse = await this.cosmosDatabase.CreateContainerAsync(containerId, "/id"); + ContainerResponse containerResponse = await this.database.CreateContainerAsync(containerId, "/id"); Assert.AreEqual(HttpStatusCode.Created, containerResponse.StatusCode); Container container = containerResponse.Container; @@ -140,7 +124,7 @@ public async Task ContainerResourcePermissionTest(ConnectionMode mode) using (CosmosClient tokenCosmosClient = TestCommon.CreateCosmosClient(cosmosClientOptions, resourceToken: permission.Token)) { - Container readContainerRef = tokenCosmosClient.GetContainer(this.cosmosDatabase.Id, containerId); + Container readContainerRef = tokenCosmosClient.GetContainer(this.database.Id, containerId); //read resource with PermissionMode.Read using FeedIterator feedIterator = readContainerRef.GetItemQueryIterator("SELECT * FROM c"); @@ -153,7 +137,7 @@ public async Task ContainerResourcePermissionTest(ConnectionMode mode) try { ContainerResponse response = await tokenCosmosClient - .GetDatabase(this.cosmosDatabase.Id) + .GetDatabase(this.database.Id) .GetContainer(containerId) .DeleteContainerAsync(); Assert.Fail(); @@ -173,7 +157,7 @@ public async Task ContainerResourcePermissionTest(ConnectionMode mode) using (CosmosClient tokenCosmosClient = TestCommon.CreateCosmosClient(cosmosClientOptions, resourceToken: permission.Token)) { ContainerResponse response = await tokenCosmosClient - .GetDatabase(this.cosmosDatabase.Id) + .GetDatabase(this.database.Id) .GetContainer(containerId) .DeleteContainerAsync(); Assert.AreEqual(HttpStatusCode.NoContent, response.StatusCode); @@ -190,7 +174,7 @@ public async Task ContainerPartitionResourcePermissionTest(ConnectionMode connec ConnectionMode = connectionMode }; - CosmosClient cosmosClient = TestCommon.CreateCosmosClient(cosmosClientOptions); + using CosmosClient cosmosClient = TestCommon.CreateCosmosClient(cosmosClientOptions); Database database = await cosmosClient.CreateDatabaseIfNotExistsAsync("PermissionTest"); @@ -297,6 +281,8 @@ await container.CreateItemAsync( Assert.AreEqual(1, resultGateway.Count); } + + await database.DeleteStreamAsync(); } [TestMethod] @@ -311,14 +297,14 @@ public async Task ItemResourcePermissionTest(ConnectionMode connectionMode) //create user string userId = Guid.NewGuid().ToString(); - UserResponse userResponse = await this.cosmosDatabase.CreateUserAsync(userId); + UserResponse userResponse = await this.database.CreateUserAsync(userId); Assert.AreEqual(HttpStatusCode.Created, userResponse.StatusCode); Assert.AreEqual(userId, userResponse.Resource.Id); User user = userResponse.User; //create resource string containerId = Guid.NewGuid().ToString(); - ContainerResponse containerResponse = await this.cosmosDatabase.CreateContainerAsync(containerId, "/id"); + ContainerResponse containerResponse = await this.database.CreateContainerAsync(containerId, "/id"); Assert.AreEqual(HttpStatusCode.Created, containerResponse.StatusCode); Container container = containerResponse.Container; string itemId = Guid.NewGuid().ToString(); @@ -338,7 +324,7 @@ public async Task ItemResourcePermissionTest(ConnectionMode connectionMode) using (CosmosClient tokenCosmosClient = TestCommon.CreateCosmosClient(clientOptions: cosmosClientOptions, resourceToken: permission.Token)) { - Container tokenContainer = tokenCosmosClient.GetContainer(this.cosmosDatabase.Id, containerId); + Container tokenContainer = tokenCosmosClient.GetContainer(this.database.Id, containerId); //read resource with PermissionMode.Read ItemResponse readPermissionItem = await tokenContainer.ReadItemAsync(itemId, partitionKey); @@ -368,7 +354,7 @@ public async Task ItemResourcePermissionTest(ConnectionMode connectionMode) using (CosmosClient tokenCosmosClient = TestCommon.CreateCosmosClient(clientOptions: cosmosClientOptions, resourceToken: permission.Token)) { using (FeedIterator feed = tokenCosmosClient - .GetDatabase(this.cosmosDatabase.Id) + .GetDatabase(this.database.Id) .GetContainer(containerId) .GetItemQueryIterator(new QueryDefinition("select * from t"))) { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadFeedTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadFeedTests.cs index 08c65ea00d..6bd4bcbdb8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadFeedTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadFeedTests.cs @@ -33,7 +33,7 @@ public async Task TestInitialize() Assert.IsNotNull(response.Resource); this.Container = (ContainerInlineCore)response; - DocumentFeedResponse pkRangesFeed = await this.cosmosClient.DocumentClient.ReadPartitionKeyRangeFeedAsync(this.Container.LinkUri); + DocumentFeedResponse pkRangesFeed = await this.GetClient().DocumentClient.ReadPartitionKeyRangeFeedAsync(this.Container.LinkUri); Assert.IsTrue(pkRangesFeed.Count > 1, "Refresh container throughput to have at-least > 1 pk-range"); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs index 4a406c29d1..ede534cb9d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs @@ -95,7 +95,7 @@ public async Task ReadManyStreamTest() Assert.IsTrue(responseMessage.Headers.RequestCharge > 0); Assert.IsNotNull(responseMessage.Diagnostics); - ToDoActivity[] items = this.cosmosClient.ClientContext.SerializerCore.FromFeedStream( + ToDoActivity[] items = this.GetClient().ClientContext.SerializerCore.FromFeedStream( CosmosFeedResponseSerializer.GetStreamWithoutServiceEnvelope(responseMessage.Content)); Assert.AreEqual(items.Length, 5); } @@ -147,7 +147,7 @@ public async Task ReadManyWithIdasPk() Assert.IsTrue(responseMessage.Headers.RequestCharge > 0); Assert.IsNotNull(responseMessage.Diagnostics); - ToDoActivity[] items = this.cosmosClient.ClientContext.SerializerCore.FromFeedStream( + ToDoActivity[] items = this.GetClient().ClientContext.SerializerCore.FromFeedStream( CosmosFeedResponseSerializer.GetStreamWithoutServiceEnvelope(responseMessage.Content)); Assert.AreEqual(items.Length, 5); } @@ -323,7 +323,7 @@ public async Task ReadManyTestWithIncorrectIntendedContainerRid() Assert.IsTrue(responseMessage.Headers.RequestCharge > 0); Assert.IsNotNull(responseMessage.Diagnostics); - ToDoActivity[] items = this.cosmosClient.ClientContext.SerializerCore.FromFeedStream( + ToDoActivity[] items = this.GetClient().ClientContext.SerializerCore.FromFeedStream( CosmosFeedResponseSerializer.GetStreamWithoutServiceEnvelope(responseMessage.Content)); Assert.AreEqual(items.Length, 2); } @@ -332,7 +332,7 @@ public async Task ReadManyTestWithIncorrectIntendedContainerRid() [TestMethod] public async Task ReadMany404ExceptionTest() { - Database database = await this.cosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString()); + Database database = await this.GetClient().CreateDatabaseAsync(Guid.NewGuid().ToString()); Container container = await database.CreateContainerAsync(Guid.NewGuid().ToString(), "/pk"); for (int i = 0; i < 5; i++) { @@ -483,7 +483,7 @@ public async Task ReadManyExceptionsTest(HttpStatusCode statusCode) CosmosClientBuilder builder = TestCommon.GetDefaultConfiguration(); builder.AddCustomHandlers(requestHandlers); - CosmosClient client = builder.Build(); + using CosmosClient client = builder.Build(); Database database = await client.CreateDatabaseAsync(Guid.NewGuid().ToString()); Container container = await database.CreateContainerAsync(Guid.NewGuid().ToString(), "/pk"); for (int i = 0; i < 5; i++) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosUserTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosUserTests.cs index a0b849c775..f5943a4d66 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosUserTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosUserTests.cs @@ -5,45 +5,23 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests { using System; - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.Linq; using System.Net; using System.Threading.Tasks; - using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; - using Newtonsoft.Json.Linq; [TestClass] - public class CosmosUserTests + public class CosmosUserTests : BaseCosmosClientHelper { - - private CosmosClient cosmosClient = null; - private Cosmos.Database cosmosDatabase = null; - [TestInitialize] - public async Task TestInit() + public async Task TestInitialize() { - this.cosmosClient = TestCommon.CreateCosmosClient(); - - string databaseName = Guid.NewGuid().ToString(); - DatabaseResponse cosmosDatabaseResponse = await this.cosmosClient.CreateDatabaseIfNotExistsAsync(databaseName); - this.cosmosDatabase = cosmosDatabaseResponse; + await base.TestInit(); } [TestCleanup] - public async Task TestCleanup() + public async Task Cleanup() { - if (this.cosmosClient == null) - { - return; - } - - if (this.cosmosDatabase != null) - { - await this.cosmosDatabase.DeleteStreamAsync(); - } - this.cosmosClient.Dispose(); + await base.TestCleanup(); } [TestMethod] @@ -51,7 +29,7 @@ public async Task CRUDTest() { string userId = Guid.NewGuid().ToString(); - UserResponse userResponse = await this.cosmosDatabase.CreateUserAsync(userId); + UserResponse userResponse = await this.database.CreateUserAsync(userId); Assert.AreEqual(HttpStatusCode.Created, userResponse.StatusCode); Assert.AreEqual(userId, userResponse.Resource.Id); Assert.IsNotNull(userResponse.Resource.ResourceId); @@ -60,21 +38,21 @@ public async Task CRUDTest() string newUserId = Guid.NewGuid().ToString(); userResponse.Resource.Id = newUserId; - userResponse = await this.cosmosDatabase.GetUser(userId).ReplaceAsync(userResponse.Resource); + userResponse = await this.database.GetUser(userId).ReplaceAsync(userResponse.Resource); Assert.AreEqual(HttpStatusCode.OK, userResponse.StatusCode); Assert.AreEqual(newUserId, userResponse.Resource.Id); SelflinkValidator.ValidateUserSelfLink(userResponse.Resource.SelfLink); - userResponse = await this.cosmosDatabase.GetUser(userResponse.Resource.Id).ReadAsync(); + userResponse = await this.database.GetUser(userResponse.Resource.Id).ReadAsync(); Assert.AreEqual(HttpStatusCode.OK, userResponse.StatusCode); Assert.AreEqual(newUserId, userResponse.Resource.Id); SelflinkValidator.ValidateUserSelfLink(userResponse.Resource.SelfLink); - userResponse = await this.cosmosDatabase.GetUser(newUserId).DeleteAsync(); + userResponse = await this.database.GetUser(newUserId).DeleteAsync(); Assert.AreEqual(HttpStatusCode.NoContent, userResponse.StatusCode); userId = Guid.NewGuid().ToString(); - userResponse = await this.cosmosDatabase.UpsertUserAsync(userId); + userResponse = await this.database.UpsertUserAsync(userId); Assert.AreEqual(HttpStatusCode.Created, userResponse.StatusCode); Assert.AreEqual(userId, userResponse.Resource.Id); Assert.IsNotNull(userResponse.Resource.ResourceId); @@ -82,7 +60,7 @@ public async Task CRUDTest() newUserId = Guid.NewGuid().ToString(); userResponse.Resource.Id = newUserId; - userResponse = await this.cosmosDatabase.UpsertUserAsync(userResponse.Resource.Id); + userResponse = await this.database.UpsertUserAsync(userResponse.Resource.Id); Assert.AreEqual(newUserId, userResponse.Resource.Id); SelflinkValidator.ValidateUserSelfLink(userResponse.Resource.SelfLink); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DocumentClientUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DocumentClientUnitTests.cs index 74eb1dbced..227f308baf 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DocumentClientUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DocumentClientUnitTests.cs @@ -40,7 +40,7 @@ public void NoRetryOnThrottledOverride() } [TestMethod] - public void RetryExceedingMaxTimeLimit() + public async Task RetryExceedingMaxTimeLimit() { Mock mockStoreModel = new Mock(); mockStoreModel.Setup(model => model.ProcessMessageAsync(It.IsAny(), default(CancellationToken))) @@ -52,13 +52,13 @@ public void RetryExceedingMaxTimeLimit() RetryOptions = new RetryOptions { MaxRetryAttemptsOnThrottledRequests = 100, MaxRetryWaitTimeInSeconds = 1 } }; - DocumentClient client = new DocumentClient( + using DocumentClient client = new DocumentClient( new Uri(ConfigurationManager.AppSettings["GatewayEndpoint"]), ConfigurationManager.AppSettings["MasterKey"], (HttpMessageHandler)null, connectionPolicy); - client.GetDatabaseAccountAsync().Wait(); + await client.GetDatabaseAccountAsync(); int expectedExecutionTimes = 11; @@ -68,11 +68,10 @@ public void RetryExceedingMaxTimeLimit() try { Database db = new Database { Id = "test db 1" }; - client.CreateDatabaseAsync(db).Wait(); + await client.CreateDatabaseAsync(db); } - catch (Exception exp) + catch (DocumentClientException docExp) { - DocumentClientException docExp = exp.InnerException as DocumentClientException; Assert.AreEqual((HttpStatusCode)429, docExp.StatusCode); throttled = true; } @@ -97,7 +96,7 @@ public async Task OpenConnectionsToAllReplicasAsync_WithEmptyDatabaseName_Should RetryOptions = new RetryOptions { MaxRetryAttemptsOnThrottledRequests = 100, MaxRetryWaitTimeInSeconds = 1 } }; - DocumentClient client = new ( + using DocumentClient client = new ( new Uri(ConfigurationManager.AppSettings["GatewayEndpoint"]), ConfigurationManager.AppSettings["MasterKey"], (HttpMessageHandler)null, @@ -139,13 +138,13 @@ public async Task OpenConnectionsToAllReplicasAsync_WhenStoreModelThrowsInternal RetryOptions = new RetryOptions { MaxRetryAttemptsOnThrottledRequests = 100, MaxRetryWaitTimeInSeconds = 1 } }; - DocumentClient client = new ( + using DocumentClient client = new ( new Uri(ConfigurationManager.AppSettings["GatewayEndpoint"]), ConfigurationManager.AppSettings["MasterKey"], (HttpMessageHandler)null, connectionPolicy); - client.GetDatabaseAccountAsync().Wait(); + await client.GetDatabaseAccountAsync(); client.StoreModel = mockStoreModel.Object; client.GatewayStoreModel = mockStoreModel.Object; @@ -167,7 +166,7 @@ public async Task OpenConnectionsToAllReplicasAsync_WhenStoreModelThrowsInternal [TestMethod] public async Task QueryPartitionProviderSingletonTestAsync() { - DocumentClient client = new DocumentClient( + using DocumentClient client = new DocumentClient( new Uri(ConfigurationManager.AppSettings["GatewayEndpoint"]), ConfigurationManager.AppSettings["MasterKey"], (HttpMessageHandler)null, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/ChangeFeedIteratorCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/ChangeFeedIteratorCoreTests.cs index b9d179c0c1..4a1d92c59c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/ChangeFeedIteratorCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/ChangeFeedIteratorCoreTests.cs @@ -707,8 +707,8 @@ public async Task TestCancellationTokenAsync() await this.CreateRandomItems(itemsCore, 100, randomPartitionKey: true); // Inject validating handler - RequestHandler currentInnerHandler = this.cosmosClient.RequestHandler.InnerHandler; - this.cosmosClient.RequestHandler.InnerHandler = cancellationTokenHandler; + RequestHandler currentInnerHandler = this.GetClient().RequestHandler.InnerHandler; + this.GetClient().RequestHandler.InnerHandler = cancellationTokenHandler; cancellationTokenHandler.InnerHandler = currentInnerHandler; { @@ -808,17 +808,13 @@ public async Task ChangeFeedIteratorCore_WithQuery() private async Task ValidateChangeFeedIteratorCore_WithQuery( bool useGateway) { - await this.Cleanup(); - this.cancellationTokenSource = new CancellationTokenSource(); this.cancellationToken = this.cancellationTokenSource.Token; - this.cosmosClient = TestCommon.CreateCosmosClient(useGateway: useGateway); - this.database = await this.cosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString(), - cancellationToken: this.cancellationToken); + CosmosClient cosmosClient = useGateway ? TestCommon.CreateCosmosClient(useGateway: useGateway) : this.GetClient(); ContainerProperties properties = new ContainerProperties(id: Guid.NewGuid().ToString(), partitionKeyPath: "/pkey"); properties.ChangeFeedPolicy.FullFidelityRetention = TimeSpan.FromMinutes(5); - ContainerResponse response = await this.database.CreateContainerAsync( + ContainerResponse response = await cosmosClient.GetDatabase(this.database.Id).CreateContainerAsync( properties, cancellationToken: this.cancellationToken); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/QueryFeedTokenTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/QueryFeedTokenTests.cs index 1e26ef0738..df61615fe6 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/QueryFeedTokenTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/QueryFeedTokenTests.cs @@ -50,7 +50,7 @@ public async Task GetTargetPartitionKeyRangesAsyncWithFeedRange() container = (ContainerInlineCore)containerResponse; // Get all the partition key ranges to verify there is more than one partition - IRoutingMapProvider routingMapProvider = await this.cosmosClient.DocumentClient.GetPartitionKeyRangeCacheAsync(NoOpTrace.Singleton); + IRoutingMapProvider routingMapProvider = await this.GetClient().DocumentClient.GetPartitionKeyRangeCacheAsync(NoOpTrace.Singleton); ContainerQueryProperties containerQueryProperties = new ContainerQueryProperties( containerResponse.Resource.ResourceId, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Fluent/ContainerSettingsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Fluent/ContainerSettingsTests.cs index 9c1724fc26..9de85f9f7e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Fluent/ContainerSettingsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Fluent/ContainerSettingsTests.cs @@ -315,7 +315,7 @@ await this.database.DefineContainer(containerName, partitionKeyPath) [TestMethod] public async Task TestConflictResolutionPolicy() { - Database databaseForConflicts = await this.cosmosClient.CreateDatabaseAsync("conflictResolutionContainerTest", + Database databaseForConflicts = await this.GetClient().CreateDatabaseAsync("conflictResolutionContainerTest", cancellationToken: this.cancellationToken); try @@ -368,7 +368,7 @@ await databaseForConflicts.DefineContainer(containerName, partitionKeyPath) [TestMethod] public async Task TestChangeFeedPolicy() { - Database databaseForChangeFeed = await this.cosmosClient.CreateDatabaseAsync("changeFeedRetentionContainerTest", + Database databaseForChangeFeed = await this.GetClient().CreateDatabaseAsync("changeFeedRetentionContainerTest", cancellationToken: this.cancellationToken); try diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayClientSideRequestStatsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayClientSideRequestStatsTests.cs index 8d65a5e7f0..3a5e08a2fc 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayClientSideRequestStatsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayClientSideRequestStatsTests.cs @@ -8,7 +8,6 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Net.Http; using System.Threading; using System.Threading.Tasks; - using Antlr4.Runtime.Tree; using Microsoft.Azure.Cosmos.Diagnostics; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayTests.cs index 0d7eaa7ea5..41ccbc2da4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/GatewayTests.cs @@ -739,25 +739,25 @@ private async Task CreateTriggerAndValidateAsync(DocumentClient client, } [TestMethod] - public void ValidateTriggers() + public async Task ValidateTriggers() { - this.ValidateTriggersInternal(Protocol.Https, ConsistencyLevel.Session); - this.ValidateTriggersInternal(Protocol.Tcp, ConsistencyLevel.Session); + await this.ValidateTriggersInternal(Protocol.Https, ConsistencyLevel.Session); + await this.ValidateTriggersInternal(Protocol.Tcp, ConsistencyLevel.Session); } - internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, ConsistencyLevel? consistencyLevel = null) + internal async Task ValidateTriggersInternal(Protocol protocol = Protocol.Https, ConsistencyLevel? consistencyLevel = null) { #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - DocumentClient client = TestCommon.CreateClient(false, protocol: protocol, defaultConsistencyLevel: consistencyLevel); + using DocumentClient client = TestCommon.CreateClient(false, protocol: protocol, defaultConsistencyLevel: consistencyLevel); #endif #if !DIRECT_MODE - DocumentClient client = TestCommon.CreateClient(true, defaultConsistencyLevel: consistencyLevel); + using DocumentClient client = TestCommon.CreateClient(true, defaultConsistencyLevel: consistencyLevel); #endif TestCommon.DeleteAllDatabasesAsync().Wait(); Documents.Database database = TestCommon.CreateOrGetDatabase(client); PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection(new[] { "/pk" }), Kind = PartitionKind.Hash }; - DocumentCollection collection1 = TestCommon.CreateCollectionAsync(client, database, new DocumentCollection { Id = "TestTriggers" + Guid.NewGuid().ToString(), PartitionKey = partitionKeyDefinition }).Result; + DocumentCollection collection1 = await TestCommon.CreateCollectionAsync(client, database, new DocumentCollection { Id = "TestTriggers" + Guid.NewGuid().ToString(), PartitionKey = partitionKeyDefinition }); // 1. Basic tests @@ -773,7 +773,7 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi TriggerType = Documents.TriggerType.Pre, TriggerOperation = Documents.TriggerOperation.All }; - Trigger retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection1, t1).Result; + Trigger retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection1, t1); dynamic doct1 = GatewayTests.CreateDocument(client, this.baseUri, collection1, "Doc1", "empty", 0, pretrigger: "t1"); Assert.AreEqual("DOC1t1", doct1.Id); @@ -791,7 +791,7 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi TriggerType = Documents.TriggerType.Post, TriggerOperation = Documents.TriggerOperation.All }; - retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection1, response1).Result; + retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection1, response1); dynamic docresponse1 = GatewayTests.CreateDocument(client, this.baseUri, collection1, "testing post trigger", "empty", 0, pretrigger: "t1", posttrigger: "response1"); Assert.AreEqual("TESTING POST TRIGGERt1", docresponse1.Id); @@ -809,7 +809,7 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi TriggerType = Documents.TriggerType.Post, TriggerOperation = Documents.TriggerOperation.All }; - retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection1, response2).Result; + retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection1, response2); dynamic docresponse2 = GatewayTests.CreateDocument(client, this.baseUri, collection1, "post trigger output", "empty", 0, pretrigger: "t1", posttrigger: "response2"); Assert.AreEqual("POST TRIGGER OUTPUTt1POST TRIGGER OUTPUTt1response2", docresponse2.Id); @@ -842,7 +842,7 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi TriggerType = Documents.TriggerType.Post, TriggerOperation = Documents.TriggerOperation.All }; - retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection1, response3).Result; + retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection1, response3); dynamic docresponse3 = GatewayTests.CreateDocument(client, this.baseUri, collection1, "testing post trigger2", "empty", 0, pretrigger: "t1", posttrigger: "response3"); Assert.AreEqual("TESTING POST TRIGGER2t1", docresponse3.Id); @@ -857,7 +857,7 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi TriggerType = Documents.TriggerType.Pre, TriggerOperation = Documents.TriggerOperation.All }; - retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection2, t2).Result; + retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection2, t2); dynamic doct2 = GatewayTests.CreateDocument(client, this.baseUri, collection2, "Doc2", "Prop1Value", 101, pretrigger: "t2"); Assert.AreEqual("Doc2", doct2.Id); @@ -874,7 +874,7 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi TriggerType = Documents.TriggerType.Pre, TriggerOperation = Documents.TriggerOperation.All }; - retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection2, t3).Result; + retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection2, t3); dynamic doct3 = GatewayTests.CreateDocument(client, this.baseUri, collection2, "Doc3", "empty", 0, pretrigger: "t3"); Assert.AreEqual("doc3t3", doct3.Id); @@ -887,7 +887,7 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi TriggerType = Documents.TriggerType.Post, TriggerOperation = Documents.TriggerOperation.All }; - retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection2, triggerTypeMismatch).Result; + retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection2, triggerTypeMismatch); bool exceptionThrown = false; try @@ -909,7 +909,7 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi TriggerType = Documents.TriggerType.Pre, TriggerOperation = Documents.TriggerOperation.All }; - retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection2, preTriggerThatThrows).Result; + retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection2, preTriggerThatThrows); try { @@ -931,7 +931,7 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi TriggerType = Documents.TriggerType.Post, TriggerOperation = Documents.TriggerOperation.All }; - retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection2, postTriggerThatThrows).Result; + retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection2, postTriggerThatThrows); try { @@ -954,13 +954,12 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi }; try { - Trigger retrievedTriggerNoBody = client.CreateTriggerAsync(collection2, triggerNoBody).Result; + Trigger retrievedTriggerNoBody = await client.CreateTriggerAsync(collection2, triggerNoBody); } catch (Exception ex) { Assert.IsNotNull(ex); - Assert.IsNotNull(ex.InnerException); - Assert.IsTrue(ex.InnerException.Message.Contains("The input content is invalid because the required properties - 'body; ' - are missing")); + Assert.IsTrue(ex.Message.Contains("The input content is invalid because the required properties - 'body; ' - are missing")); } // failure test - trigger without trigger type @@ -972,13 +971,12 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi }; try { - Trigger retrievedTriggerNoType = client.CreateTriggerAsync(collection2, triggerNoType).Result; + Trigger retrievedTriggerNoType = await client.CreateTriggerAsync(collection2, triggerNoType); } catch (Exception ex) { Assert.IsNotNull(ex); - Assert.IsNotNull(ex.InnerException); - Assert.IsTrue(ex.InnerException.Message.Contains("The input content is invalid because the required properties - 'triggerType; ' - are missing")); + Assert.IsTrue(ex.Message.Contains("The input content is invalid because the required properties - 'triggerType; ' - are missing")); } // failure test - trigger without trigger operation @@ -990,13 +988,12 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi }; try { - Trigger retrievedTriggerNoType = client.CreateTriggerAsync(collection2, triggerNoOperation).Result; + Trigger retrievedTriggerNoType = await client.CreateTriggerAsync(collection2, triggerNoOperation); } catch (Exception ex) { Assert.IsNotNull(ex); - Assert.IsNotNull(ex.InnerException); - Assert.IsTrue(ex.InnerException.Message.Contains("The input content is invalid because the required properties - 'triggerOperation; ' - are missing")); + Assert.IsTrue(ex.Message.Contains("The input content is invalid because the required properties - 'triggerOperation; ' - are missing")); } // TODO: uncomment when preserializedScripts is enabled. @@ -1028,14 +1025,11 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi }; try { - dbToCreate = client.CreateDatabaseAsync(dbToCreate, new Documents.Client.RequestOptions { PreTriggerInclude = new List { "t1" } }).Result; + dbToCreate = await client.CreateDatabaseAsync(dbToCreate, new Documents.Client.RequestOptions { PreTriggerInclude = new List { "t1" } }); } - catch (Exception e) + catch (DocumentClientException de) { - Assert.IsNotNull(e); - Assert.IsNotNull(e.InnerException); - - DocumentClientException de = e.InnerException as DocumentClientException; + Assert.IsNotNull(de); Assert.AreEqual(HttpStatusCode.BadRequest.ToString(), de.Error.Code); } @@ -1098,12 +1092,12 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi TriggerType = Documents.TriggerType.Pre, TriggerOperation = Documents.TriggerOperation.All }; - retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection2, request1).Result; + retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection2, request1); dynamic docrequest1 = GatewayTests.CreateDocument(client, this.baseUri, collection2, "abc", "empty", 0, pretrigger: "request1"); Assert.AreEqual("def", docrequest1.Id); - DocumentCollection collection3 = TestCommon.CreateCollectionAsync(client, database, new DocumentCollection { Id = "TestTriggers" + Guid.NewGuid().ToString(), PartitionKey = partitionKeyDefinition }).Result; + DocumentCollection collection3 = await TestCommon.CreateCollectionAsync(client, database, new DocumentCollection { Id = "TestTriggers" + Guid.NewGuid().ToString(), PartitionKey = partitionKeyDefinition }); // set request body multiple times Trigger request2 = new Trigger @@ -1120,7 +1114,7 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi TriggerType = Documents.TriggerType.Pre, TriggerOperation = Documents.TriggerOperation.All }; - retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection3, request2).Result; + retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection3, request2); dynamic docrequest2 = GatewayTests.CreateDocument(client, this.baseUri, collection3, "doc", "empty", 0, pretrigger: "request2"); Assert.AreEqual(203, docrequest2.Id.Length); @@ -1142,7 +1136,7 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi TriggerType = Documents.TriggerType.Pre, TriggerOperation = Documents.TriggerOperation.All }; - retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection3, request3).Result; + retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection3, request3); dynamic docrequest3 = GatewayTests.CreateDocument(client, this.baseUri, collection3, "noname", "empty", 0, pretrigger: "request3"); Assert.AreEqual("noresponse", docrequest3.Id); @@ -1164,9 +1158,9 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi TriggerType = Documents.TriggerType.Pre, TriggerOperation = Documents.TriggerOperation.All }; - retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection3, request4).Result; + retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection3, request4); - ResourceResponse docrequest4 = client.CreateDocumentAsync(collection3, new Document { Id = "noname" }, new Documents.Client.RequestOptions { PreTriggerInclude = new List { "request4" } }).Result; + ResourceResponse docrequest4 = await client.CreateDocumentAsync(collection3, new Document { Id = "noname" }, new Documents.Client.RequestOptions { PreTriggerInclude = new List { "request4" } }); Assert.IsTrue(docrequest4.Resource.Id == "noheaders"); Assert.IsTrue(docrequest4.ResponseHeaders["Test"] == null); @@ -1186,9 +1180,9 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi TriggerType = Documents.TriggerType.Post, TriggerOperation = Documents.TriggerOperation.All }; - retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection3, responseQuotaHeader).Result; + retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection3, responseQuotaHeader); - Book docresponseQuotaHeader = (dynamic)client.CreateDocumentAsync(collection3, new Book { Id = "quotaDocument" }, new Documents.Client.RequestOptions { PostTriggerInclude = new List { "responseQuotaHeader" } }).Result.Resource; + Book docresponseQuotaHeader = (await (dynamic)client.CreateDocumentAsync(collection3, new Book { Id = "quotaDocument" }, new Documents.Client.RequestOptions { PostTriggerInclude = new List { "responseQuotaHeader" } })).Resource; Assert.IsTrue(docresponseQuotaHeader.Author.Contains("collectionSize")); Assert.IsTrue(docresponseQuotaHeader.Title.Contains("collectionSize")); @@ -1202,7 +1196,7 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi TriggerType = Documents.TriggerType.Post, TriggerOperation = Documents.TriggerOperation.Delete }; - retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection3, triggerOpType).Result; + retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection3, triggerOpType); exceptionThrown = false; try @@ -1224,7 +1218,7 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi TriggerType = Documents.TriggerType.Post, TriggerOperation = Documents.TriggerOperation.All }; - retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection3, triggerAbortTransaction).Result; + retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection3, triggerAbortTransaction); exceptionThrown = false; try @@ -1244,7 +1238,7 @@ internal void ValidateTriggersInternal(Protocol protocol = Protocol.Https, Consi Assert.AreNotEqual(doc.Id, "Docabort"); // make sure the doc isnt present } - DocumentCollection collection4 = TestCommon.CreateCollectionAsync(client, database, new DocumentCollection { Id = "TestTriggers" + Guid.NewGuid().ToString(), PartitionKey = partitionKeyDefinition }).Result; + DocumentCollection collection4 = await TestCommon.CreateCollectionAsync(client, database, new DocumentCollection { Id = "TestTriggers" + Guid.NewGuid().ToString(), PartitionKey = partitionKeyDefinition }); // delete post trigger Trigger deletePostTrigger = new Trigger @@ -1280,7 +1274,7 @@ function callback(err, docFeed, responseOptions) TriggerType = Documents.TriggerType.Post, TriggerOperation = Documents.TriggerOperation.All }; - retrievedTrigger = this.CreateTriggerAndValidateAsync(client, collection4, deletePostTrigger).Result; + retrievedTrigger = await this.CreateTriggerAndValidateAsync(client, collection4, deletePostTrigger); dynamic docDeletePostTrigger = null; try @@ -1307,12 +1301,10 @@ function callback(err, docFeed, responseOptions) exceptionThrown = false; try { - Document doc5 = client.CreateDocumentAsync(collection4, new Document { Id = "Doc5" }, new Documents.Client.RequestOptions { PreTriggerInclude = new List { "t1", "t3" } }).Result.Resource; + Document doc5 = (await client.CreateDocumentAsync(collection4, new Document { Id = "Doc5" }, new Documents.Client.RequestOptions { PreTriggerInclude = new List { "t1", "t3" } })).Resource; } - catch (Exception e) + catch (DocumentClientException de) { - Assert.IsNotNull(e); - DocumentClientException de = e.InnerException as DocumentClientException; Assert.IsNotNull(de); exceptionThrown = true; } @@ -1321,17 +1313,20 @@ function callback(err, docFeed, responseOptions) exceptionThrown = false; try { - ResourceResponse docMultiple1 = client.CreateDocumentAsync(collection4, new Document { Id = "multipleHeaders1" }, new Documents.Client.RequestOptions { PreTriggerInclude = new List { "t1" }, PostTriggerInclude = new List { "response2", "multiple1" } }).Result; + ResourceResponse docMultiple1 = await client.CreateDocumentAsync(collection4, new Document { Id = "multipleHeaders1" }, new Documents.Client.RequestOptions { PreTriggerInclude = new List { "t1" }, PostTriggerInclude = new List { "response2", "multiple1" } }); } - catch (Exception e) + catch (DocumentClientException de) { - Assert.IsNotNull(e); - DocumentClientException de = e.InnerException as DocumentClientException; Assert.IsNotNull(de); exceptionThrown = true; } Assert.IsTrue(exceptionThrown, "multiple post-triggers didn't cause failure"); + if (dbToCreate != null) + { + await client.DeleteDatabaseAsync(database); + } + // re-enable these tests if we re-enable multiple triggers // // pre-trigger request body // Document doc5 = client.CreateDocumentAsync(collection1, new Document { Id = "Doc5" }, new RequestOptions { PreTriggerInclude = new List { "t1", "t3" } }).Result.Resource; @@ -1384,7 +1379,7 @@ function callback(err, docFeed, responseOptions) [TestMethod] public async Task ValidateLongProcessingStoredProcedures() { - CosmosClient client = TestCommon.CreateCosmosClient(true); + using CosmosClient client = TestCommon.CreateCosmosClient(true); Cosmos.Database database = await client.CreateDatabaseAsync(Guid.NewGuid().ToString()); PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection(new[] { "/id" }), Kind = PartitionKind.Hash }; @@ -1422,7 +1417,7 @@ function callback(err, docFeed, responseOptions) { [TestMethod] public async Task ValidateSprocWithFailedUpdates() { - CosmosClient client = TestCommon.CreateCosmosClient(true); + using CosmosClient client = TestCommon.CreateCosmosClient(true); Cosmos.Database database = await client.CreateDatabaseAsync(Guid.NewGuid().ToString()); PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection(new[] { "/id" }), Kind = PartitionKind.Hash }; @@ -1468,7 +1463,7 @@ public async Task ValidateSprocWithFailedUpdates() } catch (DocumentClientException exception) { - Assert.Fail("Exception should not have occurred. {0}", exception.InnerException.ToString()); + Assert.Fail("Exception should not have occurred. {0}", exception.ToString()); } await database.DeleteAsync(); } @@ -1485,7 +1480,7 @@ public async Task ValidateSystemSproc() internal async Task ValidateSystemSprocInternal(bool useGateway, Protocol protocol = Protocol.Tcp) { - CosmosClient client = TestCommon.CreateCosmosClient(useGateway); + using CosmosClient client = TestCommon.CreateCosmosClient(useGateway); PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection(new[] { "/pk" }), Kind = PartitionKind.Hash }; Cosmos.Database database = await client.CreateDatabaseAsync(Guid.NewGuid().ToString()); ContainerProperties collectionSpec = new ContainerProperties @@ -2238,13 +2233,13 @@ await masterClient.CreateStoredProcedureAsync(UriFactory.CreateDocumentCollectio } [TestMethod] - public void ValidateStoredProceduresBlacklisting() + public async Task ValidateStoredProceduresBlacklisting() { try { TestCommon.SetDoubleConfigurationProperty("StoredProcedureMaximumChargeInSeconds", 0.0); TestCommon.WaitForConfigRefresh(); - this.ValidateStoredProceduresBlacklistingInternal(); + await this.ValidateStoredProceduresBlacklistingInternal(); } finally { @@ -2253,14 +2248,14 @@ public void ValidateStoredProceduresBlacklisting() } } - public void ValidateStoredProceduresBlacklistingInternal() + public async Task ValidateStoredProceduresBlacklistingInternal() { - DocumentClient client = TestCommon.CreateClient(true); + using DocumentClient client = TestCommon.CreateClient(true); Documents.Database database = TestCommon.CreateOrGetDatabase(client); PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection(new[] { "/pk" }), Kind = PartitionKind.Hash }; DocumentCollection inputCollection = new DocumentCollection { Id = "ValidateStoredProceduresBlacklisting" + Guid.NewGuid().ToString(), PartitionKey = partitionKeyDefinition }; - DocumentCollection collection = TestCommon.CreateCollectionAsync(client, database, inputCollection).Result; + DocumentCollection collection = await TestCommon.CreateCollectionAsync(client, database, inputCollection); string badScript = @"function() { var start = new Date(); @@ -2301,18 +2296,20 @@ public void ValidateStoredProceduresBlacklistingInternal() isBlacklisted = true; } + await client.DeleteDatabaseAsync(database); + Assert.IsTrue(isBlacklisted); } [TestMethod] - public void ValidateUserDefinedFunctions() + public async Task ValidateUserDefinedFunctions() { - DocumentClient client = TestCommon.CreateClient(true); + using DocumentClient client = TestCommon.CreateClient(true); - DocumentClient secondary1Client = TestCommon.CreateClient(false, Protocol.Tcp); + using DocumentClient secondary1Client = TestCommon.CreateClient(false, Protocol.Tcp); secondary1Client.LockClient(1); - DocumentClient secondary2Client = TestCommon.CreateClient(false, Protocol.Tcp); + using DocumentClient secondary2Client = TestCommon.CreateClient(false, Protocol.Tcp); secondary1Client.LockClient(2); Documents.Database database = TestCommon.CreateOrGetDatabase(client); @@ -2333,7 +2330,7 @@ public void ValidateUserDefinedFunctions() if(label.toLowerCase() == testLabel.toLowerCase()) return true; };", }; - UserDefinedFunction retrievedUdf = client.CreateUserDefinedFunctionAsync(collection.UserDefinedFunctionsLink, udf1).Result; + UserDefinedFunction retrievedUdf = await client.CreateUserDefinedFunctionAsync(collection.UserDefinedFunctionsLink, udf1); this.Retry(() => { @@ -2362,13 +2359,12 @@ public void ValidateUserDefinedFunctions() }; try { - UserDefinedFunction retrievedUdfNoBody = client.CreateUserDefinedFunctionAsync(collection.UserDefinedFunctionsLink, udfNoBody).Result; + UserDefinedFunction retrievedUdfNoBody = await client.CreateUserDefinedFunctionAsync(collection.UserDefinedFunctionsLink, udfNoBody); } catch (Exception ex) { Assert.IsNotNull(ex); - Assert.IsNotNull(ex.InnerException); - Assert.IsTrue(ex.InnerException.Message.Contains("The input content is invalid because the required properties - 'body; ' - are missing")); + Assert.IsTrue(ex.Message.Contains("The input content is invalid because the required properties - 'body; ' - are missing")); } // failure test - UDF that throws specific error number. @@ -2396,6 +2392,8 @@ public void ValidateUserDefinedFunctions() } } + await client.DeleteDatabaseAsync(database); + // // precompilation should catch errors on create // UserDefinedFunction udfSyntaxError = new UserDefinedFunction // { @@ -2421,13 +2419,13 @@ public void ValidateUserDefinedFunctions() } [TestMethod] - public void ValidateUserDefinedFunctionsBlacklisting() + public async Task ValidateUserDefinedFunctionsBlacklisting() { try { TestCommon.SetDoubleConfigurationProperty("UdfMaximumChargeInSeconds", 0.0); TestCommon.WaitForConfigRefresh(); - this.ValidateUserDefinedFunctionsBlacklistingInternal(); + await this.ValidateUserDefinedFunctionsBlacklistingInternal(); } finally { @@ -2436,9 +2434,9 @@ public void ValidateUserDefinedFunctionsBlacklisting() } } - public void ValidateUserDefinedFunctionsBlacklistingInternal() + public async Task ValidateUserDefinedFunctionsBlacklistingInternal() { - DocumentClient client = TestCommon.CreateClient(true); + using DocumentClient client = TestCommon.CreateClient(true); Documents.Database database = TestCommon.CreateOrGetDatabase(client); PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection(new[] { "/pk" }), Kind = PartitionKind.Hash }; @@ -2457,7 +2455,7 @@ public void ValidateUserDefinedFunctionsBlacklistingInternal() return name; }" }; - UserDefinedFunction udf = client.CreateUserDefinedFunctionAsync(collection, udfSpec).Result; + UserDefinedFunction udf = await client.CreateUserDefinedFunctionAsync(collection, udfSpec); DocumentClient secondaryClient = TestCommon.CreateClient(false); secondaryClient.LockClient(1); // lock so we can get reliable blacklistling @@ -2468,18 +2466,18 @@ public void ValidateUserDefinedFunctionsBlacklistingInternal() "select udf.badUdf(r.id) from root r", new FeedOptions { EnableCrossPartitionQuery = true }).AsDocumentQuery(); // with 0 docs, UDF shouldn't be blacklisted - DocumentFeedResponse docCollection = docQuery.ExecuteNextAsync().Result; + DocumentFeedResponse docCollection = await docQuery.ExecuteNextAsync(); Assert.AreEqual(0, docCollection.Count); } // create one doc and try again - client.CreateDocumentAsync(collection, new Document() { Id = "newdoc1" }).Wait(); + await client.CreateDocumentAsync(collection, new Document() { Id = "newdoc1" }); for (int i = 0; i < 3; i++) { IDocumentQuery docQuery2 = secondaryClient.CreateDocumentQuery(collection.DocumentsLink, "select udf.badUdf(r.id) from root r", new FeedOptions { EnableCrossPartitionQuery = true }).AsDocumentQuery(); - DocumentFeedResponse docCollection2 = docQuery2.ExecuteNextAsync().Result; + DocumentFeedResponse docCollection2 = await docQuery2.ExecuteNextAsync(); } IDocumentQuery docQuery2BlackListed = secondaryClient.CreateDocumentQuery(collection.DocumentsLink, @@ -2488,12 +2486,10 @@ public void ValidateUserDefinedFunctionsBlacklistingInternal() bool isBlacklisted = false; try { - DocumentFeedResponse docCollection2 = docQuery2BlackListed.ExecuteNextAsync().Result; + DocumentFeedResponse docCollection2 = await docQuery2BlackListed.ExecuteNextAsync(); } - catch (Exception e) + catch (DocumentClientException de) { - Assert.IsNotNull(e); - DocumentClientException de = e.InnerException as DocumentClientException; Assert.IsNotNull(de); Assert.AreEqual(HttpStatusCode.Forbidden.ToString(), de.Error.Code); Assert.IsTrue(de.Message.Contains("is blocked for execution because it has violated its allowed resources limit several times.")); @@ -2511,7 +2507,7 @@ public void ValidateUserDefinedFunctionsBlacklistingInternal() // create lots of documents for (int i = 0; i < 1000; i++) { - client.CreateDocumentAsync(collection2, new Document() { Id = "newdoc" + Guid.NewGuid().ToString() }).Wait(); + await client.CreateDocumentAsync(collection2, new Document() { Id = "newdoc" + Guid.NewGuid().ToString() }); } UserDefinedFunction udfSpec2 = new UserDefinedFunction @@ -2519,12 +2515,15 @@ public void ValidateUserDefinedFunctionsBlacklistingInternal() Id = "goodUdf", Body = "function(name) { return name; }" }; - UserDefinedFunction udf2 = client.CreateUserDefinedFunctionAsync(collection2, udfSpec2).Result; + UserDefinedFunction udf2 = await client.CreateUserDefinedFunctionAsync(collection2, udfSpec2); IDocumentQuery docQuery3 = secondaryClient.CreateDocumentQuery(collection2.DocumentsLink, "select udf.goodUdf(r.id) from root r", new FeedOptions { MaxItemCount = 1000, EnableCrossPartitionQuery = true }).AsDocumentQuery(); - DocumentFeedResponse docCollection3 = docQuery3.ExecuteNextAsync().Result; + DocumentFeedResponse docCollection3 = await docQuery3.ExecuteNextAsync(); + + await client.DeleteDatabaseAsync(database); + Assert.AreEqual(1000, docCollection3.Count); } @@ -2541,7 +2540,7 @@ public async Task ValidateChangeFeedIfNoneMatch() private async Task ValidateChangeFeedIfNoneMatchHelper(bool useGateway, Protocol protocol = Protocol.Tcp) { - DocumentClient client = TestCommon.CreateClient(useGateway, protocol); + using DocumentClient client = TestCommon.CreateClient(useGateway, protocol); ResourceResponse db = await client.CreateDatabaseAsync(new Documents.Database() { Id = Guid.NewGuid().ToString() }); try { @@ -2673,7 +2672,7 @@ private async Task ValidateChangeFeedIfNoneMatchHelper(bool useGateway, Protocol } finally { - client.DeleteDatabaseAsync(db).Wait(); + await client.DeleteDatabaseAsync(db); } } @@ -2690,7 +2689,7 @@ public async Task ValidateChangeFeedIfModifiedSince() private async Task ValidateChangeFeedIfModifiedSinceHelper(bool useGateway, Protocol protocol = Protocol.Tcp) { - DocumentClient client = TestCommon.CreateClient(useGateway, protocol); + using DocumentClient client = TestCommon.CreateClient(useGateway, protocol); ResourceResponse db = await client.CreateDatabaseAsync(new Documents.Database() { Id = Guid.NewGuid().ToString() }); try { @@ -2788,7 +2787,7 @@ private async Task ValidateChangeFeedIfModifiedSinceHelper(bool useGateway, Prot } finally { - client.DeleteDatabaseAsync(db).Wait(); + await client.DeleteDatabaseAsync(db); } } @@ -2840,7 +2839,7 @@ private async Task GetPKRangeIdForPartitionKey( private async Task ValidateChangeFeedWithPartitionKeyHelper(bool useGateway, Protocol protocol = Protocol.Tcp) { - DocumentClient client = TestCommon.CreateClient(useGateway, protocol); + using DocumentClient client = TestCommon.CreateClient(useGateway, protocol); Documents.Database db = await client.CreateDatabaseAsync(new Documents.Database() { Id = Guid.NewGuid().ToString() }); string pk1 = "4", pk2 = "6", pk3 = "22"; // The values are chosen in such a way that hash lands on the same range. @@ -2928,7 +2927,7 @@ private async Task ValidateChangeFeedWithPartitionKeyHelper(bool useGateway, Pro } finally { - client.DeleteDatabaseAsync(db).Wait(); + await client.DeleteDatabaseAsync(db); } } @@ -2978,7 +2977,7 @@ public async Task ValidateReadPartitionKeyRange() private async Task ValidateReadPartitionKeyRangeHelper(bool useGateway, Protocol protocol = Protocol.Tcp) { - DocumentClient client = TestCommon.CreateClient(useGateway, protocol); + using DocumentClient client = TestCommon.CreateClient(useGateway, protocol); Documents.Database db = await client.CreateDatabaseAsync(new Documents.Database() { Id = Guid.NewGuid().ToString() }); try { @@ -3020,14 +3019,14 @@ private async Task ValidateReadPartitionKeyRangeHelper(bool useGateway, Protocol } finally { - client.DeleteDatabaseAsync(db).Wait(); + await client.DeleteDatabaseAsync(db); } } [TestMethod] public async Task ValidateStoredProcedureExecutionWithPartitionKey() { - DocumentClient client = TestCommon.CreateClient(true); + using DocumentClient client = TestCommon.CreateClient(true); await TestCommon.DeleteAllDatabasesAsync(); Documents.Database database = await client.CreateDatabaseAsync(new Documents.Database { Id = "db" }); @@ -3064,26 +3063,27 @@ public async Task ValidateStoredProcedureExecutionWithPartitionKey() new Documents.Client.RequestOptions { PartitionKey = new Documents.PartitionKey("1") }, "DocumentDB").Result; Assert.IsTrue(string.CompareOrdinal(output, "Hello World, DocumentDB!") == 0); - client.DeleteStoredProcedureAsync(UriFactory.CreateStoredProcedureUri(database.Id, collection.Id, sproc.Id)).Wait(); + await client.DeleteStoredProcedureAsync(UriFactory.CreateStoredProcedureUri(database.Id, collection.Id, sproc.Id)); + await client.DeleteDatabaseAsync(database); } [TestMethod] - public void ValidateGenericReadDocumentGateway() + public async Task ValidateGenericReadDocumentGateway() { - this.ValidateGenericReadDocument(true, Protocol.Https).Wait(); - this.ValidateGenericReadDocumentFromResource(true, Protocol.Https).Wait(); + await this.ValidateGenericReadDocument(true, Protocol.Https); + await this.ValidateGenericReadDocumentFromResource(true, Protocol.Https); } [TestMethod] - public void ValidateGenericReadDocumentDirectTcp() + public async Task ValidateGenericReadDocumentDirectTcp() { - this.ValidateGenericReadDocument(false, Protocol.Tcp).Wait(); - this.ValidateGenericReadDocumentFromResource(false, Protocol.Tcp).Wait(); + await this.ValidateGenericReadDocument(false, Protocol.Tcp); + await this.ValidateGenericReadDocumentFromResource(false, Protocol.Tcp); } private async Task ValidateGenericReadDocument(bool useGateway, Protocol protocol) { - CosmosClient client = TestCommon.CreateCosmosClient(useGateway); + using CosmosClient client = TestCommon.CreateCosmosClient(useGateway); Cosmos.Database database = await client.CreateDatabaseIfNotExistsAsync(Guid.NewGuid().ToString()); PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection(new[] { "/id" }), Kind = PartitionKind.Hash }; @@ -3122,7 +3122,7 @@ private async Task ValidateGenericReadDocument(bool useGateway, Protocol protoco private async Task ValidateGenericReadDocumentFromResource(bool useGateway, Protocol protocol) { - CosmosClient client = TestCommon.CreateCosmosClient(useGateway); + using CosmosClient client = TestCommon.CreateCosmosClient(useGateway); Cosmos.Database database = await client.CreateDatabaseAsync(Guid.NewGuid().ToString()); PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection(new[] { "/id" }), Kind = PartitionKind.Hash }; @@ -3156,16 +3156,18 @@ private async Task ValidateGenericReadDocumentFromResource(bool useGateway, Prot // This tests the implicit operator for ReadDocumentAsync CustomerObjectFromResource doc1 = await collection.ReadItemAsync(partitionKey: new Cosmos.PartitionKey(customerObjectFromResource.id), id: customerObjectFromResource.id); Assert.IsNotNull(doc1.id); + + await database.DeleteStreamAsync(); } [TestMethod] - public void ValidatePOCODocumentSerialization() + public async Task ValidatePOCODocumentSerialization() { // 1. Verify the customer can serialize their POCO object in their own ways - DocumentClient client = TestCommon.CreateClient(true); + using DocumentClient client = TestCommon.CreateClient(true); Documents.Database database = TestCommon.CreateOrGetDatabase(client); PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection(new[] { "/pk" }), Kind = PartitionKind.Hash }; - DocumentCollection collection1 = TestCommon.CreateCollectionAsync(client, database, new DocumentCollection { Id = "TestTriggers" + Guid.NewGuid().ToString(), PartitionKey = partitionKeyDefinition }).Result; + DocumentCollection collection1 = await TestCommon.CreateCollectionAsync(client, database, new DocumentCollection { Id = "TestTriggers" + Guid.NewGuid().ToString(), PartitionKey = partitionKeyDefinition }); CustomerPOCO poco = new CustomerPOCO() { @@ -3298,6 +3300,8 @@ public void ValidatePOCODocumentSerialization() CustomerObjectFromDocumentEx doc5 = (dynamic)client.CreateDocumentAsync(collection1, testobject5).Result.Resource; Assert.AreEqual(doc5.TestProperty, testobject5.TestProperty); Assert.IsFalse(doc5.ToString().Contains("TestProperty")); + + await client.DeleteDatabaseAsync(database); } [TestMethod] @@ -3305,10 +3309,10 @@ public async Task ValidateIndexingDirectives() { #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator - DocumentClient client = TestCommon.CreateClient(false); + using DocumentClient client = TestCommon.CreateClient(false); #endif #if !DIRECT_MODE - CosmosClient client = TestCommon.CreateCosmosClient(true); + using CosmosClient client = TestCommon.CreateCosmosClient(true); #endif Cosmos.Database database = await client.CreateDatabaseAsync(Guid.NewGuid().ToString()); PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection(new[] { "/id" }), Kind = PartitionKind.Hash }; @@ -3400,7 +3404,7 @@ public static string DumpFullExceptionMessage(Exception e) private async Task ValidateCollectionQuotaTestsWithFailure(bool useGateway) { - DocumentClient client = TestCommon.CreateClient(useGateway); + using DocumentClient client = TestCommon.CreateClient(useGateway); Documents.Database database = null; try { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/HeadersValidationTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/HeadersValidationTests.cs index be83b0e1fd..b24ce5f03b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/HeadersValidationTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/HeadersValidationTests.cs @@ -46,7 +46,7 @@ public async Task Startup() this.currentVersionUTF8 = HttpConstants.Versions.CurrentVersionUTF8; //var client = TestCommon.CreateClient(false, Protocol.Tcp); - var client = TestCommon.CreateClient(true); + using var client = TestCommon.CreateClient(true); await TestCommon.DeleteAllDatabasesAsync(); } @@ -60,14 +60,14 @@ public void TestCleanup() [TestMethod] public void ValidatePageSizeRntbd() { - var client = TestCommon.CreateClient(false, Protocol.Tcp); + using var client = TestCommon.CreateClient(false, Protocol.Tcp); ValidatePageSize(client); } [TestMethod] public void ValidatePageSizeGatway() { - var client = TestCommon.CreateClient(true); + using var client = TestCommon.CreateClient(true); ValidatePageSize(client); } @@ -506,7 +506,7 @@ private void ValidateEmitVerboseTracesInQuery(DocumentClient client, bool isHttp [TestMethod] public void ValidateIfNonMatchGateway() { - var client = TestCommon.CreateClient(true); + using var client = TestCommon.CreateClient(true); ValidateIfNonMatch(client); } @@ -514,7 +514,7 @@ public void ValidateIfNonMatchGateway() [TestMethod] public void ValidateIfNonMatchRntbd() { - var client = TestCommon.CreateClient(false, Protocol.Tcp); + using var client = TestCommon.CreateClient(false, Protocol.Tcp); ValidateIfNonMatch(client); } @@ -557,48 +557,45 @@ public void ValidateCustomUserAgentContainerHeader() } [TestMethod] - public void ValidateVersionHeader() + public async Task ValidateVersionHeader() { string correctVersion = HttpConstants.Versions.CurrentVersion; + Database db = null; try { DocumentClient client = TestCommon.CreateClient(true); - var db = client.CreateDatabaseAsync(new Database() { Id = Guid.NewGuid().ToString() }).Result.Resource; + db = (await client.CreateDatabaseAsync(new Database() { Id = Guid.NewGuid().ToString() })).Resource; PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection(new[] { "/pk" }), Kind = PartitionKind.Hash }; - var coll = client.CreateDocumentCollectionAsync(db.SelfLink, new DocumentCollection() { Id = Guid.NewGuid().ToString(), PartitionKey = partitionKeyDefinition }).Result.Resource; - var doc = client.CreateDocumentAsync(coll.SelfLink, new Document()).Result.Resource; + var coll = (await client.CreateDocumentCollectionAsync(db.SelfLink, new DocumentCollection() { Id = Guid.NewGuid().ToString(), PartitionKey = partitionKeyDefinition })).Resource; + var doc = (await client.CreateDocumentAsync(coll.SelfLink, new Document())).Resource; + client.Dispose(); client = TestCommon.CreateClient(true); - doc = client.CreateDocumentAsync(coll.SelfLink, new Document()).Result.Resource; + doc = (await client.CreateDocumentAsync(coll.SelfLink, new Document())).Resource; HttpConstants.Versions.CurrentVersion = "2015-01-01"; + client.Dispose(); client = TestCommon.CreateClient(true); try { - doc = client.CreateDocumentAsync(coll.SelfLink, new Document()).Result.Resource; + doc = (await client.CreateDocumentAsync(coll.SelfLink, new Document())).Resource; Assert.Fail("Should have faild because of version error"); } - catch (AggregateException exception) + catch (CosmosException dce) { - var dce = exception.InnerException as CosmosException; - if (dce != null) - { - Assert.AreEqual(dce.StatusCode, HttpStatusCode.BadRequest); - } - else - { - Assert.Fail("Should have faild because of version error with DocumentClientException BadRequest"); - } + Assert.AreEqual(dce.StatusCode, HttpStatusCode.BadRequest); } } finally { HttpConstants.Versions.CurrentVersion = correctVersion; + using DocumentClient client = TestCommon.CreateClient(true); + await client.DeleteDatabaseAsync(db); } } [TestMethod] public async Task ValidateCurrentWriteQuorumAndReplicaSetHeader() { - CosmosClient client = TestCommon.CreateCosmosClient(false); + using CosmosClient client = TestCommon.CreateCosmosClient(false); Cosmos.Database db = null; try { @@ -626,7 +623,7 @@ public async Task ValidateCurrentWriteQuorumAndReplicaSetHeader() [TestCategory("Ignore") /* Used to filter out ignored tests in lab runs */] public void ValidateGlobalCompltedLSNAndNumberOfReadRegionsHeader() { - DocumentClient client = TestCommon.CreateClient(false); + using DocumentClient client = TestCommon.CreateClient(false); Database db = null; try { @@ -670,7 +667,7 @@ public async Task ValidateCollectionIndexProgressHeaders() [TestMethod] public async Task ValidateExcludeSystemProperties() { - var client = TestCommon.CreateClient(true); + using var client = TestCommon.CreateClient(true); await ValidateExcludeSystemProperties(client); } @@ -785,6 +782,8 @@ private async Task ValidateExcludeSystemProperties(DocumentClient client) //read document with default settings (system properties should be included) Document readDoc3Default = await client.ReadDocumentAsync(coll.AltLink + "/docs/doc3", new RequestOptions() { PartitionKey = new PartitionKey("doc3") }); Assert.AreEqual(readDoc3WithProps.ToString(), readDoc3Default.ToString()); + + await client.DeleteDatabaseAsync(db); } private async Task ValidateCollectionIndexProgressHeadersAsync(DocumentClient client, bool isElasticCollection) @@ -879,7 +878,7 @@ private async Task ValidateCollectionIndexProgressHeadersAsync(DocumentClient cl } finally { - client.DeleteDatabaseAsync(db).Wait(); + await client.DeleteDatabaseAsync(db); } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/IndexMetricsParserBaselineTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/IndexMetricsParserBaselineTest.cs index 92425bf39c..6ae91f1375 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/IndexMetricsParserBaselineTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/IndexMetricsParserBaselineTest.cs @@ -40,6 +40,8 @@ public async static Task CleanUp() { await testDb.DeleteStreamAsync(); } + + cosmosClient.Dispose(); } [TestInitialize] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/InternalFriendsTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/InternalFriendsTest.cs index b1572e6f3c..a256394681 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/InternalFriendsTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/InternalFriendsTest.cs @@ -18,10 +18,12 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests public class InternalFriendsTest { private CosmosClient cosmosClient; + private Database database; [TestCleanup] - public void Cleanup() + public async Task Cleanup() { + await this.database?.DeleteAsync(); this.cosmosClient?.Dispose(); } @@ -99,10 +101,10 @@ private async Task CreateContainer(bool isLocalQuorumConsistency) } }); - Database database = await this.cosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString(), + this.database = await this.cosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString(), cancellationToken: new CancellationTokenSource().Token); - return await database.CreateContainerAsync(id: Guid.NewGuid().ToString(), + return await this.database.CreateContainerAsync(id: Guid.NewGuid().ToString(), partitionKeyPath: "/pk"); } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqAggregateFunctionsBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqAggregateFunctionsBaselineTests.cs index 1beab5131b..0734f4dfad 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqAggregateFunctionsBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqAggregateFunctionsBaselineTests.cs @@ -54,6 +54,8 @@ public async static Task CleanUp() { await testDb.DeleteStreamAsync(); } + + client?.Dispose(); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqAttributeContractBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqAttributeContractBaselineTests.cs index d311794526..7ffc36bdbd 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqAttributeContractBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqAttributeContractBaselineTests.cs @@ -39,12 +39,14 @@ public async static Task Initialize(TestContext textContext) } [ClassCleanup] - public static void CleanUp() + public static async Task CleanUp() { if (testDb != null) { - testDb.DeleteStreamAsync().Wait(); + await testDb.DeleteStreamAsync(); } + + client?.Dispose(); } [TestInitialize] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqGeneralBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqGeneralBaselineTests.cs index aa5e68141c..a9782bb26b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqGeneralBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqGeneralBaselineTests.cs @@ -46,6 +46,8 @@ public async static Task CleanUp() { await testDb.DeleteStreamAsync(); } + + cosmosClient?.Dispose(); } public class Address diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqSQLTranslationBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqSQLTranslationBaselineTests.cs index d3fecc59e6..f3c27a2230 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqSQLTranslationBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqSQLTranslationBaselineTests.cs @@ -64,6 +64,8 @@ public async static Task CleanUp() { await testDb.DeleteStreamAsync(); } + + cosmosClient?.Dispose(); } struct simple diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs index 67a4aa9364..01b64cd4fd 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs @@ -60,6 +60,8 @@ public async static Task CleanUp() { await testDb.DeleteStreamAsync(); } + + cosmosClient?.Dispose(); } [TestInitialize] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationWithCustomSerializerBaseline.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationWithCustomSerializerBaseline.cs index be3412e05f..c81beaaeb8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationWithCustomSerializerBaseline.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationWithCustomSerializerBaseline.cs @@ -47,6 +47,8 @@ public async static Task CleanUp() { await testDb.DeleteStreamAsync(); } + + cosmosClient?.Dispose(); } [TestInitialize] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/MultiRegionStrongTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/MultiRegionStrongTests.cs deleted file mode 100644 index 1b17f6cac2..0000000000 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/MultiRegionStrongTests.cs +++ /dev/null @@ -1,286 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ - -namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Azure.Cosmos.Utils; - using Microsoft.Azure.Cosmos.Services.Management.Tests; - using Microsoft.VisualStudio.TestTools.UnitTesting; - using Microsoft.Azure.Documents.Client; - using Microsoft.Azure.Documents; - using System.Net.Http; - - [TestClass] - public sealed class MultiRegionStrongTests - { - private const string repairInProgressFileName = "ManualRepair.InProgress"; - - private string DatabaseName; - private string CollectionName; - - private DocumentClient read0; - private DocumentClient read1; - private DocumentClient read2; - - private DocumentClient write0; - private DocumentClient write1; - private DocumentClient write2; - - - [TestInitialize] - public void TestInitialize() - { - this.DatabaseName = Guid.NewGuid().ToString(); - this.CollectionName = Guid.NewGuid().ToString(); - - this.read0 = TestCommon.CreateClient(false, enableEndpointDiscovery: false, tokenType: AuthorizationTokenType.SystemAll, createForGeoRegion: true); - read0.LockClient(0); - - this.read1 = TestCommon.CreateClient(false, enableEndpointDiscovery: false, tokenType: AuthorizationTokenType.SystemAll, createForGeoRegion: true); - read1.LockClient(1); - - this.read2 = TestCommon.CreateClient(false, enableEndpointDiscovery: false, tokenType: AuthorizationTokenType.SystemAll, createForGeoRegion: true); - read2.LockClient(2); - - this.write0 = TestCommon.CreateClient(false, enableEndpointDiscovery: false, tokenType: AuthorizationTokenType.SystemAll, createForGeoRegion: false); - write0.LockClient(0); - - this.write1 = TestCommon.CreateClient(false, enableEndpointDiscovery: false, tokenType: AuthorizationTokenType.SystemAll, createForGeoRegion: false); - write1.LockClient(1); - - this.write2 = TestCommon.CreateClient(false, enableEndpointDiscovery: false, tokenType: AuthorizationTokenType.SystemAll, createForGeoRegion: false); - write2.LockClient(2); - } - - private async Task SetupSingleCollectionScenario() - { - DocumentClient client = TestCommon.CreateClient(true); - await TestCommon.DeleteAllDatabasesAsync(); - - Database database = (await client.CreateDatabaseAsync(new Database { Id = this.DatabaseName })).Resource; - DocumentCollection collection = (await client.CreateDocumentCollectionIfNotExistsAsync(database.SelfLink, new DocumentCollection { Id = this.CollectionName }, new RequestOptions { OfferThroughput = 10000 })).Resource; - - // await Task.Delay(30000); - - return collection; - } - - private DocumentClient GetDocumentClient(ConnectionMode connectionMode, Protocol protocol, List preferredRegions) - { - ConnectionPolicy connectionPolicy = new ConnectionPolicy { ConnectionMode = connectionMode, ConnectionProtocol = protocol }; - foreach (string preferredRegion in preferredRegions) - { - connectionPolicy.PreferredLocations.Add(preferredRegion); - } - - return new DocumentClient( - new Uri(ConfigurationManager.AppSettings["GatewayEndpoint"]), - ConfigurationManager.AppSettings["MasterKey"], - (HttpMessageHandler)null, - connectionPolicy); - } - - private async Task CreateDocumentsAsync(string collectionSelfLink, DocumentClient client, CancellationToken cancellationToken) - { - int writeCount = 0; - - int i = 0; - while (i < 50000) - { - if (cancellationToken.IsCancellationRequested) - { - Logger.LogLine("WriteCount: {0}", writeCount); - return; - } - - Document doc = (await client.CreateDocumentAsync(collectionSelfLink, new Document { Id = Guid.NewGuid().ToString() })).Resource; - writeCount++; - await client.ReadDocumentAsync(doc.SelfLink); - - i++; - } - } - - private async Task ReadDocumentsAsync(string collectionSelfLink, DocumentClient client, CancellationToken cancellationToken) - { - int readFeedCount = 0; - int readCount = 0; - - int i = 0; - while (i < 50000) - { - if (cancellationToken.IsCancellationRequested) - { - Logger.LogLine("ReadFeedCount: {0}, ReadCount: {1}", readFeedCount, readCount); - return; - } - - DocumentFeedResponse response = await client.ReadDocumentFeedAsync(collectionSelfLink); - readFeedCount++; - - foreach (var doc in response) - { - await client.ReadDocumentAsync(doc.SelfLink); - readCount++; - } - - i++; - } - } - - private void ResumeReplicas(string documentId) - { - ResourceId documentRId = ResourceId.Parse(documentId); - string collectionId = documentRId.DocumentCollectionId.ToString(); - IEnumerable indexFiles = Directory.EnumerateFiles("c:\\wfroot\\", "*.bwdata", SearchOption.AllDirectories); - List collectionIndexFiles = new List(); - - foreach (string indexFile in indexFiles) - { - if (indexFile.Contains(collectionId)) - { - collectionIndexFiles.Add(indexFile); - } - } - - foreach (string fileName in collectionIndexFiles) - { - string directoryName = Path.GetDirectoryName(fileName); - string manualRecoveryFileFullName = Path.Combine(directoryName, MultiRegionStrongTests.repairInProgressFileName); - try - { - File.Delete(manualRecoveryFileFullName); - } - catch (FileNotFoundException) - { - } - } - } - /* - private async Task TestGlobalStrongAsync(ConnectionMode connectionMode, Protocol protocol) - { - await TestCommon.DeleteAllDatabasesAsync(TestCommon.CreateClient(true)); - using (await TestCommon.OverrideGlobalDatabaseAccountConfigurationsAsync(Tuple.Create("defaultConsistencyLevel", "Strong"))) - { - await Task.Delay(TimeSpan.FromSeconds(35)); - - ConnectionPolicy scusConnectionPolicy = new ConnectionPolicy { ConnectionMode = connectionMode, ConnectionProtocol = protocol }; - scusConnectionPolicy.PreferredLocations.Add("South Central US"); - - ConnectionPolicy wusConnectionPolicy = new ConnectionPolicy { ConnectionMode = connectionMode, ConnectionProtocol = protocol }; - wusConnectionPolicy.PreferredLocations.Add("West US"); - - DocumentClient scusClient = new DocumentClient( - new Uri(ConfigurationManager.AppSettings["GatewayEndpoint"]), - ConfigurationManager.AppSettings["MasterKey"], - scusConnectionPolicy); - - DocumentClient wusClient = new DocumentClient( - new Uri(ConfigurationManager.AppSettings["GatewayEndpoint"]), - ConfigurationManager.AppSettings["MasterKey"], - wusConnectionPolicy); - - Database database = (await scusClient.CreateDatabaseIfNotExistsAsync(new Database { Id = "database" })).Resource; - DocumentCollection collection = (await scusClient.CreateDocumentCollectionIfNotExistsAsync(database.SelfLink, new DocumentCollection { Id = "collection" }, new RequestOptions { OfferThroughput = 10000 })).Resource; - Document doc = (await scusClient.CreateDocumentAsync(collection.SelfLink, new Document { Id = "lockDoc" })).Resource; - await Task.Delay(TimeSpan.FromSeconds(30)); - - CancellationTokenSource tokenSource = new CancellationTokenSource(); - Task writeTask = Task.Factory.StartNew(async () => await CreateDocumentsAsync(collection.SelfLink, scusClient, tokenSource.Token)); - Task readTask1 = Task.Factory.StartNew(async () => await ReadDocumentsAsync(collection.SelfLink, scusClient, tokenSource.Token)); - Task readTask2 = Task.Factory.StartNew(async () => await ReadDocumentsAsync(collection.SelfLink, wusClient, tokenSource.Token)); - - for (uint i = 0; i < 10; i++) - { - bool isReadRegion = i % 2 == 1; - uint replicaIndexToLock = i % 3; - DocumentClient crashClient = TestCommon.CreateClient(false, enableEndpointDiscovery: false, tokenType: AuthorizationTokenType.SystemAll, createForGeoRegion: isReadRegion); - crashClient.LockClient(replicaIndexToLock); - - try - { - await crashClient.CrashAsync(doc.ResourceId, typeof(Document)); - } - catch (DocumentClientException ex) - { - Logger.LogLine("Hit exception {0} while crashing replica index {1}, isReadRegion: {2}", ex.ToString(), replicaIndexToLock, isReadRegion); - } - } - - tokenSource.Cancel(); - await writeTask; - await readTask1; - await readTask2; - - Assert.IsTrue(!this.isWriteExceptionCaught); - Assert.IsTrue(!this.isReadExceptionCaught); - } - } - - private async Task CreateDocumentsAsync(string collectionSelfLink, DocumentClient client, CancellationToken cancellationToken) - { - this.isWriteExceptionCaught = false; - int writeCount = 0; - while (true) - { - if (cancellationToken.IsCancellationRequested) - { - Logger.LogLine("WriteCount: {0}", writeCount); - return; - } - - try - { - await client.CreateDocumentAsync(collectionSelfLink, new Document { Id = Guid.NewGuid().ToString() }); - writeCount++; - } - catch (DocumentClientException ex) - { - Logger.LogLine("Hit exception {0} while creating document.", ex.ToString()); - this.isWriteExceptionCaught = true; - } - } - } - - private async Task ReadDocumentsAsync(string collectionSelfLink, DocumentClient client, CancellationToken cancellationToken) - { - this.isReadExceptionCaught = false; - int readFeedCount = 0; - int readCount = 0; - while (true) - { - if (cancellationToken.IsCancellationRequested) - { - Logger.LogLine("ReadFeedCount: {0}, ReadCount: {1}", readFeedCount, readCount); - return; - } - - string continuationToken = null; - try - { - DoucmentFeedResponse response = await client.ReadDocumentFeedAsync(collectionSelfLink, new FeedOptions { RequestContinuation = continuationToken }); - readFeedCount++; - continuationToken = response.ResponseContinuation; - - foreach(var doc in response) - { - await client.ReadDocumentAsync(doc.SelfLink); - readCount++; - } - } - catch (DocumentClientException ex) - { - Logger.LogLine("Hit exception {0} while reading document.", ex.ToString()); - this.isReadExceptionCaught = true; - } - } - } - */ - } -} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/NameRoutingTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/NameRoutingTests.cs index 6c29791783..1dc1cd9af0 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/NameRoutingTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/NameRoutingTests.cs @@ -32,7 +32,7 @@ public class NameRoutingTests [TestMethod] public async Task NameRoutingSmokeGatewayTest() { - CosmosClient client = TestCommon.CreateCosmosClient(true); + using CosmosClient client = TestCommon.CreateCosmosClient(true); await SmokeTestForNameAPI(client); } @@ -419,12 +419,10 @@ private async Task SmokeTestForNameAPI(CosmosClient client) } [TestMethod] - public void ReplaceDocumentWithUri() + public async Task ReplaceDocumentWithUri() { - CosmosClient client; - - client = TestCommon.CreateCosmosClient(true); - this.ReplaceDocumentWithUriPrivateAsync(client).Wait(); + using CosmosClient client = TestCommon.CreateCosmosClient(true); + await this.ReplaceDocumentWithUriPrivateAsync(client); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator @@ -477,6 +475,8 @@ private async Task ReplaceDocumentWithUriPrivateAsync(CosmosClient client) sqlQueryText = @"select * from root r where r.title = ""My old Book"""; cosmosResultSet = collection.GetItemQueryIterator(queryText: sqlQueryText, requestOptions: options); Assert.AreEqual(1, await GetCountFromIterator(cosmosResultSet), "Query Count doesnt match"); + + await database.DeleteStreamAsync(); } [TestMethod] @@ -484,8 +484,7 @@ public async Task CollectionDeleteAndCreateWithSameNameTest() { // when collection name changes, the collectionName ->Id cache at the gateway need to get invalidated and refreshed. // This test is to verify this case is working well. - DocumentClient client; - client = TestCommon.CreateClient(true); + using DocumentClient client = TestCommon.CreateClient(true); await this.CollectionDeleteAndCreateWithSameNameTestPrivateAsync(client); #if DIRECT_MODE @@ -557,7 +556,7 @@ private async Task CollectionDeleteAndCreateWithSameNameTestPrivateAsync(Documen finally { - TestCommon.DeleteAllDatabasesAsync().Wait(); + await TestCommon.DeleteAllDatabasesAsync(); } } @@ -1368,7 +1367,8 @@ public async Task TestInvalidPartitionKeyException() [Ignore /* TODO: This tests throws a "The read session is not available for the input session token" */] public async Task TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartitionedToPartitionedForQuery() { - await this.TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartitionedToPartitionedForQuery(TestCommon.CreateClient(true)); + using DocumentClient client = TestCommon.CreateClient(true); + await this.TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartitionedToPartitionedForQuery(client); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator await this.TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartitionedToPartitionedForQuery(TestCommon.CreateClient(false, protocol: Protocol.Tcp)); @@ -1425,7 +1425,8 @@ internal async Task TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartiti [Ignore /* TODO: This tests throws a "The read session is not available for the input session token" */] public async Task TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartitionedToPartitionedForParallelQuery() { - await this.TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartitionedToPartitionedForParallelQuery(TestCommon.CreateClient(true)); + using DocumentClient client = TestCommon.CreateClient(true); + await this.TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartitionedToPartitionedForParallelQuery(client); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator await this.TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartitionedToPartitionedForParallelQuery(TestCommon.CreateClient(false, protocol: Protocol.Tcp)); @@ -1442,12 +1443,12 @@ internal async Task TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartiti await client.CreateDocumentAsync("/dbs/db1/colls/coll1", document1); Assert.AreEqual(1, client.CreateDocumentQuery("/dbs/db1/colls/coll1", "SELECT * FROM c WHERE c.field1 IN (1, 2)", new FeedOptions { EnableCrossPartitionQuery = true }).AsEnumerable().Count()); - DocumentClient otherClient = TestCommon.CreateClient(false); + using DocumentClient otherClient = TestCommon.CreateClient(false); await otherClient.DeleteDocumentCollectionAsync("/dbs/db1/colls/coll1"); PartitionKeyDefinition partitionKeyDefinition2 = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection(new[] { "/field2" }), Kind = PartitionKind.Hash }; DocumentCollection coll = await TestCommon.CreateCollectionAsync(otherClient, "/dbs/db1", new DocumentCollection { Id = "coll1", PartitionKey = partitionKeyDefinition2 }, new RequestOptions { OfferThroughput = 12000 }); - DocumentClient directClient = TestCommon.CreateClient(false); + using DocumentClient directClient = TestCommon.CreateClient(false); string sessionToken1 = (await directClient.CreateDocumentAsync("/dbs/db1/colls/coll1", document1)).SessionToken; document1 = new Document { Id = "doc2" }; document1.SetPropertyValue("field1", 2); @@ -1466,7 +1467,7 @@ internal async Task TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartiti Assert.AreEqual(2, client.CreateDocumentQuery("/dbs/db1/colls/coll1", "SELECT * FROM c WHERE c.field1 IN (1, 2)", new FeedOptions { EnableCrossPartitionQuery = true }).AsEnumerable().Count()); - DocumentClient newClient = TestCommon.CreateClient(false); + using DocumentClient newClient = TestCommon.CreateClient(false); Assert.AreEqual(2, newClient.CreateDocumentQuery("/dbs/db1/colls/coll1", "SELECT * FROM c WHERE c.field1 IN (1, 2)", new FeedOptions { EnableCrossPartitionQuery = true }).AsEnumerable().Count()); } @@ -1479,8 +1480,10 @@ internal async Task TestPartitionKeyDefinitionOnCollectionRecreateFromNonPartiti [TestMethod] public async Task TestCollectionRecreateFromMultipartitionToSinglePartitionedForQuery() { - await this.TestCollectionRecreateFromMultipartitionToSinglePartitionedForQuery(TestCommon.CreateClient(true)); - await this.TestCollectionRecreateFromMultipartitionToSinglePartitionedForQuery(TestCommon.CreateClient(false, protocol: Protocol.Tcp)); + using DocumentClient client = TestCommon.CreateClient(true); + await this.TestCollectionRecreateFromMultipartitionToSinglePartitionedForQuery(client); + using DocumentClient directClient = TestCommon.CreateClient(false, protocol: Protocol.Tcp); + await this.TestCollectionRecreateFromMultipartitionToSinglePartitionedForQuery(directClient); } internal async Task TestCollectionRecreateFromMultipartitionToSinglePartitionedForQuery(DocumentClient client) @@ -1523,7 +1526,8 @@ internal async Task TestCollectionRecreateFromMultipartitionToSinglePartitionedF [TestMethod] public async Task TestRouteToNonExistentRangeAfterCollectionRecreate() { - await this.TestRouteToNonExistentRangeAfterCollectionRecreate(TestCommon.CreateCosmosClient(true)); + using CosmosClient client = TestCommon.CreateCosmosClient(true); + await this.TestRouteToNonExistentRangeAfterCollectionRecreate(client); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator await this.TestRouteToNonExistentRangeAfterCollectionRecreate(TestCommon.CreateClient(false, protocol: Protocol.Tcp)); @@ -1595,7 +1599,8 @@ internal async Task TestRouteToNonExistentRangeAfterCollectionRecreate(CosmosCli [TestMethod] public async Task TestRouteToExistentRangeAfterCollectionRecreate() { - await this.TestRouteToExistentRangeAfterCollectionRecreate(TestCommon.CreateCosmosClient(true)); + using CosmosClient client = TestCommon.CreateCosmosClient(true); + await this.TestRouteToExistentRangeAfterCollectionRecreate(client); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator await this.TestRouteToExistentRangeAfterCollectionRecreate(TestCommon.CreateClient(false, protocol: Protocol.Tcp)); @@ -1673,7 +1678,8 @@ internal async Task TestRouteToExistentRangeAfterCollectionRecreate(CosmosClient [TestMethod] public async Task TestPartitionKeyDefinitionOnCollectionRecreateFromPartitionedToNonPartitionedForQuery() { - await this.TestPartitionKeyDefinitionOnCollectionRecreateFromPartitionedToNonPartitionedForQuery(TestCommon.CreateClient(true)); + using DocumentClient client = TestCommon.CreateClient(true); + await this.TestPartitionKeyDefinitionOnCollectionRecreateFromPartitionedToNonPartitionedForQuery(client); #if DIRECT_MODE // DIRECT MODE has ReadFeed issues in the Public emulator await this.TestPartitionKeyDefinitionOnCollectionRecreateFromPartitionedToNonPartitionedForQuery(TestCommon.CreateClient(false, protocol: Protocol.Tcp)); @@ -1724,7 +1730,8 @@ internal async Task TestPartitionKeyDefinitionOnCollectionRecreateFromPartitione [TestMethod] public async Task TestScriptCreateOnContainerRecreateFromDifferentPartitionKeyPath() { - await this.TestScriptCreateOnContainerRecreateFromDifferentPartitionKeyPath(TestCommon.CreateCosmosClient(true)); + using CosmosClient client = TestCommon.CreateCosmosClient(true); + await this.TestScriptCreateOnContainerRecreateFromDifferentPartitionKeyPath(client); } internal async Task TestScriptCreateOnContainerRecreateFromDifferentPartitionKeyPath(CosmosClient client) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/OfferTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/OfferTests.cs index aa92401e3e..d2015cc8ae 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/OfferTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/OfferTests.cs @@ -88,11 +88,11 @@ public static void Initialize(TestContext textContext) } [TestInitialize] - public void TestInitialize() + public async Task TestInitialize() { using (DocumentClient client = TestCommon.CreateClient(true)) { - TestCommon.DeleteAllDatabasesAsync().Wait(); + await TestCommon.DeleteAllDatabasesAsync(); } } @@ -100,7 +100,7 @@ public void TestInitialize() [Ignore] //Not a valid scenerio for V3 SDK onwards public async Task ValidateOfferCreateNegative_1() { - DocumentClient client = TestCommon.CreateClient(false); + using DocumentClient client = TestCommon.CreateClient(false); Database database = (await client.CreateDatabaseAsync(new Database { Id = Guid.NewGuid().ToString("N") })).Resource; @@ -123,7 +123,7 @@ public async Task ValidateOfferCreateNegative_1() [TestMethod] public async Task ValidateOfferDefaults() { - DocumentClient client = TestCommon.CreateClient(false); + using DocumentClient client = TestCommon.CreateClient(false); Database database = (await client.CreateDatabaseAsync(new Database { Id = Guid.NewGuid().ToString("N") })).Resource; string collectionId = Guid.NewGuid().ToString("N"); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/PartitionKeyRangeCacheTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/PartitionKeyRangeCacheTests.cs index 1b7d554772..d0bdb59adb 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/PartitionKeyRangeCacheTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/PartitionKeyRangeCacheTests.cs @@ -79,7 +79,7 @@ public async Task VerifyPkRangeCacheRefreshOnSplitWithErrorsAsync() }) }; - CosmosClient resourceClient = TestCommon.CreateCosmosClient(clientOptions); + using CosmosClient resourceClient = TestCommon.CreateCosmosClient(clientOptions); string dbName = Guid.NewGuid().ToString(); string containerName = nameof(PartitionKeyRangeCacheTests); @@ -143,6 +143,8 @@ public async Task VerifyPkRangeCacheRefreshOnSplitWithErrorsAsync() } Assert.AreEqual(0, exceptions.Count, $"Unexpected exceptions: {string.Join(';', exceptions)}"); + + await db.DeleteStreamAsync(); } private async Task CreateAndReadItemBackgroundLoop(Container container, List exceptions) @@ -213,7 +215,7 @@ public async Task VerifyPkRangeCacheRefreshOnThrottlesAsync() }) }; - CosmosClient resourceClient = TestCommon.CreateCosmosClient(clientOptions); + using CosmosClient resourceClient = TestCommon.CreateCosmosClient(clientOptions); string dbName = Guid.NewGuid().ToString(); string containerName = nameof(PartitionKeyRangeCacheTests); @@ -239,6 +241,8 @@ public async Task VerifyPkRangeCacheRefreshOnThrottlesAsync() Assert.AreEqual(4, pkRangeCalls); Assert.AreEqual(0, ifNoneMatchValues.Count(x => string.IsNullOrEmpty(x)), "The cache is already init. It should never re-initialize the cache."); + + await db.DeleteStreamAsync(); } [TestMethod] @@ -272,7 +276,7 @@ public async Task VerifyPkRangeCacheRefreshOnTimeoutsAsync() HttpClientFactory = () => new HttpClient(httpHandlerHelper), }; - CosmosClient resourceClient = TestCommon.CreateCosmosClient(clientOptions); + using CosmosClient resourceClient = TestCommon.CreateCosmosClient(clientOptions); string dbName = Guid.NewGuid().ToString(); string containerName = nameof(PartitionKeyRangeCacheTests); @@ -288,12 +292,14 @@ public async Task VerifyPkRangeCacheRefreshOnTimeoutsAsync() Assert.AreEqual(3, pkRangeCalls); Assert.AreEqual(2, ifNoneMatchValues.Count(x => string.IsNullOrEmpty(x)), "First call is a 408"); + + await db.DeleteStreamAsync(); } [TestMethod] public async Task TestRidRefreshOnNotFoundAsync() { - CosmosClient resourceClient = TestCommon.CreateCosmosClient(); + using CosmosClient resourceClient = TestCommon.CreateCosmosClient(); string dbName = Guid.NewGuid().ToString(); string containerName = Guid.NewGuid().ToString(); @@ -301,7 +307,7 @@ public async Task TestRidRefreshOnNotFoundAsync() Database db = await resourceClient.CreateDatabaseAsync(dbName); Container container = await db.CreateContainerAsync(containerName, "/_id"); - CosmosClient testClient = TestCommon.CreateCosmosClient(); + using CosmosClient testClient = TestCommon.CreateCosmosClient(); ContainerInternal testContainer = (ContainerInlineCore)testClient.GetContainer(dbName, containerName); // Populate the RID cache. @@ -326,6 +332,8 @@ public async Task TestRidRefreshOnNotFoundAsync() CollectionRoutingMap collectionRoutingMapFromCache = await testContainer.GetRoutingMapAsync(cancellationToken: default); Assert.AreEqual(collectionRoutingMap, collectionRoutingMapFromCache); + + await db.DeleteStreamAsync(); } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/QueryTestsBase.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/QueryTestsBase.cs index c196af9d44..8af5eeafef 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/QueryTestsBase.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/QueryTestsBase.cs @@ -40,12 +40,6 @@ public abstract class QueryTestsBase internal CosmosClient Client; internal Cosmos.Database database; - public QueryTestsBase() - { - this.GatewayClient = TestCommon.CreateCosmosClient(true, builder => builder.AddCustomHandlers(this.GatewayRequestChargeHandler)); - this.Client = TestCommon.CreateCosmosClient(false, builder => builder.AddCustomHandlers(this.DirectRequestChargeHandler)); - } - [FlagsAttribute] internal enum ConnectionModes { @@ -63,17 +57,11 @@ internal enum CollectionTypes MultiPartition = 0x4, } - [ClassInitialize] - [ClassCleanup] - public static void ClassSetup(TestContext testContext = null) - { - CosmosClient client = TestCommon.CreateCosmosClient(false); - QueryTestsBase.CleanUp(client).Wait(); - } - [TestInitialize] public async Task Initialize() { + this.GatewayClient = TestCommon.CreateCosmosClient(true, builder => builder.AddCustomHandlers(this.GatewayRequestChargeHandler)); + this.Client = TestCommon.CreateCosmosClient(false, builder => builder.AddCustomHandlers(this.DirectRequestChargeHandler)); this.database = await this.Client.CreateDatabaseAsync(Guid.NewGuid().ToString() + "db"); } @@ -81,6 +69,8 @@ public async Task Initialize() public async Task Cleanup() { await this.database.DeleteStreamAsync(); + this.Client.Dispose(); + this.GatewayClient.Dispose(); } private static string GetApiVersion() @@ -359,6 +349,8 @@ internal async Task RunWithApiVersion(string apiVersion, Func function) } finally { + this.Client.Dispose(); + this.GatewayClient.Dispose(); this.Client = originalCosmosClient; this.GatewayClient = originalGatewayClient; this.database = originalDatabase; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs index 6d6484e5a9..afc25ec771 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs @@ -68,6 +68,16 @@ public void TestInitialize() this.CleanUp(); } + [TestCleanup] + public void TestCleanup() + { + this.CleanUp(); + + this.client.Dispose(); + this.primaryReadonlyClient.Dispose(); + this.secondaryReadonlyClient.Dispose(); + } + [ClassInitialize] public static void Initialize(TestContext textContext) { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SmokeTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SmokeTests.cs index 6aa1b2ca16..485f75a2a5 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SmokeTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SmokeTests.cs @@ -33,6 +33,13 @@ static SmokeTests() { } + [TestCleanup] + public async Task Cleanup() + { + await this.client.GetDatabase(DatabaseName).DeleteStreamAsync(); + this.client?.Dispose(); + } + /// /// Test for the existence of native assembly dependencies /// diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SpatialTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SpatialTest.cs index 63eaaeda46..279014dccf 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SpatialTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SpatialTest.cs @@ -27,14 +27,22 @@ private class SpatialSampleClass public Geometry Location { get; set; } } - private readonly DocumentClient client; + private DocumentClient client; - public SpatialTest() + [TestInitialize] + public void TestInitialize() { this.client = TestCommon.CreateClient(true, defaultConsistencyLevel: ConsistencyLevel.Session); this.CleanUp(); } + [TestCleanup] + public void TestCleanup() + { + this.CleanUp(); + this.client.Dispose(); + } + [TestMethod] public async Task TestDistanceAndWithin() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/StoredProcedureTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/StoredProcedureTests.cs index 8e61c2dcc9..6d8a0f7873 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/StoredProcedureTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/StoredProcedureTests.cs @@ -2,11 +2,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------ -using System.Net.Http; -using Microsoft.Azure.Documents.Client; - namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests { + using System.Net.Http; using System; using System.Collections.Generic; using System.IO; @@ -14,7 +12,6 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Text; using System.Threading; using System.Threading.Tasks; - using Microsoft.Azure.Cosmos.Fluent; using Microsoft.Azure.Cosmos.Scripts; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -34,8 +31,8 @@ public async Task TestInitialize() SendingRequestEventArgs = this.SendingRequestEventHandlerScriptsVerifier, }; - this.cosmosClient = TestCommon.CreateCosmosClient(clientOptions); - this.database = await this.cosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString(), + this.SetClient(TestCommon.CreateCosmosClient(clientOptions)); + this.database = await this.GetClient().CreateDatabaseAsync(Guid.NewGuid().ToString(), cancellationToken: this.cancellationToken); string containerName = Guid.NewGuid().ToString(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SummaryDiagnosticsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SummaryDiagnosticsTests.cs index 9f200af263..ae94a7220d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SummaryDiagnosticsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SummaryDiagnosticsTests.cs @@ -32,6 +32,7 @@ public async Task TestInitialize() public async Task Cleanup() { await this.Database.DeleteAsync(); + this.Client.Dispose(); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs index bb46c0f3f3..e81eda0d01 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs @@ -98,6 +98,10 @@ public static async Task ClassCleanupAsync() Util.DisposeOpenTelemetryAndCustomListeners(); + EndToEndTraceWriterBaselineTests.client?.Dispose(); + EndToEndTraceWriterBaselineTests.bulkClient?.Dispose(); + EndToEndTraceWriterBaselineTests.miscCosmosClient?.Dispose(); + await Task.Delay(5000); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/TransportWrapperTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/TransportWrapperTests.cs index 720f37375c..9e7394bf21 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/TransportWrapperTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/TransportWrapperTests.cs @@ -19,7 +19,7 @@ public class TransportWrapperTests [TestMethod] public async Task TransportInterceptorContractTest() { - CosmosClient cosmosClient = TestCommon.CreateCosmosClient( + using CosmosClient cosmosClient = TestCommon.CreateCosmosClient( builder => { builder.WithTransportClientHandlerFactory(transportClient => new TransportClientWrapper(transportClient, TransportWrapperTests.Interceptor)); @@ -31,12 +31,13 @@ public async Task TransportInterceptorContractTest() string id1 = Guid.NewGuid().ToString(); TestPayload payload1 = await container.CreateItemAsync(new TestPayload { id = id1 }); payload1 = await container.ReadItemAsync(id1, new Cosmos.PartitionKey(id1)); + await database.DeleteStreamAsync(); } [TestMethod] public async Task TransportExceptionValidationTest() { - CosmosClient cosmosClient = TestCommon.CreateCosmosClient( + using CosmosClient cosmosClient = TestCommon.CreateCosmosClient( builder => { builder.WithTransportClientHandlerFactory(transportClient => new TransportClientWrapper( @@ -79,7 +80,9 @@ public async Task TransportExceptionValidationTest() using (ResponseMessage responseMessage = await streamIterator.ReadNextAsync()) { this.ValidateTransportException(responseMessage); - } + } + + await database.DeleteStreamAsync(); } private void ValidateTransportException(CosmosException cosmosException) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/TriggersTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/TriggersTests.cs index d32f33643d..82d76427d5 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/TriggersTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/TriggersTests.cs @@ -29,8 +29,8 @@ public async Task TestInitialize() SendingRequestEventArgs = this.SendingRequestEventHandlerTriggersVerifier, }; - this.cosmosClient = TestCommon.CreateCosmosClient(clientOptions); - this.database = await this.cosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString(), + this.SetClient(TestCommon.CreateCosmosClient(clientOptions)); + this.database = await this.GetClient().CreateDatabaseAsync(Guid.NewGuid().ToString(), cancellationToken: this.cancellationToken); string PartitionKey = "/pk"; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/UniqueIndexTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/UniqueIndexTests.cs index e6a33ab170..f2c856b837 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/UniqueIndexTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/UniqueIndexTests.cs @@ -34,6 +34,8 @@ public async Task TestCleanupAsync() { using (await this.database.DeleteStreamAsync()) { } } + + this.client.Dispose(); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/UserDefinedFunctionsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/UserDefinedFunctionsTests.cs index 6ff6c117ee..cf3354575d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/UserDefinedFunctionsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/UserDefinedFunctionsTests.cs @@ -28,8 +28,8 @@ public async Task TestInitialize() SendingRequestEventArgs = this.SendingRequestEventHandlerUdfVerifier, }; - this.cosmosClient = TestCommon.CreateCosmosClient(clientOptions); - this.database = await this.cosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString(), + this.SetClient(TestCommon.CreateCosmosClient(clientOptions)); + this.database = await this.GetClient().CreateDatabaseAsync(Guid.NewGuid().ToString(), cancellationToken: this.cancellationToken); string PartitionKey = "/pk"; ContainerResponse response = await this.database.CreateContainerAsync( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/BaseCosmosClientHelper.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/BaseCosmosClientHelper.cs index 20f083d85d..26930a59a0 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/BaseCosmosClientHelper.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/BaseCosmosClientHelper.cs @@ -11,34 +11,44 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests public abstract class BaseCosmosClientHelper { - protected CosmosClient cosmosClient = null; + private static readonly CosmosClient defaultCosmosClient = TestCommon.CreateCosmosClient(); + + private CosmosClient cosmosClient = null; protected Database database = null; protected CancellationTokenSource cancellationTokenSource = null; protected CancellationToken cancellationToken; - public async Task TestInit( - bool validateSinglePartitionKeyRangeCacheCall = false, - Action customizeClientBuilder = null, - string accountEndpointOverride = null) + private async Task BaseInit(CosmosClient client) + { + this.cancellationTokenSource = new CancellationTokenSource(); + this.cancellationToken = this.cancellationTokenSource.Token; + + this.database = await client.CreateDatabaseAsync(Guid.NewGuid().ToString(), + cancellationToken: this.cancellationToken); + } + + public async Task TestInit() { this.cancellationTokenSource = new CancellationTokenSource(); this.cancellationToken = this.cancellationTokenSource.Token; + await this.BaseInit(BaseCosmosClientHelper.defaultCosmosClient); + } + + public async Task TestInit( + bool validateSinglePartitionKeyRangeCacheCall, + Action customizeClientBuilder = null, + string accountEndpointOverride = null) + { this.cosmosClient = TestCommon.CreateCosmosClient( validatePartitionKeyRangeCalls: validateSinglePartitionKeyRangeCacheCall, customizeClientBuilder: customizeClientBuilder, accountEndpointOverride: accountEndpointOverride); - this.database = await this.cosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString(), - cancellationToken: this.cancellationToken); + await this.BaseInit(this.cosmosClient); } public async Task TestCleanup() { - if (this.cosmosClient == null) - { - return; - } - if (this.database != null) { await this.database.DeleteStreamAsync( @@ -48,7 +58,19 @@ await this.database.DeleteStreamAsync( this.cancellationTokenSource?.Cancel(); - this.cosmosClient.Dispose(); + // Only dispose if the caller set a custom client + this.cosmosClient?.Dispose(); + } + + public CosmosClient GetClient() + { + return this.cosmosClient ?? BaseCosmosClientHelper.defaultCosmosClient; + } + + public void SetClient(CosmosClient client) + { + this.cosmosClient?.Dispose(); + this.cosmosClient = client; } } } diff --git a/templates/emulator-setup.yml b/templates/emulator-setup.yml index 56ba69b98b..f081209295 100644 --- a/templates/emulator-setup.yml +++ b/templates/emulator-setup.yml @@ -1,30 +1,52 @@ # File: templates/emulator-setup.yml steps: - - pwsh: | - Write-Host "Downloading Cosmos Emulator - $env:EMULATORMSIURL" -ForegroundColor green - Invoke-WebRequest "$env:EMULATORMSIURL" -OutFile "$env:temp\azure-cosmosdb-emulator.msi" - Write-Host "Finished Downloading Cosmos Emulator - $env:temp\azure-cosmosdb-emulator.msi" -ForegroundColor green - dir "$env:temp" - choco install lessmsi - choco upgrade lessmsi - mkdir "$env:temp\Azure Cosmos DB Emulator" - lessmsi x "$env:temp\azure-cosmosdb-emulator.msi" "$env:temp\Azure Cosmos DB Emulator\" - Write-Host "Starting Comsos DB Emulator" -ForegroundColor green - Add-MpPreference -ExclusionPath "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator" - Start-Process "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe" "/NoExplorer /NoUI /DisableRateLimiting /PartitionCount=100 /Consistency=Strong /enableRio /EnablePreview /EnableAadAuthentication /EnableSqlComputeEndpoint" -Verb RunAs - Import-Module "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator" - Get-Item env:* | Sort-Object -Property Name - for ($i=0; $i -lt 10; $i++) { - $status=Get-CosmosDbEmulatorStatus + - pwsh: | + Write-Host "Downloading Cosmos Emulator - $env:EMULATORMSIURL" -ForegroundColor green + Invoke-WebRequest "$env:EMULATORMSIURL" -OutFile "$env:temp\azure-cosmosdb-emulator.msi" + Write-Host "Finished Downloading Cosmos Emulator - $env:temp\azure-cosmosdb-emulator.msi" -ForegroundColor green + dir "$env:temp" + choco install lessmsi + choco upgrade lessmsi + mkdir "$env:temp\Azure Cosmos DB Emulator" + lessmsi x "$env:temp\azure-cosmosdb-emulator.msi" "$env:temp\Azure Cosmos DB Emulator\" + Add-MpPreference -ExclusionPath "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator" + Add-MpPreference -ExclusionPath "$env:localappdata\CosmosDBEmulator" + displayName: Downloading and Installing Cosmos DB Emulator + failOnStderr: true + errorActionPreference: stop + - pwsh: | + Write-Host "Starting Cosmos DB Emulator" -ForegroundColor green + Import-Module "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator" + Get-Item env:* | Sort-Object -Property Name + + for ($j=0; $j -lt 3; $j++) { + Write-Host "Attempt $j" + Start-Process "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe" "/NoExplorer /NoUI /DisableRateLimiting /PartitionCount=50 /Consistency=Strong /EnablePreview /EnableSqlComputeEndpoint" -Verb RunAs + for ($i=0; $i -lt 5; $i++) { + $status = Get-CosmosDbEmulatorStatus + Write-Host "Cosmos DB Emulator Status: $status" if ($status -ne "Running") { sleep 30; - Write-Host "Cosmos DB Emulator Status: $status" -ForegroundColor yellow - } else { + } + else { break; } } - - displayName: Install Public Cosmos DB Emulator - failOnStderr: true - errorActionPreference: stop + if ($status -ne "Running") { + Write-Host "Shutting down and restarting" + Start-Process "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe" "/Shutdown" -Verb RunAs + sleep 30; + } + else { + break; + } + } + + if ($status -ne "Running") { + Write-Error "Emulator failed to start" + } + + displayName: Waiting for Cosmos DB Emulator status + failOnStderr: true + errorActionPreference: stop From 6434c1074615cf435085cba5a5e31f62d3ea6b37 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Tue, 14 Feb 2023 14:52:55 -0800 Subject: [PATCH 055/240] [Internal] GitHub Template: Adds needs-investigation label (#3708) By default, all "Bug report" issues will have "needs-investigation" --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 40d469e6fe..39dc8d035f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,7 +2,7 @@ name: Bug report about: Create a report to help us improve title: '' -labels: '' +labels: needs-investigation assignees: '' --- From 4e923da024956732acfa44a5205104cdd751bee4 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Tue, 14 Feb 2023 15:57:51 -0800 Subject: [PATCH 056/240] Adding fabric bot action (#3709) --- .github/fabricbot.json | 56 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/.github/fabricbot.json b/.github/fabricbot.json index eddfa52721..90924da0c3 100644 --- a/.github/fabricbot.json +++ b/.github/fabricbot.json @@ -6,7 +6,6 @@ "capabilityId": "ScheduledSearch", "subCapability": "ScheduledSearch", "version": "1.1", - "id": "a-PNOJWK3Jbr7QY7vkc2O", "config": { "frequency": [ { @@ -50,7 +49,60 @@ ] }, "disabled": true + }, + { + "taskType": "trigger", + "capabilityId": "IssueResponder", + "subCapability": "IssuesOnlyResponder", + "version": "1.0", + "config": { + "conditions": { + "operator": "and", + "operands": [ + { + "operator": "not", + "operands": [ + { + "name": "isAssignedToSomeone", + "parameters": {} + } + ] + }, + { + "name": "isAction", + "parameters": { + "action": "opened" + } + }, + { + "operator": "not", + "operands": [ + { + "name": "hasLabel", + "parameters": { + "label": "needs-investigation" + } + } + ] + } + ] + }, + "eventType": "issue", + "eventNames": [ + "issues", + "project_card" + ], + "taskName": "Add needs-investigation", + "actions": [ + { + "name": "addLabel", + "parameters": { + "label": "needs-investigation" + } + } + ] + } } ], "userGroups": [] -} +} \ No newline at end of file From 38d1bcc09022b3d96fcc34cb51aa0912f211b10b Mon Sep 17 00:00:00 2001 From: Abhijeet Mohanty Date: Fri, 17 Feb 2023 14:46:38 -0500 Subject: [PATCH 057/240] CosmosNullReferenceException: Refactors CosmosNullReferenceException to pass along InnerException property on parent NullReferenceException (#3713) * Passed inner exception details to NullReferenceException ctor when instantiating CosmosNullReferenceException. * Added unit tests. * Addressed PR feedback. --- .../CosmosExceptions/CosmosNullReferenceException.cs | 5 +++-- .../CosmosNullReferenceExceptionTests.cs | 10 +++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosNullReferenceException.cs b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosNullReferenceException.cs index 03e4cb21e8..4e7aa73f54 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosNullReferenceException.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosNullReferenceException.cs @@ -25,9 +25,10 @@ internal class CosmosNullReferenceException : NullReferenceException /// internal CosmosNullReferenceException( NullReferenceException originalException, - ITrace trace) + ITrace trace) + : base(originalException?.Message ?? throw new ArgumentNullException(nameof(originalException)), originalException ?? throw new ArgumentNullException(nameof(originalException))) { - this.originalException = originalException ?? throw new ArgumentNullException(nameof(originalException)); + this.originalException = originalException; if (trace == null) { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosNullReferenceExceptionTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosNullReferenceExceptionTests.cs index a97b56189b..072b63a660 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosNullReferenceExceptionTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosNullReferenceExceptionTests.cs @@ -37,9 +37,10 @@ public void CosmosNullRefWrapingTest() trace); Assert.AreEqual(nullReferenceException.StackTrace, cosmosNullReferenceException.StackTrace); - Assert.AreEqual(nullReferenceException.InnerException, cosmosNullReferenceException.InnerException); + Assert.AreEqual(nullReferenceException, cosmosNullReferenceException.InnerException); Assert.AreEqual(nullReferenceException.Data, cosmosNullReferenceException.Data); + Assert.IsTrue(cosmosNullReferenceException.Message.Contains(message)); Assert.IsTrue(cosmosNullReferenceException.Message.Contains(rootTraceName)); Assert.AreNotEqual(nullReferenceException.Message, cosmosNullReferenceException.Message); @@ -48,5 +49,12 @@ public void CosmosNullRefWrapingTest() Assert.IsTrue(cosmosToString.Contains(message)); Assert.IsTrue(cosmosToString.Contains(rootTraceName)); } + + [TestMethod] + [ExpectedException(typeof(ArgumentNullException))] + public void ExpectArgumentNullExceptionTest() + { + _ = new CosmosNullReferenceException(null, NoOpTrace.Singleton); + } } } From 209e4733a7047e57439f2fa40a016ea8cfc77e2c Mon Sep 17 00:00:00 2001 From: Achint-Agrawal <45819170+Achint-Agrawal@users.noreply.github.com> Date: Sat, 18 Feb 2023 02:54:37 +0530 Subject: [PATCH 058/240] [Internal] PriorityRequests: Fixes header value (#3714) Co-authored-by: Matias Quaranta --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 887ca2d334..a4a5b0a087 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,7 +3,7 @@ 3.32.0 3.32.0 preview - 3.30.1 + 3.30.2 2.0.1 2.0.1 preview From 67e1a90a5a2f4a33123e714d80393bdf937343ba Mon Sep 17 00:00:00 2001 From: akotalwar <94020786+akotalwar@users.noreply.github.com> Date: Fri, 17 Feb 2023 14:59:15 -0800 Subject: [PATCH 059/240] [Internal] Query: Adds single physical partition check for OptimisticDirectExecution queries (#3699) * Added single physical partition check for Ode queries. Updated test infrastructure for Ode emulator tests too. * Refactored emulator tests to have all the test cases at the top of the file * Updated TryGetTargetRangeOptimisticDirectExecutionAsync() * Uodated logic on how many times CreateIngestQueryDeleteAsync() gets called * Added debug asserts for partitionKeyDefinition * Added pageSizeOptions parameter in CreateInput() in EmulatorTests * Fixed comments --- .../CosmosQueryExecutionContextFactory.cs | 30 +- .../OptimisticDirectExecutionQueryTests.cs | 309 ++++++++---------- ...egativeOptimisticDirectExecutionOutput.xml | 39 --- ...ositiveOptimisticDirectExecutionOutput.xml | 39 +++ ...misticDirectExecutionQueryBaselineTests.cs | 54 +-- 5 files changed, 218 insertions(+), 253 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs index d8a885a07b..a7f7f17934 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs @@ -755,22 +755,9 @@ private static Documents.PartitionKeyDefinition GetPartitionKeyDefinition(InputP { if (!inputParameters.EnableOptimisticDirectExecution) return null; - // case 1: Is query going to a single partition - bool hasPartitionKey = inputParameters.PartitionKey.HasValue - && inputParameters.PartitionKey != PartitionKey.Null - && inputParameters.PartitionKey != PartitionKey.None; - - // case 2: does query execution plan have a single query range - bool hasQueryRanges = partitionedQueryExecutionInfo != null - && partitionedQueryExecutionInfo.QueryRanges.Count == 1 - && partitionedQueryExecutionInfo.QueryRanges[0].IsSingleValue; - - if (!hasPartitionKey && !hasQueryRanges) return null; - - //TODO: does collection have only one physical partition - - List targetRanges = new List(); + Debug.Assert(containerQueryProperties.ResourceId != null, "CosmosQueryExecutionContextFactory Assert!", "Container ResourceId cannot be null!"); + List targetRanges; if (partitionedQueryExecutionInfo != null) { targetRanges = await CosmosQueryExecutionContextFactory.GetTargetPartitionKeyRangesAsync( @@ -785,8 +772,10 @@ private static Documents.PartitionKeyDefinition GetPartitionKeyDefinition(InputP else { Documents.PartitionKeyDefinition partitionKeyDefinition = GetPartitionKeyDefinition(inputParameters, containerQueryProperties); - if (partitionKeyDefinition != null && containerQueryProperties.ResourceId != null && inputParameters.PartitionKey != null) + if (inputParameters.PartitionKey != null) { + Debug.Assert(partitionKeyDefinition != null, "CosmosQueryExecutionContextFactory Assert!", "PartitionKeyDefinition cannot be null if partitionKey is defined"); + targetRanges = await cosmosQueryContext.QueryClient.GetTargetPartitionKeyRangesByEpkStringAsync( cosmosQueryContext.ResourceLink, containerQueryProperties.ResourceId, @@ -794,6 +783,15 @@ private static Documents.PartitionKeyDefinition GetPartitionKeyDefinition(InputP forceRefresh: false, trace); } + else + { + targetRanges = await cosmosQueryContext.QueryClient.GetTargetPartitionKeyRangesAsync( + cosmosQueryContext.ResourceLink, + containerQueryProperties.ResourceId, + new List> { FeedRangeEpk.FullRange.Range }, + forceRefresh: false, + trace); + } } if (targetRanges.Count == 1) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs index 9d89f6362a..751c21b64b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs @@ -14,195 +14,131 @@ [TestCategory("Query")] public sealed class OptimisticDirectExecutionQueryTests : QueryTestsBase { + private static class PageSizeOptions + { + public static readonly int[] NonGroupByPageSizeOptions = { -1, 1, 2, 10, 100 }; + public static readonly int[] GroupByPageSizeOptions = { -1 }; + } + [TestMethod] - public async Task TestOptimisticDirectExecutionQueries() + public async Task TestPassingOptimisticDirectExecutionQueries() { int numberOfDocuments = 8; string partitionKey = "key"; string numberField = "numberField"; string nullField = "nullField"; - List documents = new List(numberOfDocuments); - for (int i = 0; i < numberOfDocuments; ++i) + List documents = CreateDocuments(numberOfDocuments, partitionKey, numberField, nullField); + + List singlePartitionContainerTestCases = new List() { - Document doc = new Document(); - doc.SetPropertyValue(partitionKey, "/value"); - doc.SetPropertyValue(numberField, i % 8); - doc.SetPropertyValue(nullField, null); - documents.Add(doc.ToString()); - } + // Tests for bool enableOptimisticDirectExecution + CreateInput( query: $"SELECT TOP 5 VALUE r.numberField FROM r ORDER BY r.{partitionKey}", expectedResult: new List { 0, 1, 2, 3, 4 }, partitionKey: "/value", partition: CollectionTypes.SinglePartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( query: $"SELECT TOP 5 VALUE r.numberField FROM r ORDER BY r.{partitionKey}", expectedResult: new List { 0, 1, 2, 3, 4 }, partitionKey: "/value", partition: CollectionTypes.SinglePartition, enableOptimisticDirectExecution: false, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.Passthrough), + + // Simple query + CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: new List { 0, 1, 2, 3, 4, 5, 6, 7 }, partitionKey: "/value", partition: CollectionTypes.SinglePartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: new List { 0, 1, 2, 3, 4, 5, 6, 7 }, partitionKey: null, partition: CollectionTypes.SinglePartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + // DISTINCT with ORDER BY + CreateInput( query: $"SELECT DISTINCT VALUE r.{numberField} FROM r ORDER BY r.{numberField} DESC", expectedResult: new List { 7, 6, 5, 4, 3, 2, 1, 0 }, partitionKey: "/value", partition: CollectionTypes.SinglePartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( query: $"SELECT DISTINCT VALUE r.{numberField} FROM r ORDER BY r.{numberField} DESC", expectedResult: new List { 7, 6, 5, 4, 3, 2, 1, 0 }, partitionKey: null, partition: CollectionTypes.SinglePartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + // TOP with GROUP BY + CreateInput( query: $"SELECT TOP 5 VALUE r.{numberField} FROM r GROUP BY r.{numberField}", expectedResult: new List { 0, 1, 2, 3, 4 }, partitionKey: "/value", partition: CollectionTypes.SinglePartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.GroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( query: $"SELECT TOP 5 VALUE r.{numberField} FROM r GROUP BY r.{numberField}", expectedResult: new List { 0, 1, 2, 3, 4 }, partitionKey: null, partition: CollectionTypes.SinglePartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.GroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + // OFFSET LIMIT with WHERE and BETWEEN + CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{numberField} BETWEEN 0 AND {numberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, partitionKey: "/value", partition: CollectionTypes.SinglePartition, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, enableOptimisticDirectExecution: true, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{numberField} BETWEEN 0 AND {numberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, partitionKey: null, partition: CollectionTypes.SinglePartition, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, enableOptimisticDirectExecution: true, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution) + }; - SinglePartitionWithContinuationsArgs args = new SinglePartitionWithContinuationsArgs + List multiPartitionContainerTestCases = new List() { - NumberOfDocuments = numberOfDocuments, - PartitionKey = partitionKey, - NumberField = numberField, - NullField = nullField, + // Simple query + CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: new List { 0, 1, 2, 3, 4, 5, 6, 7 }, partitionKey: "/value", partition: CollectionTypes.MultiPartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: new List { 0, 1, 2, 3, 4, 5, 6, 7 }, partitionKey: null, partition: CollectionTypes.MultiPartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.Passthrough), + + // DISTINCT with ORDER BY + CreateInput( query: $"SELECT DISTINCT VALUE r.{numberField} FROM r ORDER BY r.{numberField} DESC", expectedResult: new List { 7, 6, 5, 4, 3, 2, 1, 0 }, partitionKey: "/value", partition: CollectionTypes.MultiPartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( query: $"SELECT DISTINCT VALUE r.{numberField} FROM r ORDER BY r.{numberField} DESC", expectedResult: new List { 7, 6, 5, 4, 3, 2, 1, 0 }, partitionKey: null, partition: CollectionTypes.MultiPartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.Specialized), + + // OFFSET LIMIT with WHERE and BETWEEN + CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{numberField} BETWEEN 0 AND {numberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, partitionKey: "/value", partition: CollectionTypes.MultiPartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{numberField} BETWEEN 0 AND {numberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, partitionKey: null, partition: CollectionTypes.MultiPartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.Specialized) }; - await this.CreateIngestQueryDeleteAsync( + await this.CreateIngestQueryDeleteAsync( ConnectionModes.Direct | ConnectionModes.Gateway, - CollectionTypes.SinglePartition | CollectionTypes.MultiPartition, + CollectionTypes.SinglePartition, documents, - RunTests, - args, + (container, documents) => RunPassingTests(singlePartitionContainerTestCases, container), "/" + partitionKey); - } - private static async Task RunTests(Container container, IReadOnlyList documents, SinglePartitionWithContinuationsArgs args) - { - await TestPositiveOptimisticDirectExecutionOutput(container, args); - await TestNegativeOptimisticDirectExecutionOutput(container); + await this.CreateIngestQueryDeleteAsync( + ConnectionModes.Direct | ConnectionModes.Gateway, + CollectionTypes.MultiPartition, + documents, + (container, documents) => RunPassingTests(multiPartitionContainerTestCases, container), + "/" + partitionKey); } - private static async Task TestPositiveOptimisticDirectExecutionOutput( - Container container, - SinglePartitionWithContinuationsArgs args) + [TestMethod] + public async Task TestFailingOptimisticDirectExecutionOutput() { - int documentCount = args.NumberOfDocuments; - string partitionKey = args.PartitionKey; - string numberField = args.NumberField; - string nullField = args.NullField; - - QueryRequestOptions feedOptions = new QueryRequestOptions - { - MaxItemCount = -1, - EnableOptimisticDirectExecution = true, - TestSettings = new TestInjections(simulate429s: false, simulateEmptyPages: false, new TestInjections.ResponseStats()) - }; - - // check if pipeline returns empty continuation token - FeedResponse responseWithEmptyContinuationExpected = await container.GetItemQueryIterator( - $"SELECT TOP 0 * FROM r", - requestOptions: feedOptions).ReadNextAsync(); - - Assert.AreEqual(null, responseWithEmptyContinuationExpected.ContinuationToken); - - List queries = new List - { - $"SELECT TOP 5 VALUE r.numberField FROM r ORDER BY r.{partitionKey}", - $"SELECT VALUE r.numberField FROM r", - $"SELECT VALUE r.numberField FROM r", - $"SELECT TOP 4 VALUE r.numberField FROM r ORDER BY r.{numberField}", - $"SELECT TOP 3 VALUE r.numberField FROM r WHERE r.{numberField} BETWEEN 0 AND {documentCount} ORDER BY r.{numberField} DESC", - $"SELECT VALUE r.numberField FROM r WHERE r.{numberField} BETWEEN 0 AND {documentCount} OFFSET 1 LIMIT 1", - $"SELECT DISTINCT VALUE r.{numberField} FROM r ORDER BY r.{numberField}", - $"SELECT TOP 3 VALUE r.numberField FROM r WHERE r.{numberField} BETWEEN 0 AND {documentCount} ORDER BY r.{numberField} DESC", - $"SELECT TOP 4 VALUE r.numberField FROM r ORDER BY r.{numberField}", - $"SELECT VALUE r.numberField FROM r", - }; - - List> results = new List> - { - new List { 0, 1, 2, 3, 4 }, - new List { 0, 1, 2, 3, 4, 5, 6, 7 }, - new List { 0, 1, 2, 3, 4, 5, 6, 7 }, - new List { 0, 1, 2, 3}, - new List { 7, 6, 5}, - new List { 1}, - new List { 0, 1, 2, 3, 4, 5, 6, 7}, - new List { 7, 6, 5}, - new List { 0, 1, 2, 3}, - new List { 0, 1, 2, 3, 4, 5, 6, 7 }, - }; - - List partitionKeys = new List - { - "/value", - null, - "/value", - "/value", - "/value", - null, - null, - "/value", - "/value", - "/value", - }; + int numberOfDocuments = 8; + string partitionKey = "key"; + string numberField = "numberField"; + string nullField = "nullField"; - List expectedPipelineType = new List - { - TestInjections.PipelineType.OptimisticDirectExecution, - TestInjections.PipelineType.Passthrough, - TestInjections.PipelineType.OptimisticDirectExecution, - TestInjections.PipelineType.OptimisticDirectExecution, - TestInjections.PipelineType.OptimisticDirectExecution, - TestInjections.PipelineType.Specialized, - TestInjections.PipelineType.Specialized, - TestInjections.PipelineType.Specialized, - TestInjections.PipelineType.Specialized, - TestInjections.PipelineType.Passthrough, - }; + List documents = CreateDocuments(numberOfDocuments, partitionKey, numberField, nullField); - List enabledOptimisticDirectExecution = new List + // check if bad continuation queries and syntax error queries are handled by pipeline + IDictionary invalidQueries = new Dictionary { - true, - true, - true, - true, - true, - true, - true, - false, - false, - false, + { "SELECT * FROM t", Guid.NewGuid().ToString() }, + { "SELECT TOP 10 * FOM r", null }, + { "this is not a valid query", null }, }; + + await this.CreateIngestQueryDeleteAsync( + ConnectionModes.Direct | ConnectionModes.Gateway, + CollectionTypes.SinglePartition | CollectionTypes.MultiPartition, + documents, + (container, documents) => RunFailingTests(container, invalidQueries), + "/" + partitionKey); + } - List queryAndResults = new List(); - - for (int i = 0; i < queries.Count(); i++) - { - QueryResultsAndPipelineType queryAndResult = new QueryResultsAndPipelineType() - { - Query = queries[i], - Result = results[i], - PartitionKey = partitionKeys[i], - ExpectedPipelineType = expectedPipelineType[i], - EnableOptimisticDirectExecution = enabledOptimisticDirectExecution[i], - }; - - queryAndResults.Add(queryAndResult); - } - - int[] pageSizeOptions = new[] { -1, 1, 2, 10, 100 }; - - for (int i = 0; i < pageSizeOptions.Length; i++) + private static async Task RunPassingTests(IEnumerable testCases, Container container) + { + foreach (DirectExecutionTestCase testCase in testCases) { - for(int j = 0; j < queryAndResults.Count(); j++) + foreach (int pageSize in testCase.PageSizeOptions) { - feedOptions = new QueryRequestOptions + QueryRequestOptions feedOptions = new QueryRequestOptions { - MaxItemCount = pageSizeOptions[i], - PartitionKey = queryAndResults[j].PartitionKey == null - ? null - : new Cosmos.PartitionKey(queryAndResults[j].PartitionKey), - EnableOptimisticDirectExecution = queryAndResults[j].EnableOptimisticDirectExecution, + MaxItemCount = pageSize, + PartitionKey = testCase.PartitionKey == null + ? null + : new Cosmos.PartitionKey(testCase.PartitionKey), + EnableOptimisticDirectExecution = testCase.EnableOptimisticDirectExecution, TestSettings = new TestInjections(simulate429s: false, simulateEmptyPages: false, new TestInjections.ResponseStats()) }; List items = await RunQueryAsync( container, - queryAndResults[j].Query, + testCase.Query, feedOptions); long[] actual = items.Cast().Select(x => Number64.ToLong(x.Value)).ToArray(); - Assert.IsTrue(queryAndResults[j].Result.SequenceEqual(actual)); - - if (queryAndResults[j].EnableOptimisticDirectExecution) - { - Assert.AreEqual(queryAndResults[j].ExpectedPipelineType, feedOptions.TestSettings.Stats.PipelineType.Value); - } - else - { // test if pipeline is called if TestInjection.EnableOptimisticDirectExecution is false - Assert.AreNotEqual(TestInjections.PipelineType.OptimisticDirectExecution, feedOptions.TestSettings.Stats.PipelineType.Value); - } + Assert.IsTrue(testCase.ExpectedResult.SequenceEqual(actual)); + Assert.AreEqual(testCase.ExpectedPipelineType, feedOptions.TestSettings.Stats.PipelineType.Value); } } } - private static async Task TestNegativeOptimisticDirectExecutionOutput( - Container container) + private static async Task RunFailingTests(Container container, IDictionary invalidQueries) { QueryRequestOptions feedOptions = new QueryRequestOptions { @@ -211,21 +147,13 @@ private static async Task TestNegativeOptimisticDirectExecutionOutput( TestSettings = new TestInjections(simulate429s: false, simulateEmptyPages: false, new TestInjections.ResponseStats()) }; - // check if bad continuation queries and syntax error queries are handled by pipeline - IDictionary invalidQueries = new Dictionary - { - { "SELECT * FROM t", Guid.NewGuid().ToString() }, - { "SELECT TOP 10 * FOM r", null }, - { "this is not a valid query", null }, - }; - - foreach (KeyValuePair entry in invalidQueries) + foreach (KeyValuePair queryAndResult in invalidQueries) { try { await container.GetItemQueryIterator( - queryDefinition: new QueryDefinition(entry.Key), - continuationToken: entry.Value, + queryDefinition: new QueryDefinition(queryAndResult.Key), + continuationToken: queryAndResult.Value, requestOptions: feedOptions).ReadNextAsync(); Assert.Fail("Expect exception"); @@ -241,21 +169,60 @@ await container.GetItemQueryIterator( } } - private struct SinglePartitionWithContinuationsArgs + private static List CreateDocuments(int documentCount, string partitionKey, string numberField, string nullField) + { + List documents = new List(documentCount); + for (int i = 0; i < documentCount; ++i) + { + Document doc = new Document(); + doc.SetPropertyValue(partitionKey, "/value"); + doc.SetPropertyValue(numberField, i % documentCount); + doc.SetPropertyValue(nullField, null); + documents.Add(doc.ToString()); + } + + return documents; + } + + private static DirectExecutionTestCase CreateInput( + string query, + List expectedResult, + string partitionKey, + CollectionTypes partition, + bool enableOptimisticDirectExecution, + int[] pageSizeOptions, + TestInjections.PipelineType expectedPipelineType) { - public int NumberOfDocuments; - public string PartitionKey; - public string NumberField; - public string NullField; + return new DirectExecutionTestCase(query, expectedResult, partitionKey, partition, enableOptimisticDirectExecution, pageSizeOptions, expectedPipelineType); } - private struct QueryResultsAndPipelineType + internal readonly struct DirectExecutionTestCase { - public string Query { get; set; } - public List Result { get; set; } - public string PartitionKey { get; set; } - public TestInjections.PipelineType ExpectedPipelineType { get; set; } - public bool EnableOptimisticDirectExecution { get; set; } + public string Query { get; } + public List ExpectedResult { get; } + public string PartitionKey { get; } + public CollectionTypes Partition { get; } + public bool EnableOptimisticDirectExecution { get; } + public int[] PageSizeOptions { get; } + public TestInjections.PipelineType ExpectedPipelineType { get; } + + public DirectExecutionTestCase( + string query, + List expectedResult, + string partitionKey, + CollectionTypes partition, + bool enableOptimisticDirectExecution, + int[] pageSizeOptions, + TestInjections.PipelineType expectedPipelineType) + { + this.Query = query; + this.ExpectedResult = expectedResult; + this.PartitionKey = partitionKey; + this.Partition = partition; + this.EnableOptimisticDirectExecution = enableOptimisticDirectExecution; + this.PageSizeOptions = pageSizeOptions; + this.ExpectedPipelineType = expectedPipelineType; + } } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.NegativeOptimisticDirectExecutionOutput.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.NegativeOptimisticDirectExecutionOutput.xml index 7a8259eefc..4685001217 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.NegativeOptimisticDirectExecutionOutput.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.NegativeOptimisticDirectExecutionOutput.xml @@ -1,43 +1,4 @@  - - - Null Partition Key Value - SELECT * FROM c - - /pk - - Hash - - - false - - - - - None Partition Key Value - SELECT * FROM c - - /pk - - Hash - - - false - - - - - C# Null Partition Key Value - SELECT * FROM c - - /pk - - Hash - - - false - - Single Partition Key with Parallel continuation token diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml index 2482925bd8..5e496fc564 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml @@ -64,4 +64,43 @@ true + + + Null Partition Key Value + SELECT * FROM c + + /pk + + Hash + + + true + + + + + None Partition Key Value + SELECT * FROM c + + /pk + + Hash + + + true + + + + + C# Null Partition Key Value + SELECT * FROM c + + /pk + + Hash + + + true + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs index b6a78c111d..20de3f1f03 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs @@ -36,10 +36,6 @@ public class OptimisticDirectExecutionQueryBaselineTests : BaselineTests testVariations = new List { CreateInput( @@ -77,7 +73,32 @@ public void PositiveOptimisticDirectExecutionOutput() expectedOptimisticDirectExecution: true, partitionKeyPath: @"/pk", partitionKeyValue: "a", - continuationToken: cosmosElementOdeContinuationToken), + continuationToken: CosmosElement.Parse( + "{\"OptimisticDirectExecutionToken\":{\"token\":\"{\\\"resourceId\\\":\\\"AQAAAMmFOw8LAAAAAAAAAA==\\\"," + + "\\\"skipCount\\\":1}\", \"range\":{\"min\":\"\",\"max\":\"FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF\"}}}")), + + // Below cases are Ode because they have a collection with a single physical partition. + // Added emulator tests (TestPassingOptimisticDirectExecutionQueries()) to verify the negation of the below cases. + CreateInput( + description: @"Null Partition Key Value", + query: "SELECT * FROM c", + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: Cosmos.PartitionKey.Null), + + CreateInput( + description: @"None Partition Key Value", + query: "SELECT * FROM c", + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: Cosmos.PartitionKey.None), + + CreateInput( + description: @"C# Null Partition Key Value", + query: "SELECT * FROM c", + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: null), }; this.ExecuteTestSuite(testVariations); } @@ -105,27 +126,6 @@ public void NegativeOptimisticDirectExecutionOutput() List testVariations = new List { - CreateInput( - description: @"Null Partition Key Value", - query: "SELECT * FROM c", - expectedOptimisticDirectExecution: false, - partitionKeyPath: @"/pk", - partitionKeyValue: Cosmos.PartitionKey.Null), - - CreateInput( - description: @"None Partition Key Value", - query: "SELECT * FROM c", - expectedOptimisticDirectExecution: false, - partitionKeyPath: @"/pk", - partitionKeyValue: Cosmos.PartitionKey.None), - - CreateInput( - description: @"C# Null Partition Key Value", - query: "SELECT * FROM c", - expectedOptimisticDirectExecution: false, - partitionKeyPath: @"/pk", - partitionKeyValue: null), - CreateInput( description: @"Single Partition Key with Parallel continuation token", query: "SELECT * FROM c", @@ -798,7 +798,7 @@ public override Task> TryGetOverlappingRangesAs } public override async Task> TryGetPartitionedQueryExecutionInfoAsync(SqlQuerySpec sqlQuerySpec, ResourceType resourceType, PartitionKeyDefinition partitionKeyDefinition, bool requireFormattableOrderByQuery, bool isContinuationExpected, bool allowNonValueAggregateQuery, bool hasLogicalPartitionKey, bool allowDCount, bool useSystemPrefix, Cosmos.GeospatialType geospatialType, CancellationToken cancellationToken) - { + { CosmosSerializerCore serializerCore = new(); using StreamReader streamReader = new(serializerCore.ToStreamSqlQuerySpec(sqlQuerySpec, Documents.ResourceType.Document)); string sqlQuerySpecJsonString = streamReader.ReadToEnd(); From b257f8e9b14ee1eae243b2c462d7582dbf5fb07f Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Fri, 17 Feb 2023 15:26:51 -0800 Subject: [PATCH 060/240] [Internal] CTL: Fixes Reservoir Sampling Logic (#3712) * Code changes to fix the reservoir sampling logic in CTL * Code changes to modify help text on reservoir type. * Code changes to address minor code refactor. --- .../Tools/CTL/CTLConfig.cs | 9 +++- .../Tools/CTL/ReservoirProvider.cs | 49 +++++++++++++++++++ .../CTL/Scenarios/ChangeFeedPullScenario.cs | 2 +- .../Tools/CTL/Scenarios/ReadManyScenario.cs | 2 +- .../CTL/Scenarios/ReadWriteQueryScenario.cs | 14 +++--- 5 files changed, 66 insertions(+), 10 deletions(-) create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/CTL/ReservoirProvider.cs diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/CTL/CTLConfig.cs b/Microsoft.Azure.Cosmos.Samples/Tools/CTL/CTLConfig.cs index ae930dd7ba..05064003ce 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/CTL/CTLConfig.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/CTL/CTLConfig.cs @@ -11,6 +11,7 @@ namespace CosmosCTL using CommandLine.Text; using Microsoft.Azure.Cosmos; using Newtonsoft.Json; + using static CosmosCTL.ReservoirProvider; public class CTLConfig { @@ -76,7 +77,7 @@ public string DiagnosticsThresholdDuration } [Option("ctl_content_response_on_write", Required = false, HelpText = "Should return content response on writes")] - public bool IsContentResponseOnWriteEnabled { get; set; } = true; + public bool? IsContentResponseOnWriteEnabled { get; set; } = true; [Option("ctl_output_event_traces", Required = false, HelpText = "Outputs TraceSource to console")] public bool OutputEventTraces { get; set; } = false; @@ -102,6 +103,12 @@ public string DiagnosticsThresholdDuration [Option("ctl_telemetry_schedule_in_sec", Required = false, HelpText = "telemetry task schedule time in sec")] public string TelemetryScheduleInSeconds { get; set; } + [Option("ctl_reservoir_type", Required = false, HelpText = "Defines the reservoir type. Valid values are: Uniform, SlidingWindow and ExponentialDecay. The default value is SlidingWindow.")] + public ReservoirTypes ReservoirType { get; set; } = ReservoirTypes.SlidingWindow; + + [Option("ctl_reservoir_sample_size", Required = false, HelpText = "The reservoir sample size.")] + public int ReservoirSampleSize { get; set; } = 1028; + internal TimeSpan RunningTimeDurationAsTimespan { get; private set; } = TimeSpan.FromHours(10); internal TimeSpan DiagnosticsThresholdDurationAsTimespan { get; private set; } = TimeSpan.FromSeconds(60); diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/CTL/ReservoirProvider.cs b/Microsoft.Azure.Cosmos.Samples/Tools/CTL/ReservoirProvider.cs new file mode 100644 index 0000000000..9f655bbd0d --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/CTL/ReservoirProvider.cs @@ -0,0 +1,49 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace CosmosCTL +{ + using System; + using App.Metrics.ReservoirSampling; + + /// + /// Returns the based on the CTL configuration. + /// + public class ReservoirProvider + { + /// + /// Create and returns a new instance of the based on the CTL configuration. + /// + /// An instance of containing the CTL config params. + /// An implementation of . + public static IReservoir GetReservoir(CTLConfig ctlConfig) + { + return ctlConfig.ReservoirType switch + { + ReservoirTypes.Uniform => new App.Metrics.ReservoirSampling.Uniform.DefaultAlgorithmRReservoir( + sampleSize: ctlConfig.ReservoirSampleSize), + + ReservoirTypes.SlidingWindow => new App.Metrics.ReservoirSampling.SlidingWindow.DefaultSlidingWindowReservoir( + sampleSize: ctlConfig.ReservoirSampleSize), + + ReservoirTypes.ExponentialDecay => new App.Metrics.ReservoirSampling.ExponentialDecay.DefaultForwardDecayingReservoir( + sampleSize: ctlConfig.ReservoirSampleSize, + alpha: 0.015), + + _ => throw new ArgumentException( + message: "Invalid ReservoirType Specified."), + }; + } + + /// + /// An enum containing different reservoir types. + /// + public enum ReservoirTypes + { + Uniform, + SlidingWindow, + ExponentialDecay + } + } +} diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/CTL/Scenarios/ChangeFeedPullScenario.cs b/Microsoft.Azure.Cosmos.Samples/Tools/CTL/Scenarios/ChangeFeedPullScenario.cs index d549f398d1..65c40864f7 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/CTL/Scenarios/ChangeFeedPullScenario.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/CTL/Scenarios/ChangeFeedPullScenario.cs @@ -64,7 +64,7 @@ public async Task RunAsync( DurationUnit = TimeUnit.Milliseconds, RateUnit = TimeUnit.Seconds, Context = loggingContextIdentifier, - Reservoir = () => new App.Metrics.ReservoirSampling.Uniform.DefaultAlgorithmRReservoir() + Reservoir = () => ReservoirProvider.GetReservoir(config) }; Container container = cosmosClient.GetContainer(config.Database, config.Collection); diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/CTL/Scenarios/ReadManyScenario.cs b/Microsoft.Azure.Cosmos.Samples/Tools/CTL/Scenarios/ReadManyScenario.cs index ae53acb07f..09a84530a6 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/CTL/Scenarios/ReadManyScenario.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/CTL/Scenarios/ReadManyScenario.cs @@ -76,7 +76,7 @@ public async Task RunAsync( DurationUnit = TimeUnit.Milliseconds, RateUnit = TimeUnit.Seconds, Context = loggingContextIdentifier, - Reservoir = () => new App.Metrics.ReservoirSampling.Uniform.DefaultAlgorithmRReservoir() + Reservoir = () => ReservoirProvider.GetReservoir(config) }; Container container = cosmosClient.GetContainer(config.Database, config.Collection); diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/CTL/Scenarios/ReadWriteQueryScenario.cs b/Microsoft.Azure.Cosmos.Samples/Tools/CTL/Scenarios/ReadWriteQueryScenario.cs index fe15e4efaa..db85445bef 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/CTL/Scenarios/ReadWriteQueryScenario.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/CTL/Scenarios/ReadWriteQueryScenario.cs @@ -105,34 +105,34 @@ private async Task ExecuteOperationsAsync( CounterOptions querySuccessMeter = new CounterOptions { Name = "#Query Successful Operations", Context = loggingContextIdentifier }; CounterOptions queryFailureMeter = new CounterOptions { Name = "#Query Unsuccessful Operations", Context = loggingContextIdentifier }; - TimerOptions readLatencyTimer = new TimerOptions + TimerOptions readLatencyTimer = new() { Name = "Read latency", MeasurementUnit = Unit.Requests, DurationUnit = TimeUnit.Milliseconds, RateUnit = TimeUnit.Seconds, Context = loggingContextIdentifier, - Reservoir = () => new App.Metrics.ReservoirSampling.Uniform.DefaultAlgorithmRReservoir() + Reservoir = () => ReservoirProvider.GetReservoir(config) }; - TimerOptions writeLatencyTimer = new TimerOptions + TimerOptions writeLatencyTimer = new () { Name = "Write latency", MeasurementUnit = Unit.Requests, DurationUnit = TimeUnit.Milliseconds, RateUnit = TimeUnit.Seconds, Context = loggingContextIdentifier, - Reservoir = () => new App.Metrics.ReservoirSampling.Uniform.DefaultAlgorithmRReservoir() + Reservoir = () => ReservoirProvider.GetReservoir(config) }; - TimerOptions queryLatencyTimer = new TimerOptions + TimerOptions queryLatencyTimer = new () { Name = "Query latency", MeasurementUnit = Unit.Requests, DurationUnit = TimeUnit.Milliseconds, RateUnit = TimeUnit.Seconds, Context = loggingContextIdentifier, - Reservoir = () => new App.Metrics.ReservoirSampling.Uniform.DefaultAlgorithmRReservoir() + Reservoir = () => ReservoirProvider.GetReservoir(config) }; SemaphoreSlim concurrencyControlSemaphore = new SemaphoreSlim(config.Concurrency); @@ -178,7 +178,7 @@ private async Task ExecuteOperationsAsync( operation: i, partitionKeyAttributeName: config.CollectionPartitionKey, containers: initializationResult.Containers, - isContentResponseOnWriteEnabled: config.IsContentResponseOnWriteEnabled)), + isContentResponseOnWriteEnabled: config.IsContentResponseOnWriteEnabled.Value)), onSuccess: () => { concurrencyControlSemaphore.Release(); From 94c83f58ed9f83b36b5e42b6a5187b579f666d0d Mon Sep 17 00:00:00 2001 From: Nimit Shah Date: Mon, 27 Feb 2023 07:53:21 -0800 Subject: [PATCH 061/240] Diagnostics: Adds startDate in Summary (#3707) * Adding start date * Updated trace files * PR comment * Committing missing tests --------- Co-authored-by: Matias Quaranta --- .../Tracing/TraceWriter.TraceJsonWriter.cs | 4 ++-- .../Tracing/TraceWriter.TraceTextWriter.cs | 1 + ...iterBaselineTests.BatchOperationsAsync.xml | 2 +- ...riterBaselineTests.BulkOperationsAsync.xml | 22 +++++++++---------- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 10 ++++----- ...eWriterBaselineTests.MiscellanousAsync.xml | 4 ++-- ...neTests.PointOperationsExceptionsAsync.xml | 12 +++++----- ...EndTraceWriterBaselineTests.QueryAsync.xml | 14 ++++++------ ...TraceWriterBaselineTests.ReadFeedAsync.xml | 8 +++---- ...TraceWriterBaselineTests.ReadManyAsync.xml | 4 ++-- ...selineTests.StreamPointOperationsAsync.xml | 8 +++---- ...aselineTests.TypedPointOperationsAsync.xml | 8 +++---- ...raceWriterBaselineTests.ScenariosAsync.xml | 6 ++--- ...TraceWriterBaselineTests.Serialization.xml | 14 ++++++------ .../TraceWriterBaselineTests.TraceData.xml | 14 ++++++------ 15 files changed, 66 insertions(+), 65 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs b/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs index 4710f00a2e..74363c8ca1 100644 --- a/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs @@ -46,8 +46,8 @@ public static void WriteTrace( if (isRootTrace) { - writer.WriteFieldName("start time"); - writer.WriteStringValue(trace.StartTime.ToString(TraceWriter.HourTimeFormatString)); + writer.WriteFieldName("start datetime"); + writer.WriteStringValue(trace.StartTime.ToString(TraceWriter.DateTimeFormatString)); } writer.WriteFieldName("duration in milliseconds"); writer.WriteNumber64Value(trace.Duration.TotalMilliseconds); diff --git a/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceTextWriter.cs b/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceTextWriter.cs index f77307b359..502c87c4fe 100644 --- a/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceTextWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceTextWriter.cs @@ -18,6 +18,7 @@ namespace Microsoft.Azure.Cosmos.Tracing internal static partial class TraceWriter { internal static readonly string HourTimeFormatString = "HH:mm:ss:fff"; + internal static readonly string DateTimeFormatString = "yyyy-MM-ddTHH:mm:ss.fffZ"; private static class TraceTextWriter { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index 59a5eabf76..d468fe87f5 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -61,7 +61,7 @@ @@ -71,7 +71,7 @@ Date: Tue, 28 Feb 2023 01:04:01 +0530 Subject: [PATCH 062/240] [Internal] Client Telemetry: Adds network information in the payload (#3691) * first draft * clean code * add test * fix test * add replica info collection * fix substatuscode and operation type error * fix code * collect http infor in cache also * message to stacktrace * remove rntbd recording from cache * print proper exception message * fix test * cleanup unused code and added few status codes in ignore list * fixed all exception logging * refactor conditions * fix tests --- .../src/Handler/TelemetryHandler.cs | 5 +- .../src/Telemetry/ClientTelemetry.cs | 73 +++++++++++++++---- .../src/Telemetry/ClientTelemetryHelper.cs | 35 +++++++-- .../src/Telemetry/ClientTelemetryOptions.cs | 38 +++++++++- .../Models/ClientTelemetryProperties.cs | 5 ++ .../src/Telemetry/Models/RequestInfo.cs | 66 +++++++++++++++++ .../ClientSideRequestStatisticsTraceDatum.cs | 1 + .../Tracing/TraceData/SummaryDiagnostics.cs | 24 ++++-- .../ClientTelemetryTests.cs | 58 ++++++++++++--- .../ClientTelemetryTests.cs | 57 +++++++++------ 10 files changed, 300 insertions(+), 62 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/src/Telemetry/Models/RequestInfo.cs diff --git a/Microsoft.Azure.Cosmos/src/Handler/TelemetryHandler.cs b/Microsoft.Azure.Cosmos/src/Handler/TelemetryHandler.cs index 449a981d0d..9d7e504eba 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/TelemetryHandler.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/TelemetryHandler.cs @@ -40,11 +40,12 @@ public override async Task SendAsync( resourceType: request.ResourceType, consistencyLevel: request.Headers?[Documents.HttpConstants.HttpHeaders.ConsistencyLevel], requestCharge: response.Headers.RequestCharge, - subStatusCode: response.Headers.SubStatusCode); + subStatusCode: response.Headers.SubStatusCode, + trace: response.Trace); } catch (Exception ex) { - DefaultTrace.TraceError("Error while collecting telemetry information : " + ex.Message); + DefaultTrace.TraceError("Error while collecting telemetry information : {0}", ex); } } return response; diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs index 3f124e2ee0..82e212f7f3 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs @@ -17,11 +17,14 @@ namespace Microsoft.Azure.Cosmos.Telemetry using Microsoft.Azure.Cosmos.Core.Trace; using Microsoft.Azure.Cosmos.Routing; using Microsoft.Azure.Cosmos.Telemetry.Models; + using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Cosmos.Tracing.TraceData; using Microsoft.Azure.Documents; using Microsoft.Azure.Documents.Collections; using Microsoft.Azure.Documents.Rntbd; using Newtonsoft.Json; using Util; + using static Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum; /// /// This class collects and send all the telemetry information. @@ -53,6 +56,9 @@ internal class ClientTelemetry : IDisposable private ConcurrentDictionary cacheRefreshInfoMap = new ConcurrentDictionary(); + private ConcurrentDictionary requestInfoMap + = new ConcurrentDictionary(); + private int numberOfFailures = 0; /// @@ -182,22 +188,26 @@ private async Task EnrichAndSendAsync() this.RecordSystemUtilization(); this.clientTelemetryInfo.DateTimeUtc = DateTime.UtcNow.ToString(ClientTelemetryOptions.DateFormat); - + ConcurrentDictionary operationInfoSnapshot = Interlocked.Exchange(ref this.operationInfoMap, new ConcurrentDictionary()); ConcurrentDictionary cacheRefreshInfoSnapshot = Interlocked.Exchange(ref this.cacheRefreshInfoMap, new ConcurrentDictionary()); + ConcurrentDictionary requestInfoSnapshot + = Interlocked.Exchange(ref this.requestInfoMap, new ConcurrentDictionary()); + this.clientTelemetryInfo.OperationInfo = ClientTelemetryHelper.ToListWithMetricsInfo(operationInfoSnapshot); this.clientTelemetryInfo.CacheRefreshInfo = ClientTelemetryHelper.ToListWithMetricsInfo(cacheRefreshInfoSnapshot); - + this.clientTelemetryInfo.RequestInfo = ClientTelemetryHelper.ToListWithMetricsInfo(requestInfoSnapshot); + await this.SendAsync(); } } catch (Exception ex) { - DefaultTrace.TraceError("Exception in EnrichAndSendAsync() : {0}", ex.Message); + DefaultTrace.TraceError("Exception in EnrichAndSendAsync() : {0}", ex); } DefaultTrace.TraceInformation("Telemetry Job Stopped."); @@ -224,7 +234,7 @@ internal void CollectCacheInfo(string cacheRefreshSource, } DefaultTrace.TraceVerbose($"Collecting cacheRefreshSource {cacheRefreshSource} data for Telemetry."); - + string regionsContacted = ClientTelemetryHelper.GetContactedRegions(regionsContactedList); // Recording Request Latency @@ -249,7 +259,7 @@ internal void CollectCacheInfo(string cacheRefreshSource, } catch (Exception ex) { - DefaultTrace.TraceError("Latency Recording Failed by Telemetry. Exception : {0}", ex.Message); + DefaultTrace.TraceError("Latency Recording Failed by Telemetry. Exception : {0}", ex); } } @@ -266,6 +276,7 @@ internal void CollectCacheInfo(string cacheRefreshSource, /// /// /// + /// internal void CollectOperationInfo(CosmosDiagnostics cosmosDiagnostics, HttpStatusCode statusCode, long responseSizeInBytes, @@ -275,17 +286,22 @@ internal void CollectOperationInfo(CosmosDiagnostics cosmosDiagnostics, ResourceType resourceType, string consistencyLevel, double requestCharge, - SubStatusCodes subStatusCode) + SubStatusCodes subStatusCode, + ITrace trace) { DefaultTrace.TraceVerbose("Collecting Operation data for Telemetry."); - + if (cosmosDiagnostics == null) { throw new ArgumentNullException(nameof(cosmosDiagnostics)); } - string regionsContacted = ClientTelemetryHelper.GetContactedRegions(cosmosDiagnostics.GetContactedRegions()); + // Record Network/Replica Information + SummaryDiagnostics summaryDiagnostics = new SummaryDiagnostics(trace); + this.RecordRntbdResponses(containerId, databaseId, summaryDiagnostics.StoreResponseStatistics.Value); + string regionsContacted = ClientTelemetryHelper.GetContactedRegions(cosmosDiagnostics.GetContactedRegions()); + // Recording Request Latency and Request Charge OperationInfo payloadKey = new OperationInfo(regionsContacted: regionsContacted?.ToString(), responseSizeInBytes: responseSizeInBytes, @@ -307,10 +323,10 @@ internal void CollectOperationInfo(CosmosDiagnostics cosmosDiagnostics, try { latency.RecordValue(cosmosDiagnostics.GetClientElapsedTime().Ticks); - } + } catch (Exception ex) { - DefaultTrace.TraceError("Latency Recording Failed by Telemetry. Exception : {0}", ex.Message); + DefaultTrace.TraceError("Latency Recording Failed by Telemetry. Exception : {0}", ex); } long requestChargeToRecord = (long)(requestCharge * ClientTelemetryOptions.HistogramPrecisionFactor); @@ -320,10 +336,41 @@ internal void CollectOperationInfo(CosmosDiagnostics cosmosDiagnostics, } catch (Exception ex) { - DefaultTrace.TraceError("Request Charge Recording Failed by Telemetry. Request Charge Value : {0} Exception : {1} ", requestChargeToRecord, ex.Message); + DefaultTrace.TraceError("Request Charge Recording Failed by Telemetry. Request Charge Value : {0} Exception : {1} ", requestChargeToRecord, ex); } } + /// + /// Records RNTBD calls statistics + /// + /// + /// + /// + private void RecordRntbdResponses(string containerId, string databaseId, List storeResponseStatistics) + { + foreach (StoreResponseStatistics storetatistics in storeResponseStatistics) + { + if (ClientTelemetryOptions.IsEligible((int)storetatistics.StoreResult.StatusCode, (int)storetatistics.StoreResult.SubStatusCode, storetatistics.RequestLatency)) + { + RequestInfo requestInfo = new RequestInfo() + { + DatabaseName = databaseId, + ContainerName = containerId, + Uri = storetatistics.StoreResult.StorePhysicalAddress.ToString(), + StatusCode = (int)storetatistics.StoreResult.StatusCode, + SubStatusCode = (int)storetatistics.StoreResult.SubStatusCode, + Resource = storetatistics.RequestResourceType.ToString(), + Operation = storetatistics.RequestOperationType.ToString(), + }; + + LongConcurrentHistogram latencyHist = this.requestInfoMap.GetOrAdd(requestInfo, x => new LongConcurrentHistogram(ClientTelemetryOptions.RequestLatencyMin, + ClientTelemetryOptions.RequestLatencyMax, + ClientTelemetryOptions.RequestLatencyPrecision)); + latencyHist.RecordValue(storetatistics.RequestLatency.Ticks); + } + } + } + /// /// Record CPU and memory usage which will be sent as part of telemetry information /// @@ -349,7 +396,7 @@ private void RecordSystemUtilization() } catch (Exception ex) { - DefaultTrace.TraceError("System Usage Recording Error : {0}", ex.Message); + DefaultTrace.TraceError("System Usage Recording Error : {0} ", ex); } } @@ -427,7 +474,7 @@ await this.tokenProvider.AddAuthorizationHeaderAsync( { this.numberOfFailures++; - DefaultTrace.TraceError("Exception while sending telemetry data : {0}", ex.Message); + DefaultTrace.TraceError("Exception while sending telemetry data : {0}", ex); } finally { diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryHelper.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryHelper.cs index dca2ef6b94..2a29ef9454 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryHelper.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryHelper.cs @@ -6,15 +6,12 @@ namespace Microsoft.Azure.Cosmos.Telemetry using System; using System.Collections.Generic; using System.Linq; - using System.Net.Http; using System.Text; - using System.Threading; using System.Threading.Tasks; using HdrHistogram; using Microsoft.Azure.Cosmos.Core.Trace; using Microsoft.Azure.Cosmos.Routing; using Microsoft.Azure.Cosmos.Telemetry.Models; - using Microsoft.Azure.Documents; using Microsoft.Azure.Documents.Rntbd; internal static class ClientTelemetryHelper @@ -93,7 +90,7 @@ internal static List ToListWithMetricsInfo( OperationInfo payloadForLatency = entry.Key; payloadForLatency.MetricInfo = new MetricInfo(ClientTelemetryOptions.RequestLatencyName, ClientTelemetryOptions.RequestLatencyUnit); payloadForLatency.SetAggregators(entry.Value.latency, ClientTelemetryOptions.TicksToMsFactor); - + payloadWithMetricInformation.Add(payloadForLatency); OperationInfo payloadForRequestCharge = payloadForLatency.Copy(); @@ -103,7 +100,35 @@ internal static List ToListWithMetricsInfo( payloadWithMetricInformation.Add(payloadForRequestCharge); } - DefaultTrace.TraceInformation("Aggregating operation information to list done"); + DefaultTrace.TraceVerbose("Aggregating operation information to list done"); + + return payloadWithMetricInformation; + } + + /// + /// Convert map with request information to list of operations along with request latency and request charge metrics + /// + /// + /// Collection of ReportPayload + internal static List ToListWithMetricsInfo( + IDictionary metrics) + { + DefaultTrace.TraceVerbose("Aggregating RequestInfo information to list started"); + + List payloadWithMetricInformation = new List(); + foreach (KeyValuePair entry in metrics) + { + MetricInfo metricInfo = new MetricInfo(ClientTelemetryOptions.RequestLatencyName, ClientTelemetryOptions.RequestLatencyUnit); + metricInfo.SetAggregators(entry.Value, ClientTelemetryOptions.TicksToMsFactor); + + RequestInfo payloadForLatency = entry.Key; + payloadForLatency.Metrics.Add(metricInfo); + + payloadWithMetricInformation.Add(payloadForLatency); + } + + DefaultTrace.TraceVerbose("Aggregating RequestInfo information to list done"); return payloadWithMetricInformation; } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs index f114483b07..3b69e0c621 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs @@ -4,11 +4,11 @@ namespace Microsoft.Azure.Cosmos.Telemetry { using System; + using System.Collections.Generic; using Microsoft.Azure.Cosmos.Core.Trace; using Microsoft.Azure.Cosmos.Telemetry.Models; using Microsoft.Azure.Documents; using Newtonsoft.Json; - using Util; internal static class ClientTelemetryOptions { @@ -79,7 +79,7 @@ internal static class ClientTelemetryOptions internal const double Percentile99 = 99.0; internal const double Percentile999 = 99.9; internal const string DateFormat = "yyyy-MM-ddTHH:mm:ssZ"; - + internal const string EnvPropsClientTelemetrySchedulingInSeconds = "COSMOS.CLIENT_TELEMETRY_SCHEDULING_IN_SECONDS"; internal const string EnvPropsClientTelemetryEnabled = "COSMOS.CLIENT_TELEMETRY_ENABLED"; internal const string EnvPropsClientTelemetryVmMetadataUrl = "COSMOS.VM_METADATA_URL"; @@ -87,17 +87,20 @@ internal static class ClientTelemetryOptions internal const string EnvPropsClientTelemetryEnvironmentName = "COSMOS.ENVIRONMENT_NAME"; internal static readonly ResourceType AllowedResourceTypes = ResourceType.Document; - + // Why 5 sec? As of now, if any network request is taking more than 5 millisecond sec, we will consider it slow request this value can be revisited in future + private static readonly TimeSpan NetworkLatencyThreshold = TimeSpan.FromMilliseconds(5); internal static readonly JsonSerializerSettings JsonSerializerSettings = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, MaxDepth = 64, // https://github.com/advisories/GHSA-5crp-9r3c-p9vr }; + private static readonly List ExcludedStatusCodes = new List { 404, 409 }; + private static Uri clientTelemetryEndpoint; private static string environmentName; private static TimeSpan scheduledTimeSpan = TimeSpan.Zero; - + internal static bool IsClientTelemetryEnabled() { bool isTelemetryEnabled = ConfigurationManager @@ -175,5 +178,32 @@ internal static string GetEnvironmentName() } return environmentName; } + + /// + /// This method will return true if the request is failed with User or Server Exception and not excluded from telemetry. + /// This method will return true if the request latency is more than the threshold. + /// otherwise return false + /// + /// + /// + /// + /// true/false + internal static bool IsEligible(int statusCode, int subStatusCode, TimeSpan latencyInMs) + { + return + ClientTelemetryOptions.IsStatusCodeNotExcluded(statusCode, subStatusCode) && + (ClientTelemetryOptions.IsUserOrServerError(statusCode) || latencyInMs >= ClientTelemetryOptions.NetworkLatencyThreshold); + } + + private static bool IsUserOrServerError(int statusCode) + { + return statusCode >= 400 && statusCode <= 599; + } + + private static bool IsStatusCodeNotExcluded(int statusCode, int subStatusCode) + { + return !(ClientTelemetryOptions.ExcludedStatusCodes.Contains(statusCode) && subStatusCode == 0); + } + } } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/Models/ClientTelemetryProperties.cs b/Microsoft.Azure.Cosmos/src/Telemetry/Models/ClientTelemetryProperties.cs index 87418ac8d7..6ad08f694e 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/Models/ClientTelemetryProperties.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/Models/ClientTelemetryProperties.cs @@ -60,6 +60,9 @@ internal sealed class ClientTelemetryProperties [JsonProperty(PropertyName = "operationInfo")] internal List OperationInfo { get; set; } + [JsonProperty(PropertyName = "requestInfo")] + internal List RequestInfo { get; set; } + [JsonIgnore] internal bool IsDirectConnectionMode { get; } @@ -97,6 +100,7 @@ public ClientTelemetryProperties(string dateTimeUtc, List systemInfo, List cacheRefreshInfo, List operationInfo, + List requestInfo, string machineId) { this.DateTimeUtc = dateTimeUtc; @@ -111,6 +115,7 @@ public ClientTelemetryProperties(string dateTimeUtc, this.SystemInfo = systemInfo; this.CacheRefreshInfo = cacheRefreshInfo; this.OperationInfo = operationInfo; + this.RequestInfo = requestInfo; this.PreferredRegions = preferredRegions; this.MachineId = machineId; } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/Models/RequestInfo.cs b/Microsoft.Azure.Cosmos/src/Telemetry/Models/RequestInfo.cs new file mode 100644 index 0000000000..d71f0fa446 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Telemetry/Models/RequestInfo.cs @@ -0,0 +1,66 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Telemetry.Models +{ + using System; + using System.Collections.Generic; + using Newtonsoft.Json; + + [Serializable] + internal sealed class RequestInfo + { + [JsonProperty("uri")] + public string Uri { get; set; } + + [JsonProperty("databaseName")] + public string DatabaseName { get; set; } + + [JsonProperty("containerName")] + public string ContainerName { get; set; } + + [JsonProperty("operation")] + public string Operation { get; set; } + + [JsonProperty("resource")] + public string Resource { get; set; } + + [JsonProperty("statusCode")] + public int? StatusCode { get; set; } + + [JsonProperty("subStatusCode")] + public int SubStatusCode { get; set; } + + [JsonProperty("metricInfo")] + public List Metrics { get; set; } = new List(); + + public override int GetHashCode() + { + int hash = 3; + hash = (hash * 7) ^ (this.Uri == null ? 0 : this.Uri.GetHashCode()); + hash = (hash * 7) ^ (this.DatabaseName == null ? 0 : this.DatabaseName.GetHashCode()); + hash = (hash * 7) ^ (this.ContainerName == null ? 0 : this.ContainerName.GetHashCode()); + hash = (hash * 7) ^ (this.Operation == null ? 0 : this.Operation.GetHashCode()); + hash = (hash * 7) ^ (this.Resource == null ? 0 : this.Resource.GetHashCode()); + hash = (hash * 7) ^ (this.StatusCode == null ? 0 : this.StatusCode.GetHashCode()); + hash = (hash * 7) ^ (this.SubStatusCode.GetHashCode()); + return hash; + } + + public override bool Equals(object obj) + { + bool isequal = obj is RequestInfo payload && + ((this.Uri == null && payload.Uri == null) || (this.Uri != null && payload.Uri != null && this.Uri.Equals(payload.Uri))) && + ((this.DatabaseName == null && payload.DatabaseName == null) || (this.DatabaseName != null && payload.DatabaseName != null && this.DatabaseName.Equals(payload.DatabaseName))) && + ((this.ContainerName == null && payload.ContainerName == null) || (this.ContainerName != null && payload.ContainerName != null && this.ContainerName.Equals(payload.ContainerName))) && + ((this.Operation == null && payload.Operation == null) || (this.Operation != null && payload.Operation != null && this.Operation.Equals(payload.Operation))) && + ((this.Resource == null && payload.Resource == null) || (this.Resource != null && payload.Resource != null && this.Resource.Equals(payload.Resource))) && + ((this.StatusCode == null && payload.StatusCode == null) || (this.StatusCode != null && payload.StatusCode != null && this.StatusCode.Equals(payload.StatusCode))) && + this.SubStatusCode.Equals(payload.SubStatusCode); + + return isequal; + } + + } +} diff --git a/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs b/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs index e4e160c13a..10845f133f 100644 --- a/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs +++ b/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs @@ -477,6 +477,7 @@ public StoreResponseStatistics( public string RequestSessionToken { get; } public Uri LocationEndpoint { get; } public bool IsSupplementalResponse { get; } + public TimeSpan RequestLatency => this.RequestResponseTime - this.RequestStartTime.GetValueOrDefault(); } public readonly struct HttpResponseStatistics diff --git a/Microsoft.Azure.Cosmos/src/Tracing/TraceData/SummaryDiagnostics.cs b/Microsoft.Azure.Cosmos/src/Tracing/TraceData/SummaryDiagnostics.cs index b01ddcfb77..1838cb72c5 100644 --- a/Microsoft.Azure.Cosmos/src/Tracing/TraceData/SummaryDiagnostics.cs +++ b/Microsoft.Azure.Cosmos/src/Tracing/TraceData/SummaryDiagnostics.cs @@ -8,25 +8,31 @@ namespace Microsoft.Azure.Cosmos.Tracing.TraceData using System.Collections.Generic; using System.Globalization; using Microsoft.Azure.Cosmos.Json; + using static Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum; internal struct SummaryDiagnostics { public SummaryDiagnostics(ITrace trace) : this() { - this.DirectRequestsSummary = new Lazy>(() => - new Dictionary<(int, int), int>()); - this.GatewayRequestsSummary = new Lazy>(() => - new Dictionary<(int, int), int>()); - this.AllRegionsContacted = new Lazy>(() => new HashSet()); + this.DirectRequestsSummary + = new Lazy>(() => new Dictionary<(int, int), int>()); + this.GatewayRequestsSummary + = new Lazy>(() => new Dictionary<(int, int), int>()); + this.AllRegionsContacted + = new Lazy>(() => new HashSet()); + this.CollectSummaryFromTraceTree(trace); } + public Lazy> AllRegionsNameContacted { get; private set; } = new Lazy>(() => new HashSet()); public Lazy> AllRegionsContacted { get; private set; } + public Lazy> StoreResponseStatistics { get; private set; } = new Lazy>(() => new List()); // Count of (StatusCode, SubStatusCode) tuples public Lazy> DirectRequestsSummary { get; private set; } + public Lazy> HttpResponseStatistics { get; private set; } = new Lazy>(() => new List()); public Lazy> GatewayRequestsSummary { get; private set; } private void CollectSummaryFromTraceTree(ITrace currentTrace) @@ -49,9 +55,10 @@ private void CollectSummaryFromTraceTree(ITrace currentTrace) private void AggregateRegionsContacted(HashSet<(string, Uri)> regionsContacted) { - foreach ((string _, Uri uri) in regionsContacted) + foreach ((string name, Uri uri) in regionsContacted) { this.AllRegionsContacted.Value.Add(uri); + this.AllRegionsNameContacted.Value.Add(name); } } @@ -59,6 +66,8 @@ private void AggregateGatewayStatistics(IReadOnlyList( await this.WaitAndAssert(expectedOperationCount: 2, expectedConsistencyLevel: Microsoft.Azure.Cosmos.ConsistencyLevel.Eventual, expectedOperationRecordCountMap: expectedRecordCountInOperation, - expectedCacheSource: null); + expectedCacheSource: null, + isExpectedNetworkTelemetry: false); } [TestMethod] @@ -303,7 +302,8 @@ await container.ReadItemStreamAsync( await this.WaitAndAssert(expectedOperationCount: 2, expectedConsistencyLevel: Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix, expectedOperationRecordCountMap: expectedRecordCountInOperation, - expectedCacheSource: null); + expectedCacheSource: null, + isExpectedNetworkTelemetry: false); } [TestMethod] @@ -758,10 +758,11 @@ public async Task CreateItemWithSubStatusCodeTest(ConnectionMode mode) { { Documents.OperationType.Create.ToString(), 1} }; - + await this.WaitAndAssert(expectedOperationCount: 2, expectedOperationRecordCountMap: expectedRecordCountInOperation, - expectedSubstatuscode: 999999); + expectedSubstatuscode: 999999, + isExpectedNetworkTelemetry: false); } @@ -778,19 +779,23 @@ private async Task WaitAndAssert( IDictionary expectedOperationRecordCountMap = null, int expectedSubstatuscode = 0, bool? isAzureInstance = null, - string expectedCacheSource = "ClientCollectionCache") + string expectedCacheSource = "ClientCollectionCache", + bool isExpectedNetworkTelemetry = true) { Assert.IsNotNull(this.actualInfo, "Telemetry Information not available"); // As this feature is thread based execution so wait for the results to avoid test flakiness List localCopyOfActualInfo = null; ValueStopwatch stopwatch = ValueStopwatch.StartNew(); + HashSet cacheRefreshInfoSet = new HashSet(); do { await Task.Delay(TimeSpan.FromMilliseconds(1500)); // wait at least for 1 round of telemetry HashSet actualOperationSet = new HashSet(); + HashSet requestInfoSet = new HashSet(); + lock (this.actualInfo) { // Setting the number of unique OperationInfo irrespective of response size as response size is varying in case of queries. @@ -830,7 +835,8 @@ private async Task WaitAndAssert( List actualOperationList = new List(); List actualSystemInformation = new List(); - + List actualRequestInformation = new List(); + if (localCopyOfActualInfo[0].ConnectionMode == ConnectionMode.Direct.ToString().ToUpperInvariant()) { this.expectedMetricNameUnitMap.Add(ClientTelemetryOptions.NumberOfTcpConnectionName, ClientTelemetryOptions.NumberOfTcpConnectionUnit); @@ -840,6 +846,7 @@ private async Task WaitAndAssert( localCopyOfActualInfo: localCopyOfActualInfo, actualOperationList: actualOperationList, actualSystemInformation: actualSystemInformation, + actualRequestInformation: actualRequestInformation, isAzureInstance: isAzureInstance); ClientTelemetryTests.AssertOperationLevelInformation( @@ -858,8 +865,37 @@ private async Task WaitAndAssert( } ClientTelemetryTests.AssertSystemLevelInformation(actualSystemInformation, this.expectedMetricNameUnitMap); + if (localCopyOfActualInfo.First().ConnectionMode == ConnectionMode.Direct.ToString().ToUpperInvariant() + && isExpectedNetworkTelemetry) + { + ClientTelemetryTests.AssertNetworkLevelInformation(actualRequestInformation); + } + else + { + Assert.IsTrue(actualRequestInformation == null || actualRequestInformation.Count == 0, "Request Information is not expected in Gateway mode"); + } } - + + private static void AssertNetworkLevelInformation(List actualRequestInformation) + { + Assert.IsNotNull(actualRequestInformation); + Assert.IsTrue(actualRequestInformation.Count > 0); + + foreach(RequestInfo requestInfo in actualRequestInformation) + { + Assert.IsNotNull(requestInfo.Uri); + Assert.IsNotNull(requestInfo.DatabaseName); + Assert.IsNotNull(requestInfo.ContainerName); + Assert.IsNotNull(requestInfo.Operation); + Assert.IsNotNull(requestInfo.Resource); + Assert.IsNotNull(requestInfo.StatusCode); + Assert.AreNotEqual(0, requestInfo.StatusCode); + Assert.IsNotNull(requestInfo.SubStatusCode); + + Assert.IsNotNull(requestInfo.Metrics, "MetricInfo is null"); + } + } + private static void AssertSystemLevelInformation(List actualSystemInformation, IDictionary expectedMetricNameUnitMap) { IDictionary actualMetricNameUnitMap = new Dictionary(); @@ -903,12 +939,12 @@ private static void AssertOperationLevelInformation( int expectedSubstatuscode = 0) { IDictionary actualOperationRecordCountMap = new Dictionary(); - // Asserting If operation list is as expected foreach (OperationInfo operation in actualOperationList) { Assert.IsNotNull(operation.Operation, "Operation Type is null"); Assert.IsNotNull(operation.Resource, "Resource Type is null"); + Assert.AreEqual(expectedSubstatuscode, operation.SubStatusCode); Assert.AreEqual(expectedConsistencyLevel?.ToString(), operation.Consistency, $"Consistency is not {expectedConsistencyLevel}"); @@ -944,6 +980,7 @@ private static void AssertAccountLevelInformation( List localCopyOfActualInfo, List actualOperationList, List actualSystemInformation, + List actualRequestInformation, bool? isAzureInstance) { ISet machineId = new HashSet(); @@ -953,6 +990,7 @@ private static void AssertAccountLevelInformation( { actualOperationList.AddRange(telemetryInfo.OperationInfo); actualSystemInformation.AddRange(telemetryInfo.SystemInfo); + actualRequestInformation.AddRange(telemetryInfo.RequestInfo); if (telemetryInfo.ConnectionMode == ConnectionMode.Direct.ToString().ToUpperInvariant()) { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientTelemetryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientTelemetryTests.cs index 3bbbd1d3ac..b7e5d1f08e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientTelemetryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientTelemetryTests.cs @@ -30,13 +30,13 @@ public void CheckMetricsAggregationLogic() MetricInfo metrics = new MetricInfo("metricsName", "unitName"); LongConcurrentHistogram histogram = new LongConcurrentHistogram(1, - Int64.MaxValue, + long.MaxValue, 5); - histogram.RecordValue((long)10); - histogram.RecordValue((long)20); - histogram.RecordValue((long)30); - histogram.RecordValue((long)40); + histogram.RecordValue(10); + histogram.RecordValue(20); + histogram.RecordValue(30); + histogram.RecordValue(40); metrics.SetAggregators(histogram); @@ -58,14 +58,14 @@ public void CheckMetricsAggregationLogicWithAdjustment() MetricInfo metrics = new MetricInfo("metricsName", "unitName"); long adjustmentFactor = 1000; - LongConcurrentHistogram histogram = new LongConcurrentHistogram(1, - Int64.MaxValue, - 5); + LongConcurrentHistogram histogram = new LongConcurrentHistogram(1, + long.MaxValue, + 5); - histogram.RecordValue((long)(10 * adjustmentFactor)); - histogram.RecordValue((long)(20 * adjustmentFactor)); - histogram.RecordValue((long)(30 * adjustmentFactor)); - histogram.RecordValue((long)(40 * adjustmentFactor)); + histogram.RecordValue(10 * adjustmentFactor); + histogram.RecordValue(20 * adjustmentFactor); + histogram.RecordValue(30 * adjustmentFactor); + histogram.RecordValue(40 * adjustmentFactor); metrics.SetAggregators(histogram, adjustmentFactor); @@ -85,11 +85,11 @@ public void CheckMetricsAggregationLogicWithAdjustment() [TestMethod] public void CheckJsonSerializerContract() { - string json = JsonConvert.SerializeObject(new ClientTelemetryProperties(clientId: "clientId", - processId: "", - userAgent: null, - connectionMode: ConnectionMode.Direct, - preferredRegions: null, + string json = JsonConvert.SerializeObject(new ClientTelemetryProperties(clientId: "clientId", + processId: "", + userAgent: null, + connectionMode: ConnectionMode.Direct, + preferredRegions: null, aggregationIntervalInSec: 10), ClientTelemetryOptions.JsonSerializerSettings); Assert.AreEqual("{\"clientId\":\"clientId\",\"processId\":\"\",\"connectionMode\":\"DIRECT\",\"aggregationIntervalInSec\":10,\"systemInfo\":[]}", json); } @@ -101,21 +101,34 @@ public void CheckJsonSerializerContractWithPreferredRegions() { "region1" }; - string json = JsonConvert.SerializeObject(new ClientTelemetryProperties(clientId: "clientId", - processId: "", - userAgent: null, - connectionMode: ConnectionMode.Direct, + string json = JsonConvert.SerializeObject(new ClientTelemetryProperties(clientId: "clientId", + processId: "", + userAgent: null, + connectionMode: ConnectionMode.Direct, preferredRegions: preferredRegion, aggregationIntervalInSec: 1), ClientTelemetryOptions.JsonSerializerSettings); Assert.AreEqual("{\"clientId\":\"clientId\",\"processId\":\"\",\"connectionMode\":\"DIRECT\",\"preferredRegions\":[\"region1\"],\"aggregationIntervalInSec\":1,\"systemInfo\":[]}", json); } [TestMethod] - [ExpectedException(typeof(System.FormatException))] + [ExpectedException(typeof(FormatException))] public void CheckMisconfiguredTelemetry_should_fail() { Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, "non-boolean"); using CosmosClient client = MockCosmosUtil.CreateMockCosmosClient(); } + + [TestMethod] + [DataRow(200, 0 ,1, false)] + [DataRow(404, 0, 1, false)] + [DataRow(404, 1002, 1, true)] + [DataRow(409, 0, 1, false)] + [DataRow(409, 1002, 1, true)] + [DataRow(503, 2001, 1, true)] + [DataRow(200, 0, 6, true)] + public void CheckEligibleStatistics(int statusCode, int subStatusCode, int latencyInMs, bool expectedFlag) + { + Assert.AreEqual(expectedFlag, ClientTelemetryOptions.IsEligible(statusCode, subStatusCode, TimeSpan.FromMilliseconds(latencyInMs))); + } } } From 0088c2f8e4f8562c03f06ff852337b6aeca7d75c Mon Sep 17 00:00:00 2001 From: SaurabhSharma-MSFT <38112130+SaurabhSharma-MSFT@users.noreply.github.com> Date: Tue, 28 Feb 2023 19:31:29 -0800 Subject: [PATCH 063/240] Documentation: Fixes Database.ReadAsync description (#3457) * Documentation: Modify retry time to timespan Modify retry time in seconds to timespan of parameter maxRetryWaitTimeOnThrottledRequests (Method: [WithThrottlingRetryOptions](https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.cosmos.fluent.cosmosclientbuilder.withthrottlingretryoptions?view=azure-dotnet#feedback)) Resolves https://github.com/Azure/azure-sdk-for-net/issues/29567 * Documentation: Fixes DeleteItemAsync Example Documentation: Fixes DeleteItemAsync Example * Documentation: Fixes ItemRequestOptions Example Documentation: Fixes ItemRequestOptions Example * Documentation:Update Database.ReadAsync description Documentation: Update Database.ReadAsync description * Documentation: Update Database.ReadAsync description Documentation: Update Database.ReadAsync description * Documentation: Updated ToStreamIterator example Documentation: Updated ToStreamIterator example * Modified StreamIterator section * Update Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs Co-authored-by: Matias Quaranta * Remarks correction * Revert the StreamIterator changes Revert the StreamIterator changes Co-authored-by: Matias Quaranta Co-authored-by: Kiran Kumar Kolli --- Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs | 2 +- Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs b/Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs index baddf0fe31..dc86de0cb6 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs @@ -186,7 +186,7 @@ public static FeedIterator ToFeedIterator(this IQueryable query) /// /// linqQueryable = this.Container.GetItemLinqQueryable(); - /// using (FeedIterator setIterator = linqQueryable.Where(item => (item.taskNum < 100)).ToFeedIterator() + /// using (FeedIterator setIterator = linqQueryable.Where(item => (item.taskNum < 100)).ToStreamIterator()) /// ]]> /// /// diff --git a/Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs b/Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs index a59dcb8be9..8a62f9ec56 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Database/Database.cs @@ -31,8 +31,8 @@ public abstract class Database /// public abstract CosmosClient Client { get; } - /// - /// Reads a from the Azure Cosmos service as an asynchronous operation. + /// + /// Reads a from the Azure Cosmos service as an asynchronous operation. /// /// (Optional) The options for the request. /// (Optional) representing request cancellation. @@ -40,6 +40,9 @@ public abstract class Database /// A containing a which wraps a containing the read resource record. /// /// https://aka.ms/cosmosdb-dot-net-exceptions + /// + /// contains the that include the resource information. + /// /// /// /// Date: Wed, 1 Mar 2023 08:02:15 -0800 Subject: [PATCH 064/240] Upgrade Resiliency: Adds Implementation for Validating the Unhealthy Backend Replicas in Direct mode (#3631) * Code changes to implement replica validation in dotnet v3 sdk. * Cosmetic changes to add inline code comments. * Code chages to address review comments. * Code changes to cover a scenario for async cache. * Code changes to refactor async non-blocking cache code. * Code changes to address minor review comments. --------- Co-authored-by: Kiran Kumar Kolli --- .../src/Routing/AsyncCacheNonBlocking.cs | 93 +++- .../src/Routing/GatewayAddressCache.cs | 154 +++++++ .../GatewayAddressCacheTests.cs | 433 +++++++++++++++++- .../Routing/AsyncCacheNonBlockingTests.cs | 145 ++++++ .../Utils/ReflectionUtils.cs | 43 ++ docs/ReplicaValidationDesign.md | 338 ++++++++++++++ 6 files changed, 1180 insertions(+), 26 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Utils/ReflectionUtils.cs create mode 100644 docs/ReplicaValidationDesign.md diff --git a/Microsoft.Azure.Cosmos/src/Routing/AsyncCacheNonBlocking.cs b/Microsoft.Azure.Cosmos/src/Routing/AsyncCacheNonBlocking.cs index 2b1f82ea3a..9fb908d83f 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/AsyncCacheNonBlocking.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/AsyncCacheNonBlocking.cs @@ -120,30 +120,11 @@ public async Task GetAsync( throw; } - try - { - return await initialLazyValue.CreateAndWaitForBackgroundRefreshTaskAsync( - createRefreshTask: singleValueInitFunc); - } - catch (Exception e) - { - if (initialLazyValue.ShouldRemoveFromCacheThreadSafe()) - { - DefaultTrace.TraceError( - "AsyncCacheNonBlocking.GetAsync with ForceRefresh Failed. key: {0}, Exception: {1}", - key, - e); - - // In some scenarios when a background failure occurs like a 404 - // the initial cache value should be removed. - if (this.removeFromCacheOnBackgroundRefreshException(e)) - { - this.TryRemove(key); - } - } - - throw; - } + return await this.UpdateCacheAndGetValueFromBackgroundTaskAsync( + key: key, + initialValue: initialLazyValue, + callbackDelegate: singleValueInitFunc, + operationName: nameof(GetAsync)); } // The AsyncLazyWithRefreshTask is lazy and won't create the task until GetValue is called. @@ -196,6 +177,70 @@ public bool TryRemove(TKey key) return this.values.TryRemove(key, out _); } + /// + /// Refreshes the async non blocking cache on-demand for the given + /// and caches the result for later usage. + /// + /// The requested key to be refreshed. + /// A func delegate to be invoked at a later point of time. + public async Task RefreshAsync( + TKey key, + Func> singleValueInitFunc) + { + if (this.values.TryGetValue(key, out AsyncLazyWithRefreshTask initialLazyValue)) + { + await this.UpdateCacheAndGetValueFromBackgroundTaskAsync( + key: key, + initialValue: initialLazyValue, + callbackDelegate: singleValueInitFunc, + operationName: nameof(RefreshAsync)); + } + } + + /// + /// Creates a background task to invoke the callback delegate and updates the cache with the value returned from the delegate. + /// + /// The requested key to be updated. + /// An instance of containing the initial cached value. + /// A func callback delegate to be invoked at a later point of time. + /// A string indicating the operation on the cache. + /// A containing the updated, refreshed value. + private async Task UpdateCacheAndGetValueFromBackgroundTaskAsync( + TKey key, + AsyncLazyWithRefreshTask initialValue, + Func> callbackDelegate, + string operationName) + { + try + { + return await initialValue.CreateAndWaitForBackgroundRefreshTaskAsync( + createRefreshTask: callbackDelegate); + } + catch (Exception ex) + { + if (initialValue.ShouldRemoveFromCacheThreadSafe()) + { + bool removed = false; + + // In some scenarios when a background failure occurs like a 404 + // the initial cache value should be removed. + if (this.removeFromCacheOnBackgroundRefreshException(ex)) + { + removed = this.TryRemove(key); + } + + DefaultTrace.TraceError( + "AsyncCacheNonBlocking Failed. key: {0}, operation: {1}, tryRemoved: {2}, Exception: {3}", + key, + operationName, + removed, + ex); + } + + throw; + } + } + /// /// This is AsyncLazy that has an additional Task that can /// be used to update the value. This allows concurrent requests diff --git a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs index 7c6355591e..b577443761 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs @@ -46,6 +46,7 @@ internal class GatewayAddressCache : IAddressCache, IDisposable private readonly bool enableTcpConnectionEndpointRediscovery; private readonly CosmosHttpClient httpClient; + private readonly bool isReplicaAddressValidationEnabled; private Tuple masterPartitionAddressCache; private DateTime suboptimalMasterPartitionTimestamp; @@ -84,10 +85,27 @@ public GatewayAddressCache( GatewayAddressCache.ProtocolString(this.protocol)); this.openConnectionsHandler = openConnectionsHandler; + this.isReplicaAddressValidationEnabled = Helpers.GetEnvironmentVariableAsBool( + name: Constants.EnvironmentVariables.ReplicaConnectivityValidationEnabled, + defaultValue: false); } public Uri ServiceEndpoint => this.serviceEndpoint; + /// + /// Gets the address information from the gateway and sets them into the async non blocking cache for later lookup. + /// Additionally attempts to establish Rntbd connections to the backend replicas based on `shouldOpenRntbdChannels` + /// boolean flag. + /// + /// A string containing the database name. + /// An instance of containing the collection properties. + /// A read only list containing the partition key range identities. + /// A boolean flag indicating whether Rntbd connections are required to be established + /// to the backend replica nodes. For cosmos client initialization and cache warmups, the Rntbd connection are needed to be + /// openned deterministically to the backend replicas to reduce latency, thus the + /// should be set to `true` during cosmos client initialization and cache warmups. The OpenAsync flow from DocumentClient + /// doesn't require the connections to be opened deterministically thus should set the parameter to `false`. + /// An instance of . public async Task OpenConnectionsAsync( string databaseName, ContainerProperties collection, @@ -161,6 +179,10 @@ public async Task OpenConnectionsAsync( new PartitionKeyRangeIdentity(collection.ResourceId, addressInfo.Item1.PartitionKeyRangeId), addressInfo.Item2); + // The `shouldOpenRntbdChannels` boolean flag indicates whether the SDK should establish Rntbd connections to the + // backend replica nodes. For the `CosmosClient.CreateAndInitializeAsync()` flow, the flag should be passed as + // `true` so that the Rntbd connections to the backend replicas could be established deterministically. For any + // other flow, the flag should be passed as `false`. if (this.openConnectionsHandler != null && shouldOpenRntbdChannels) { await this.openConnectionsHandler @@ -178,6 +200,7 @@ public void SetOpenConnectionsHandler(IOpenConnectionsHandler openConnectionsHan this.openConnectionsHandler = openConnectionsHandler; } + /// public async Task TryGetAddressesAsync( DocumentServiceRequest request, PartitionKeyRangeIdentity partitionKeyRangeIdentity, @@ -229,6 +252,7 @@ public async Task TryGetAddressesAsync( return this.GetAddressesForRangeIdAsync( request, + cachedAddresses: currentCachedValue, partitionKeyRangeIdentity.CollectionRid, partitionKeyRangeIdentity.PartitionKeyRangeId, forceRefresh: forceRefreshPartitionAddresses); @@ -259,6 +283,7 @@ public async Task TryGetAddressesAsync( key: partitionKeyRangeIdentity, singleValueInitFunc: (_) => this.GetAddressesForRangeIdAsync( request, + cachedAddresses: null, partitionKeyRangeIdentity.CollectionRid, partitionKeyRangeIdentity.PartitionKeyRangeId, forceRefresh: false), @@ -278,6 +303,27 @@ public async Task TryGetAddressesAsync( this.suboptimalServerPartitionTimestamps.TryAdd(partitionKeyRangeIdentity, DateTime.UtcNow); } + // Refresh the cache on-demand, if there were some address that remained as unhealthy long enough (more than 1 minute) + // and need to revalidate its status. The reason it is not dependent on 410 to force refresh the addresses, is being: + // When an address is marked as unhealthy, then the address enumerator will deprioritize it and move it back to the + // end of the transport uris list. Therefore, it could happen that no request will land on the unhealthy address for + // an extended period of time therefore, the chances of 410 (Gone Exception) to trigger the forceRefresh workflow may + // not happen for that particular replica. + if (addresses + .Get(Protocol.Tcp) + .ReplicaTransportAddressUris + .Any(x => x.ShouldRefreshHealthStatus())) + { + Task refreshAddressesInBackgroundTask = Task.Run(async () => await this.serverPartitionAddressCache.RefreshAsync( + key: partitionKeyRangeIdentity, + singleValueInitFunc: (currentCachedValue) => this.GetAddressesForRangeIdAsync( + request, + cachedAddresses: currentCachedValue, + partitionKeyRangeIdentity.CollectionRid, + partitionKeyRangeIdentity.PartitionKeyRangeId, + forceRefresh: true))); + } + return addresses; } catch (DocumentClientException ex) @@ -384,6 +430,7 @@ public async Task UpdateAsync( key: partitionKeyRangeIdentity, singleValueInitFunc: (_) => this.GetAddressesForRangeIdAsync( null, + cachedAddresses: null, partitionKeyRangeIdentity.CollectionRid, partitionKeyRangeIdentity.PartitionKeyRangeId, forceRefresh: true), @@ -444,6 +491,7 @@ private async Task private async Task GetAddressesForRangeIdAsync( DocumentServiceRequest request, + PartitionAddressInformation cachedAddresses, string collectionRid, string partitionKeyRangeId, bool forceRefresh) @@ -475,6 +523,32 @@ await this.GetServerAddressesViaGatewayAsync(request, collectionRid, new[] { par throw new PartitionKeyRangeGoneException(errorMessage) { ResourceAddress = collectionRid }; } + if (this.isReplicaAddressValidationEnabled) + { + // The purpose of this step is to merge the new transport addresses with the old one. What this means is - + // 1. If a newly returned address from gateway is already a part of the cache, then restore the health state + // of the new address with that of the cached one. + // 2. If a newly returned address from gateway doesn't exist in the cache, then keep using the new address + // with `Unknown` (initial) status. + PartitionAddressInformation mergedAddresses = GatewayAddressCache.MergeAddresses(result.Item2, cachedAddresses); + IReadOnlyList transportAddressUris = mergedAddresses.Get(Protocol.Tcp)?.ReplicaTransportAddressUris; + + // If cachedAddresses are null, that would mean that the returned address from gateway would remain in Unknown + // status and there is no cached state that could transition them into Unhealthy. + if (cachedAddresses != null) + { + foreach (TransportAddressUri address in transportAddressUris) + { + // The main purpose for this step is to move address health status from Unhealthy to UnhealthyPending. + address.SetRefreshedIfUnhealthy(); + } + } + + this.ValidateUnhealthyPendingReplicas(transportAddressUris); + + return mergedAddresses; + } + return result.Item2; } } @@ -760,6 +834,86 @@ await this.GetServerAddressesViaGatewayAsync( } } + /// + /// Validates the unhealthy pending replicas by attempting to open the Rntbd connection. This operation + /// will eventually marks the unhealthy pending replicas to healthy, if the rntbd connection attempt made was + /// successful or unhealthy otherwise. + /// + /// A read-only list of needs to be validated. + private void ValidateUnhealthyPendingReplicas( + IReadOnlyList addresses) + { + if (addresses == null) + { + throw new ArgumentNullException(nameof(addresses)); + } + + IEnumerable addressesNeedToValidation = addresses + .Where(address => address + .GetCurrentHealthState() + .GetHealthStatus() == TransportAddressHealthState.HealthStatus.UnhealthyPending); + + if (addressesNeedToValidation.Any()) + { + Task openConnectionsInBackgroundTask = Task.Run(async () => await this.openConnectionsHandler.TryOpenRntbdChannelsAsync( + addresses: addressesNeedToValidation.ToList())); + } + } + + /// + /// Merge the new addresses returned from gateway service with that of the cached addresses. If the returned + /// new addresses list contains some of the addresses, which are already cached, then reset the health state + /// of the new address to that of the cached one. If the the new addresses doesn't contain any of the cached + /// addresses, then keep using the health state of the new addresses, which should be `unknown`. + /// + /// A list of containing the latest + /// addresses being returned from gateway. + /// A list of containing the cached + /// addresses from the async non blocking cache. + /// A list of containing the merged addresses. + private static PartitionAddressInformation MergeAddresses( + PartitionAddressInformation newAddresses, + PartitionAddressInformation cachedAddresses) + { + if (newAddresses == null) + { + throw new ArgumentNullException(nameof(newAddresses)); + } + + if (cachedAddresses == null) + { + return newAddresses; + } + + PerProtocolPartitionAddressInformation currentAddressInfo = newAddresses.Get(Protocol.Tcp); + PerProtocolPartitionAddressInformation cachedAddressInfo = cachedAddresses.Get(Protocol.Tcp); + Dictionary cachedAddressDict = new (); + + foreach (TransportAddressUri transportAddressUri in cachedAddressInfo.ReplicaTransportAddressUris) + { + cachedAddressDict[transportAddressUri.ToString()] = transportAddressUri; + } + + foreach (TransportAddressUri transportAddressUri in currentAddressInfo.ReplicaTransportAddressUris) + { + if (cachedAddressDict.ContainsKey(transportAddressUri.ToString())) + { + TransportAddressUri cachedTransportAddressUri = cachedAddressDict[transportAddressUri.ToString()]; + transportAddressUri.ResetHealthStatus( + status: cachedTransportAddressUri.GetCurrentHealthState().GetHealthStatus(), + lastUnknownTimestamp: cachedTransportAddressUri.GetCurrentHealthState().GetLastKnownTimestampByHealthStatus( + healthStatus: TransportAddressHealthState.HealthStatus.Unknown), + lastUnhealthyPendingTimestamp: cachedTransportAddressUri.GetCurrentHealthState().GetLastKnownTimestampByHealthStatus( + healthStatus: TransportAddressHealthState.HealthStatus.UnhealthyPending), + lastUnhealthyTimestamp: cachedTransportAddressUri.GetCurrentHealthState().GetLastKnownTimestampByHealthStatus( + healthStatus: TransportAddressHealthState.HealthStatus.Unhealthy)); + + } + } + + return newAddresses; + } + protected virtual void Dispose(bool disposing) { if (this.disposedValue) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs index 3954b4ae8f..9e3b87ec83 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs @@ -6,16 +6,15 @@ namespace Microsoft.Azure.Cosmos using System; using System.Collections.Generic; using System.Collections.ObjectModel; - using System.Collections.Specialized; using System.Linq; using System.Net; using System.Net.Http; + using System.Reflection; using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Common; using Microsoft.Azure.Cosmos.Routing; - using Microsoft.Azure.Cosmos.Serialization.HybridRow; using Microsoft.Azure.Cosmos.Tests; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; @@ -872,6 +871,436 @@ await cache.OpenConnectionsAsync( expectedSuccessCount: addresses.Count); } + /// + /// Test to validate that when replica validation is enabled and force address refresh happens to fetch the latest address from gateway, + /// if in case the gateway returns the same address which was previously unhealthy, the gateway address cache resets the returned status + /// to unhealthy and validates that replica using the open connection handler and finally marks it to connected. + /// + [TestMethod] + [Owner("dkunda")] + public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabled_ShouldValidateUnhealthyReplicasHealth() + { + // Arrange. + ManualResetEvent manualResetEvent = new(initialState: false); + Mock mockHttpHandler = new (MockBehavior.Strict); + string oldAddress = "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/4s"; + string newAddress = "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/5s"; + string addressTobeMarkedUnhealthy = "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/2s"; + mockHttpHandler.SetupSequence(x => x.SendAsync( + It.IsAny(), + It.IsAny())) + .Returns(MockCosmosUtil.CreateHttpResponseOfAddresses(new List() + { + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/1p", + addressTobeMarkedUnhealthy, + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/3s", + oldAddress, + })) + .Returns(MockCosmosUtil.CreateHttpResponseOfAddresses(new List() + { + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/1p", + addressTobeMarkedUnhealthy, + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/3s", + newAddress, + })); + + FakeOpenConnectionHandler fakeOpenConnectionHandler = new ( + failingIndexes: new HashSet(), + manualResetEvent: manualResetEvent); + + HttpClient httpClient = new (new HttpHandlerHelper(mockHttpHandler.Object)); + GatewayAddressCache cache = new ( + new Uri(GatewayAddressCacheTests.DatabaseAccountApiEndpoint), + Documents.Client.Protocol.Tcp, + this.mockTokenProvider.Object, + this.mockServiceConfigReader.Object, + MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), + openConnectionsHandler: fakeOpenConnectionHandler, + suboptimalPartitionForceRefreshIntervalInSeconds: 2, + enableTcpConnectionEndpointRediscovery: true); + + // By default, the replica validation feature is disabled in GatewayAddressCache. Reflection is used to enable the feature + // for the purpose of this test. + FieldInfo fieldInfo = cache + .GetType() + .GetField( + name: "isReplicaAddressValidationEnabled", + bindingAttr: BindingFlags.Instance | BindingFlags.NonPublic); + + fieldInfo.SetValue( + obj: cache, + value: true); + + DocumentServiceRequest request = DocumentServiceRequest.Create(OperationType.Invalid, ResourceType.Address, AuthorizationTokenType.Invalid); + + // Act and Assert. + PartitionAddressInformation addressInfo = await cache.TryGetAddressesAsync( + request: request, + partitionKeyRangeIdentity: this.testPartitionKeyRangeIdentity, + serviceIdentity: this.serviceIdentity, + forceRefreshPartitionAddresses: false, + cancellationToken: CancellationToken.None); + + TransportAddressUri refreshedUri = addressInfo + .Get(Documents.Client.Protocol.Tcp)? + .ReplicaTransportAddressUris + .Single(x => x.ToString().Equals(addressTobeMarkedUnhealthy)); + + Assert.IsNotNull(refreshedUri); + Assert.AreEqual( + expected: TransportAddressHealthState.HealthStatus.Unknown, + actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); + + Assert.AreEqual(4, addressInfo.AllAddresses.Count); + Assert.AreEqual(1, addressInfo.AllAddresses.Count(x => x.PhysicalUri == oldAddress)); + Assert.AreEqual(0, addressInfo.AllAddresses.Count(x => x.PhysicalUri == newAddress)); + + // Because force refresh is requested, an unhealthy replica is added to the failed endpoint so that it's status could be validted. + request.RequestContext.FailedEndpoints.Value.Add( + new TransportAddressUri( + addressUri: new Uri( + uriString: addressTobeMarkedUnhealthy))); + + addressInfo = await cache.TryGetAddressesAsync( + request: request, + partitionKeyRangeIdentity: this.testPartitionKeyRangeIdentity, + serviceIdentity: this.serviceIdentity, + forceRefreshPartitionAddresses: true, + cancellationToken: CancellationToken.None); + + Assert.AreEqual(4, addressInfo.AllAddresses.Count); + Assert.AreEqual(0, addressInfo.AllAddresses.Count(x => x.PhysicalUri == oldAddress)); + Assert.AreEqual(1, addressInfo.AllAddresses.Count(x => x.PhysicalUri == newAddress)); + + // Waits until a completion signal from the background task is received. + GatewayAddressCacheTests.WaitForManualResetEventSignal( + manualResetEvent: manualResetEvent, + shouldReset: false); + + refreshedUri = addressInfo + .Get(Documents.Client.Protocol.Tcp)? + .ReplicaTransportAddressUris + .Single(x => x.ToString().Equals(addressTobeMarkedUnhealthy)); + + Assert.IsNotNull(refreshedUri); + Assert.AreEqual( + expected: TransportAddressHealthState.HealthStatus.Connected, + actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); + + mockHttpHandler.VerifyAll(); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedExceptionCount: 0, + expectedMethodInvocationCount: 1, + expectedReceivedAddressesCount: 1, + expectedSuccessCount: 1); + } + + /// + /// Test to validate that when replica validation is enabled and there exists a replica such that it remained unhealthy for a period of one minute or + /// more, then even though a force refresh is not requested, the unhealthy replicas at least get a chance to re-validate it's status by the + /// on-demand async non-blocking cache refresh flow and eventually marks itself as healthy once the open connection attempt is successful. + /// + [TestMethod] + [Owner("dkunda")] + public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUriExistsForOneMinute_ShouldForceRefreshUnhealthyReplicas() + { + // Arrange. + ManualResetEvent manualResetEvent = new (initialState: false); + Mock mockHttpHandler = new(MockBehavior.Strict); + string oldAddress = "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/4s"; + string newAddress = "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/5s"; + string addressTobeMarkedUnhealthy = "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/2s"; + mockHttpHandler.SetupSequence(x => x.SendAsync( + It.IsAny(), + It.IsAny())) + .Returns(MockCosmosUtil.CreateHttpResponseOfAddresses(new List() + { + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/1p", + addressTobeMarkedUnhealthy, + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/3s", + oldAddress, + })) + .Returns(MockCosmosUtil.CreateHttpResponseOfAddresses(new List() + { + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/1p", + addressTobeMarkedUnhealthy, + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/3s", + newAddress, + })) + .Returns(MockCosmosUtil.CreateHttpResponseOfAddresses(new List() + { + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/1p", + addressTobeMarkedUnhealthy, + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/3s", + newAddress, + })); + + FakeOpenConnectionHandler fakeOpenConnectionHandler = new ( + failIndexesByAttempts: new Dictionary>() + { + { 0, new HashSet() { 0 } } + }, + manualResetEvent: manualResetEvent); + + HttpClient httpClient = new (new HttpHandlerHelper(mockHttpHandler.Object)); + GatewayAddressCache cache = new ( + new Uri(GatewayAddressCacheTests.DatabaseAccountApiEndpoint), + Documents.Client.Protocol.Tcp, + this.mockTokenProvider.Object, + this.mockServiceConfigReader.Object, + MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), + openConnectionsHandler: fakeOpenConnectionHandler, + suboptimalPartitionForceRefreshIntervalInSeconds: 2, + enableTcpConnectionEndpointRediscovery: true); + + // By default, the replica validation feature is disabled in GatewayAddressCache. Reflection is used to enable the feature + // for the purpose of this test. + FieldInfo fieldInfo = cache + .GetType() + .GetField( + name: "isReplicaAddressValidationEnabled", + bindingAttr: BindingFlags.Instance | BindingFlags.NonPublic); + + fieldInfo.SetValue( + obj: cache, + value: true); + + DocumentServiceRequest request = DocumentServiceRequest.Create(OperationType.Invalid, ResourceType.Address, AuthorizationTokenType.Invalid); + + // Act and Assert. + PartitionAddressInformation addressInfo = await cache.TryGetAddressesAsync( + request: request, + partitionKeyRangeIdentity: this.testPartitionKeyRangeIdentity, + serviceIdentity: this.serviceIdentity, + forceRefreshPartitionAddresses: false, + cancellationToken: CancellationToken.None); + + TransportAddressUri refreshedUri = addressInfo + .Get(Documents.Client.Protocol.Tcp)? + .ReplicaTransportAddressUris + .Single(x => x.ToString().Equals(addressTobeMarkedUnhealthy)); + + Assert.IsNotNull(refreshedUri); + Assert.AreEqual( + expected: TransportAddressHealthState.HealthStatus.Unknown, + actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); + + Assert.AreEqual(4, addressInfo.AllAddresses.Count); + Assert.AreEqual(1, addressInfo.AllAddresses.Count(x => x.PhysicalUri == oldAddress)); + Assert.AreEqual(0, addressInfo.AllAddresses.Count(x => x.PhysicalUri == newAddress)); + + // Because force refresh is requested, an unhealthy replica is added to the failed endpoint so that it's health status could be validted. + request.RequestContext.FailedEndpoints.Value.Add( + new TransportAddressUri( + addressUri: new Uri( + uriString: addressTobeMarkedUnhealthy))); + + addressInfo = await cache.TryGetAddressesAsync( + request: request, + partitionKeyRangeIdentity: this.testPartitionKeyRangeIdentity, + serviceIdentity: this.serviceIdentity, + forceRefreshPartitionAddresses: true, + cancellationToken: CancellationToken.None); + + Assert.AreEqual(4, addressInfo.AllAddresses.Count); + Assert.AreEqual(0, addressInfo.AllAddresses.Count(x => x.PhysicalUri == oldAddress)); + Assert.AreEqual(1, addressInfo.AllAddresses.Count(x => x.PhysicalUri == newAddress)); + + // Waits until a completion signal from the background task is received. + GatewayAddressCacheTests.WaitForManualResetEventSignal( + manualResetEvent: manualResetEvent, + shouldReset: true); + + // During the replica validation flow, the connection attempt was not successful thus the replica + // was marked unhealthy. + refreshedUri = addressInfo + .Get(Documents.Client.Protocol.Tcp)? + .ReplicaTransportAddressUris + .Single(x => x.ToString().Equals(addressTobeMarkedUnhealthy)); + + Assert.IsNotNull(refreshedUri); + Assert.AreEqual( + expected: TransportAddressHealthState.HealthStatus.Unhealthy, + actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); + + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedExceptionCount: 1, + expectedMethodInvocationCount: 1, + expectedReceivedAddressesCount: 1, + expectedSuccessCount: 0); + + // A delay of 2 minute was added to make the replica unhealthy for more than one minute. This + // will make sure the unhealthy replica gets a chance to re-validate it's health status. + ReflectionUtils.AddMinuteToDateTimeFieldUsingReflection( + objectName: refreshedUri.GetCurrentHealthState(), + fieldName: "lastUnhealthyTimestamp", + delayInMinutes: -2); + + addressInfo = await cache.TryGetAddressesAsync( + request: request, + partitionKeyRangeIdentity: this.testPartitionKeyRangeIdentity, + serviceIdentity: this.serviceIdentity, + forceRefreshPartitionAddresses: false, + cancellationToken: CancellationToken.None); + + // Waits until a completion signal from the background task is received. + GatewayAddressCacheTests.WaitForManualResetEventSignal( + manualResetEvent: manualResetEvent, + shouldReset: false); + + Assert.AreEqual(4, addressInfo.AllAddresses.Count); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedExceptionCount: 1, + expectedMethodInvocationCount: 2, + expectedReceivedAddressesCount: 1, + expectedSuccessCount: 1); + + addressInfo = await cache.TryGetAddressesAsync( + request: request, + partitionKeyRangeIdentity: this.testPartitionKeyRangeIdentity, + serviceIdentity: this.serviceIdentity, + forceRefreshPartitionAddresses: false, + cancellationToken: CancellationToken.None); + + refreshedUri = addressInfo + .Get(Documents.Client.Protocol.Tcp)? + .ReplicaTransportAddressUris + .Single(x => x.ToString().Equals(addressTobeMarkedUnhealthy)); + + // Because the open connection attempt to the unhealthy replica was successful, the replica was + // marked as healthy. + mockHttpHandler.VerifyAll(); + Assert.AreEqual(4, addressInfo.AllAddresses.Count); + Assert.IsNotNull(refreshedUri); + Assert.AreEqual( + expected: TransportAddressHealthState.HealthStatus.Connected, + actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); + + // This assertion makes sure that no additional calls were made to the open connection handler after + // since the last address refresh, because all the replicas are now either Unknown or Connected. + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedExceptionCount: 1, + expectedMethodInvocationCount: 2, + expectedReceivedAddressesCount: 1, + expectedSuccessCount: 1); + } + + /// + /// Test to validate that when replica validation is disabled and there exists some unhealthy replicas, the gateway address + /// cache doesn't validate the health state of the unhealthy replicas. + /// + [TestMethod] + [Owner("dkunda")] + public async Task TryGetAddressesAsync_WhenReplicaVlidationDisabled_ShouldNotValidateUnhealthyReplicas() + { + // Arrange. + Mock mockHttpHandler = new(MockBehavior.Strict); + string oldAddress = "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/4s"; + string newAddress = "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/5s"; + string addressTobeMarkedUnhealthy = "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/2s"; + mockHttpHandler.SetupSequence(x => x.SendAsync( + It.IsAny(), + It.IsAny())) + .Returns(MockCosmosUtil.CreateHttpResponseOfAddresses(new List() + { + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/1p", + addressTobeMarkedUnhealthy, + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/3s", + oldAddress, + })) + .Returns(MockCosmosUtil.CreateHttpResponseOfAddresses(new List() + { + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/1p", + addressTobeMarkedUnhealthy, + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/3s", + newAddress, + })); + + FakeOpenConnectionHandler fakeOpenConnectionHandler = new(failingIndexes: new HashSet()); + HttpClient httpClient = new(new HttpHandlerHelper(mockHttpHandler.Object)); + GatewayAddressCache cache = new( + new Uri(GatewayAddressCacheTests.DatabaseAccountApiEndpoint), + Documents.Client.Protocol.Tcp, + this.mockTokenProvider.Object, + this.mockServiceConfigReader.Object, + MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), + openConnectionsHandler: fakeOpenConnectionHandler, + suboptimalPartitionForceRefreshIntervalInSeconds: 2, + enableTcpConnectionEndpointRediscovery: true); + + DocumentServiceRequest request = DocumentServiceRequest.Create(OperationType.Invalid, ResourceType.Address, AuthorizationTokenType.Invalid); + + // Act and Assert. + PartitionAddressInformation addressInfo = await cache.TryGetAddressesAsync( + request: request, + partitionKeyRangeIdentity: this.testPartitionKeyRangeIdentity, + serviceIdentity: this.serviceIdentity, + forceRefreshPartitionAddresses: false, + cancellationToken: CancellationToken.None); + + Assert.AreEqual(4, addressInfo.AllAddresses.Count); + Assert.AreEqual(1, addressInfo.AllAddresses.Count(x => x.PhysicalUri == oldAddress)); + Assert.AreEqual(0, addressInfo.AllAddresses.Count(x => x.PhysicalUri == newAddress)); + + // Because force refresh is requested, an unhealthy replica is added to the failed endpoint so that it's status could be validted. + request.RequestContext.FailedEndpoints.Value.Add( + new TransportAddressUri( + addressUri: new Uri( + uriString: addressTobeMarkedUnhealthy))); + + addressInfo = await cache.TryGetAddressesAsync( + request: request, + partitionKeyRangeIdentity: this.testPartitionKeyRangeIdentity, + serviceIdentity: this.serviceIdentity, + forceRefreshPartitionAddresses: true, + cancellationToken: CancellationToken.None); + + Assert.AreEqual(4, addressInfo.AllAddresses.Count); + Assert.AreEqual(0, addressInfo.AllAddresses.Count(x => x.PhysicalUri == oldAddress)); + Assert.AreEqual(1, addressInfo.AllAddresses.Count(x => x.PhysicalUri == newAddress)); + + TransportAddressUri refreshedUri = addressInfo + .Get(Documents.Client.Protocol.Tcp)? + .ReplicaTransportAddressUris + .Single(x => x.ToString().Equals(addressTobeMarkedUnhealthy)); + + Assert.IsNotNull(refreshedUri); + Assert.AreEqual( + expected: TransportAddressHealthState.HealthStatus.Unknown, + actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); + + mockHttpHandler.VerifyAll(); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedExceptionCount: 0, + expectedMethodInvocationCount: 0, + expectedReceivedAddressesCount: 0, + expectedSuccessCount: 0); + } + + /// + /// Blocks the current thread until a completion signal on the ManualResetEvent + /// is received. A timeout of 5 seconds is added to avoid any thread starvation. + /// + /// An instance of . + /// A boolean flag indicating if a Reset on the manualResetEvent is required. + private static void WaitForManualResetEventSignal( + ManualResetEvent manualResetEvent, + bool shouldReset) + { + manualResetEvent.WaitOne( + millisecondsTimeout: 5000); + + if (shouldReset) + { + manualResetEvent.Reset(); + } + } + /// /// Helper method to assert on the class attributes /// to match with that of the expected ones. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/AsyncCacheNonBlockingTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/AsyncCacheNonBlockingTests.cs index d5250b0408..d58ab3db5b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/AsyncCacheNonBlockingTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/AsyncCacheNonBlockingTests.cs @@ -392,5 +392,150 @@ await asyncCache.GetAsync( Assert.AreEqual(1, totalLazyCalls); Assert.AreEqual("Test3", result); } + + /// + /// Test to validate that when RefreshAsync() is invoked for a valid existing key, the + /// cache refreshes the key successfully and the new value is updated in the cache. + /// + [TestMethod] + [Owner("dkunda")] + public async Task RefreshAsync_WhenRefreshRequestedForAnExistingKey_ShouldRefreshTheCache() + { + // Arrange. + AsyncCacheNonBlocking asyncCache = new (); + + // Act and Assert. + string result = await asyncCache.GetAsync( + "key", + (_) => Task.FromResult("value1"), + (_) => false); + + Assert.AreEqual("value1", result); + + await asyncCache.RefreshAsync( + "key", + (_) => Task.FromResult("value2")); + + result = await asyncCache.GetAsync( + "key", + (_) => throw new Exception("Should not refresh."), + (_) => false); + + Assert.AreEqual("value2", result); + } + + /// + /// Test to validate that when a DocumentClientException is thrown during RefreshAsync() operation, + /// then the cache removes the key for which a refresh was requested. + /// + [TestMethod] + [Owner("dkunda")] + public async Task RefreshAsync_WhenThrowsDocumentClientException_ShouldRemoveKeyFromTheCache() + { + // Arrange. + AsyncCacheNonBlocking asyncCache = new (); + + // Act and Assert. + string result = await asyncCache.GetAsync( + "key", + (_) => Task.FromResult("value1"), + (_) => false); + + Assert.AreEqual("value1", result); + + result = await asyncCache.GetAsync( + "key", + (_) => Task.FromResult("value2"), + (_) => false); + + // Because the key is already present in the cache and a force refresh was not requested + // the func delegate should not get invoked and thus the cache should not be updated + // and still return the old cached value. + Assert.AreEqual("value1", result); + + NotFoundException notFoundException = new ( + message: "Item was deleted."); + try + { + await asyncCache.RefreshAsync( + "key", + async (_) => + { + await Task.Delay(TimeSpan.FromMilliseconds(5)); + throw notFoundException; + }); + Assert.Fail("Should throw a NotFoundException"); + } + catch (NotFoundException exception) + { + Assert.AreEqual(notFoundException, exception); + } + + // Because the key was deleted from the cache, the func delegate should get invoked at + // this point and update the value to value2. + result = await asyncCache.GetAsync( + "key", + (_) => Task.FromResult("value2"), + (_) => false); + + Assert.AreEqual("value2", result); + } + + /// + /// Test to validate that when some other Exception is thrown during RefreshAsync() operation, + /// then the cache does not remove the key for which the refresh was originally requested. + /// + [TestMethod] + [Owner("dkunda")] + public async Task RefreshAsync_WhenThrowsOtherException_ShouldNotRemoveKeyFromTheCache() + { + // Arrange. + AsyncCacheNonBlocking asyncCache = new(); + + // Act and Assert. + string result = await asyncCache.GetAsync( + "key", + (_) => Task.FromResult("value1"), + (_) => false); + + Assert.AreEqual("value1", result); + + result = await asyncCache.GetAsync( + "key", + (_) => Task.FromResult("value2"), + (_) => false); + + // Because the key is already present in the cache and a force refresh was not requested + // the func delegate should not get invoked and thus the cache should not be updated + // and still return the old cached value. + Assert.AreEqual("value1", result); + + Exception exception = new( + message: "Timeout exception."); + try + { + await asyncCache.RefreshAsync( + "key", + async (_) => + { + await Task.Delay(TimeSpan.FromMilliseconds(5)); + throw exception; + }); + Assert.Fail("Should throw a NotFoundException"); + } + catch (Exception ex) + { + Assert.AreEqual(ex, exception); + } + + // Because the key should not get deleted from the cache, the func delegate should not get invoked at + // this point. + result = await asyncCache.GetAsync( + "key", + (_) => Task.FromResult("value2"), + (_) => false); + + Assert.AreEqual("value1", result); + } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Utils/ReflectionUtils.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Utils/ReflectionUtils.cs new file mode 100644 index 0000000000..78bf6fafb2 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Utils/ReflectionUtils.cs @@ -0,0 +1,43 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Tests +{ + using System; + using System.Reflection; + + /// + /// Common utility class for reflaction related operations. + /// + internal static class ReflectionUtils + { + /// + /// This helper method uses reflection to set the private and read only fields + /// to the disered values to help the test cases mimic the expected behavior. + /// + /// An object where reflection will be applied to update the field. + /// A string containing the internal field name. + /// An integer to add or substract the desired delay in minutes. + internal static void AddMinuteToDateTimeFieldUsingReflection( + object objectName, + string fieldName, + int delayInMinutes) + { + FieldInfo fieldInfo = objectName + .GetType() + .GetField( + name: fieldName, + bindingAttr: BindingFlags.Instance | BindingFlags.NonPublic); + + DateTime? fieldValue = (DateTime?)fieldInfo + .GetValue( + obj: objectName); + + fieldInfo + .SetValue( + obj: objectName, + value: ((DateTime)fieldValue).AddMinutes(delayInMinutes)); + } + } +} diff --git a/docs/ReplicaValidationDesign.md b/docs/ReplicaValidationDesign.md new file mode 100644 index 0000000000..0e23db09d7 --- /dev/null +++ b/docs/ReplicaValidationDesign.md @@ -0,0 +1,338 @@ +# Design Approach to Validate Backend Replicas During Service Upgrade in Direct Mode + +## Table of Contents + +* [Scope.](#scope) +* [Backgraound.](#backgraound) +* [Proposed Solution.](#proposed-solution) +* [Design Approach.](#design-approach) + * [Outline.](#outline) + * [Updated Sequence Diagram for `CosmosClient` initialization.](#updated-sequence-diagram-for-cosmosclient-initialization) + * [Sequence Diagram when `StoreReader` invokes the `GatewayAddressCache` to resolve addresses and leverages `AddressEnumerator` to enumerate the transport addresses.](#sequence-diagram-when-storereader-invokes-the-gatewayaddresscache-to-resolve-addresses-and-leverages-addressenumerator-to-enumerate-the-transport-addresses) + * [State Diagram to Understand the `TransportAddressUri` Health State Transformations.](#state-diagram-to-understand-the-transportaddressuri-health-state-transformations) + * [`Microsoft.Azure.Cosmos.Direct` package class diagrams.](#azurecosmosdirect-package-class-diagrams) + * [`Microsoft.Azure.Cosmos` package class diagrams.](#microsoftazurecosmos-package-class-diagrams) +* [Pull Request with Sample Code Changes.](#pull-request-with-sample-code-changes) +* [References.](#references) + +## Scope + +The scope of the replica validation workstream is targed for the `CosmosClient` configured for `Direct` mode. + +## Backgraund + +During an upgrade scenario in the backend replica nodes, there has been an observation of increased request latency. One of the primary reason for the latency is that, during an upgrade, a replica which is still undergoing upgrade may still be returned back to SDK, when an address refresh occurres. As of today, the incoming request will have `25%` chance to hit the replica that not ready yet, therefore causing the `ConnectionTimeoutException`, which contributes to the increased latency. + +To understand the problem statement better, please take a look at the below sequence diagram which reflects the connection timeouts caused by the replica upgrade. + +```mermaid +sequenceDiagram + autonumber + participant A as StoreReader
[Direct Code] + participant B as GlobalAddressResolver
[v3 Code] + participant C as GatewayAddressCache
[v3 Code] + participant D as GatewayService
[External Service] + participant E as BackendReplica
[A Replica Node Still Undergoing Upgrade
Address: rntbd://test.azure.com:443/partitions/2s] + A->>+B: Request (forceRefresh - false) + B->>+C: TryGetAddresses (forceRefresh - false) + C->>-B: Fetch Cached Addresses
rntbd://test.azure.com:443/partitions/2s + B->>-A: Return Addresses
rntbd://test.azure.com:443/partitions/2s + A->>+E: Request Sent to Backend Replica + E-x-A: Request fails with 410 GoneException + A->>+B: Request (forceRefresh - true)
GoneWithRetryAttempt + B->>+C: TryGetAddresses (forceRefresh - true) + C->>+D: GetServerAddresses + D->>-C: Returns the new refreshed addresses
rntbd://test.azure.com:443/partitions/2s + Note over D: Note that the returned addresses from
GatewayService may still undergoing
the upgrade, thus and they are not in a ready state. + C->>-B: Returns the refreshed addresses
rntbd://test.azure.com:443/partitions/2s + B->>-A: Returns the refreshed addresses
rntbd://test.azure.com:443/partitions/2s + A->>+E: Request Sent to Backend Replica + E-x-A: Request fails again with 410 GoneException + Note over A: Note that the request fails to connect to the replica
which causes a "ConnectionTimeoutException". +``` + +## Proposed Solution + +The .NET SDK will track the replica endpoint health based on client side metrics, and de-prioritize any replica which were marked as - `Unhealthy`. SDK will validate the health of the replica by attempting to open RNTBD connections to the backend. When SDK refresh addresses back from gateway for a partition, **SDK will only validate the replica/s which were in `Unhealthy` status, by opening RNTBD connection requests**. This process will be completed with best effort, which means: + +- If the validation can not finish within `1 min` of opening connections, the de-prioritize will stop for certain status. + +- The selection of the replica will not be blocked by the validation process. To better understand this - if a request needs to be sent to `N` replicas, and if there is only `N-1` replica in good status, it will still go ahead selecting the `Nth` replica which needs validation. + +- It is opt in only for now, by setting the environment variable `AZURE_COSMOS_REPLICA_VALIDATION_ENABLED` to `true`. + +## Design Approach + +### Outline + +The basic idea for this design approach has been divited into *three* parts, which has been mentioned below in detail: + +- Maintain `4` new health statuses into the `TransportAddressUri`, which are : + + - **`Connected`** (Indicates that there is already a connection made successfully to the backend replica) + - **`Unknown`** (Indicates that the connection exists however the status is unknown at the moment) + - **`Unhealthy Pending`** (Indicates that the connection was unhealthy previously, but an attempt will be made to validate the replica to check the current status) + - **`Unhealthy`** (Indicates that the connection is unhealthy at the moment) + +- Validate the `Unhealthy` replicas returned from the Address Cache, by attempting to open the RNTBD connection. Note that the validation task and the connection opening part has been done as a background task, so that the address resolving doesn't wait on the RNTBD context negotiation to finish. + +- Leverage the `AddressEnumerator` to reorder the replicas by their health statuses. For instance, if the replica validation is enabled, the `AddressEnumerator` will reorder the replicas by sorting them in the order of **Connected/ Unknown** > **Unhealthy Pending** > **Unhealthy**. However, if the replica validation is disabled, the replicas will be sorted in the order of **Connected/ Unknown/ Unhealthy Pending** > **Unhealthy**. + +Prior discussing the replica validation, it is very important to understand the changes in the flow while opening the RNTBD connections to the backend replica nodes, during the `CosmosClient` initialization. The changes in the flow are mentioned below as an updated sequence diagram. + +### Updated Sequence Diagram for `CosmosClient` initialization. + +```mermaid +sequenceDiagram + participant A as CosmosClient
[v3 Code] + participant B as ClientContextCore
[v3 Code] + participant C as DocumentClient
[v3 Code] + participant D as ServerStoreModel
[Direct Code] + participant K as StoreClientFactory
[Direct Code] + participant E as StoreClient
[Direct Code] + participant F as ReplicatedResourceClient
[Direct Code] + participant G as GlobalAddressResolver
[v3 Code] + participant H as GatewayAddressCache
[v3 Code] + participant J as RntbdOpenConnectionHandler
[Direct Code] + participant I as TransportClient
[Direct Code] + A->>B: 1. InitializeContainerWithRntbdAsync() + B->>C: 2. OpenConnectionsAsync() + C->>C: 2.1. CreateStoreModel() + C->>K: 3. CreateStoreClient(addressResolver) + K->>E: 4. new StoreClient(addressResolver) + E->>G: 5. SetOpenConnectionsHandler(new RntbdOpenConnectionHandler(transportClient)) + Note over E: a) Creates a new instance of RntbdOpenConnectionHandler
and sets it to the IAddressResolverExtension.
Note that the GlobalAddressResolver implements the
IAddressResolverExtension today.
b) Sets the IAddressResolverExtension to the Replicated
ResourceClient. + G->>H: 6. SetOpenConnectionsHandler(openConnectionHandler) + C->>D: 7. OpenConnectionsToAllReplicasAsync() + D->>E: 8. OpenConnectionsToAllReplicasAsync() + E->>F: 9. OpenConnectionsToAllReplicasAsync() + F->>G: 10. OpenConnectionsToAllReplicasAsync() + G->>G: 10.1 collection = collectionCache.
ResolveByNameAsync() + G->>G: 10.2 partitionKeyRanges = routingMapProvider.
TryGetOverlappingRangesAsync(FullRange) + G->>H: 11. OpenAsync
(partitionKeyRangeIdentities) + Note over G: Resolves the collection by the
container link url and fetches
the partition key full ranges. + H->>H: 11.1 GetServerAddressesViaGatewayAsync() + H->>J: 12. OpenRntbdChannelsAsync() + Note over H: Gets the transport address uris from address info
and invokes the RntbdOpenConnectionHandler
OpenRntbdChannelsAsync() method with the transport uris
to establish the Rntbd connection. + J->>I: 13. OpenConnectionAsync()
using the resolved transport address uris. +``` + +Now that we are well aware of the changes in the RNTBD open connection flow, let's leverage the changes in the replica validation flow. The below sequence diagram describes the request and response flow from `StoreReader` (present in the `Cosmos.Direct` namespace) to the `GatewayAddressCache` (present in the `Microsoft.Azure.Cosmos` namespace), during the read request to backend replica/s. + +### Sequence Diagram when `StoreReader` invokes the `GatewayAddressCache` to resolve addresses and leverages `AddressEnumerator` to enumerate the transport addresses. + +```mermaid +sequenceDiagram + participant A as StoreReader
[Direct Code] + participant B as AddressSelector
[v3 Code] + participant C as GlobalAddressResolver
[v3 Code] + participant D as AddressResolver
[v3 Code] + participant E as GatewayAddressCache
[v3 Code] + participant F as RntbdOpenConnectionHandler
[Direct Code] + participant G as AsyncCacheNonBlocking
[v3 Code] + participant H as GatewayService
[external service] + participant I as AddressEnumerator
[Direct Code] + participant J as TransportClient
[Direct Code] + participant K as Channel
[Direct Code] + participant L as TransportAddressUri
[Direct Code] + A->>A: 1. ReadMultipleReplicaAsync() + A->>B: 2. ResolveAllTransportAddressUriAsync(forceRefresh - false) + B->>C: 3. ResolveAsync(forceRefresh - false) + C->>D: 4. ResolveAsync(forceRefresh - false) + D->>D: 5. ResolveAddressesAndIdentityAsync() + D->>E: 6. TryGetAddressesAsync(forceRefresh - false) + E->>G: 7. GetAsync ("singleValueInitFunc delegate", "forceRefresh - false") + Note over L: Initial health status of a
TransportAddressUri is "Unknown". + Note over E: Passes the SingleValueInitFunc delegate
to async nonblocking cache. + G->>E: 8. Returns the cached addresses + E->>D: 9. Returns the resolved addresses + D->>C: 10. Returns the resolved addresses + C->>B: 11. Returns the resolved addresses + B->>A: 12. Returns the resolved addresses + A->>A: 13. Request failes with "GoneException" + Note over A: Sets Force Refresh
header to true. + A->>A: 14. ReadMultipleReplicaAsync() + A->>B: 15. ResolveAllTransportAddressUriAsync (forceRefresh - true) + B->>C: 16. ResolveAsync(forceRefresh - true) + C->>D: 17. ResolveAsync(forceRefresh - true) + D->>D: 18. ResolveAddressesAndIdentityAsync(forceRefresh - true) + D->>E: 19. TryGetAddressesAsync(forceRefresh - true) + E->>G: 20. GetAsync ("singleValueInitFunc delegate", "forceRefresh - true") + Note over E: Passes the SingleValueInitFunc delegate
to async nonblocking cache. + G->>E: 21. Invokes the singleValueInitFunc delegate + E->>E: 22. SetTransportAddressUrisToUnhealthy(currentCachedValue, failedEndpoints) + Note over E: Sets the failed TransportAddressUris
to an "Unhealthy" status. + E->>L: 23. SetUnhealthy() + E->>E: 24. GetAddressesForRangeIdAsync(forceRefresh - true, cachedAddresses) + E->>H: 25. Invokes the GatewayService using GetServerAddressesViaGatewayAsync()
to receive new addresses. + H->>E: 26. Receives the resolved new addresses. + E->>E: 27. MergeAddresses + Note over E: The purpose of the merge is to restore the health statuses of all the new addresses to
that of their recpective cached addresses, if returned same addresses. + E->>L: 28. SetRefreshedIfUnhealthy() + Note over E: Sets any TransportAddressUri with
an "Unhealthy" status to "UnhealthyPending". + E->>E: 29. ValidateReplicaAddresses(mergedTransportAddress) + Note over E: Validates the backend replicas,
if the replica validation env variable is enabled. + E-->>F: 30. OpenRntbdChannelsAsync(mergedTransportAddress) + Note over E: If replica validation is enabled, then validate unhealthy pending
replicas by opening RNTBD connections. Note that this
operations executes as a background task. + F-->>J: 31. OpenConnectionAsync()
using the resolved transport address uris + J-->>K: 32. OpenConnectionAsync()
using the resolved physical address uris + K-->>L: 33. SetConnected() + Note over K: Initializes and Establishes a RNTBD
context negotiation to the backend replica nodes. + E->>G: 34. Returns the merged addresses to cache and store into the Async Nonblocking Cache + G->>E: 35. Returns the resolved addresses + E->>E: 36. ShouldRefreshHealthStatus() + Note over E: Refresh the cache if there was an address
has been marked as unhealthy long enough (more than a minute)
and need to revalidate its status. + E-->>G: 37. Refresh ("GetAddressesForRangeIdAsync() as the singleValueInitFunc delegate", "forceRefresh - true") + Note over E: Note that the refresh operation
happens as a background task. + E->>D: 38. Returns the resolved addresses + D->>C: 39. Returns the resolved addresses + C->>B: 40. Returns the resolved addresses + B->>A: 41. Returns the resolved transport addresses + A->>I: 42. GetTransportAddresses("transportAddressUris", "replicaAddressValidationEnabled") + I->>I: 43. ReorderReplicasByHealthStatus() + Note over I: Re-orders the transport addresses
by their health statuses
Connected/Unknown >> UnhealthyPending >> Unhealthy. + I->>A: 44. Returns the transport addresses re-ordered by their health statuses +``` +### State Diagram to Understand the `TransportAddressUri` Health State Transformations. + +To better understand the design, it is critical to understand the `TransportAddressUri` health state transformations. The below state diagram depicts the `TransportAddressUri` state transitions in detail. + +```mermaid + stateDiagram-v2 + [*] --> Unknown + note right of Unknown + Initial state of
a TransportAddressUri + end note + Unknown --> Connected: Channel Aquire
Successful + Unknown --> Unhealthy: Channel Aquire
Failed + Unhealthy --> Connected: Channel Aquire
Successful after 1 Min + Unhealthy --> UnhealthyPending: Refresh Addresses
from Gateway when
Replica Validation
is enabled + UnhealthyPending --> Unhealthy: RntbdOpenConnectionHandler -
Channel Aquire
Failed + UnhealthyPending --> Connected: RntbdOpenConnectionHandler -
Channel Aquire
Successful + Connected --> Unhealthy: Request failed with 410
GoneException and
force refresh + Connected --> [*] +``` + +To accomplish the above changes in the replica validation flow, below are the class diagrams and the proposed code changes in both `Microsoft.Azure.Cosmos.Direct` and `Microsoft.Azure.Cosmos` packages. + +### `Microsoft.Azure.Cosmos.Direct` package class diagrams. + +Introduce a new `IOpenConnectionsHandler` interface with `OpenRntbdChannelsAsync()` method. Create a new class `RntbdOpenConnectionHandler` that will eventually implement the `IOpenConnectionsHandler` interface and override the `OpenRntbdChannelsAsync()` method to establish Rntbd connections to the transport address uris. Note that, this class will also add the concurrency control logic, so that any burst of connection creation could be avoided. The below class diagram depicts the same behavior. + +```mermaid +classDiagram + IOpenConnectionsHandler --|> RntbdOpenConnectionHandler : implements + <> IOpenConnectionsHandler + IOpenConnectionsHandler: +OpenRntbdChannelsAsync(IReadOnlyList~TransportAddressUri~ addresses) + class RntbdOpenConnectionHandler{ + -TransportClient transportClient + -SemaphoreSlim semaphore + -int SemaphoreAcquireTimeoutInMillis + +OpenRntbdChannelsAsync() + } +``` + +Extend the `IAddressResolverExtension` interface with `SetOpenConnectionsHandler()` method. The benefits and the utilizations are provided below: + +- The `GlobalAddressResolver` can then implement the `SetOpenConnectionsHandler()` method, which will be invoked by the `StoreClient` constructor to set the `RntbdOpenConnectionHandler`. + +- The `OpenConnectionsAsync()` method present inside `GlobalAddressResolver`, will be invoked from the `ReplicatedResourceClient` eventually. The `AddressResolver` class can simply implement the method/s and return an empty `Task`. The `GlobalAddressResolver`.`OpenConnectionsAsync()` is responsible for + + - Resolving the collection by the database name and container link, + - Fetching the partition key full ranges and + - Invoking the `GatewayAddressCache` for the preferred region, with the `RntbdOpenConnectionHandler` instance, passed by the `StoreClient`. + +The below class diagram depicts the same behavior. + +*[Note: The `IAddressResolverExtension` was introduced to hold the new methods, which could break the existing build, if put directly into `IAddressResolver` interface. The `IAddressResolverExtension` will be removed eventually and the existing methods will be moved into `IAddressResolver` interface.]* + +```mermaid +classDiagram + IAddressResolver --|> IAddressResolverExtension : extends + IAddressResolverExtension --|> GlobalAddressResolver : implements + <> IAddressResolver + <> IAddressResolverExtension + IAddressResolverExtension: +OpenConnectionsAsync(string databaseName, string containerLinkUri) + IAddressResolverExtension: +SetOpenConnectionsHandler(IOpenConnectionsHandler openConnectionHandler) + class GlobalAddressResolver{ + +OpenConnectionsAsync() + +SetOpenConnectionsHandler() + } +``` + +Update the method definition of `GetTransportAddresses()` present in `IAddressEnumerator` to add a new `boolean` argument `replicaAddressValidationEnabled`. This will help to choose the correct set of replica/s when replica validation is enabled or disabled. Additionally, a new private method `ReorderReplicasByHealthStatus()` will be added in `AddressEnumerator` to re-order the transport uri/s by their health status priority. The below class diagram depicts the same changes. + +```mermaid +classDiagram + IAddressEnumerator --|> AddressEnumerator : implements + <> IAddressEnumerator + IAddressEnumerator: +GetTransportAddresses(IReadOnlyList~TransportAddressUri~ transportAddressUris, Lazy~HashSet~TransportAddressUri~~ failedEndpoints, bool replicaAddressValidationEnabled) IEnumerable~TransportAddressUri~ + class AddressEnumerator{ + +GetTransportAddresses() + -ReorderReplicasByHealthStatus(IReadOnlyList~TransportAddressUri~ transportAddressUris, Lazy~HashSet~TransportAddressUri~~ failedEndpoints, bool replicaAddressValidationEnabled) IEnumerable~TransportAddressUri~ + } +``` + +This class will be updated eventually, with critical set of changes required for the replica validation workstream. It will introduce an enum `HealthStatus` with `4` new health statuses - `Connected`, `Unknown`, `UnhealthyPending` and `Unhealthy` to re-order the replicas with their status priorities. The setters will help to capture the correct health state of the `TransportAddressUri` at any given point of time. The below class diagram depicts the same behavior. + +```mermaid +classDiagram + class TransportAddressUri { + -DateTime? lastUnknownTimestamp + -DateTime? lastUnhealthyPendingTimestamp + -DateTime? lastUnhealthyTimestamp + -HealthStatus healthStatus + -ReaderWriterLockSlim healthStatusLock + +SetConnected() + +SetRefreshedIfUnhealthy() + +SetHealthStatus(HealthStatus status, bool forceSet) + +GetHealthStatus() HealthStatus + +GetEffectiveHealthStatus() HealthStatus + +ShouldRefreshHealthStatus() bool + } + + class HealthStatus { + <> + Connected : 100 + Unknown : 200 + UnhealthyPending : 300 + Unhealthy : 400 + } +``` + +### `Microsoft.Azure.Cosmos` package class diagrams. + +Extend the `IAddressCache` interface with `SetOpenConnectionsHandler()` method. This method should take an instance of the `RntbdOpenConnectionHandler` (which implements the `IOpenConnectionsHandler`) and sets it to a private field for later usage, to establish the Rntbd connectivity to the backend replica nodes. + +```mermaid +classDiagram + IAddressCache --|> GatewayAddressCache : implements + <> IAddressCache + IAddressCache: +SetOpenConnectionsHandler(IOpenConnectionsHandler openConnectionsHandler) + class GatewayAddressCache { + -IOpenConnectionsHandler openConnectionsHandler + -string replicaValidationVariableName + +SetOpenConnectionsHandler(IOpenConnectionsHandler openConnectionsHandler) + -MergeAddresses(PartitionAddressInformation newAddresses, PartitionAddressInformation cachedAddresses) PartitionAddressInformation + -ValidateReplicaAddresses(IReadOnlyList~TransportAddressUri~ addresses) + } +``` + +Add a new method `Refresh()` into the `AsyncCacheNonBlocking` to force refresh the address cache on demand. Note that `Refresh()` is used to force refresh any `Unhealthy` replica nodes, which has been in `Unhealthy` state for more than `1` minute. That way, any `Unhealthy` replica nodes will be back into the validation pool, which will eventually be useful to avoid any skewed replica selection. + +```mermaid +classDiagram + class AsyncCacheNonBlocking~TKey, TValue~ { + +Task Refresh(TKey key, Func~TValue, Task~TValue~~ singleValueInitFunc) + } +``` + +## Pull Request with Sample Code Changes + +Here is the [link to a sample PR](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3570) which provides an overview of the incoming changes. + +## References + +- [Mermaid Documentation.](https://mermaid-js.github.io/mermaid/#/) +- [Upgrade Resiliency Tasks List.](https://github.com/Azure/azure-cosmos-dotnet-v3/issues/3409) +- [Design Document to Utilize RNTBD Context Negotiation During `CosmosClient` Initialization.](https://github.com/Azure/azure-cosmos-dotnet-v3/issues/3442) \ No newline at end of file From 93bb10b47b6bc96b3b647daf84cccb0e850ca9f9 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Wed, 1 Mar 2023 13:06:30 -0800 Subject: [PATCH 065/240] ReadMany: Fixes BadRequest when using Ids with single quotes (#3732) * Use parameters * Emulator tests --- .../src/ReadManyQueryHelper.cs | 8 +++-- .../CosmosReadManyItemsTests.cs | 31 ++++++++----------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ReadManyQueryHelper.cs b/Microsoft.Azure.Cosmos/src/ReadManyQueryHelper.cs index e69476129c..6ebcda267c 100644 --- a/Microsoft.Azure.Cosmos/src/ReadManyQueryHelper.cs +++ b/Microsoft.Azure.Cosmos/src/ReadManyQueryHelper.cs @@ -249,10 +249,13 @@ private QueryDefinition CreateReadManyQueryDefinitionForId(List<(string, Partiti { int totalItemCount = Math.Min(items.Count, startIndex + this.maxItemsPerQuery); StringBuilder queryStringBuilder = new StringBuilder(); + SqlParameterCollection sqlParameters = new SqlParameterCollection(); queryStringBuilder.Append("SELECT * FROM c WHERE c.id IN ( "); for (int i = startIndex; i < totalItemCount; i++) { - queryStringBuilder.Append($"'{items[i].Item1}'"); + string idParamName = "@param_id" + i; + sqlParameters.Add(new SqlParameter(idParamName, items[i].Item1)); + queryStringBuilder.Append(idParamName); if (i < totalItemCount - 1) { queryStringBuilder.Append(","); @@ -260,7 +263,8 @@ private QueryDefinition CreateReadManyQueryDefinitionForId(List<(string, Partiti } queryStringBuilder.Append(" )"); - return new QueryDefinition(queryStringBuilder.ToString()); + return QueryDefinition.CreateFromQuerySpec(new SqlQuerySpec(queryStringBuilder.ToString(), + sqlParameters)); } private QueryDefinition CreateReadManyQueryDefinitionForOther(List<(string, PartitionKey)> items, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs index ede534cb9d..c3949d763f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs @@ -5,16 +5,11 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests { using System; - using System.Collections.Concurrent; using System.Collections.Generic; - using System.Collections.ObjectModel; using System.Net; - using System.Net.Http; - using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Fluent; - using Microsoft.Azure.Cosmos.Query.Core; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -22,16 +17,15 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests public class CosmosReadManyItemsTests : BaseCosmosClientHelper { private Container Container = null; - private ContainerProperties containerSettings = null; [TestInitialize] public async Task TestInitialize() { await base.TestInit(); string PartitionKey = "/pk"; - this.containerSettings = new ContainerProperties(id: Guid.NewGuid().ToString(), partitionKeyPath: PartitionKey); + ContainerProperties containerSettings = new ContainerProperties(id: Guid.NewGuid().ToString(), partitionKeyPath: PartitionKey); ContainerResponse response = await this.database.CreateContainerAsync( - this.containerSettings, + containerSettings, throughput: 20000, cancellationToken: this.cancellationToken); Assert.IsNotNull(response); @@ -122,23 +116,24 @@ public async Task ReadManyDoesNotFetchQueryPlan() [TestMethod] public async Task ReadManyWithIdasPk() { - string PartitionKey = "/id"; - ContainerProperties containerSettings = new ContainerProperties(id: Guid.NewGuid().ToString(), partitionKeyPath: PartitionKey); - Container container = await this.database.CreateContainerAsync(containerSettings); + Container container = await this.database.CreateContainerAsync(Guid.NewGuid().ToString(), "/id"); List<(string, PartitionKey)> itemList = new List<(string, PartitionKey)>(); - for (int i = 0; i < 5; i++) - { - itemList.Add((i.ToString(), new PartitionKey(i.ToString()))); - } // Create items with different pk values for (int i = 0; i < 5; i++) { ToDoActivity item = ToDoActivity.CreateRandomToDoActivity(); - item.id = i.ToString(); ItemResponse itemResponse = await container.CreateItemAsync(item); Assert.AreEqual(HttpStatusCode.Created, itemResponse.StatusCode); + + itemList.Add((item.id, new PartitionKey(item.id))); + + ToDoActivity itemWithSingleQuotes = ToDoActivity.CreateRandomToDoActivity(id: item.id + "'singlequote"); + ItemResponse itemResponseWithSingleQuotes = await container.CreateItemAsync(itemWithSingleQuotes); + Assert.AreEqual(HttpStatusCode.Created, itemResponseWithSingleQuotes.StatusCode); + + itemList.Add((itemWithSingleQuotes.id, new PartitionKey(itemWithSingleQuotes.id))); } using (ResponseMessage responseMessage = await container.ReadManyItemsStreamAsync(itemList)) @@ -149,12 +144,12 @@ public async Task ReadManyWithIdasPk() ToDoActivity[] items = this.GetClient().ClientContext.SerializerCore.FromFeedStream( CosmosFeedResponseSerializer.GetStreamWithoutServiceEnvelope(responseMessage.Content)); - Assert.AreEqual(items.Length, 5); + Assert.AreEqual(items.Length, 10); } FeedResponse feedResponse = await container.ReadManyItemsAsync(itemList); Assert.IsNotNull(feedResponse); - Assert.AreEqual(feedResponse.Count, 5); + Assert.AreEqual(feedResponse.Count, 10); Assert.IsTrue(feedResponse.Headers.RequestCharge > 0); Assert.IsNotNull(feedResponse.Diagnostics); } From 45c0d147ab35ddc6e9c13e91919b147ee6ea06c0 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Wed, 1 Mar 2023 14:39:47 -0800 Subject: [PATCH 066/240] Release: Adds SDK version and changelog for 3.32.1 (#3733) * version bump * Contracts --- Directory.Build.props | 4 +- .../contracts/API_3.32.1-preview.txt | 1531 +++++++++++++++++ .../contracts/API_3.32.1.txt | 1478 ++++++++++++++++ changelog.md | 6 + 4 files changed, 3017 insertions(+), 2 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.32.1-preview.txt create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.32.1.txt diff --git a/Directory.Build.props b/Directory.Build.props index a4a5b0a087..aa8918e3b1 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 3.32.0 - 3.32.0 + 3.32.1 + 3.32.1 preview 3.30.2 2.0.1 diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.32.1-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.32.1-preview.txt new file mode 100644 index 0000000000..69b7a4b83e --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.32.1-preview.txt @@ -0,0 +1,1531 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool IsDistributedTracingEnabled { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithDistributedTracing(bool isEnabled=true); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsPrimitive(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.32.1.txt b/Microsoft.Azure.Cosmos/contracts/API_3.32.1.txt new file mode 100644 index 0000000000..5218206b0e --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.32.1.txt @@ -0,0 +1,1478 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsPrimitive(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/changelog.md b/changelog.md index aa2aaad67d..b201ba77fb 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,12 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +###
[3.32.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.32.1) - 2023-03-01 +### [3.32.1-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.32.1-preview) - 2023-03-01 + +#### Fixed +- [#3732](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3732) ReadMany: Fixes BadRequest when using Ids with single quotes + ### [3.32.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.32.0) - 2023-02-03 #### Fixed - [#3466](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3466) ClientRetryPolicy: Fixes behavior to Meta-data write operations in multimaster accounts From 0018c4a1c165dd3bbbca704abdae645fa2cd4182 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Thu, 2 Mar 2023 13:11:10 -0800 Subject: [PATCH 067/240] [Internal] Build: Fixes static tool analysis versions (#3736) * Update Binskim and follow warnings * Fixing task * More version bumps * binskim args * Padding * policheck * postanalysis parameters * analysis settings --- templates/static-tools.yml | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/templates/static-tools.yml b/templates/static-tools.yml index b3ce2b11de..fb7b375586 100644 --- a/templates/static-tools.yml +++ b/templates/static-tools.yml @@ -23,30 +23,16 @@ jobs: arguments: '-p:Optimize=true -p:IsPreview=true --configuration Release' versioningScheme: OFF - - task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@3 + - task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@4 displayName: 'BinSkim' inputs: - toolVersion: Latest - InputType: Basic - Function: analyze - AnalyzeTarget: $(Build.SourcesDirectory)\Microsoft.Azure.Cosmos\src\bin\Release\netstandard2.0\Microsoft.Azure.Cosmos.Client.dll - AnalyzeConfigPath: default + AnalyzeTargetGlob: $(Build.SourcesDirectory)\Microsoft.Azure.Cosmos\src\bin\Release\netstandard2.0\Microsoft.Azure.Cosmos.Client.dll AnalyzeRecurse: true AnalyzeVerbose: true AnalyzeHashes: false AnalyzeStatistics: false AnalyzeEnvironment: false - #Analyze source code for type of content and target types to help determine which tools to run - - task: securedevelopmentteam.vss-secure-development-tools.build-task-autoapplicability.AutoApplicability@1 - displayName: 'AutoApplicability' - inputs: - VerboseWriter: true - ExternalRelease: true - InternalRelease: true - IsService: true - IsSoftware: true - # Analyze source and build output text files for credentials - task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@3 displayName: 'CredScan' @@ -58,22 +44,19 @@ jobs: verboseOutput: false # Scan text elements including code, code comments, and content/web pages, for sensitive terms based on legal, cultural, or geopolitical reasons - - task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@1 + - task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@2 displayName: 'PoliCheck' inputs: targetType: F + optionsFC: 0 # AntiMalware scan - - task: securedevelopmentteam.vss-secure-development-tools.build-task-antimalware.AntiMalware@3 + - task: securedevelopmentteam.vss-secure-development-tools.build-task-antimalware.AntiMalware@4 displayName: 'AntiMalware' continueOnError: true # signature refresh failing resulting in tasks failures inputs: EnableServices: true - # Run checks for recently discovered vulnerabilities which are not yet incorporated to another tool - - task: securedevelopmentteam.vss-secure-development-tools.build-task-vulnerabilityassessment.VulnerabilityAssessment@0 - displayName: 'Vulnerability Assessment' - - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 displayName: 'Component Governance Detection' #https://docs.opensource.microsoft.com/tools/cg.html inputs: @@ -81,11 +64,16 @@ jobs: failOnAlert: true # Publish Analysis Results (position after all tools ran) - - task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@2 + - task: securedevelopmentteam.vss-secure-development-tools.build-task-publishsecurityanalysislogs.PublishSecurityAnalysisLogs@3 displayName: 'Publish Security Analysis Logs' # The Post-Analysis build task will analyze the log files produced by the tools, and introduce a build break - - task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@1 + - task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@2 displayName: 'Post Analysis' inputs: - AllTools: true + GdnBreakFast: true + GdnBreakAllTools: false + GdnBreakGdnToolCredScan: true + GdnBreakGdnToolBinSkim: true + GdnBreakGdnToolPoliCheck: true + GdnBreakGdnToolPoliCheckSeverity: Error From d6e04a92f8778565eb1d1452738d37c7faf3c47a Mon Sep 17 00:00:00 2001 From: neildsh <35383880+neildsh@users.noreply.github.com> Date: Thu, 2 Mar 2023 14:11:14 -0800 Subject: [PATCH 068/240] Query: Fixes System.ArgumentException when using PartitionKey.None on x86, Linux or in Optimistic Direct Execution (#3730) * Minor clean up of OptimisticDirectExecutionQueryTests * More minor cleanup in OptimisticDirectExecutionQueryTests * Add emulator tests for the bypass query parsing scenario * Handle PartitionKey.None while creating QueryIterator. This is a workaround for the PartitionKeyInternal.None not following its own contract * Fix up to correctly handle PartitionKey.None using the CachedContainerQueryProperties * Add more tests where PartitionKey.None maps to PartitionKey.Undefined --------- Co-authored-by: Matias Quaranta --- .../CosmosQueryExecutionContextFactory.cs | 4 +- .../src/Query/v3Query/QueryIterator.cs | 6 +- .../Query/BypassQueryParsingTests.cs | 64 ++++ .../OptimisticDirectExecutionQueryTests.cs | 298 ++++++++++++++---- 4 files changed, 303 insertions(+), 69 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/BypassQueryParsingTests.cs diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs index a7f7f17934..744d98bf44 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs @@ -214,7 +214,7 @@ private static async Task> TryCreateCoreContextAsy List targetRanges = await cosmosQueryContext.QueryClient.GetTargetPartitionKeyRangesByEpkStringAsync( cosmosQueryContext.ResourceLink, containerQueryProperties.ResourceId, - inputParameters.PartitionKey.Value.InternalKey.GetEffectivePartitionKeyString(partitionKeyDefinition), + containerQueryProperties.EffectivePartitionKeyString, forceRefresh: false, createQueryPipelineTrace); @@ -779,7 +779,7 @@ private static Documents.PartitionKeyDefinition GetPartitionKeyDefinition(InputP targetRanges = await cosmosQueryContext.QueryClient.GetTargetPartitionKeyRangesByEpkStringAsync( cosmosQueryContext.ResourceLink, containerQueryProperties.ResourceId, - inputParameters.PartitionKey.Value.InternalKey.GetEffectivePartitionKeyString(partitionKeyDefinition), + containerQueryProperties.EffectivePartitionKeyString, forceRefresh: false, trace); } diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs index a820a0a49a..7dfcea9818 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs @@ -129,9 +129,9 @@ public static QueryIterator Create( default: throw new ArgumentOutOfRangeException($"Unknown {nameof(ExecutionEnvironment)}: {queryRequestOptions.ExecutionEnvironment.Value}."); - } - - CosmosQueryExecutionContextFactory.InputParameters inputParameters = new CosmosQueryExecutionContextFactory.InputParameters( + } + + CosmosQueryExecutionContextFactory.InputParameters inputParameters = new CosmosQueryExecutionContextFactory.InputParameters( sqlQuerySpec: sqlQuerySpec, initialUserContinuationToken: requestContinuationToken, initialFeedRange: feedRangeInternal, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/BypassQueryParsingTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/BypassQueryParsingTests.cs new file mode 100644 index 0000000000..a0c821c72d --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/BypassQueryParsingTests.cs @@ -0,0 +1,64 @@ +namespace Microsoft.Azure.Cosmos.EmulatorTests.Query +{ + using System.Collections.Generic; + using System.Linq; + using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.CosmosElements; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + [TestClass] + [TestCategory("Query")] + public sealed class BypassQueryParsingTests : QueryTestsBase + { + [TestMethod] + public async Task TestBypassQueryParsingWithNonePartitionKey() + { + int documentCount = 400; + QueryRequestOptions feedOptions = new QueryRequestOptions { PartitionKey = PartitionKey.None }; + string query = "SELECT VALUE r.numberField FROM r"; + IReadOnlyList expected = Enumerable.Range(0, documentCount).ToList(); + + async Task ImplementationAsync(Container container, IReadOnlyList documents) + { + ContainerInternal containerCore = container as ContainerInlineCore; + + MockCosmosQueryClient cosmosQueryClientCore = new MockCosmosQueryClient( + containerCore.ClientContext, + containerCore, + forceQueryPlanGatewayElseServiceInterop: true); + + ContainerInternal containerWithBypassParsing = new ContainerInlineCore( + containerCore.ClientContext, + (DatabaseCore)containerCore.Database, + containerCore.Id, + cosmosQueryClientCore); + + List items = await RunQueryAsync(containerWithBypassParsing, query, feedOptions); + int[] actual = items.Cast().Select(x => (int)Number64.ToLong(x.Value)).ToArray(); + + Assert.IsTrue(expected.SequenceEqual(actual)); + } + + IReadOnlyList documents = CreateDocuments(documentCount); + + await this.CreateIngestQueryDeleteAsync( + ConnectionModes.Direct | ConnectionModes.Gateway, + CollectionTypes.NonPartitioned | CollectionTypes.SinglePartition | CollectionTypes.MultiPartition, + documents, + ImplementationAsync, + "/undefinedPartitionKey"); + } + + private static IReadOnlyList CreateDocuments(int documentCount) + { + List documents = new List(documentCount); + for (int i = 0; i < documentCount; ++i) + { + string document = $@"{{ ""numberField"": {i}, ""nullField"": null }}"; + documents.Add(document); + } + + return documents; + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs index 751c21b64b..cc9ef91733 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs @@ -7,91 +7,270 @@ using System.Threading.Tasks; using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.Query.Core; - using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] [TestCategory("Query")] public sealed class OptimisticDirectExecutionQueryTests : QueryTestsBase - { + { + private const int NumberOfDocuments = 8; + private const string PartitionKeyField = "key"; + private const string NumberField = "numberField"; + private const string NullField = "nullField"; + private static class PageSizeOptions { public static readonly int[] NonGroupByPageSizeOptions = { -1, 1, 2, 10, 100 }; - public static readonly int[] GroupByPageSizeOptions = { -1 }; + public static readonly int[] GroupByPageSizeOptions = { -1 }; + public static readonly int[] PageSize100 = { 100 }; } [TestMethod] public async Task TestPassingOptimisticDirectExecutionQueries() - { - int numberOfDocuments = 8; - string partitionKey = "key"; - string numberField = "numberField"; - string nullField = "nullField"; - - List documents = CreateDocuments(numberOfDocuments, partitionKey, numberField, nullField); + { + IReadOnlyList empty = new List(0); + IReadOnlyList first5Integers = Enumerable.Range(0, 5).ToList(); + IReadOnlyList first7Integers = Enumerable.Range(0, NumberOfDocuments).ToList(); + IReadOnlyList first7IntegersReversed = Enumerable.Range(0, NumberOfDocuments).Reverse().ToList(); + PartitionKey partitionKeyValue = new PartitionKey("/value"); List singlePartitionContainerTestCases = new List() { // Tests for bool enableOptimisticDirectExecution - CreateInput( query: $"SELECT TOP 5 VALUE r.numberField FROM r ORDER BY r.{partitionKey}", expectedResult: new List { 0, 1, 2, 3, 4 }, partitionKey: "/value", partition: CollectionTypes.SinglePartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), - CreateInput( query: $"SELECT TOP 5 VALUE r.numberField FROM r ORDER BY r.{partitionKey}", expectedResult: new List { 0, 1, 2, 3, 4 }, partitionKey: "/value", partition: CollectionTypes.SinglePartition, enableOptimisticDirectExecution: false, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.Passthrough), + CreateInput( + query: $"SELECT TOP 5 VALUE r.numberField FROM r ORDER BY r.{PartitionKeyField}", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT TOP 5 VALUE r.numberField FROM r ORDER BY r.{PartitionKeyField}", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: false, + pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Passthrough), // Simple query - CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: new List { 0, 1, 2, 3, 4, 5, 6, 7 }, partitionKey: "/value", partition: CollectionTypes.SinglePartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), - CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: new List { 0, 1, 2, 3, 4, 5, 6, 7 }, partitionKey: null, partition: CollectionTypes.SinglePartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r", + expectedResult: first7Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r", + expectedResult: first7Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), // DISTINCT with ORDER BY - CreateInput( query: $"SELECT DISTINCT VALUE r.{numberField} FROM r ORDER BY r.{numberField} DESC", expectedResult: new List { 7, 6, 5, 4, 3, 2, 1, 0 }, partitionKey: "/value", partition: CollectionTypes.SinglePartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), - CreateInput( query: $"SELECT DISTINCT VALUE r.{numberField} FROM r ORDER BY r.{numberField} DESC", expectedResult: new List { 7, 6, 5, 4, 3, 2, 1, 0 }, partitionKey: null, partition: CollectionTypes.SinglePartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", + expectedResult: first7IntegersReversed, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", + expectedResult: first7IntegersReversed, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), // TOP with GROUP BY - CreateInput( query: $"SELECT TOP 5 VALUE r.{numberField} FROM r GROUP BY r.{numberField}", expectedResult: new List { 0, 1, 2, 3, 4 }, partitionKey: "/value", partition: CollectionTypes.SinglePartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.GroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), - CreateInput( query: $"SELECT TOP 5 VALUE r.{numberField} FROM r GROUP BY r.{numberField}", expectedResult: new List { 0, 1, 2, 3, 4 }, partitionKey: null, partition: CollectionTypes.SinglePartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.GroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r GROUP BY r.{NumberField}", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.GroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r GROUP BY r.{NumberField}", + expectedResult: first5Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.GroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), // OFFSET LIMIT with WHERE and BETWEEN - CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{numberField} BETWEEN 0 AND {numberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, partitionKey: "/value", partition: CollectionTypes.SinglePartition, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, enableOptimisticDirectExecution: true, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), - CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{numberField} BETWEEN 0 AND {numberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, partitionKey: null, partition: CollectionTypes.SinglePartition, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, enableOptimisticDirectExecution: true, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution) + CreateInput( + query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", + expectedResult: new List { 1 }, + partitionKey: partitionKeyValue, + pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + enableOptimisticDirectExecution: true, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", + expectedResult: new List { 1 }, + partitionKey: null, + pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + enableOptimisticDirectExecution: true, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution) }; List multiPartitionContainerTestCases = new List() { // Simple query - CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: new List { 0, 1, 2, 3, 4, 5, 6, 7 }, partitionKey: "/value", partition: CollectionTypes.MultiPartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), - CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: new List { 0, 1, 2, 3, 4, 5, 6, 7 }, partitionKey: null, partition: CollectionTypes.MultiPartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.Passthrough), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r", + expectedResult: first7Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r", + expectedResult: first7Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Passthrough), // DISTINCT with ORDER BY - CreateInput( query: $"SELECT DISTINCT VALUE r.{numberField} FROM r ORDER BY r.{numberField} DESC", expectedResult: new List { 7, 6, 5, 4, 3, 2, 1, 0 }, partitionKey: "/value", partition: CollectionTypes.MultiPartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), - CreateInput( query: $"SELECT DISTINCT VALUE r.{numberField} FROM r ORDER BY r.{numberField} DESC", expectedResult: new List { 7, 6, 5, 4, 3, 2, 1, 0 }, partitionKey: null, partition: CollectionTypes.MultiPartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( + query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", + expectedResult: first7IntegersReversed, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", + expectedResult: first7IntegersReversed, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), // OFFSET LIMIT with WHERE and BETWEEN - CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{numberField} BETWEEN 0 AND {numberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, partitionKey: "/value", partition: CollectionTypes.MultiPartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), - CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{numberField} BETWEEN 0 AND {numberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, partitionKey: null, partition: CollectionTypes.MultiPartition, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.Specialized) - }; + CreateInput( + query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", + expectedResult: new List { 1 }, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", + expectedResult: new List { 1 }, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized) + }; + + IReadOnlyList documents = CreateDocuments(NumberOfDocuments, PartitionKeyField, NumberField, NullField); await this.CreateIngestQueryDeleteAsync( ConnectionModes.Direct | ConnectionModes.Gateway, CollectionTypes.SinglePartition, documents, - (container, documents) => RunPassingTests(singlePartitionContainerTestCases, container), - "/" + partitionKey); + (container, documents) => RunTests(singlePartitionContainerTestCases, container), + "/" + PartitionKeyField); await this.CreateIngestQueryDeleteAsync( ConnectionModes.Direct | ConnectionModes.Gateway, CollectionTypes.MultiPartition, documents, - (container, documents) => RunPassingTests(multiPartitionContainerTestCases, container), - "/" + partitionKey); + (container, documents) => RunTests(multiPartitionContainerTestCases, container), + "/" + PartitionKeyField); + } + + [TestMethod] + public async Task TestQueriesWithPartitionKeyNone() + { + int documentCount = 400; + IReadOnlyList first400Integers = Enumerable.Range(0, documentCount).ToList(); + IReadOnlyList first400IntegersReversed = Enumerable.Range(0, documentCount).Reverse().ToList(); + + IReadOnlyList testCases = new List + { + CreateInput( + query: $"SELECT VALUE r.numberField FROM r", + expectedResult: first400Integers, + partitionKey: PartitionKey.None, + enableOptimisticDirectExecution: false, + pageSizeOptions: PageSizeOptions.PageSize100, + expectedPipelineType: TestInjections.PipelineType.Passthrough), + CreateInput( + query: $"SELECT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} ASC", + expectedResult: first400Integers, + partitionKey: PartitionKey.None, + enableOptimisticDirectExecution: false, + pageSizeOptions: PageSizeOptions.PageSize100, + expectedPipelineType: TestInjections.PipelineType.Passthrough), + CreateInput( + query: $"SELECT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", + expectedResult: first400IntegersReversed, + partitionKey: PartitionKey.None, + enableOptimisticDirectExecution: false, + pageSizeOptions: PageSizeOptions.PageSize100, + expectedPipelineType: TestInjections.PipelineType.Passthrough), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", + expectedResult: new List { 1 }, + partitionKey: PartitionKey.None, + enableOptimisticDirectExecution: false, + pageSizeOptions: PageSizeOptions.PageSize100, + expectedPipelineType: TestInjections.PipelineType.Passthrough), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r", + expectedResult: first400Integers, + partitionKey: PartitionKey.None, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.PageSize100, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} ASC", + expectedResult: first400Integers, + partitionKey: PartitionKey.None, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.PageSize100, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", + expectedResult: first400IntegersReversed, + partitionKey: PartitionKey.None, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.PageSize100, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", + expectedResult: new List { 1 }, + partitionKey: PartitionKey.None, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.PageSize100, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + }; + + List documents = new List(documentCount); + for (int i = 0; i < documentCount; ++i) + { + string document = $@"{{ {NumberField}: {i}, {NullField}: null }}"; + documents.Add(document); + } + + await this.CreateIngestQueryDeleteAsync( + ConnectionModes.Direct | ConnectionModes.Gateway, + CollectionTypes.NonPartitioned | CollectionTypes.SinglePartition | CollectionTypes.MultiPartition, + documents, + (container, documents) => RunTests(testCases, container), + "/undefinedPartitionKey"); } [TestMethod] public async Task TestFailingOptimisticDirectExecutionOutput() { - int numberOfDocuments = 8; - string partitionKey = "key"; - string numberField = "numberField"; - string nullField = "nullField"; - - List documents = CreateDocuments(numberOfDocuments, partitionKey, numberField, nullField); + IReadOnlyList documents = CreateDocuments(NumberOfDocuments, PartitionKeyField, NumberField, NullField); // check if bad continuation queries and syntax error queries are handled by pipeline IDictionary invalidQueries = new Dictionary @@ -106,10 +285,10 @@ await this.CreateIngestQueryDeleteAsync( CollectionTypes.SinglePartition | CollectionTypes.MultiPartition, documents, (container, documents) => RunFailingTests(container, invalidQueries), - "/" + partitionKey); + "/" + PartitionKeyField); } - private static async Task RunPassingTests(IEnumerable testCases, Container container) + private static async Task RunTests(IEnumerable testCases, Container container) { foreach (DirectExecutionTestCase testCase in testCases) { @@ -118,9 +297,7 @@ private static async Task RunPassingTests(IEnumerable t QueryRequestOptions feedOptions = new QueryRequestOptions { MaxItemCount = pageSize, - PartitionKey = testCase.PartitionKey == null - ? null - : new Cosmos.PartitionKey(testCase.PartitionKey), + PartitionKey = testCase.PartitionKey, EnableOptimisticDirectExecution = testCase.EnableOptimisticDirectExecution, TestSettings = new TestInjections(simulate429s: false, simulateEmptyPages: false, new TestInjections.ResponseStats()) }; @@ -130,7 +307,7 @@ private static async Task RunPassingTests(IEnumerable t testCase.Query, feedOptions); - long[] actual = items.Cast().Select(x => Number64.ToLong(x.Value)).ToArray(); + int[] actual = items.Cast().Select(x => (int)Number64.ToLong(x.Value)).ToArray(); Assert.IsTrue(testCase.ExpectedResult.SequenceEqual(actual)); Assert.AreEqual(testCase.ExpectedPipelineType, feedOptions.TestSettings.Stats.PipelineType.Value); @@ -151,7 +328,7 @@ private static async Task RunFailingTests(Container container, IDictionary( + await container.GetItemQueryIterator( queryDefinition: new QueryDefinition(queryAndResult.Key), continuationToken: queryAndResult.Value, requestOptions: feedOptions).ReadNextAsync(); @@ -169,16 +346,13 @@ await container.GetItemQueryIterator( } } - private static List CreateDocuments(int documentCount, string partitionKey, string numberField, string nullField) + private static IReadOnlyList CreateDocuments(int documentCount, string partitionKey, string numberField, string nullField) { List documents = new List(documentCount); for (int i = 0; i < documentCount; ++i) { - Document doc = new Document(); - doc.SetPropertyValue(partitionKey, "/value"); - doc.SetPropertyValue(numberField, i % documentCount); - doc.SetPropertyValue(nullField, null); - documents.Add(doc.ToString()); + string document = $@"{{ {partitionKey}: ""/value"", {numberField}: {i}, {nullField}: null }}"; + documents.Add(document); } return documents; @@ -186,31 +360,28 @@ private static List CreateDocuments(int documentCount, string partitionK private static DirectExecutionTestCase CreateInput( string query, - List expectedResult, - string partitionKey, - CollectionTypes partition, + IReadOnlyList expectedResult, + PartitionKey? partitionKey, bool enableOptimisticDirectExecution, int[] pageSizeOptions, TestInjections.PipelineType expectedPipelineType) { - return new DirectExecutionTestCase(query, expectedResult, partitionKey, partition, enableOptimisticDirectExecution, pageSizeOptions, expectedPipelineType); - } - - internal readonly struct DirectExecutionTestCase + return new DirectExecutionTestCase(query, expectedResult, partitionKey, enableOptimisticDirectExecution, pageSizeOptions, expectedPipelineType); + } + + private readonly struct DirectExecutionTestCase { public string Query { get; } - public List ExpectedResult { get; } - public string PartitionKey { get; } - public CollectionTypes Partition { get; } + public IReadOnlyList ExpectedResult { get; } + public PartitionKey? PartitionKey { get; } public bool EnableOptimisticDirectExecution { get; } public int[] PageSizeOptions { get; } public TestInjections.PipelineType ExpectedPipelineType { get; } public DirectExecutionTestCase( string query, - List expectedResult, - string partitionKey, - CollectionTypes partition, + IReadOnlyList expectedResult, + PartitionKey? partitionKey, bool enableOptimisticDirectExecution, int[] pageSizeOptions, TestInjections.PipelineType expectedPipelineType) @@ -218,7 +389,6 @@ public DirectExecutionTestCase( this.Query = query; this.ExpectedResult = expectedResult; this.PartitionKey = partitionKey; - this.Partition = partition; this.EnableOptimisticDirectExecution = enableOptimisticDirectExecution; this.PageSizeOptions = pageSizeOptions; this.ExpectedPipelineType = expectedPipelineType; From f262f8941f541332509eba64a2297e9d5e221675 Mon Sep 17 00:00:00 2001 From: Ezra Haleva <115735172+ezrahaleva-msft@users.noreply.github.com> Date: Mon, 6 Mar 2023 10:50:04 -0800 Subject: [PATCH 069/240] Query: Adds FIRST and LAST Scalar Expressions (#3629) * Add FIRST and LAST objects and update visitors * add FIRST LAST evaluation and update offline engine visitors * Add FIRST and LAST to parser * update another visitor * Fix typo * fix typo * added new tests and baselines * cleaning * cleaning --------- Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com> Co-authored-by: Matias Quaranta --- .../src/Query/Core/Parser/CstToAstVisitor.cs | 20 + .../src/Query/Core/Parser/IsqlListener.cs | 24 + .../src/Query/Core/Parser/IsqlVisitor.cs | 14 + .../src/Query/Core/Parser/sql.g4 | 6 + .../src/Query/Core/Parser/sqlBaseListener.cs | 28 + .../src/Query/Core/Parser/sqlBaseVisitor.cs | 22 + .../src/Query/Core/Parser/sqlLexer.cs | 978 +++++++++--------- .../src/Query/Core/Parser/sqlParser.cs | 579 ++++++----- .../CosmosQueryExecutionContextFactory.cs | 12 + .../SqlObjects/SqlFirstScalarExpression.cs | 40 + .../src/SqlObjects/SqlLastScalarExpression.cs | 40 + .../Visitors/SqlObjectEqualityVisitor.cs | 30 + .../SqlObjects/Visitors/SqlObjectHasher.cs | 16 + .../Visitors/SqlObjectObfuscator.cs | 12 +- .../Visitors/SqlObjectTextSerializer.cs | 16 + .../SqlObjects/Visitors/SqlObjectVisitor.cs | 2 + .../SqlObjectVisitor{TArg,TOutput}.cs | 2 + .../Visitors/SqlObjectVisitor{TResult}.cs | 2 + .../Visitors/SqlScalarExpressionVisitor.cs | 2 + ...qlScalarExpressionVisitor{TArg,TOutput}.cs | 2 + .../SqlScalarExpressionVisitor{TResult}.cs | 2 + ...teSubquerySqlParserBaselineTests.First.xml | 92 ++ ...ateSubquerySqlParserBaselineTests.Last.xml | 92 ++ ...ExpressionSqlParserBaselineTests.First.xml | 47 + ...rExpressionSqlParserBaselineTests.Last.xml | 47 + .../Microsoft.Azure.Cosmos.Tests.csproj | 30 +- .../AggregateProjectionDector.cs | 12 + .../AggregateProjectionTransformer.cs | 12 + .../ScalarExpressionEvaluator.cs | 20 + .../Query/OfflineEngine/SqlInterpreter.cs | 10 + ...AggregateSubquerySqlParserBaselineTests.cs | 99 +- .../ScalarExpressionSqlParserBaselineTests.cs | 64 ++ 32 files changed, 1633 insertions(+), 741 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/src/SqlObjects/SqlFirstScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/SqlObjects/SqlLastScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/AggregateSubquerySqlParserBaselineTests.First.xml create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/AggregateSubquerySqlParserBaselineTests.Last.xml create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ScalarExpressionSqlParserBaselineTests.First.xml create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ScalarExpressionSqlParserBaselineTests.Last.xml diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/CstToAstVisitor.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/CstToAstVisitor.cs index 448b8f4ca6..8ba6c4fc45 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/CstToAstVisitor.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/CstToAstVisitor.cs @@ -568,6 +568,16 @@ public override SqlObject VisitExistsScalarExpression([NotNull] sqlParser.Exists return SqlExistsScalarExpression.Create(subquery); } + public override SqlObject VisitFirstScalarExpression([NotNull] sqlParser.FirstScalarExpressionContext context) + { + Contract.Requires(context != null); + // K_FIRST '(' sql_query ')' + Contract.Requires(context.ChildCount == 4); + + SqlQuery subquery = (SqlQuery)this.Visit(context.children[2]); + return SqlFirstScalarExpression.Create(subquery); + } + public override SqlObject VisitFunctionCallScalarExpression([NotNull] sqlParser.FunctionCallScalarExpressionContext context) { Contract.Requires(context != null); @@ -627,6 +637,16 @@ public override SqlObject VisitIn_scalar_expression([NotNull] sqlParser.In_scala return SqlInScalarExpression.Create(needle, not, searchList.ToImmutableArray()); } + public override SqlObject VisitLastScalarExpression([NotNull] sqlParser.LastScalarExpressionContext context) + { + Contract.Requires(context != null); + // K_LAST '(' sql_query ')' + Contract.Requires(context.ChildCount == 4); + + SqlQuery subquery = (SqlQuery)this.Visit(context.children[2]); + return SqlLastScalarExpression.Create(subquery); + } + public override SqlObject VisitLike_scalar_expression([NotNull] sqlParser.Like_scalar_expressionContext context) { Contract.Requires(context != null); diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/IsqlListener.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/IsqlListener.cs index 24a4a0694a..9cde50fb6b 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/IsqlListener.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/IsqlListener.cs @@ -562,6 +562,18 @@ internal interface IsqlListener : IParseTreeListener { /// The parse tree. void ExitObjectCreateScalarExpression([NotNull] sqlParser.ObjectCreateScalarExpressionContext context); /// + /// Enter a parse tree produced by the FirstScalarExpression + /// labeled alternative in . + /// + /// The parse tree. + void EnterFirstScalarExpression([NotNull] sqlParser.FirstScalarExpressionContext context); + /// + /// Exit a parse tree produced by the FirstScalarExpression + /// labeled alternative in . + /// + /// The parse tree. + void ExitFirstScalarExpression([NotNull] sqlParser.FirstScalarExpressionContext context); + /// /// Enter a parse tree produced by the ArrayCreateScalarExpression /// labeled alternative in . /// @@ -670,6 +682,18 @@ internal interface IsqlListener : IParseTreeListener { /// The parse tree. void ExitArrayScalarExpression([NotNull] sqlParser.ArrayScalarExpressionContext context); /// + /// Enter a parse tree produced by the LastScalarExpression + /// labeled alternative in . + /// + /// The parse tree. + void EnterLastScalarExpression([NotNull] sqlParser.LastScalarExpressionContext context); + /// + /// Exit a parse tree produced by the LastScalarExpression + /// labeled alternative in . + /// + /// The parse tree. + void ExitLastScalarExpression([NotNull] sqlParser.LastScalarExpressionContext context); + /// /// Enter a parse tree produced by the PropertyRefScalarExpressionRecursive /// labeled alternative in . /// diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/IsqlVisitor.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/IsqlVisitor.cs index e22a9d4218..b9bea8ca1d 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/IsqlVisitor.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/IsqlVisitor.cs @@ -347,6 +347,13 @@ internal interface IsqlVisitor : IParseTreeVisitor { /// The visitor result. Result VisitObjectCreateScalarExpression([NotNull] sqlParser.ObjectCreateScalarExpressionContext context); /// + /// Visit a parse tree produced by the FirstScalarExpression + /// labeled alternative in . + /// + /// The parse tree. + /// The visitor result. + Result VisitFirstScalarExpression([NotNull] sqlParser.FirstScalarExpressionContext context); + /// /// Visit a parse tree produced by the ArrayCreateScalarExpression /// labeled alternative in . /// @@ -410,6 +417,13 @@ internal interface IsqlVisitor : IParseTreeVisitor { /// The visitor result. Result VisitArrayScalarExpression([NotNull] sqlParser.ArrayScalarExpressionContext context); /// + /// Visit a parse tree produced by the LastScalarExpression + /// labeled alternative in . + /// + /// The parse tree. + /// The visitor result. + Result VisitLastScalarExpression([NotNull] sqlParser.LastScalarExpressionContext context); + /// /// Visit a parse tree produced by the PropertyRefScalarExpressionRecursive /// labeled alternative in . /// diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sql.g4 b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sql.g4 index 42ac229557..2b0002a8ab 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sql.g4 +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sql.g4 @@ -173,6 +173,8 @@ primary_expression | K_EXISTS '(' sql_query ')' #ExistsScalarExpression | K_ARRAY '(' sql_query ')' #ArrayScalarExpression | K_ALL '(' sql_query ')' #AllScalarExpression + | K_FIRST '(' sql_query ')' #FirstScalarExpression + | K_LAST '(' sql_query ')' #LastScalarExpression | function_call_scalar_expression #FunctionCallScalarExpression ; @@ -191,6 +193,8 @@ object_property : STRING_LITERAL ':' scalar_expression ; identifier : LEX_IDENTIFIER | K_ALL + | K_FIRST + | K_LAST ; /*--------------------------------------------------------------------------------*/ @@ -208,11 +212,13 @@ K_DESC : D E S C; K_DISTINCT : D I S T I N C T; K_ESCAPE: E S C A P E; K_EXISTS : E X I S T S; +K_FIRST : F I R S T; K_FALSE : 'false'; K_FROM : F R O M; K_GROUP : G R O U P; K_IN : I N ; K_JOIN : J O I N; +K_LAST : L A S T; K_LEFT : L E F T; K_LIKE : L I K E; K_LIMIT : L I M I T; diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlBaseListener.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlBaseListener.cs index 18003391b1..62f2873d72 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlBaseListener.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlBaseListener.cs @@ -666,6 +666,20 @@ public virtual void EnterObjectCreateScalarExpression([NotNull] sqlParser.Object /// The parse tree. public virtual void ExitObjectCreateScalarExpression([NotNull] sqlParser.ObjectCreateScalarExpressionContext context) { } /// + /// Enter a parse tree produced by the FirstScalarExpression + /// labeled alternative in . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterFirstScalarExpression([NotNull] sqlParser.FirstScalarExpressionContext context) { } + /// + /// Exit a parse tree produced by the FirstScalarExpression + /// labeled alternative in . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitFirstScalarExpression([NotNull] sqlParser.FirstScalarExpressionContext context) { } + /// /// Enter a parse tree produced by the ArrayCreateScalarExpression /// labeled alternative in . /// The default implementation does nothing. @@ -792,6 +806,20 @@ public virtual void EnterArrayScalarExpression([NotNull] sqlParser.ArrayScalarEx /// The parse tree. public virtual void ExitArrayScalarExpression([NotNull] sqlParser.ArrayScalarExpressionContext context) { } /// + /// Enter a parse tree produced by the LastScalarExpression + /// labeled alternative in . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void EnterLastScalarExpression([NotNull] sqlParser.LastScalarExpressionContext context) { } + /// + /// Exit a parse tree produced by the LastScalarExpression + /// labeled alternative in . + /// The default implementation does nothing. + /// + /// The parse tree. + public virtual void ExitLastScalarExpression([NotNull] sqlParser.LastScalarExpressionContext context) { } + /// /// Enter a parse tree produced by the PropertyRefScalarExpressionRecursive /// labeled alternative in . /// The default implementation does nothing. diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlBaseVisitor.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlBaseVisitor.cs index bb3b86379d..4594f5fc79 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlBaseVisitor.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlBaseVisitor.cs @@ -549,6 +549,17 @@ internal partial class sqlBaseVisitor : AbstractParseTreeVisitor /// The visitor result. public virtual Result VisitObjectCreateScalarExpression([NotNull] sqlParser.ObjectCreateScalarExpressionContext context) { return VisitChildren(context); } /// + /// Visit a parse tree produced by the FirstScalarExpression + /// labeled alternative in . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitFirstScalarExpression([NotNull] sqlParser.FirstScalarExpressionContext context) { return VisitChildren(context); } + /// /// Visit a parse tree produced by the ArrayCreateScalarExpression /// labeled alternative in . /// @@ -648,6 +659,17 @@ internal partial class sqlBaseVisitor : AbstractParseTreeVisitor /// The visitor result. public virtual Result VisitArrayScalarExpression([NotNull] sqlParser.ArrayScalarExpressionContext context) { return VisitChildren(context); } /// + /// Visit a parse tree produced by the LastScalarExpression + /// labeled alternative in . + /// + /// The default implementation returns the result of calling + /// on . + /// + /// + /// The parse tree. + /// The visitor result. + public virtual Result VisitLastScalarExpression([NotNull] sqlParser.LastScalarExpressionContext context) { return VisitChildren(context); } + /// /// Visit a parse tree produced by the PropertyRefScalarExpressionRecursive /// labeled alternative in . /// diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlLexer.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlLexer.cs index 1d5b7262bd..88888fea5d 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlLexer.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlLexer.cs @@ -37,11 +37,11 @@ public const int T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24, T__24=25, T__25=26, T__26=27, K_ALL=28, K_AND=29, K_ARRAY=30, K_AS=31, K_ASC=32, K_BETWEEN=33, K_BY=34, K_DESC=35, K_DISTINCT=36, K_ESCAPE=37, - K_EXISTS=38, K_FALSE=39, K_FROM=40, K_GROUP=41, K_IN=42, K_JOIN=43, K_LEFT=44, - K_LIKE=45, K_LIMIT=46, K_NOT=47, K_NULL=48, K_OFFSET=49, K_OR=50, K_ORDER=51, - K_RIGHT=52, K_SELECT=53, K_TOP=54, K_TRUE=55, K_UDF=56, K_UNDEFINED=57, - K_VALUE=58, K_WHERE=59, WS=60, NUMERIC_LITERAL=61, STRING_LITERAL=62, - LEX_IDENTIFIER=63, PARAMETER=64; + K_EXISTS=38, K_FIRST=39, K_FALSE=40, K_FROM=41, K_GROUP=42, K_IN=43, K_JOIN=44, + K_LAST=45, K_LEFT=46, K_LIKE=47, K_LIMIT=48, K_NOT=49, K_NULL=50, K_OFFSET=51, + K_OR=52, K_ORDER=53, K_RIGHT=54, K_SELECT=55, K_TOP=56, K_TRUE=57, K_UDF=58, + K_UNDEFINED=59, K_VALUE=60, K_WHERE=61, WS=62, NUMERIC_LITERAL=63, STRING_LITERAL=64, + LEX_IDENTIFIER=65, PARAMETER=66; public static string[] channelNames = { "DEFAULT_TOKEN_CHANNEL", "HIDDEN" }; @@ -55,11 +55,11 @@ public const int "T__9", "T__10", "T__11", "T__12", "T__13", "T__14", "T__15", "T__16", "T__17", "T__18", "T__19", "T__20", "T__21", "T__22", "T__23", "T__24", "T__25", "T__26", "K_ALL", "K_AND", "K_ARRAY", "K_AS", "K_ASC", "K_BETWEEN", - "K_BY", "K_DESC", "K_DISTINCT", "K_ESCAPE", "K_EXISTS", "K_FALSE", "K_FROM", - "K_GROUP", "K_IN", "K_JOIN", "K_LEFT", "K_LIKE", "K_LIMIT", "K_NOT", "K_NULL", - "K_OFFSET", "K_OR", "K_ORDER", "K_RIGHT", "K_SELECT", "K_TOP", "K_TRUE", - "K_UDF", "K_UNDEFINED", "K_VALUE", "K_WHERE", "WS", "NUMERIC_LITERAL", - "STRING_LITERAL", "ESC", "UNICODE", "HEX", "SAFECODEPOINTWITHSINGLEQUOTATION", + "K_BY", "K_DESC", "K_DISTINCT", "K_ESCAPE", "K_EXISTS", "K_FIRST", "K_FALSE", + "K_FROM", "K_GROUP", "K_IN", "K_JOIN", "K_LAST", "K_LEFT", "K_LIKE", "K_LIMIT", + "K_NOT", "K_NULL", "K_OFFSET", "K_OR", "K_ORDER", "K_RIGHT", "K_SELECT", + "K_TOP", "K_TRUE", "K_UDF", "K_UNDEFINED", "K_VALUE", "K_WHERE", "WS", + "NUMERIC_LITERAL", "STRING_LITERAL", "ESC", "UNICODE", "HEX", "SAFECODEPOINTWITHSINGLEQUOTATION", "SAFECODEPOINTWITHDOUBLEQUOTATION", "LEX_IDENTIFIER", "PARAMETER", "DIGIT", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" @@ -79,19 +79,20 @@ public sqlLexer(ICharStream input, TextWriter output, TextWriter errorOutput) null, "'*'", "','", "'('", "')'", "'.'", "'['", "']'", "'?'", "':'", "'??'", "'/'", "'%'", "'+'", "'-'", "'<'", "'>'", "'>='", "'<='", "'='", "'!='", "'&'", "'^'", "'|'", "'||'", "'~'", "'{'", "'}'", null, null, null, null, - null, null, null, null, null, null, null, "'false'", null, null, null, - null, null, null, null, null, "'null'", null, null, null, null, null, - null, "'true'", "'udf'", "'undefined'" + null, null, null, null, null, null, null, null, "'false'", null, null, + null, null, null, null, null, null, null, "'null'", null, null, null, + null, null, null, "'true'", "'udf'", "'undefined'" }; private static readonly string[] _SymbolicNames = { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "K_ALL", "K_AND", "K_ARRAY", "K_AS", "K_ASC", - "K_BETWEEN", "K_BY", "K_DESC", "K_DISTINCT", "K_ESCAPE", "K_EXISTS", "K_FALSE", - "K_FROM", "K_GROUP", "K_IN", "K_JOIN", "K_LEFT", "K_LIKE", "K_LIMIT", - "K_NOT", "K_NULL", "K_OFFSET", "K_OR", "K_ORDER", "K_RIGHT", "K_SELECT", - "K_TOP", "K_TRUE", "K_UDF", "K_UNDEFINED", "K_VALUE", "K_WHERE", "WS", - "NUMERIC_LITERAL", "STRING_LITERAL", "LEX_IDENTIFIER", "PARAMETER" + "K_BETWEEN", "K_BY", "K_DESC", "K_DISTINCT", "K_ESCAPE", "K_EXISTS", "K_FIRST", + "K_FALSE", "K_FROM", "K_GROUP", "K_IN", "K_JOIN", "K_LAST", "K_LEFT", + "K_LIKE", "K_LIMIT", "K_NOT", "K_NULL", "K_OFFSET", "K_OR", "K_ORDER", + "K_RIGHT", "K_SELECT", "K_TOP", "K_TRUE", "K_UDF", "K_UNDEFINED", "K_VALUE", + "K_WHERE", "WS", "NUMERIC_LITERAL", "STRING_LITERAL", "LEX_IDENTIFIER", + "PARAMETER" }; public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames); @@ -122,7 +123,7 @@ static sqlLexer() { } private static char[] _serializedATN = { '\x3', '\x608B', '\xA72A', '\x8133', '\xB9ED', '\x417C', '\x3BE7', '\x7786', - '\x5964', '\x2', '\x42', '\x24E', '\b', '\x1', '\x4', '\x2', '\t', '\x2', + '\x5964', '\x2', '\x44', '\x25D', '\b', '\x1', '\x4', '\x2', '\t', '\x2', '\x4', '\x3', '\t', '\x3', '\x4', '\x4', '\t', '\x4', '\x4', '\x5', '\t', '\x5', '\x4', '\x6', '\t', '\x6', '\x4', '\a', '\t', '\a', '\x4', '\b', '\t', '\b', '\x4', '\t', '\t', '\t', '\x4', '\n', '\t', '\n', '\x4', '\v', @@ -156,469 +157,482 @@ static sqlLexer() { 'X', '\x4', 'Y', '\t', 'Y', '\x4', 'Z', '\t', 'Z', '\x4', '[', '\t', '[', '\x4', '\\', '\t', '\\', '\x4', ']', '\t', ']', '\x4', '^', '\t', '^', '\x4', '_', '\t', '_', '\x4', '`', '\t', '`', '\x4', '\x61', '\t', '\x61', - '\x3', '\x2', '\x3', '\x2', '\x3', '\x3', '\x3', '\x3', '\x3', '\x4', - '\x3', '\x4', '\x3', '\x5', '\x3', '\x5', '\x3', '\x6', '\x3', '\x6', - '\x3', '\a', '\x3', '\a', '\x3', '\b', '\x3', '\b', '\x3', '\t', '\x3', - '\t', '\x3', '\n', '\x3', '\n', '\x3', '\v', '\x3', '\v', '\x3', '\v', - '\x3', '\f', '\x3', '\f', '\x3', '\r', '\x3', '\r', '\x3', '\xE', '\x3', - '\xE', '\x3', '\xF', '\x3', '\xF', '\x3', '\x10', '\x3', '\x10', '\x3', - '\x11', '\x3', '\x11', '\x3', '\x12', '\x3', '\x12', '\x3', '\x12', '\x3', - '\x13', '\x3', '\x13', '\x3', '\x13', '\x3', '\x14', '\x3', '\x14', '\x3', - '\x15', '\x3', '\x15', '\x3', '\x15', '\x3', '\x16', '\x3', '\x16', '\x3', - '\x17', '\x3', '\x17', '\x3', '\x18', '\x3', '\x18', '\x3', '\x19', '\x3', - '\x19', '\x3', '\x19', '\x3', '\x1A', '\x3', '\x1A', '\x3', '\x1B', '\x3', - '\x1B', '\x3', '\x1C', '\x3', '\x1C', '\x3', '\x1D', '\x3', '\x1D', '\x3', - '\x1D', '\x3', '\x1D', '\x3', '\x1E', '\x3', '\x1E', '\x3', '\x1E', '\x3', - '\x1E', '\x3', '\x1F', '\x3', '\x1F', '\x3', '\x1F', '\x3', '\x1F', '\x3', - '\x1F', '\x3', '\x1F', '\x3', ' ', '\x3', ' ', '\x3', ' ', '\x3', '!', - '\x3', '!', '\x3', '!', '\x3', '!', '\x3', '\"', '\x3', '\"', '\x3', '\"', - '\x3', '\"', '\x3', '\"', '\x3', '\"', '\x3', '\"', '\x3', '\"', '\x3', - '#', '\x3', '#', '\x3', '#', '\x3', '$', '\x3', '$', '\x3', '$', '\x3', - '$', '\x3', '$', '\x3', '%', '\x3', '%', '\x3', '%', '\x3', '%', '\x3', - '%', '\x3', '%', '\x3', '%', '\x3', '%', '\x3', '%', '\x3', '&', '\x3', - '&', '\x3', '&', '\x3', '&', '\x3', '&', '\x3', '&', '\x3', '&', '\x3', - '\'', '\x3', '\'', '\x3', '\'', '\x3', '\'', '\x3', '\'', '\x3', '\'', - '\x3', '\'', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', - '\x3', '(', '\x3', ')', '\x3', ')', '\x3', ')', '\x3', ')', '\x3', ')', - '\x3', '*', '\x3', '*', '\x3', '*', '\x3', '*', '\x3', '*', '\x3', '*', - '\x3', '+', '\x3', '+', '\x3', '+', '\x3', ',', '\x3', ',', '\x3', ',', - '\x3', ',', '\x3', ',', '\x3', '-', '\x3', '-', '\x3', '-', '\x3', '-', - '\x3', '-', '\x3', '.', '\x3', '.', '\x3', '.', '\x3', '.', '\x3', '.', - '\x3', '/', '\x3', '/', '\x3', '/', '\x3', '/', '\x3', '/', '\x3', '/', - '\x3', '\x30', '\x3', '\x30', '\x3', '\x30', '\x3', '\x30', '\x3', '\x31', - '\x3', '\x31', '\x3', '\x31', '\x3', '\x31', '\x3', '\x31', '\x3', '\x32', - '\x3', '\x32', '\x3', '\x32', '\x3', '\x32', '\x3', '\x32', '\x3', '\x32', - '\x3', '\x32', '\x3', '\x33', '\x3', '\x33', '\x3', '\x33', '\x3', '\x34', - '\x3', '\x34', '\x3', '\x34', '\x3', '\x34', '\x3', '\x34', '\x3', '\x34', - '\x3', '\x35', '\x3', '\x35', '\x3', '\x35', '\x3', '\x35', '\x3', '\x35', - '\x3', '\x35', '\x3', '\x36', '\x3', '\x36', '\x3', '\x36', '\x3', '\x36', - '\x3', '\x36', '\x3', '\x36', '\x3', '\x36', '\x3', '\x37', '\x3', '\x37', - '\x3', '\x37', '\x3', '\x37', '\x3', '\x38', '\x3', '\x38', '\x3', '\x38', - '\x3', '\x38', '\x3', '\x38', '\x3', '\x39', '\x3', '\x39', '\x3', '\x39', - '\x3', '\x39', '\x3', ':', '\x3', ':', '\x3', ':', '\x3', ':', '\x3', - ':', '\x3', ':', '\x3', ':', '\x3', ':', '\x3', ':', '\x3', ':', '\x3', - ';', '\x3', ';', '\x3', ';', '\x3', ';', '\x3', ';', '\x3', ';', '\x3', - '<', '\x3', '<', '\x3', '<', '\x3', '<', '\x3', '<', '\x3', '<', '\x3', - '=', '\x6', '=', '\x1AE', '\n', '=', '\r', '=', '\xE', '=', '\x1AF', '\x3', - '=', '\x3', '=', '\x3', '>', '\x5', '>', '\x1B5', '\n', '>', '\x3', '>', - '\x6', '>', '\x1B8', '\n', '>', '\r', '>', '\xE', '>', '\x1B9', '\x3', - '>', '\x3', '>', '\a', '>', '\x1BE', '\n', '>', '\f', '>', '\xE', '>', - '\x1C1', '\v', '>', '\x5', '>', '\x1C3', '\n', '>', '\x3', '>', '\x3', - '>', '\x5', '>', '\x1C7', '\n', '>', '\x3', '>', '\x6', '>', '\x1CA', - '\n', '>', '\r', '>', '\xE', '>', '\x1CB', '\x5', '>', '\x1CE', '\n', - '>', '\x3', '>', '\x5', '>', '\x1D1', '\n', '>', '\x3', '>', '\x3', '>', - '\x6', '>', '\x1D5', '\n', '>', '\r', '>', '\xE', '>', '\x1D6', '\x3', - '>', '\x3', '>', '\x5', '>', '\x1DB', '\n', '>', '\x3', '>', '\x6', '>', - '\x1DE', '\n', '>', '\r', '>', '\xE', '>', '\x1DF', '\x5', '>', '\x1E2', - '\n', '>', '\x5', '>', '\x1E4', '\n', '>', '\x3', '?', '\x3', '?', '\x3', - '?', '\a', '?', '\x1E9', '\n', '?', '\f', '?', '\xE', '?', '\x1EC', '\v', - '?', '\x3', '?', '\x3', '?', '\x3', '?', '\x3', '?', '\a', '?', '\x1F2', - '\n', '?', '\f', '?', '\xE', '?', '\x1F5', '\v', '?', '\x3', '?', '\x5', - '?', '\x1F8', '\n', '?', '\x3', '@', '\x3', '@', '\x3', '@', '\x5', '@', - '\x1FD', '\n', '@', '\x3', '\x41', '\x3', '\x41', '\x3', '\x41', '\x3', - '\x41', '\x3', '\x41', '\x3', '\x41', '\x3', '\x42', '\x3', '\x42', '\x3', - '\x43', '\x3', '\x43', '\x3', '\x44', '\x3', '\x44', '\x3', '\x45', '\x3', - '\x45', '\x3', '\x45', '\x3', '\x45', '\a', '\x45', '\x20F', '\n', '\x45', - '\f', '\x45', '\xE', '\x45', '\x212', '\v', '\x45', '\x5', '\x45', '\x214', - '\n', '\x45', '\x3', '\x46', '\x3', '\x46', '\x3', '\x46', '\x3', 'G', - '\x3', 'G', '\x3', 'H', '\x3', 'H', '\x3', 'I', '\x3', 'I', '\x3', 'J', - '\x3', 'J', '\x3', 'K', '\x3', 'K', '\x3', 'L', '\x3', 'L', '\x3', 'M', - '\x3', 'M', '\x3', 'N', '\x3', 'N', '\x3', 'O', '\x3', 'O', '\x3', 'P', - '\x3', 'P', '\x3', 'Q', '\x3', 'Q', '\x3', 'R', '\x3', 'R', '\x3', 'S', - '\x3', 'S', '\x3', 'T', '\x3', 'T', '\x3', 'U', '\x3', 'U', '\x3', 'V', - '\x3', 'V', '\x3', 'W', '\x3', 'W', '\x3', 'X', '\x3', 'X', '\x3', 'Y', - '\x3', 'Y', '\x3', 'Z', '\x3', 'Z', '\x3', '[', '\x3', '[', '\x3', '\\', - '\x3', '\\', '\x3', ']', '\x3', ']', '\x3', '^', '\x3', '^', '\x3', '_', - '\x3', '_', '\x3', '`', '\x3', '`', '\x3', '\x61', '\x3', '\x61', '\x2', - '\x2', '\x62', '\x3', '\x3', '\x5', '\x4', '\a', '\x5', '\t', '\x6', '\v', - '\a', '\r', '\b', '\xF', '\t', '\x11', '\n', '\x13', '\v', '\x15', '\f', - '\x17', '\r', '\x19', '\xE', '\x1B', '\xF', '\x1D', '\x10', '\x1F', '\x11', - '!', '\x12', '#', '\x13', '%', '\x14', '\'', '\x15', ')', '\x16', '+', - '\x17', '-', '\x18', '/', '\x19', '\x31', '\x1A', '\x33', '\x1B', '\x35', - '\x1C', '\x37', '\x1D', '\x39', '\x1E', ';', '\x1F', '=', ' ', '?', '!', - '\x41', '\"', '\x43', '#', '\x45', '$', 'G', '%', 'I', '&', 'K', '\'', - 'M', '(', 'O', ')', 'Q', '*', 'S', '+', 'U', ',', 'W', '-', 'Y', '.', - '[', '/', ']', '\x30', '_', '\x31', '\x61', '\x32', '\x63', '\x33', '\x65', - '\x34', 'g', '\x35', 'i', '\x36', 'k', '\x37', 'm', '\x38', 'o', '\x39', - 'q', ':', 's', ';', 'u', '<', 'w', '=', 'y', '>', '{', '?', '}', '@', - '\x7F', '\x2', '\x81', '\x2', '\x83', '\x2', '\x85', '\x2', '\x87', '\x2', - '\x89', '\x41', '\x8B', '\x42', '\x8D', '\x2', '\x8F', '\x2', '\x91', - '\x2', '\x93', '\x2', '\x95', '\x2', '\x97', '\x2', '\x99', '\x2', '\x9B', - '\x2', '\x9D', '\x2', '\x9F', '\x2', '\xA1', '\x2', '\xA3', '\x2', '\xA5', - '\x2', '\xA7', '\x2', '\xA9', '\x2', '\xAB', '\x2', '\xAD', '\x2', '\xAF', - '\x2', '\xB1', '\x2', '\xB3', '\x2', '\xB5', '\x2', '\xB7', '\x2', '\xB9', - '\x2', '\xBB', '\x2', '\xBD', '\x2', '\xBF', '\x2', '\xC1', '\x2', '\x3', - '\x2', '$', '\x5', '\x2', '\v', '\f', '\xF', '\xF', '\"', '\"', '\x4', - '\x2', '-', '-', '/', '/', '\n', '\x2', '$', '$', '\x31', '\x31', '^', - '^', '\x64', '\x64', 'h', 'h', 'p', 'p', 't', 't', 'v', 'v', '\x5', '\x2', - '\x32', ';', '\x43', 'H', '\x63', 'h', '\x5', '\x2', '\x2', '!', ')', - ')', '^', '^', '\x5', '\x2', '\x2', '!', '$', '$', '^', '^', '\x5', '\x2', - '\x43', '\\', '\x61', '\x61', '\x63', '|', '\x3', '\x2', '\x32', ';', - '\x4', '\x2', '\x43', '\x43', '\x63', '\x63', '\x4', '\x2', '\x44', '\x44', - '\x64', '\x64', '\x4', '\x2', '\x45', '\x45', '\x65', '\x65', '\x4', '\x2', - '\x46', '\x46', '\x66', '\x66', '\x4', '\x2', 'G', 'G', 'g', 'g', '\x4', - '\x2', 'H', 'H', 'h', 'h', '\x4', '\x2', 'I', 'I', 'i', 'i', '\x4', '\x2', - 'J', 'J', 'j', 'j', '\x4', '\x2', 'K', 'K', 'k', 'k', '\x4', '\x2', 'L', - 'L', 'l', 'l', '\x4', '\x2', 'M', 'M', 'm', 'm', '\x4', '\x2', 'N', 'N', - 'n', 'n', '\x4', '\x2', 'O', 'O', 'o', 'o', '\x4', '\x2', 'P', 'P', 'p', - 'p', '\x4', '\x2', 'Q', 'Q', 'q', 'q', '\x4', '\x2', 'R', 'R', 'r', 'r', - '\x4', '\x2', 'S', 'S', 's', 's', '\x4', '\x2', 'T', 'T', 't', 't', '\x4', - '\x2', 'U', 'U', 'u', 'u', '\x4', '\x2', 'V', 'V', 'v', 'v', '\x4', '\x2', - 'W', 'W', 'w', 'w', '\x4', '\x2', 'X', 'X', 'x', 'x', '\x4', '\x2', 'Y', - 'Y', 'y', 'y', '\x4', '\x2', 'Z', 'Z', 'z', 'z', '\x4', '\x2', '[', '[', - '{', '{', '\x4', '\x2', '\\', '\\', '|', '|', '\x2', '\x244', '\x2', '\x3', - '\x3', '\x2', '\x2', '\x2', '\x2', '\x5', '\x3', '\x2', '\x2', '\x2', - '\x2', '\a', '\x3', '\x2', '\x2', '\x2', '\x2', '\t', '\x3', '\x2', '\x2', - '\x2', '\x2', '\v', '\x3', '\x2', '\x2', '\x2', '\x2', '\r', '\x3', '\x2', - '\x2', '\x2', '\x2', '\xF', '\x3', '\x2', '\x2', '\x2', '\x2', '\x11', - '\x3', '\x2', '\x2', '\x2', '\x2', '\x13', '\x3', '\x2', '\x2', '\x2', - '\x2', '\x15', '\x3', '\x2', '\x2', '\x2', '\x2', '\x17', '\x3', '\x2', - '\x2', '\x2', '\x2', '\x19', '\x3', '\x2', '\x2', '\x2', '\x2', '\x1B', - '\x3', '\x2', '\x2', '\x2', '\x2', '\x1D', '\x3', '\x2', '\x2', '\x2', - '\x2', '\x1F', '\x3', '\x2', '\x2', '\x2', '\x2', '!', '\x3', '\x2', '\x2', - '\x2', '\x2', '#', '\x3', '\x2', '\x2', '\x2', '\x2', '%', '\x3', '\x2', - '\x2', '\x2', '\x2', '\'', '\x3', '\x2', '\x2', '\x2', '\x2', ')', '\x3', - '\x2', '\x2', '\x2', '\x2', '+', '\x3', '\x2', '\x2', '\x2', '\x2', '-', - '\x3', '\x2', '\x2', '\x2', '\x2', '/', '\x3', '\x2', '\x2', '\x2', '\x2', - '\x31', '\x3', '\x2', '\x2', '\x2', '\x2', '\x33', '\x3', '\x2', '\x2', - '\x2', '\x2', '\x35', '\x3', '\x2', '\x2', '\x2', '\x2', '\x37', '\x3', - '\x2', '\x2', '\x2', '\x2', '\x39', '\x3', '\x2', '\x2', '\x2', '\x2', - ';', '\x3', '\x2', '\x2', '\x2', '\x2', '=', '\x3', '\x2', '\x2', '\x2', - '\x2', '?', '\x3', '\x2', '\x2', '\x2', '\x2', '\x41', '\x3', '\x2', '\x2', - '\x2', '\x2', '\x43', '\x3', '\x2', '\x2', '\x2', '\x2', '\x45', '\x3', - '\x2', '\x2', '\x2', '\x2', 'G', '\x3', '\x2', '\x2', '\x2', '\x2', 'I', - '\x3', '\x2', '\x2', '\x2', '\x2', 'K', '\x3', '\x2', '\x2', '\x2', '\x2', - 'M', '\x3', '\x2', '\x2', '\x2', '\x2', 'O', '\x3', '\x2', '\x2', '\x2', - '\x2', 'Q', '\x3', '\x2', '\x2', '\x2', '\x2', 'S', '\x3', '\x2', '\x2', - '\x2', '\x2', 'U', '\x3', '\x2', '\x2', '\x2', '\x2', 'W', '\x3', '\x2', - '\x2', '\x2', '\x2', 'Y', '\x3', '\x2', '\x2', '\x2', '\x2', '[', '\x3', - '\x2', '\x2', '\x2', '\x2', ']', '\x3', '\x2', '\x2', '\x2', '\x2', '_', - '\x3', '\x2', '\x2', '\x2', '\x2', '\x61', '\x3', '\x2', '\x2', '\x2', - '\x2', '\x63', '\x3', '\x2', '\x2', '\x2', '\x2', '\x65', '\x3', '\x2', - '\x2', '\x2', '\x2', 'g', '\x3', '\x2', '\x2', '\x2', '\x2', 'i', '\x3', - '\x2', '\x2', '\x2', '\x2', 'k', '\x3', '\x2', '\x2', '\x2', '\x2', 'm', - '\x3', '\x2', '\x2', '\x2', '\x2', 'o', '\x3', '\x2', '\x2', '\x2', '\x2', - 'q', '\x3', '\x2', '\x2', '\x2', '\x2', 's', '\x3', '\x2', '\x2', '\x2', - '\x2', 'u', '\x3', '\x2', '\x2', '\x2', '\x2', 'w', '\x3', '\x2', '\x2', - '\x2', '\x2', 'y', '\x3', '\x2', '\x2', '\x2', '\x2', '{', '\x3', '\x2', - '\x2', '\x2', '\x2', '}', '\x3', '\x2', '\x2', '\x2', '\x2', '\x89', '\x3', - '\x2', '\x2', '\x2', '\x2', '\x8B', '\x3', '\x2', '\x2', '\x2', '\x3', - '\xC3', '\x3', '\x2', '\x2', '\x2', '\x5', '\xC5', '\x3', '\x2', '\x2', - '\x2', '\a', '\xC7', '\x3', '\x2', '\x2', '\x2', '\t', '\xC9', '\x3', - '\x2', '\x2', '\x2', '\v', '\xCB', '\x3', '\x2', '\x2', '\x2', '\r', '\xCD', - '\x3', '\x2', '\x2', '\x2', '\xF', '\xCF', '\x3', '\x2', '\x2', '\x2', - '\x11', '\xD1', '\x3', '\x2', '\x2', '\x2', '\x13', '\xD3', '\x3', '\x2', - '\x2', '\x2', '\x15', '\xD5', '\x3', '\x2', '\x2', '\x2', '\x17', '\xD8', - '\x3', '\x2', '\x2', '\x2', '\x19', '\xDA', '\x3', '\x2', '\x2', '\x2', - '\x1B', '\xDC', '\x3', '\x2', '\x2', '\x2', '\x1D', '\xDE', '\x3', '\x2', - '\x2', '\x2', '\x1F', '\xE0', '\x3', '\x2', '\x2', '\x2', '!', '\xE2', - '\x3', '\x2', '\x2', '\x2', '#', '\xE4', '\x3', '\x2', '\x2', '\x2', '%', - '\xE7', '\x3', '\x2', '\x2', '\x2', '\'', '\xEA', '\x3', '\x2', '\x2', - '\x2', ')', '\xEC', '\x3', '\x2', '\x2', '\x2', '+', '\xEF', '\x3', '\x2', - '\x2', '\x2', '-', '\xF1', '\x3', '\x2', '\x2', '\x2', '/', '\xF3', '\x3', - '\x2', '\x2', '\x2', '\x31', '\xF5', '\x3', '\x2', '\x2', '\x2', '\x33', - '\xF8', '\x3', '\x2', '\x2', '\x2', '\x35', '\xFA', '\x3', '\x2', '\x2', - '\x2', '\x37', '\xFC', '\x3', '\x2', '\x2', '\x2', '\x39', '\xFE', '\x3', - '\x2', '\x2', '\x2', ';', '\x102', '\x3', '\x2', '\x2', '\x2', '=', '\x106', - '\x3', '\x2', '\x2', '\x2', '?', '\x10C', '\x3', '\x2', '\x2', '\x2', - '\x41', '\x10F', '\x3', '\x2', '\x2', '\x2', '\x43', '\x113', '\x3', '\x2', - '\x2', '\x2', '\x45', '\x11B', '\x3', '\x2', '\x2', '\x2', 'G', '\x11E', - '\x3', '\x2', '\x2', '\x2', 'I', '\x123', '\x3', '\x2', '\x2', '\x2', - 'K', '\x12C', '\x3', '\x2', '\x2', '\x2', 'M', '\x133', '\x3', '\x2', - '\x2', '\x2', 'O', '\x13A', '\x3', '\x2', '\x2', '\x2', 'Q', '\x140', - '\x3', '\x2', '\x2', '\x2', 'S', '\x145', '\x3', '\x2', '\x2', '\x2', - 'U', '\x14B', '\x3', '\x2', '\x2', '\x2', 'W', '\x14E', '\x3', '\x2', - '\x2', '\x2', 'Y', '\x153', '\x3', '\x2', '\x2', '\x2', '[', '\x158', - '\x3', '\x2', '\x2', '\x2', ']', '\x15D', '\x3', '\x2', '\x2', '\x2', - '_', '\x163', '\x3', '\x2', '\x2', '\x2', '\x61', '\x167', '\x3', '\x2', - '\x2', '\x2', '\x63', '\x16C', '\x3', '\x2', '\x2', '\x2', '\x65', '\x173', - '\x3', '\x2', '\x2', '\x2', 'g', '\x176', '\x3', '\x2', '\x2', '\x2', - 'i', '\x17C', '\x3', '\x2', '\x2', '\x2', 'k', '\x182', '\x3', '\x2', - '\x2', '\x2', 'm', '\x189', '\x3', '\x2', '\x2', '\x2', 'o', '\x18D', - '\x3', '\x2', '\x2', '\x2', 'q', '\x192', '\x3', '\x2', '\x2', '\x2', - 's', '\x196', '\x3', '\x2', '\x2', '\x2', 'u', '\x1A0', '\x3', '\x2', - '\x2', '\x2', 'w', '\x1A6', '\x3', '\x2', '\x2', '\x2', 'y', '\x1AD', - '\x3', '\x2', '\x2', '\x2', '{', '\x1E3', '\x3', '\x2', '\x2', '\x2', - '}', '\x1F7', '\x3', '\x2', '\x2', '\x2', '\x7F', '\x1F9', '\x3', '\x2', - '\x2', '\x2', '\x81', '\x1FE', '\x3', '\x2', '\x2', '\x2', '\x83', '\x204', - '\x3', '\x2', '\x2', '\x2', '\x85', '\x206', '\x3', '\x2', '\x2', '\x2', - '\x87', '\x208', '\x3', '\x2', '\x2', '\x2', '\x89', '\x213', '\x3', '\x2', - '\x2', '\x2', '\x8B', '\x215', '\x3', '\x2', '\x2', '\x2', '\x8D', '\x218', - '\x3', '\x2', '\x2', '\x2', '\x8F', '\x21A', '\x3', '\x2', '\x2', '\x2', - '\x91', '\x21C', '\x3', '\x2', '\x2', '\x2', '\x93', '\x21E', '\x3', '\x2', - '\x2', '\x2', '\x95', '\x220', '\x3', '\x2', '\x2', '\x2', '\x97', '\x222', - '\x3', '\x2', '\x2', '\x2', '\x99', '\x224', '\x3', '\x2', '\x2', '\x2', - '\x9B', '\x226', '\x3', '\x2', '\x2', '\x2', '\x9D', '\x228', '\x3', '\x2', - '\x2', '\x2', '\x9F', '\x22A', '\x3', '\x2', '\x2', '\x2', '\xA1', '\x22C', - '\x3', '\x2', '\x2', '\x2', '\xA3', '\x22E', '\x3', '\x2', '\x2', '\x2', - '\xA5', '\x230', '\x3', '\x2', '\x2', '\x2', '\xA7', '\x232', '\x3', '\x2', - '\x2', '\x2', '\xA9', '\x234', '\x3', '\x2', '\x2', '\x2', '\xAB', '\x236', - '\x3', '\x2', '\x2', '\x2', '\xAD', '\x238', '\x3', '\x2', '\x2', '\x2', - '\xAF', '\x23A', '\x3', '\x2', '\x2', '\x2', '\xB1', '\x23C', '\x3', '\x2', - '\x2', '\x2', '\xB3', '\x23E', '\x3', '\x2', '\x2', '\x2', '\xB5', '\x240', - '\x3', '\x2', '\x2', '\x2', '\xB7', '\x242', '\x3', '\x2', '\x2', '\x2', - '\xB9', '\x244', '\x3', '\x2', '\x2', '\x2', '\xBB', '\x246', '\x3', '\x2', - '\x2', '\x2', '\xBD', '\x248', '\x3', '\x2', '\x2', '\x2', '\xBF', '\x24A', - '\x3', '\x2', '\x2', '\x2', '\xC1', '\x24C', '\x3', '\x2', '\x2', '\x2', - '\xC3', '\xC4', '\a', ',', '\x2', '\x2', '\xC4', '\x4', '\x3', '\x2', - '\x2', '\x2', '\xC5', '\xC6', '\a', '.', '\x2', '\x2', '\xC6', '\x6', - '\x3', '\x2', '\x2', '\x2', '\xC7', '\xC8', '\a', '*', '\x2', '\x2', '\xC8', - '\b', '\x3', '\x2', '\x2', '\x2', '\xC9', '\xCA', '\a', '+', '\x2', '\x2', - '\xCA', '\n', '\x3', '\x2', '\x2', '\x2', '\xCB', '\xCC', '\a', '\x30', - '\x2', '\x2', '\xCC', '\f', '\x3', '\x2', '\x2', '\x2', '\xCD', '\xCE', - '\a', ']', '\x2', '\x2', '\xCE', '\xE', '\x3', '\x2', '\x2', '\x2', '\xCF', - '\xD0', '\a', '_', '\x2', '\x2', '\xD0', '\x10', '\x3', '\x2', '\x2', - '\x2', '\xD1', '\xD2', '\a', '\x41', '\x2', '\x2', '\xD2', '\x12', '\x3', - '\x2', '\x2', '\x2', '\xD3', '\xD4', '\a', '<', '\x2', '\x2', '\xD4', - '\x14', '\x3', '\x2', '\x2', '\x2', '\xD5', '\xD6', '\a', '\x41', '\x2', - '\x2', '\xD6', '\xD7', '\a', '\x41', '\x2', '\x2', '\xD7', '\x16', '\x3', - '\x2', '\x2', '\x2', '\xD8', '\xD9', '\a', '\x31', '\x2', '\x2', '\xD9', - '\x18', '\x3', '\x2', '\x2', '\x2', '\xDA', '\xDB', '\a', '\'', '\x2', - '\x2', '\xDB', '\x1A', '\x3', '\x2', '\x2', '\x2', '\xDC', '\xDD', '\a', - '-', '\x2', '\x2', '\xDD', '\x1C', '\x3', '\x2', '\x2', '\x2', '\xDE', - '\xDF', '\a', '/', '\x2', '\x2', '\xDF', '\x1E', '\x3', '\x2', '\x2', - '\x2', '\xE0', '\xE1', '\a', '>', '\x2', '\x2', '\xE1', ' ', '\x3', '\x2', - '\x2', '\x2', '\xE2', '\xE3', '\a', '@', '\x2', '\x2', '\xE3', '\"', '\x3', - '\x2', '\x2', '\x2', '\xE4', '\xE5', '\a', '@', '\x2', '\x2', '\xE5', - '\xE6', '\a', '?', '\x2', '\x2', '\xE6', '$', '\x3', '\x2', '\x2', '\x2', - '\xE7', '\xE8', '\a', '>', '\x2', '\x2', '\xE8', '\xE9', '\a', '?', '\x2', - '\x2', '\xE9', '&', '\x3', '\x2', '\x2', '\x2', '\xEA', '\xEB', '\a', - '?', '\x2', '\x2', '\xEB', '(', '\x3', '\x2', '\x2', '\x2', '\xEC', '\xED', - '\a', '#', '\x2', '\x2', '\xED', '\xEE', '\a', '?', '\x2', '\x2', '\xEE', - '*', '\x3', '\x2', '\x2', '\x2', '\xEF', '\xF0', '\a', '(', '\x2', '\x2', - '\xF0', ',', '\x3', '\x2', '\x2', '\x2', '\xF1', '\xF2', '\a', '`', '\x2', - '\x2', '\xF2', '.', '\x3', '\x2', '\x2', '\x2', '\xF3', '\xF4', '\a', - '~', '\x2', '\x2', '\xF4', '\x30', '\x3', '\x2', '\x2', '\x2', '\xF5', - '\xF6', '\a', '~', '\x2', '\x2', '\xF6', '\xF7', '\a', '~', '\x2', '\x2', - '\xF7', '\x32', '\x3', '\x2', '\x2', '\x2', '\xF8', '\xF9', '\a', '\x80', - '\x2', '\x2', '\xF9', '\x34', '\x3', '\x2', '\x2', '\x2', '\xFA', '\xFB', - '\a', '}', '\x2', '\x2', '\xFB', '\x36', '\x3', '\x2', '\x2', '\x2', '\xFC', - '\xFD', '\a', '\x7F', '\x2', '\x2', '\xFD', '\x38', '\x3', '\x2', '\x2', - '\x2', '\xFE', '\xFF', '\x5', '\x8F', 'H', '\x2', '\xFF', '\x100', '\x5', - '\xA5', 'S', '\x2', '\x100', '\x101', '\x5', '\xA5', 'S', '\x2', '\x101', - ':', '\x3', '\x2', '\x2', '\x2', '\x102', '\x103', '\x5', '\x8F', 'H', - '\x2', '\x103', '\x104', '\x5', '\xA9', 'U', '\x2', '\x104', '\x105', - '\x5', '\x95', 'K', '\x2', '\x105', '<', '\x3', '\x2', '\x2', '\x2', '\x106', - '\x107', '\x5', '\x8F', 'H', '\x2', '\x107', '\x108', '\x5', '\xB1', 'Y', - '\x2', '\x108', '\x109', '\x5', '\xB1', 'Y', '\x2', '\x109', '\x10A', - '\x5', '\x8F', 'H', '\x2', '\x10A', '\x10B', '\x5', '\xBF', '`', '\x2', - '\x10B', '>', '\x3', '\x2', '\x2', '\x2', '\x10C', '\x10D', '\x5', '\x8F', - 'H', '\x2', '\x10D', '\x10E', '\x5', '\xB3', 'Z', '\x2', '\x10E', '@', - '\x3', '\x2', '\x2', '\x2', '\x10F', '\x110', '\x5', '\x8F', 'H', '\x2', - '\x110', '\x111', '\x5', '\xB3', 'Z', '\x2', '\x111', '\x112', '\x5', - '\x93', 'J', '\x2', '\x112', '\x42', '\x3', '\x2', '\x2', '\x2', '\x113', - '\x114', '\x5', '\x91', 'I', '\x2', '\x114', '\x115', '\x5', '\x97', 'L', - '\x2', '\x115', '\x116', '\x5', '\xB5', '[', '\x2', '\x116', '\x117', - '\x5', '\xBB', '^', '\x2', '\x117', '\x118', '\x5', '\x97', 'L', '\x2', - '\x118', '\x119', '\x5', '\x97', 'L', '\x2', '\x119', '\x11A', '\x5', - '\xA9', 'U', '\x2', '\x11A', '\x44', '\x3', '\x2', '\x2', '\x2', '\x11B', - '\x11C', '\x5', '\x91', 'I', '\x2', '\x11C', '\x11D', '\x5', '\xBF', '`', - '\x2', '\x11D', '\x46', '\x3', '\x2', '\x2', '\x2', '\x11E', '\x11F', - '\x5', '\x95', 'K', '\x2', '\x11F', '\x120', '\x5', '\x97', 'L', '\x2', - '\x120', '\x121', '\x5', '\xB3', 'Z', '\x2', '\x121', '\x122', '\x5', - '\x93', 'J', '\x2', '\x122', 'H', '\x3', '\x2', '\x2', '\x2', '\x123', - '\x124', '\x5', '\x95', 'K', '\x2', '\x124', '\x125', '\x5', '\x9F', 'P', - '\x2', '\x125', '\x126', '\x5', '\xB3', 'Z', '\x2', '\x126', '\x127', - '\x5', '\xB5', '[', '\x2', '\x127', '\x128', '\x5', '\x9F', 'P', '\x2', - '\x128', '\x129', '\x5', '\xA9', 'U', '\x2', '\x129', '\x12A', '\x5', - '\x93', 'J', '\x2', '\x12A', '\x12B', '\x5', '\xB5', '[', '\x2', '\x12B', - 'J', '\x3', '\x2', '\x2', '\x2', '\x12C', '\x12D', '\x5', '\x97', 'L', - '\x2', '\x12D', '\x12E', '\x5', '\xB3', 'Z', '\x2', '\x12E', '\x12F', - '\x5', '\x93', 'J', '\x2', '\x12F', '\x130', '\x5', '\x8F', 'H', '\x2', - '\x130', '\x131', '\x5', '\xAD', 'W', '\x2', '\x131', '\x132', '\x5', - '\x97', 'L', '\x2', '\x132', 'L', '\x3', '\x2', '\x2', '\x2', '\x133', - '\x134', '\x5', '\x97', 'L', '\x2', '\x134', '\x135', '\x5', '\xBD', '_', - '\x2', '\x135', '\x136', '\x5', '\x9F', 'P', '\x2', '\x136', '\x137', - '\x5', '\xB3', 'Z', '\x2', '\x137', '\x138', '\x5', '\xB5', '[', '\x2', - '\x138', '\x139', '\x5', '\xB3', 'Z', '\x2', '\x139', 'N', '\x3', '\x2', - '\x2', '\x2', '\x13A', '\x13B', '\a', 'h', '\x2', '\x2', '\x13B', '\x13C', - '\a', '\x63', '\x2', '\x2', '\x13C', '\x13D', '\a', 'n', '\x2', '\x2', - '\x13D', '\x13E', '\a', 'u', '\x2', '\x2', '\x13E', '\x13F', '\a', 'g', - '\x2', '\x2', '\x13F', 'P', '\x3', '\x2', '\x2', '\x2', '\x140', '\x141', - '\x5', '\x99', 'M', '\x2', '\x141', '\x142', '\x5', '\xB1', 'Y', '\x2', - '\x142', '\x143', '\x5', '\xAB', 'V', '\x2', '\x143', '\x144', '\x5', - '\xA7', 'T', '\x2', '\x144', 'R', '\x3', '\x2', '\x2', '\x2', '\x145', - '\x146', '\x5', '\x9B', 'N', '\x2', '\x146', '\x147', '\x5', '\xB1', 'Y', - '\x2', '\x147', '\x148', '\x5', '\xAB', 'V', '\x2', '\x148', '\x149', - '\x5', '\xB7', '\\', '\x2', '\x149', '\x14A', '\x5', '\xAD', 'W', '\x2', - '\x14A', 'T', '\x3', '\x2', '\x2', '\x2', '\x14B', '\x14C', '\x5', '\x9F', - 'P', '\x2', '\x14C', '\x14D', '\x5', '\xA9', 'U', '\x2', '\x14D', 'V', - '\x3', '\x2', '\x2', '\x2', '\x14E', '\x14F', '\x5', '\xA1', 'Q', '\x2', - '\x14F', '\x150', '\x5', '\xAB', 'V', '\x2', '\x150', '\x151', '\x5', - '\x9F', 'P', '\x2', '\x151', '\x152', '\x5', '\xA9', 'U', '\x2', '\x152', - 'X', '\x3', '\x2', '\x2', '\x2', '\x153', '\x154', '\x5', '\xA5', 'S', - '\x2', '\x154', '\x155', '\x5', '\x97', 'L', '\x2', '\x155', '\x156', - '\x5', '\x99', 'M', '\x2', '\x156', '\x157', '\x5', '\xB5', '[', '\x2', - '\x157', 'Z', '\x3', '\x2', '\x2', '\x2', '\x158', '\x159', '\x5', '\xA5', - 'S', '\x2', '\x159', '\x15A', '\x5', '\x9F', 'P', '\x2', '\x15A', '\x15B', - '\x5', '\xA3', 'R', '\x2', '\x15B', '\x15C', '\x5', '\x97', 'L', '\x2', - '\x15C', '\\', '\x3', '\x2', '\x2', '\x2', '\x15D', '\x15E', '\x5', '\xA5', - 'S', '\x2', '\x15E', '\x15F', '\x5', '\x9F', 'P', '\x2', '\x15F', '\x160', - '\x5', '\xA7', 'T', '\x2', '\x160', '\x161', '\x5', '\x9F', 'P', '\x2', - '\x161', '\x162', '\x5', '\xB5', '[', '\x2', '\x162', '^', '\x3', '\x2', - '\x2', '\x2', '\x163', '\x164', '\x5', '\xA9', 'U', '\x2', '\x164', '\x165', - '\x5', '\xAB', 'V', '\x2', '\x165', '\x166', '\x5', '\xB5', '[', '\x2', - '\x166', '`', '\x3', '\x2', '\x2', '\x2', '\x167', '\x168', '\a', 'p', - '\x2', '\x2', '\x168', '\x169', '\a', 'w', '\x2', '\x2', '\x169', '\x16A', - '\a', 'n', '\x2', '\x2', '\x16A', '\x16B', '\a', 'n', '\x2', '\x2', '\x16B', - '\x62', '\x3', '\x2', '\x2', '\x2', '\x16C', '\x16D', '\x5', '\xAB', 'V', - '\x2', '\x16D', '\x16E', '\x5', '\x99', 'M', '\x2', '\x16E', '\x16F', - '\x5', '\x99', 'M', '\x2', '\x16F', '\x170', '\x5', '\xB3', 'Z', '\x2', - '\x170', '\x171', '\x5', '\x97', 'L', '\x2', '\x171', '\x172', '\x5', - '\xB5', '[', '\x2', '\x172', '\x64', '\x3', '\x2', '\x2', '\x2', '\x173', - '\x174', '\x5', '\xAB', 'V', '\x2', '\x174', '\x175', '\x5', '\xB1', 'Y', - '\x2', '\x175', '\x66', '\x3', '\x2', '\x2', '\x2', '\x176', '\x177', - '\x5', '\xAB', 'V', '\x2', '\x177', '\x178', '\x5', '\xB1', 'Y', '\x2', - '\x178', '\x179', '\x5', '\x95', 'K', '\x2', '\x179', '\x17A', '\x5', - '\x97', 'L', '\x2', '\x17A', '\x17B', '\x5', '\xB1', 'Y', '\x2', '\x17B', - 'h', '\x3', '\x2', '\x2', '\x2', '\x17C', '\x17D', '\x5', '\xB1', 'Y', - '\x2', '\x17D', '\x17E', '\x5', '\x9F', 'P', '\x2', '\x17E', '\x17F', - '\x5', '\x9B', 'N', '\x2', '\x17F', '\x180', '\x5', '\x9D', 'O', '\x2', - '\x180', '\x181', '\x5', '\xB5', '[', '\x2', '\x181', 'j', '\x3', '\x2', - '\x2', '\x2', '\x182', '\x183', '\x5', '\xB3', 'Z', '\x2', '\x183', '\x184', - '\x5', '\x97', 'L', '\x2', '\x184', '\x185', '\x5', '\xA5', 'S', '\x2', - '\x185', '\x186', '\x5', '\x97', 'L', '\x2', '\x186', '\x187', '\x5', - '\x93', 'J', '\x2', '\x187', '\x188', '\x5', '\xB5', '[', '\x2', '\x188', - 'l', '\x3', '\x2', '\x2', '\x2', '\x189', '\x18A', '\x5', '\xB5', '[', - '\x2', '\x18A', '\x18B', '\x5', '\xAB', 'V', '\x2', '\x18B', '\x18C', - '\x5', '\xAD', 'W', '\x2', '\x18C', 'n', '\x3', '\x2', '\x2', '\x2', '\x18D', - '\x18E', '\a', 'v', '\x2', '\x2', '\x18E', '\x18F', '\a', 't', '\x2', - '\x2', '\x18F', '\x190', '\a', 'w', '\x2', '\x2', '\x190', '\x191', '\a', - 'g', '\x2', '\x2', '\x191', 'p', '\x3', '\x2', '\x2', '\x2', '\x192', - '\x193', '\a', 'w', '\x2', '\x2', '\x193', '\x194', '\a', '\x66', '\x2', - '\x2', '\x194', '\x195', '\a', 'h', '\x2', '\x2', '\x195', 'r', '\x3', - '\x2', '\x2', '\x2', '\x196', '\x197', '\a', 'w', '\x2', '\x2', '\x197', - '\x198', '\a', 'p', '\x2', '\x2', '\x198', '\x199', '\a', '\x66', '\x2', - '\x2', '\x199', '\x19A', '\a', 'g', '\x2', '\x2', '\x19A', '\x19B', '\a', - 'h', '\x2', '\x2', '\x19B', '\x19C', '\a', 'k', '\x2', '\x2', '\x19C', - '\x19D', '\a', 'p', '\x2', '\x2', '\x19D', '\x19E', '\a', 'g', '\x2', - '\x2', '\x19E', '\x19F', '\a', '\x66', '\x2', '\x2', '\x19F', 't', '\x3', - '\x2', '\x2', '\x2', '\x1A0', '\x1A1', '\x5', '\xB9', ']', '\x2', '\x1A1', - '\x1A2', '\x5', '\x8F', 'H', '\x2', '\x1A2', '\x1A3', '\x5', '\xA5', 'S', - '\x2', '\x1A3', '\x1A4', '\x5', '\xB7', '\\', '\x2', '\x1A4', '\x1A5', - '\x5', '\x97', 'L', '\x2', '\x1A5', 'v', '\x3', '\x2', '\x2', '\x2', '\x1A6', - '\x1A7', '\x5', '\xBB', '^', '\x2', '\x1A7', '\x1A8', '\x5', '\x9D', 'O', - '\x2', '\x1A8', '\x1A9', '\x5', '\x97', 'L', '\x2', '\x1A9', '\x1AA', - '\x5', '\xB1', 'Y', '\x2', '\x1AA', '\x1AB', '\x5', '\x97', 'L', '\x2', - '\x1AB', 'x', '\x3', '\x2', '\x2', '\x2', '\x1AC', '\x1AE', '\t', '\x2', - '\x2', '\x2', '\x1AD', '\x1AC', '\x3', '\x2', '\x2', '\x2', '\x1AE', '\x1AF', - '\x3', '\x2', '\x2', '\x2', '\x1AF', '\x1AD', '\x3', '\x2', '\x2', '\x2', - '\x1AF', '\x1B0', '\x3', '\x2', '\x2', '\x2', '\x1B0', '\x1B1', '\x3', - '\x2', '\x2', '\x2', '\x1B1', '\x1B2', '\b', '=', '\x2', '\x2', '\x1B2', - 'z', '\x3', '\x2', '\x2', '\x2', '\x1B3', '\x1B5', '\t', '\x3', '\x2', - '\x2', '\x1B4', '\x1B3', '\x3', '\x2', '\x2', '\x2', '\x1B4', '\x1B5', - '\x3', '\x2', '\x2', '\x2', '\x1B5', '\x1B7', '\x3', '\x2', '\x2', '\x2', - '\x1B6', '\x1B8', '\x5', '\x8D', 'G', '\x2', '\x1B7', '\x1B6', '\x3', - '\x2', '\x2', '\x2', '\x1B8', '\x1B9', '\x3', '\x2', '\x2', '\x2', '\x1B9', - '\x1B7', '\x3', '\x2', '\x2', '\x2', '\x1B9', '\x1BA', '\x3', '\x2', '\x2', - '\x2', '\x1BA', '\x1C2', '\x3', '\x2', '\x2', '\x2', '\x1BB', '\x1BF', - '\a', '\x30', '\x2', '\x2', '\x1BC', '\x1BE', '\x5', '\x8D', 'G', '\x2', - '\x1BD', '\x1BC', '\x3', '\x2', '\x2', '\x2', '\x1BE', '\x1C1', '\x3', - '\x2', '\x2', '\x2', '\x1BF', '\x1BD', '\x3', '\x2', '\x2', '\x2', '\x1BF', - '\x1C0', '\x3', '\x2', '\x2', '\x2', '\x1C0', '\x1C3', '\x3', '\x2', '\x2', - '\x2', '\x1C1', '\x1BF', '\x3', '\x2', '\x2', '\x2', '\x1C2', '\x1BB', - '\x3', '\x2', '\x2', '\x2', '\x1C2', '\x1C3', '\x3', '\x2', '\x2', '\x2', - '\x1C3', '\x1CD', '\x3', '\x2', '\x2', '\x2', '\x1C4', '\x1C6', '\x5', - '\x97', 'L', '\x2', '\x1C5', '\x1C7', '\t', '\x3', '\x2', '\x2', '\x1C6', - '\x1C5', '\x3', '\x2', '\x2', '\x2', '\x1C6', '\x1C7', '\x3', '\x2', '\x2', - '\x2', '\x1C7', '\x1C9', '\x3', '\x2', '\x2', '\x2', '\x1C8', '\x1CA', - '\x5', '\x8D', 'G', '\x2', '\x1C9', '\x1C8', '\x3', '\x2', '\x2', '\x2', - '\x1CA', '\x1CB', '\x3', '\x2', '\x2', '\x2', '\x1CB', '\x1C9', '\x3', - '\x2', '\x2', '\x2', '\x1CB', '\x1CC', '\x3', '\x2', '\x2', '\x2', '\x1CC', - '\x1CE', '\x3', '\x2', '\x2', '\x2', '\x1CD', '\x1C4', '\x3', '\x2', '\x2', - '\x2', '\x1CD', '\x1CE', '\x3', '\x2', '\x2', '\x2', '\x1CE', '\x1E4', - '\x3', '\x2', '\x2', '\x2', '\x1CF', '\x1D1', '\t', '\x3', '\x2', '\x2', - '\x1D0', '\x1CF', '\x3', '\x2', '\x2', '\x2', '\x1D0', '\x1D1', '\x3', - '\x2', '\x2', '\x2', '\x1D1', '\x1D2', '\x3', '\x2', '\x2', '\x2', '\x1D2', - '\x1D4', '\a', '\x30', '\x2', '\x2', '\x1D3', '\x1D5', '\x5', '\x8D', - 'G', '\x2', '\x1D4', '\x1D3', '\x3', '\x2', '\x2', '\x2', '\x1D5', '\x1D6', - '\x3', '\x2', '\x2', '\x2', '\x1D6', '\x1D4', '\x3', '\x2', '\x2', '\x2', - '\x1D6', '\x1D7', '\x3', '\x2', '\x2', '\x2', '\x1D7', '\x1E1', '\x3', - '\x2', '\x2', '\x2', '\x1D8', '\x1DA', '\x5', '\x97', 'L', '\x2', '\x1D9', - '\x1DB', '\t', '\x3', '\x2', '\x2', '\x1DA', '\x1D9', '\x3', '\x2', '\x2', - '\x2', '\x1DA', '\x1DB', '\x3', '\x2', '\x2', '\x2', '\x1DB', '\x1DD', - '\x3', '\x2', '\x2', '\x2', '\x1DC', '\x1DE', '\x5', '\x8D', 'G', '\x2', - '\x1DD', '\x1DC', '\x3', '\x2', '\x2', '\x2', '\x1DE', '\x1DF', '\x3', - '\x2', '\x2', '\x2', '\x1DF', '\x1DD', '\x3', '\x2', '\x2', '\x2', '\x1DF', - '\x1E0', '\x3', '\x2', '\x2', '\x2', '\x1E0', '\x1E2', '\x3', '\x2', '\x2', - '\x2', '\x1E1', '\x1D8', '\x3', '\x2', '\x2', '\x2', '\x1E1', '\x1E2', - '\x3', '\x2', '\x2', '\x2', '\x1E2', '\x1E4', '\x3', '\x2', '\x2', '\x2', - '\x1E3', '\x1B4', '\x3', '\x2', '\x2', '\x2', '\x1E3', '\x1D0', '\x3', - '\x2', '\x2', '\x2', '\x1E4', '|', '\x3', '\x2', '\x2', '\x2', '\x1E5', - '\x1EA', '\a', '$', '\x2', '\x2', '\x1E6', '\x1E9', '\x5', '\x7F', '@', - '\x2', '\x1E7', '\x1E9', '\x5', '\x87', '\x44', '\x2', '\x1E8', '\x1E6', - '\x3', '\x2', '\x2', '\x2', '\x1E8', '\x1E7', '\x3', '\x2', '\x2', '\x2', - '\x1E9', '\x1EC', '\x3', '\x2', '\x2', '\x2', '\x1EA', '\x1E8', '\x3', - '\x2', '\x2', '\x2', '\x1EA', '\x1EB', '\x3', '\x2', '\x2', '\x2', '\x1EB', - '\x1ED', '\x3', '\x2', '\x2', '\x2', '\x1EC', '\x1EA', '\x3', '\x2', '\x2', - '\x2', '\x1ED', '\x1F8', '\a', '$', '\x2', '\x2', '\x1EE', '\x1F3', '\a', - ')', '\x2', '\x2', '\x1EF', '\x1F2', '\x5', '\x7F', '@', '\x2', '\x1F0', - '\x1F2', '\x5', '\x85', '\x43', '\x2', '\x1F1', '\x1EF', '\x3', '\x2', - '\x2', '\x2', '\x1F1', '\x1F0', '\x3', '\x2', '\x2', '\x2', '\x1F2', '\x1F5', - '\x3', '\x2', '\x2', '\x2', '\x1F3', '\x1F1', '\x3', '\x2', '\x2', '\x2', - '\x1F3', '\x1F4', '\x3', '\x2', '\x2', '\x2', '\x1F4', '\x1F6', '\x3', - '\x2', '\x2', '\x2', '\x1F5', '\x1F3', '\x3', '\x2', '\x2', '\x2', '\x1F6', - '\x1F8', '\a', ')', '\x2', '\x2', '\x1F7', '\x1E5', '\x3', '\x2', '\x2', - '\x2', '\x1F7', '\x1EE', '\x3', '\x2', '\x2', '\x2', '\x1F8', '~', '\x3', - '\x2', '\x2', '\x2', '\x1F9', '\x1FC', '\a', '^', '\x2', '\x2', '\x1FA', - '\x1FD', '\t', '\x4', '\x2', '\x2', '\x1FB', '\x1FD', '\x5', '\x81', '\x41', - '\x2', '\x1FC', '\x1FA', '\x3', '\x2', '\x2', '\x2', '\x1FC', '\x1FB', - '\x3', '\x2', '\x2', '\x2', '\x1FD', '\x80', '\x3', '\x2', '\x2', '\x2', - '\x1FE', '\x1FF', '\a', 'w', '\x2', '\x2', '\x1FF', '\x200', '\x5', '\x83', - '\x42', '\x2', '\x200', '\x201', '\x5', '\x83', '\x42', '\x2', '\x201', - '\x202', '\x5', '\x83', '\x42', '\x2', '\x202', '\x203', '\x5', '\x83', - '\x42', '\x2', '\x203', '\x82', '\x3', '\x2', '\x2', '\x2', '\x204', '\x205', - '\t', '\x5', '\x2', '\x2', '\x205', '\x84', '\x3', '\x2', '\x2', '\x2', - '\x206', '\x207', '\n', '\x6', '\x2', '\x2', '\x207', '\x86', '\x3', '\x2', - '\x2', '\x2', '\x208', '\x209', '\n', '\a', '\x2', '\x2', '\x209', '\x88', - '\x3', '\x2', '\x2', '\x2', '\x20A', '\x214', '\x3', '\x2', '\x2', '\x2', - '\x20B', '\x210', '\t', '\b', '\x2', '\x2', '\x20C', '\x20F', '\t', '\b', - '\x2', '\x2', '\x20D', '\x20F', '\x5', '\x8D', 'G', '\x2', '\x20E', '\x20C', - '\x3', '\x2', '\x2', '\x2', '\x20E', '\x20D', '\x3', '\x2', '\x2', '\x2', - '\x20F', '\x212', '\x3', '\x2', '\x2', '\x2', '\x210', '\x20E', '\x3', - '\x2', '\x2', '\x2', '\x210', '\x211', '\x3', '\x2', '\x2', '\x2', '\x211', - '\x214', '\x3', '\x2', '\x2', '\x2', '\x212', '\x210', '\x3', '\x2', '\x2', - '\x2', '\x213', '\x20A', '\x3', '\x2', '\x2', '\x2', '\x213', '\x20B', - '\x3', '\x2', '\x2', '\x2', '\x214', '\x8A', '\x3', '\x2', '\x2', '\x2', - '\x215', '\x216', '\a', '\x42', '\x2', '\x2', '\x216', '\x217', '\x5', - '\x89', '\x45', '\x2', '\x217', '\x8C', '\x3', '\x2', '\x2', '\x2', '\x218', - '\x219', '\t', '\t', '\x2', '\x2', '\x219', '\x8E', '\x3', '\x2', '\x2', - '\x2', '\x21A', '\x21B', '\t', '\n', '\x2', '\x2', '\x21B', '\x90', '\x3', - '\x2', '\x2', '\x2', '\x21C', '\x21D', '\t', '\v', '\x2', '\x2', '\x21D', - '\x92', '\x3', '\x2', '\x2', '\x2', '\x21E', '\x21F', '\t', '\f', '\x2', - '\x2', '\x21F', '\x94', '\x3', '\x2', '\x2', '\x2', '\x220', '\x221', - '\t', '\r', '\x2', '\x2', '\x221', '\x96', '\x3', '\x2', '\x2', '\x2', - '\x222', '\x223', '\t', '\xE', '\x2', '\x2', '\x223', '\x98', '\x3', '\x2', - '\x2', '\x2', '\x224', '\x225', '\t', '\xF', '\x2', '\x2', '\x225', '\x9A', - '\x3', '\x2', '\x2', '\x2', '\x226', '\x227', '\t', '\x10', '\x2', '\x2', - '\x227', '\x9C', '\x3', '\x2', '\x2', '\x2', '\x228', '\x229', '\t', '\x11', - '\x2', '\x2', '\x229', '\x9E', '\x3', '\x2', '\x2', '\x2', '\x22A', '\x22B', - '\t', '\x12', '\x2', '\x2', '\x22B', '\xA0', '\x3', '\x2', '\x2', '\x2', - '\x22C', '\x22D', '\t', '\x13', '\x2', '\x2', '\x22D', '\xA2', '\x3', - '\x2', '\x2', '\x2', '\x22E', '\x22F', '\t', '\x14', '\x2', '\x2', '\x22F', - '\xA4', '\x3', '\x2', '\x2', '\x2', '\x230', '\x231', '\t', '\x15', '\x2', - '\x2', '\x231', '\xA6', '\x3', '\x2', '\x2', '\x2', '\x232', '\x233', - '\t', '\x16', '\x2', '\x2', '\x233', '\xA8', '\x3', '\x2', '\x2', '\x2', - '\x234', '\x235', '\t', '\x17', '\x2', '\x2', '\x235', '\xAA', '\x3', - '\x2', '\x2', '\x2', '\x236', '\x237', '\t', '\x18', '\x2', '\x2', '\x237', - '\xAC', '\x3', '\x2', '\x2', '\x2', '\x238', '\x239', '\t', '\x19', '\x2', - '\x2', '\x239', '\xAE', '\x3', '\x2', '\x2', '\x2', '\x23A', '\x23B', - '\t', '\x1A', '\x2', '\x2', '\x23B', '\xB0', '\x3', '\x2', '\x2', '\x2', - '\x23C', '\x23D', '\t', '\x1B', '\x2', '\x2', '\x23D', '\xB2', '\x3', - '\x2', '\x2', '\x2', '\x23E', '\x23F', '\t', '\x1C', '\x2', '\x2', '\x23F', - '\xB4', '\x3', '\x2', '\x2', '\x2', '\x240', '\x241', '\t', '\x1D', '\x2', - '\x2', '\x241', '\xB6', '\x3', '\x2', '\x2', '\x2', '\x242', '\x243', - '\t', '\x1E', '\x2', '\x2', '\x243', '\xB8', '\x3', '\x2', '\x2', '\x2', - '\x244', '\x245', '\t', '\x1F', '\x2', '\x2', '\x245', '\xBA', '\x3', - '\x2', '\x2', '\x2', '\x246', '\x247', '\t', ' ', '\x2', '\x2', '\x247', - '\xBC', '\x3', '\x2', '\x2', '\x2', '\x248', '\x249', '\t', '!', '\x2', - '\x2', '\x249', '\xBE', '\x3', '\x2', '\x2', '\x2', '\x24A', '\x24B', - '\t', '\"', '\x2', '\x2', '\x24B', '\xC0', '\x3', '\x2', '\x2', '\x2', - '\x24C', '\x24D', '\t', '#', '\x2', '\x2', '\x24D', '\xC2', '\x3', '\x2', - '\x2', '\x2', '\x1A', '\x2', '\x1AF', '\x1B4', '\x1B9', '\x1BF', '\x1C2', - '\x1C6', '\x1CB', '\x1CD', '\x1D0', '\x1D6', '\x1DA', '\x1DF', '\x1E1', - '\x1E3', '\x1E8', '\x1EA', '\x1F1', '\x1F3', '\x1F7', '\x1FC', '\x20E', - '\x210', '\x213', '\x3', '\b', '\x2', '\x2', + '\x4', '\x62', '\t', '\x62', '\x4', '\x63', '\t', '\x63', '\x3', '\x2', + '\x3', '\x2', '\x3', '\x3', '\x3', '\x3', '\x3', '\x4', '\x3', '\x4', + '\x3', '\x5', '\x3', '\x5', '\x3', '\x6', '\x3', '\x6', '\x3', '\a', '\x3', + '\a', '\x3', '\b', '\x3', '\b', '\x3', '\t', '\x3', '\t', '\x3', '\n', + '\x3', '\n', '\x3', '\v', '\x3', '\v', '\x3', '\v', '\x3', '\f', '\x3', + '\f', '\x3', '\r', '\x3', '\r', '\x3', '\xE', '\x3', '\xE', '\x3', '\xF', + '\x3', '\xF', '\x3', '\x10', '\x3', '\x10', '\x3', '\x11', '\x3', '\x11', + '\x3', '\x12', '\x3', '\x12', '\x3', '\x12', '\x3', '\x13', '\x3', '\x13', + '\x3', '\x13', '\x3', '\x14', '\x3', '\x14', '\x3', '\x15', '\x3', '\x15', + '\x3', '\x15', '\x3', '\x16', '\x3', '\x16', '\x3', '\x17', '\x3', '\x17', + '\x3', '\x18', '\x3', '\x18', '\x3', '\x19', '\x3', '\x19', '\x3', '\x19', + '\x3', '\x1A', '\x3', '\x1A', '\x3', '\x1B', '\x3', '\x1B', '\x3', '\x1C', + '\x3', '\x1C', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', '\x3', '\x1D', + '\x3', '\x1E', '\x3', '\x1E', '\x3', '\x1E', '\x3', '\x1E', '\x3', '\x1F', + '\x3', '\x1F', '\x3', '\x1F', '\x3', '\x1F', '\x3', '\x1F', '\x3', '\x1F', + '\x3', ' ', '\x3', ' ', '\x3', ' ', '\x3', '!', '\x3', '!', '\x3', '!', + '\x3', '!', '\x3', '\"', '\x3', '\"', '\x3', '\"', '\x3', '\"', '\x3', + '\"', '\x3', '\"', '\x3', '\"', '\x3', '\"', '\x3', '#', '\x3', '#', '\x3', + '#', '\x3', '$', '\x3', '$', '\x3', '$', '\x3', '$', '\x3', '$', '\x3', + '%', '\x3', '%', '\x3', '%', '\x3', '%', '\x3', '%', '\x3', '%', '\x3', + '%', '\x3', '%', '\x3', '%', '\x3', '&', '\x3', '&', '\x3', '&', '\x3', + '&', '\x3', '&', '\x3', '&', '\x3', '&', '\x3', '\'', '\x3', '\'', '\x3', + '\'', '\x3', '\'', '\x3', '\'', '\x3', '\'', '\x3', '\'', '\x3', '(', + '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', ')', + '\x3', ')', '\x3', ')', '\x3', ')', '\x3', ')', '\x3', ')', '\x3', '*', + '\x3', '*', '\x3', '*', '\x3', '*', '\x3', '*', '\x3', '+', '\x3', '+', + '\x3', '+', '\x3', '+', '\x3', '+', '\x3', '+', '\x3', ',', '\x3', ',', + '\x3', ',', '\x3', '-', '\x3', '-', '\x3', '-', '\x3', '-', '\x3', '-', + '\x3', '.', '\x3', '.', '\x3', '.', '\x3', '.', '\x3', '.', '\x3', '/', + '\x3', '/', '\x3', '/', '\x3', '/', '\x3', '/', '\x3', '\x30', '\x3', + '\x30', '\x3', '\x30', '\x3', '\x30', '\x3', '\x30', '\x3', '\x31', '\x3', + '\x31', '\x3', '\x31', '\x3', '\x31', '\x3', '\x31', '\x3', '\x31', '\x3', + '\x32', '\x3', '\x32', '\x3', '\x32', '\x3', '\x32', '\x3', '\x33', '\x3', + '\x33', '\x3', '\x33', '\x3', '\x33', '\x3', '\x33', '\x3', '\x34', '\x3', + '\x34', '\x3', '\x34', '\x3', '\x34', '\x3', '\x34', '\x3', '\x34', '\x3', + '\x34', '\x3', '\x35', '\x3', '\x35', '\x3', '\x35', '\x3', '\x36', '\x3', + '\x36', '\x3', '\x36', '\x3', '\x36', '\x3', '\x36', '\x3', '\x36', '\x3', + '\x37', '\x3', '\x37', '\x3', '\x37', '\x3', '\x37', '\x3', '\x37', '\x3', + '\x37', '\x3', '\x38', '\x3', '\x38', '\x3', '\x38', '\x3', '\x38', '\x3', + '\x38', '\x3', '\x38', '\x3', '\x38', '\x3', '\x39', '\x3', '\x39', '\x3', + '\x39', '\x3', '\x39', '\x3', ':', '\x3', ':', '\x3', ':', '\x3', ':', + '\x3', ':', '\x3', ';', '\x3', ';', '\x3', ';', '\x3', ';', '\x3', '<', + '\x3', '<', '\x3', '<', '\x3', '<', '\x3', '<', '\x3', '<', '\x3', '<', + '\x3', '<', '\x3', '<', '\x3', '<', '\x3', '=', '\x3', '=', '\x3', '=', + '\x3', '=', '\x3', '=', '\x3', '=', '\x3', '>', '\x3', '>', '\x3', '>', + '\x3', '>', '\x3', '>', '\x3', '>', '\x3', '?', '\x6', '?', '\x1BD', '\n', + '?', '\r', '?', '\xE', '?', '\x1BE', '\x3', '?', '\x3', '?', '\x3', '@', + '\x5', '@', '\x1C4', '\n', '@', '\x3', '@', '\x6', '@', '\x1C7', '\n', + '@', '\r', '@', '\xE', '@', '\x1C8', '\x3', '@', '\x3', '@', '\a', '@', + '\x1CD', '\n', '@', '\f', '@', '\xE', '@', '\x1D0', '\v', '@', '\x5', + '@', '\x1D2', '\n', '@', '\x3', '@', '\x3', '@', '\x5', '@', '\x1D6', + '\n', '@', '\x3', '@', '\x6', '@', '\x1D9', '\n', '@', '\r', '@', '\xE', + '@', '\x1DA', '\x5', '@', '\x1DD', '\n', '@', '\x3', '@', '\x5', '@', + '\x1E0', '\n', '@', '\x3', '@', '\x3', '@', '\x6', '@', '\x1E4', '\n', + '@', '\r', '@', '\xE', '@', '\x1E5', '\x3', '@', '\x3', '@', '\x5', '@', + '\x1EA', '\n', '@', '\x3', '@', '\x6', '@', '\x1ED', '\n', '@', '\r', + '@', '\xE', '@', '\x1EE', '\x5', '@', '\x1F1', '\n', '@', '\x5', '@', + '\x1F3', '\n', '@', '\x3', '\x41', '\x3', '\x41', '\x3', '\x41', '\a', + '\x41', '\x1F8', '\n', '\x41', '\f', '\x41', '\xE', '\x41', '\x1FB', '\v', + '\x41', '\x3', '\x41', '\x3', '\x41', '\x3', '\x41', '\x3', '\x41', '\a', + '\x41', '\x201', '\n', '\x41', '\f', '\x41', '\xE', '\x41', '\x204', '\v', + '\x41', '\x3', '\x41', '\x5', '\x41', '\x207', '\n', '\x41', '\x3', '\x42', + '\x3', '\x42', '\x3', '\x42', '\x5', '\x42', '\x20C', '\n', '\x42', '\x3', + '\x43', '\x3', '\x43', '\x3', '\x43', '\x3', '\x43', '\x3', '\x43', '\x3', + '\x43', '\x3', '\x44', '\x3', '\x44', '\x3', '\x45', '\x3', '\x45', '\x3', + '\x46', '\x3', '\x46', '\x3', 'G', '\x3', 'G', '\x3', 'G', '\x3', 'G', + '\a', 'G', '\x21E', '\n', 'G', '\f', 'G', '\xE', 'G', '\x221', '\v', 'G', + '\x5', 'G', '\x223', '\n', 'G', '\x3', 'H', '\x3', 'H', '\x3', 'H', '\x3', + 'I', '\x3', 'I', '\x3', 'J', '\x3', 'J', '\x3', 'K', '\x3', 'K', '\x3', + 'L', '\x3', 'L', '\x3', 'M', '\x3', 'M', '\x3', 'N', '\x3', 'N', '\x3', + 'O', '\x3', 'O', '\x3', 'P', '\x3', 'P', '\x3', 'Q', '\x3', 'Q', '\x3', + 'R', '\x3', 'R', '\x3', 'S', '\x3', 'S', '\x3', 'T', '\x3', 'T', '\x3', + 'U', '\x3', 'U', '\x3', 'V', '\x3', 'V', '\x3', 'W', '\x3', 'W', '\x3', + 'X', '\x3', 'X', '\x3', 'Y', '\x3', 'Y', '\x3', 'Z', '\x3', 'Z', '\x3', + '[', '\x3', '[', '\x3', '\\', '\x3', '\\', '\x3', ']', '\x3', ']', '\x3', + '^', '\x3', '^', '\x3', '_', '\x3', '_', '\x3', '`', '\x3', '`', '\x3', + '\x61', '\x3', '\x61', '\x3', '\x62', '\x3', '\x62', '\x3', '\x63', '\x3', + '\x63', '\x2', '\x2', '\x64', '\x3', '\x3', '\x5', '\x4', '\a', '\x5', + '\t', '\x6', '\v', '\a', '\r', '\b', '\xF', '\t', '\x11', '\n', '\x13', + '\v', '\x15', '\f', '\x17', '\r', '\x19', '\xE', '\x1B', '\xF', '\x1D', + '\x10', '\x1F', '\x11', '!', '\x12', '#', '\x13', '%', '\x14', '\'', '\x15', + ')', '\x16', '+', '\x17', '-', '\x18', '/', '\x19', '\x31', '\x1A', '\x33', + '\x1B', '\x35', '\x1C', '\x37', '\x1D', '\x39', '\x1E', ';', '\x1F', '=', + ' ', '?', '!', '\x41', '\"', '\x43', '#', '\x45', '$', 'G', '%', 'I', + '&', 'K', '\'', 'M', '(', 'O', ')', 'Q', '*', 'S', '+', 'U', ',', 'W', + '-', 'Y', '.', '[', '/', ']', '\x30', '_', '\x31', '\x61', '\x32', '\x63', + '\x33', '\x65', '\x34', 'g', '\x35', 'i', '\x36', 'k', '\x37', 'm', '\x38', + 'o', '\x39', 'q', ':', 's', ';', 'u', '<', 'w', '=', 'y', '>', '{', '?', + '}', '@', '\x7F', '\x41', '\x81', '\x42', '\x83', '\x2', '\x85', '\x2', + '\x87', '\x2', '\x89', '\x2', '\x8B', '\x2', '\x8D', '\x43', '\x8F', '\x44', + '\x91', '\x2', '\x93', '\x2', '\x95', '\x2', '\x97', '\x2', '\x99', '\x2', + '\x9B', '\x2', '\x9D', '\x2', '\x9F', '\x2', '\xA1', '\x2', '\xA3', '\x2', + '\xA5', '\x2', '\xA7', '\x2', '\xA9', '\x2', '\xAB', '\x2', '\xAD', '\x2', + '\xAF', '\x2', '\xB1', '\x2', '\xB3', '\x2', '\xB5', '\x2', '\xB7', '\x2', + '\xB9', '\x2', '\xBB', '\x2', '\xBD', '\x2', '\xBF', '\x2', '\xC1', '\x2', + '\xC3', '\x2', '\xC5', '\x2', '\x3', '\x2', '$', '\x5', '\x2', '\v', '\f', + '\xF', '\xF', '\"', '\"', '\x4', '\x2', '-', '-', '/', '/', '\n', '\x2', + '$', '$', '\x31', '\x31', '^', '^', '\x64', '\x64', 'h', 'h', 'p', 'p', + 't', 't', 'v', 'v', '\x5', '\x2', '\x32', ';', '\x43', 'H', '\x63', 'h', + '\x5', '\x2', '\x2', '!', ')', ')', '^', '^', '\x5', '\x2', '\x2', '!', + '$', '$', '^', '^', '\x5', '\x2', '\x43', '\\', '\x61', '\x61', '\x63', + '|', '\x3', '\x2', '\x32', ';', '\x4', '\x2', '\x43', '\x43', '\x63', + '\x63', '\x4', '\x2', '\x44', '\x44', '\x64', '\x64', '\x4', '\x2', '\x45', + '\x45', '\x65', '\x65', '\x4', '\x2', '\x46', '\x46', '\x66', '\x66', + '\x4', '\x2', 'G', 'G', 'g', 'g', '\x4', '\x2', 'H', 'H', 'h', 'h', '\x4', + '\x2', 'I', 'I', 'i', 'i', '\x4', '\x2', 'J', 'J', 'j', 'j', '\x4', '\x2', + 'K', 'K', 'k', 'k', '\x4', '\x2', 'L', 'L', 'l', 'l', '\x4', '\x2', 'M', + 'M', 'm', 'm', '\x4', '\x2', 'N', 'N', 'n', 'n', '\x4', '\x2', 'O', 'O', + 'o', 'o', '\x4', '\x2', 'P', 'P', 'p', 'p', '\x4', '\x2', 'Q', 'Q', 'q', + 'q', '\x4', '\x2', 'R', 'R', 'r', 'r', '\x4', '\x2', 'S', 'S', 's', 's', + '\x4', '\x2', 'T', 'T', 't', 't', '\x4', '\x2', 'U', 'U', 'u', 'u', '\x4', + '\x2', 'V', 'V', 'v', 'v', '\x4', '\x2', 'W', 'W', 'w', 'w', '\x4', '\x2', + 'X', 'X', 'x', 'x', '\x4', '\x2', 'Y', 'Y', 'y', 'y', '\x4', '\x2', 'Z', + 'Z', 'z', 'z', '\x4', '\x2', '[', '[', '{', '{', '\x4', '\x2', '\\', '\\', + '|', '|', '\x2', '\x253', '\x2', '\x3', '\x3', '\x2', '\x2', '\x2', '\x2', + '\x5', '\x3', '\x2', '\x2', '\x2', '\x2', '\a', '\x3', '\x2', '\x2', '\x2', + '\x2', '\t', '\x3', '\x2', '\x2', '\x2', '\x2', '\v', '\x3', '\x2', '\x2', + '\x2', '\x2', '\r', '\x3', '\x2', '\x2', '\x2', '\x2', '\xF', '\x3', '\x2', + '\x2', '\x2', '\x2', '\x11', '\x3', '\x2', '\x2', '\x2', '\x2', '\x13', + '\x3', '\x2', '\x2', '\x2', '\x2', '\x15', '\x3', '\x2', '\x2', '\x2', + '\x2', '\x17', '\x3', '\x2', '\x2', '\x2', '\x2', '\x19', '\x3', '\x2', + '\x2', '\x2', '\x2', '\x1B', '\x3', '\x2', '\x2', '\x2', '\x2', '\x1D', + '\x3', '\x2', '\x2', '\x2', '\x2', '\x1F', '\x3', '\x2', '\x2', '\x2', + '\x2', '!', '\x3', '\x2', '\x2', '\x2', '\x2', '#', '\x3', '\x2', '\x2', + '\x2', '\x2', '%', '\x3', '\x2', '\x2', '\x2', '\x2', '\'', '\x3', '\x2', + '\x2', '\x2', '\x2', ')', '\x3', '\x2', '\x2', '\x2', '\x2', '+', '\x3', + '\x2', '\x2', '\x2', '\x2', '-', '\x3', '\x2', '\x2', '\x2', '\x2', '/', + '\x3', '\x2', '\x2', '\x2', '\x2', '\x31', '\x3', '\x2', '\x2', '\x2', + '\x2', '\x33', '\x3', '\x2', '\x2', '\x2', '\x2', '\x35', '\x3', '\x2', + '\x2', '\x2', '\x2', '\x37', '\x3', '\x2', '\x2', '\x2', '\x2', '\x39', + '\x3', '\x2', '\x2', '\x2', '\x2', ';', '\x3', '\x2', '\x2', '\x2', '\x2', + '=', '\x3', '\x2', '\x2', '\x2', '\x2', '?', '\x3', '\x2', '\x2', '\x2', + '\x2', '\x41', '\x3', '\x2', '\x2', '\x2', '\x2', '\x43', '\x3', '\x2', + '\x2', '\x2', '\x2', '\x45', '\x3', '\x2', '\x2', '\x2', '\x2', 'G', '\x3', + '\x2', '\x2', '\x2', '\x2', 'I', '\x3', '\x2', '\x2', '\x2', '\x2', 'K', + '\x3', '\x2', '\x2', '\x2', '\x2', 'M', '\x3', '\x2', '\x2', '\x2', '\x2', + 'O', '\x3', '\x2', '\x2', '\x2', '\x2', 'Q', '\x3', '\x2', '\x2', '\x2', + '\x2', 'S', '\x3', '\x2', '\x2', '\x2', '\x2', 'U', '\x3', '\x2', '\x2', + '\x2', '\x2', 'W', '\x3', '\x2', '\x2', '\x2', '\x2', 'Y', '\x3', '\x2', + '\x2', '\x2', '\x2', '[', '\x3', '\x2', '\x2', '\x2', '\x2', ']', '\x3', + '\x2', '\x2', '\x2', '\x2', '_', '\x3', '\x2', '\x2', '\x2', '\x2', '\x61', + '\x3', '\x2', '\x2', '\x2', '\x2', '\x63', '\x3', '\x2', '\x2', '\x2', + '\x2', '\x65', '\x3', '\x2', '\x2', '\x2', '\x2', 'g', '\x3', '\x2', '\x2', + '\x2', '\x2', 'i', '\x3', '\x2', '\x2', '\x2', '\x2', 'k', '\x3', '\x2', + '\x2', '\x2', '\x2', 'm', '\x3', '\x2', '\x2', '\x2', '\x2', 'o', '\x3', + '\x2', '\x2', '\x2', '\x2', 'q', '\x3', '\x2', '\x2', '\x2', '\x2', 's', + '\x3', '\x2', '\x2', '\x2', '\x2', 'u', '\x3', '\x2', '\x2', '\x2', '\x2', + 'w', '\x3', '\x2', '\x2', '\x2', '\x2', 'y', '\x3', '\x2', '\x2', '\x2', + '\x2', '{', '\x3', '\x2', '\x2', '\x2', '\x2', '}', '\x3', '\x2', '\x2', + '\x2', '\x2', '\x7F', '\x3', '\x2', '\x2', '\x2', '\x2', '\x81', '\x3', + '\x2', '\x2', '\x2', '\x2', '\x8D', '\x3', '\x2', '\x2', '\x2', '\x2', + '\x8F', '\x3', '\x2', '\x2', '\x2', '\x3', '\xC7', '\x3', '\x2', '\x2', + '\x2', '\x5', '\xC9', '\x3', '\x2', '\x2', '\x2', '\a', '\xCB', '\x3', + '\x2', '\x2', '\x2', '\t', '\xCD', '\x3', '\x2', '\x2', '\x2', '\v', '\xCF', + '\x3', '\x2', '\x2', '\x2', '\r', '\xD1', '\x3', '\x2', '\x2', '\x2', + '\xF', '\xD3', '\x3', '\x2', '\x2', '\x2', '\x11', '\xD5', '\x3', '\x2', + '\x2', '\x2', '\x13', '\xD7', '\x3', '\x2', '\x2', '\x2', '\x15', '\xD9', + '\x3', '\x2', '\x2', '\x2', '\x17', '\xDC', '\x3', '\x2', '\x2', '\x2', + '\x19', '\xDE', '\x3', '\x2', '\x2', '\x2', '\x1B', '\xE0', '\x3', '\x2', + '\x2', '\x2', '\x1D', '\xE2', '\x3', '\x2', '\x2', '\x2', '\x1F', '\xE4', + '\x3', '\x2', '\x2', '\x2', '!', '\xE6', '\x3', '\x2', '\x2', '\x2', '#', + '\xE8', '\x3', '\x2', '\x2', '\x2', '%', '\xEB', '\x3', '\x2', '\x2', + '\x2', '\'', '\xEE', '\x3', '\x2', '\x2', '\x2', ')', '\xF0', '\x3', '\x2', + '\x2', '\x2', '+', '\xF3', '\x3', '\x2', '\x2', '\x2', '-', '\xF5', '\x3', + '\x2', '\x2', '\x2', '/', '\xF7', '\x3', '\x2', '\x2', '\x2', '\x31', + '\xF9', '\x3', '\x2', '\x2', '\x2', '\x33', '\xFC', '\x3', '\x2', '\x2', + '\x2', '\x35', '\xFE', '\x3', '\x2', '\x2', '\x2', '\x37', '\x100', '\x3', + '\x2', '\x2', '\x2', '\x39', '\x102', '\x3', '\x2', '\x2', '\x2', ';', + '\x106', '\x3', '\x2', '\x2', '\x2', '=', '\x10A', '\x3', '\x2', '\x2', + '\x2', '?', '\x110', '\x3', '\x2', '\x2', '\x2', '\x41', '\x113', '\x3', + '\x2', '\x2', '\x2', '\x43', '\x117', '\x3', '\x2', '\x2', '\x2', '\x45', + '\x11F', '\x3', '\x2', '\x2', '\x2', 'G', '\x122', '\x3', '\x2', '\x2', + '\x2', 'I', '\x127', '\x3', '\x2', '\x2', '\x2', 'K', '\x130', '\x3', + '\x2', '\x2', '\x2', 'M', '\x137', '\x3', '\x2', '\x2', '\x2', 'O', '\x13E', + '\x3', '\x2', '\x2', '\x2', 'Q', '\x144', '\x3', '\x2', '\x2', '\x2', + 'S', '\x14A', '\x3', '\x2', '\x2', '\x2', 'U', '\x14F', '\x3', '\x2', + '\x2', '\x2', 'W', '\x155', '\x3', '\x2', '\x2', '\x2', 'Y', '\x158', + '\x3', '\x2', '\x2', '\x2', '[', '\x15D', '\x3', '\x2', '\x2', '\x2', + ']', '\x162', '\x3', '\x2', '\x2', '\x2', '_', '\x167', '\x3', '\x2', + '\x2', '\x2', '\x61', '\x16C', '\x3', '\x2', '\x2', '\x2', '\x63', '\x172', + '\x3', '\x2', '\x2', '\x2', '\x65', '\x176', '\x3', '\x2', '\x2', '\x2', + 'g', '\x17B', '\x3', '\x2', '\x2', '\x2', 'i', '\x182', '\x3', '\x2', + '\x2', '\x2', 'k', '\x185', '\x3', '\x2', '\x2', '\x2', 'm', '\x18B', + '\x3', '\x2', '\x2', '\x2', 'o', '\x191', '\x3', '\x2', '\x2', '\x2', + 'q', '\x198', '\x3', '\x2', '\x2', '\x2', 's', '\x19C', '\x3', '\x2', + '\x2', '\x2', 'u', '\x1A1', '\x3', '\x2', '\x2', '\x2', 'w', '\x1A5', + '\x3', '\x2', '\x2', '\x2', 'y', '\x1AF', '\x3', '\x2', '\x2', '\x2', + '{', '\x1B5', '\x3', '\x2', '\x2', '\x2', '}', '\x1BC', '\x3', '\x2', + '\x2', '\x2', '\x7F', '\x1F2', '\x3', '\x2', '\x2', '\x2', '\x81', '\x206', + '\x3', '\x2', '\x2', '\x2', '\x83', '\x208', '\x3', '\x2', '\x2', '\x2', + '\x85', '\x20D', '\x3', '\x2', '\x2', '\x2', '\x87', '\x213', '\x3', '\x2', + '\x2', '\x2', '\x89', '\x215', '\x3', '\x2', '\x2', '\x2', '\x8B', '\x217', + '\x3', '\x2', '\x2', '\x2', '\x8D', '\x222', '\x3', '\x2', '\x2', '\x2', + '\x8F', '\x224', '\x3', '\x2', '\x2', '\x2', '\x91', '\x227', '\x3', '\x2', + '\x2', '\x2', '\x93', '\x229', '\x3', '\x2', '\x2', '\x2', '\x95', '\x22B', + '\x3', '\x2', '\x2', '\x2', '\x97', '\x22D', '\x3', '\x2', '\x2', '\x2', + '\x99', '\x22F', '\x3', '\x2', '\x2', '\x2', '\x9B', '\x231', '\x3', '\x2', + '\x2', '\x2', '\x9D', '\x233', '\x3', '\x2', '\x2', '\x2', '\x9F', '\x235', + '\x3', '\x2', '\x2', '\x2', '\xA1', '\x237', '\x3', '\x2', '\x2', '\x2', + '\xA3', '\x239', '\x3', '\x2', '\x2', '\x2', '\xA5', '\x23B', '\x3', '\x2', + '\x2', '\x2', '\xA7', '\x23D', '\x3', '\x2', '\x2', '\x2', '\xA9', '\x23F', + '\x3', '\x2', '\x2', '\x2', '\xAB', '\x241', '\x3', '\x2', '\x2', '\x2', + '\xAD', '\x243', '\x3', '\x2', '\x2', '\x2', '\xAF', '\x245', '\x3', '\x2', + '\x2', '\x2', '\xB1', '\x247', '\x3', '\x2', '\x2', '\x2', '\xB3', '\x249', + '\x3', '\x2', '\x2', '\x2', '\xB5', '\x24B', '\x3', '\x2', '\x2', '\x2', + '\xB7', '\x24D', '\x3', '\x2', '\x2', '\x2', '\xB9', '\x24F', '\x3', '\x2', + '\x2', '\x2', '\xBB', '\x251', '\x3', '\x2', '\x2', '\x2', '\xBD', '\x253', + '\x3', '\x2', '\x2', '\x2', '\xBF', '\x255', '\x3', '\x2', '\x2', '\x2', + '\xC1', '\x257', '\x3', '\x2', '\x2', '\x2', '\xC3', '\x259', '\x3', '\x2', + '\x2', '\x2', '\xC5', '\x25B', '\x3', '\x2', '\x2', '\x2', '\xC7', '\xC8', + '\a', ',', '\x2', '\x2', '\xC8', '\x4', '\x3', '\x2', '\x2', '\x2', '\xC9', + '\xCA', '\a', '.', '\x2', '\x2', '\xCA', '\x6', '\x3', '\x2', '\x2', '\x2', + '\xCB', '\xCC', '\a', '*', '\x2', '\x2', '\xCC', '\b', '\x3', '\x2', '\x2', + '\x2', '\xCD', '\xCE', '\a', '+', '\x2', '\x2', '\xCE', '\n', '\x3', '\x2', + '\x2', '\x2', '\xCF', '\xD0', '\a', '\x30', '\x2', '\x2', '\xD0', '\f', + '\x3', '\x2', '\x2', '\x2', '\xD1', '\xD2', '\a', ']', '\x2', '\x2', '\xD2', + '\xE', '\x3', '\x2', '\x2', '\x2', '\xD3', '\xD4', '\a', '_', '\x2', '\x2', + '\xD4', '\x10', '\x3', '\x2', '\x2', '\x2', '\xD5', '\xD6', '\a', '\x41', + '\x2', '\x2', '\xD6', '\x12', '\x3', '\x2', '\x2', '\x2', '\xD7', '\xD8', + '\a', '<', '\x2', '\x2', '\xD8', '\x14', '\x3', '\x2', '\x2', '\x2', '\xD9', + '\xDA', '\a', '\x41', '\x2', '\x2', '\xDA', '\xDB', '\a', '\x41', '\x2', + '\x2', '\xDB', '\x16', '\x3', '\x2', '\x2', '\x2', '\xDC', '\xDD', '\a', + '\x31', '\x2', '\x2', '\xDD', '\x18', '\x3', '\x2', '\x2', '\x2', '\xDE', + '\xDF', '\a', '\'', '\x2', '\x2', '\xDF', '\x1A', '\x3', '\x2', '\x2', + '\x2', '\xE0', '\xE1', '\a', '-', '\x2', '\x2', '\xE1', '\x1C', '\x3', + '\x2', '\x2', '\x2', '\xE2', '\xE3', '\a', '/', '\x2', '\x2', '\xE3', + '\x1E', '\x3', '\x2', '\x2', '\x2', '\xE4', '\xE5', '\a', '>', '\x2', + '\x2', '\xE5', ' ', '\x3', '\x2', '\x2', '\x2', '\xE6', '\xE7', '\a', + '@', '\x2', '\x2', '\xE7', '\"', '\x3', '\x2', '\x2', '\x2', '\xE8', '\xE9', + '\a', '@', '\x2', '\x2', '\xE9', '\xEA', '\a', '?', '\x2', '\x2', '\xEA', + '$', '\x3', '\x2', '\x2', '\x2', '\xEB', '\xEC', '\a', '>', '\x2', '\x2', + '\xEC', '\xED', '\a', '?', '\x2', '\x2', '\xED', '&', '\x3', '\x2', '\x2', + '\x2', '\xEE', '\xEF', '\a', '?', '\x2', '\x2', '\xEF', '(', '\x3', '\x2', + '\x2', '\x2', '\xF0', '\xF1', '\a', '#', '\x2', '\x2', '\xF1', '\xF2', + '\a', '?', '\x2', '\x2', '\xF2', '*', '\x3', '\x2', '\x2', '\x2', '\xF3', + '\xF4', '\a', '(', '\x2', '\x2', '\xF4', ',', '\x3', '\x2', '\x2', '\x2', + '\xF5', '\xF6', '\a', '`', '\x2', '\x2', '\xF6', '.', '\x3', '\x2', '\x2', + '\x2', '\xF7', '\xF8', '\a', '~', '\x2', '\x2', '\xF8', '\x30', '\x3', + '\x2', '\x2', '\x2', '\xF9', '\xFA', '\a', '~', '\x2', '\x2', '\xFA', + '\xFB', '\a', '~', '\x2', '\x2', '\xFB', '\x32', '\x3', '\x2', '\x2', + '\x2', '\xFC', '\xFD', '\a', '\x80', '\x2', '\x2', '\xFD', '\x34', '\x3', + '\x2', '\x2', '\x2', '\xFE', '\xFF', '\a', '}', '\x2', '\x2', '\xFF', + '\x36', '\x3', '\x2', '\x2', '\x2', '\x100', '\x101', '\a', '\x7F', '\x2', + '\x2', '\x101', '\x38', '\x3', '\x2', '\x2', '\x2', '\x102', '\x103', + '\x5', '\x93', 'J', '\x2', '\x103', '\x104', '\x5', '\xA9', 'U', '\x2', + '\x104', '\x105', '\x5', '\xA9', 'U', '\x2', '\x105', ':', '\x3', '\x2', + '\x2', '\x2', '\x106', '\x107', '\x5', '\x93', 'J', '\x2', '\x107', '\x108', + '\x5', '\xAD', 'W', '\x2', '\x108', '\x109', '\x5', '\x99', 'M', '\x2', + '\x109', '<', '\x3', '\x2', '\x2', '\x2', '\x10A', '\x10B', '\x5', '\x93', + 'J', '\x2', '\x10B', '\x10C', '\x5', '\xB5', '[', '\x2', '\x10C', '\x10D', + '\x5', '\xB5', '[', '\x2', '\x10D', '\x10E', '\x5', '\x93', 'J', '\x2', + '\x10E', '\x10F', '\x5', '\xC3', '\x62', '\x2', '\x10F', '>', '\x3', '\x2', + '\x2', '\x2', '\x110', '\x111', '\x5', '\x93', 'J', '\x2', '\x111', '\x112', + '\x5', '\xB7', '\\', '\x2', '\x112', '@', '\x3', '\x2', '\x2', '\x2', + '\x113', '\x114', '\x5', '\x93', 'J', '\x2', '\x114', '\x115', '\x5', + '\xB7', '\\', '\x2', '\x115', '\x116', '\x5', '\x97', 'L', '\x2', '\x116', + '\x42', '\x3', '\x2', '\x2', '\x2', '\x117', '\x118', '\x5', '\x95', 'K', + '\x2', '\x118', '\x119', '\x5', '\x9B', 'N', '\x2', '\x119', '\x11A', + '\x5', '\xB9', ']', '\x2', '\x11A', '\x11B', '\x5', '\xBF', '`', '\x2', + '\x11B', '\x11C', '\x5', '\x9B', 'N', '\x2', '\x11C', '\x11D', '\x5', + '\x9B', 'N', '\x2', '\x11D', '\x11E', '\x5', '\xAD', 'W', '\x2', '\x11E', + '\x44', '\x3', '\x2', '\x2', '\x2', '\x11F', '\x120', '\x5', '\x95', 'K', + '\x2', '\x120', '\x121', '\x5', '\xC3', '\x62', '\x2', '\x121', '\x46', + '\x3', '\x2', '\x2', '\x2', '\x122', '\x123', '\x5', '\x99', 'M', '\x2', + '\x123', '\x124', '\x5', '\x9B', 'N', '\x2', '\x124', '\x125', '\x5', + '\xB7', '\\', '\x2', '\x125', '\x126', '\x5', '\x97', 'L', '\x2', '\x126', + 'H', '\x3', '\x2', '\x2', '\x2', '\x127', '\x128', '\x5', '\x99', 'M', + '\x2', '\x128', '\x129', '\x5', '\xA3', 'R', '\x2', '\x129', '\x12A', + '\x5', '\xB7', '\\', '\x2', '\x12A', '\x12B', '\x5', '\xB9', ']', '\x2', + '\x12B', '\x12C', '\x5', '\xA3', 'R', '\x2', '\x12C', '\x12D', '\x5', + '\xAD', 'W', '\x2', '\x12D', '\x12E', '\x5', '\x97', 'L', '\x2', '\x12E', + '\x12F', '\x5', '\xB9', ']', '\x2', '\x12F', 'J', '\x3', '\x2', '\x2', + '\x2', '\x130', '\x131', '\x5', '\x9B', 'N', '\x2', '\x131', '\x132', + '\x5', '\xB7', '\\', '\x2', '\x132', '\x133', '\x5', '\x97', 'L', '\x2', + '\x133', '\x134', '\x5', '\x93', 'J', '\x2', '\x134', '\x135', '\x5', + '\xB1', 'Y', '\x2', '\x135', '\x136', '\x5', '\x9B', 'N', '\x2', '\x136', + 'L', '\x3', '\x2', '\x2', '\x2', '\x137', '\x138', '\x5', '\x9B', 'N', + '\x2', '\x138', '\x139', '\x5', '\xC1', '\x61', '\x2', '\x139', '\x13A', + '\x5', '\xA3', 'R', '\x2', '\x13A', '\x13B', '\x5', '\xB7', '\\', '\x2', + '\x13B', '\x13C', '\x5', '\xB9', ']', '\x2', '\x13C', '\x13D', '\x5', + '\xB7', '\\', '\x2', '\x13D', 'N', '\x3', '\x2', '\x2', '\x2', '\x13E', + '\x13F', '\x5', '\x9D', 'O', '\x2', '\x13F', '\x140', '\x5', '\xA3', 'R', + '\x2', '\x140', '\x141', '\x5', '\xB5', '[', '\x2', '\x141', '\x142', + '\x5', '\xB7', '\\', '\x2', '\x142', '\x143', '\x5', '\xB9', ']', '\x2', + '\x143', 'P', '\x3', '\x2', '\x2', '\x2', '\x144', '\x145', '\a', 'h', + '\x2', '\x2', '\x145', '\x146', '\a', '\x63', '\x2', '\x2', '\x146', '\x147', + '\a', 'n', '\x2', '\x2', '\x147', '\x148', '\a', 'u', '\x2', '\x2', '\x148', + '\x149', '\a', 'g', '\x2', '\x2', '\x149', 'R', '\x3', '\x2', '\x2', '\x2', + '\x14A', '\x14B', '\x5', '\x9D', 'O', '\x2', '\x14B', '\x14C', '\x5', + '\xB5', '[', '\x2', '\x14C', '\x14D', '\x5', '\xAF', 'X', '\x2', '\x14D', + '\x14E', '\x5', '\xAB', 'V', '\x2', '\x14E', 'T', '\x3', '\x2', '\x2', + '\x2', '\x14F', '\x150', '\x5', '\x9F', 'P', '\x2', '\x150', '\x151', + '\x5', '\xB5', '[', '\x2', '\x151', '\x152', '\x5', '\xAF', 'X', '\x2', + '\x152', '\x153', '\x5', '\xBB', '^', '\x2', '\x153', '\x154', '\x5', + '\xB1', 'Y', '\x2', '\x154', 'V', '\x3', '\x2', '\x2', '\x2', '\x155', + '\x156', '\x5', '\xA3', 'R', '\x2', '\x156', '\x157', '\x5', '\xAD', 'W', + '\x2', '\x157', 'X', '\x3', '\x2', '\x2', '\x2', '\x158', '\x159', '\x5', + '\xA5', 'S', '\x2', '\x159', '\x15A', '\x5', '\xAF', 'X', '\x2', '\x15A', + '\x15B', '\x5', '\xA3', 'R', '\x2', '\x15B', '\x15C', '\x5', '\xAD', 'W', + '\x2', '\x15C', 'Z', '\x3', '\x2', '\x2', '\x2', '\x15D', '\x15E', '\x5', + '\xA9', 'U', '\x2', '\x15E', '\x15F', '\x5', '\x93', 'J', '\x2', '\x15F', + '\x160', '\x5', '\xB7', '\\', '\x2', '\x160', '\x161', '\x5', '\xB9', + ']', '\x2', '\x161', '\\', '\x3', '\x2', '\x2', '\x2', '\x162', '\x163', + '\x5', '\xA9', 'U', '\x2', '\x163', '\x164', '\x5', '\x9B', 'N', '\x2', + '\x164', '\x165', '\x5', '\x9D', 'O', '\x2', '\x165', '\x166', '\x5', + '\xB9', ']', '\x2', '\x166', '^', '\x3', '\x2', '\x2', '\x2', '\x167', + '\x168', '\x5', '\xA9', 'U', '\x2', '\x168', '\x169', '\x5', '\xA3', 'R', + '\x2', '\x169', '\x16A', '\x5', '\xA7', 'T', '\x2', '\x16A', '\x16B', + '\x5', '\x9B', 'N', '\x2', '\x16B', '`', '\x3', '\x2', '\x2', '\x2', '\x16C', + '\x16D', '\x5', '\xA9', 'U', '\x2', '\x16D', '\x16E', '\x5', '\xA3', 'R', + '\x2', '\x16E', '\x16F', '\x5', '\xAB', 'V', '\x2', '\x16F', '\x170', + '\x5', '\xA3', 'R', '\x2', '\x170', '\x171', '\x5', '\xB9', ']', '\x2', + '\x171', '\x62', '\x3', '\x2', '\x2', '\x2', '\x172', '\x173', '\x5', + '\xAD', 'W', '\x2', '\x173', '\x174', '\x5', '\xAF', 'X', '\x2', '\x174', + '\x175', '\x5', '\xB9', ']', '\x2', '\x175', '\x64', '\x3', '\x2', '\x2', + '\x2', '\x176', '\x177', '\a', 'p', '\x2', '\x2', '\x177', '\x178', '\a', + 'w', '\x2', '\x2', '\x178', '\x179', '\a', 'n', '\x2', '\x2', '\x179', + '\x17A', '\a', 'n', '\x2', '\x2', '\x17A', '\x66', '\x3', '\x2', '\x2', + '\x2', '\x17B', '\x17C', '\x5', '\xAF', 'X', '\x2', '\x17C', '\x17D', + '\x5', '\x9D', 'O', '\x2', '\x17D', '\x17E', '\x5', '\x9D', 'O', '\x2', + '\x17E', '\x17F', '\x5', '\xB7', '\\', '\x2', '\x17F', '\x180', '\x5', + '\x9B', 'N', '\x2', '\x180', '\x181', '\x5', '\xB9', ']', '\x2', '\x181', + 'h', '\x3', '\x2', '\x2', '\x2', '\x182', '\x183', '\x5', '\xAF', 'X', + '\x2', '\x183', '\x184', '\x5', '\xB5', '[', '\x2', '\x184', 'j', '\x3', + '\x2', '\x2', '\x2', '\x185', '\x186', '\x5', '\xAF', 'X', '\x2', '\x186', + '\x187', '\x5', '\xB5', '[', '\x2', '\x187', '\x188', '\x5', '\x99', 'M', + '\x2', '\x188', '\x189', '\x5', '\x9B', 'N', '\x2', '\x189', '\x18A', + '\x5', '\xB5', '[', '\x2', '\x18A', 'l', '\x3', '\x2', '\x2', '\x2', '\x18B', + '\x18C', '\x5', '\xB5', '[', '\x2', '\x18C', '\x18D', '\x5', '\xA3', 'R', + '\x2', '\x18D', '\x18E', '\x5', '\x9F', 'P', '\x2', '\x18E', '\x18F', + '\x5', '\xA1', 'Q', '\x2', '\x18F', '\x190', '\x5', '\xB9', ']', '\x2', + '\x190', 'n', '\x3', '\x2', '\x2', '\x2', '\x191', '\x192', '\x5', '\xB7', + '\\', '\x2', '\x192', '\x193', '\x5', '\x9B', 'N', '\x2', '\x193', '\x194', + '\x5', '\xA9', 'U', '\x2', '\x194', '\x195', '\x5', '\x9B', 'N', '\x2', + '\x195', '\x196', '\x5', '\x97', 'L', '\x2', '\x196', '\x197', '\x5', + '\xB9', ']', '\x2', '\x197', 'p', '\x3', '\x2', '\x2', '\x2', '\x198', + '\x199', '\x5', '\xB9', ']', '\x2', '\x199', '\x19A', '\x5', '\xAF', 'X', + '\x2', '\x19A', '\x19B', '\x5', '\xB1', 'Y', '\x2', '\x19B', 'r', '\x3', + '\x2', '\x2', '\x2', '\x19C', '\x19D', '\a', 'v', '\x2', '\x2', '\x19D', + '\x19E', '\a', 't', '\x2', '\x2', '\x19E', '\x19F', '\a', 'w', '\x2', + '\x2', '\x19F', '\x1A0', '\a', 'g', '\x2', '\x2', '\x1A0', 't', '\x3', + '\x2', '\x2', '\x2', '\x1A1', '\x1A2', '\a', 'w', '\x2', '\x2', '\x1A2', + '\x1A3', '\a', '\x66', '\x2', '\x2', '\x1A3', '\x1A4', '\a', 'h', '\x2', + '\x2', '\x1A4', 'v', '\x3', '\x2', '\x2', '\x2', '\x1A5', '\x1A6', '\a', + 'w', '\x2', '\x2', '\x1A6', '\x1A7', '\a', 'p', '\x2', '\x2', '\x1A7', + '\x1A8', '\a', '\x66', '\x2', '\x2', '\x1A8', '\x1A9', '\a', 'g', '\x2', + '\x2', '\x1A9', '\x1AA', '\a', 'h', '\x2', '\x2', '\x1AA', '\x1AB', '\a', + 'k', '\x2', '\x2', '\x1AB', '\x1AC', '\a', 'p', '\x2', '\x2', '\x1AC', + '\x1AD', '\a', 'g', '\x2', '\x2', '\x1AD', '\x1AE', '\a', '\x66', '\x2', + '\x2', '\x1AE', 'x', '\x3', '\x2', '\x2', '\x2', '\x1AF', '\x1B0', '\x5', + '\xBD', '_', '\x2', '\x1B0', '\x1B1', '\x5', '\x93', 'J', '\x2', '\x1B1', + '\x1B2', '\x5', '\xA9', 'U', '\x2', '\x1B2', '\x1B3', '\x5', '\xBB', '^', + '\x2', '\x1B3', '\x1B4', '\x5', '\x9B', 'N', '\x2', '\x1B4', 'z', '\x3', + '\x2', '\x2', '\x2', '\x1B5', '\x1B6', '\x5', '\xBF', '`', '\x2', '\x1B6', + '\x1B7', '\x5', '\xA1', 'Q', '\x2', '\x1B7', '\x1B8', '\x5', '\x9B', 'N', + '\x2', '\x1B8', '\x1B9', '\x5', '\xB5', '[', '\x2', '\x1B9', '\x1BA', + '\x5', '\x9B', 'N', '\x2', '\x1BA', '|', '\x3', '\x2', '\x2', '\x2', '\x1BB', + '\x1BD', '\t', '\x2', '\x2', '\x2', '\x1BC', '\x1BB', '\x3', '\x2', '\x2', + '\x2', '\x1BD', '\x1BE', '\x3', '\x2', '\x2', '\x2', '\x1BE', '\x1BC', + '\x3', '\x2', '\x2', '\x2', '\x1BE', '\x1BF', '\x3', '\x2', '\x2', '\x2', + '\x1BF', '\x1C0', '\x3', '\x2', '\x2', '\x2', '\x1C0', '\x1C1', '\b', + '?', '\x2', '\x2', '\x1C1', '~', '\x3', '\x2', '\x2', '\x2', '\x1C2', + '\x1C4', '\t', '\x3', '\x2', '\x2', '\x1C3', '\x1C2', '\x3', '\x2', '\x2', + '\x2', '\x1C3', '\x1C4', '\x3', '\x2', '\x2', '\x2', '\x1C4', '\x1C6', + '\x3', '\x2', '\x2', '\x2', '\x1C5', '\x1C7', '\x5', '\x91', 'I', '\x2', + '\x1C6', '\x1C5', '\x3', '\x2', '\x2', '\x2', '\x1C7', '\x1C8', '\x3', + '\x2', '\x2', '\x2', '\x1C8', '\x1C6', '\x3', '\x2', '\x2', '\x2', '\x1C8', + '\x1C9', '\x3', '\x2', '\x2', '\x2', '\x1C9', '\x1D1', '\x3', '\x2', '\x2', + '\x2', '\x1CA', '\x1CE', '\a', '\x30', '\x2', '\x2', '\x1CB', '\x1CD', + '\x5', '\x91', 'I', '\x2', '\x1CC', '\x1CB', '\x3', '\x2', '\x2', '\x2', + '\x1CD', '\x1D0', '\x3', '\x2', '\x2', '\x2', '\x1CE', '\x1CC', '\x3', + '\x2', '\x2', '\x2', '\x1CE', '\x1CF', '\x3', '\x2', '\x2', '\x2', '\x1CF', + '\x1D2', '\x3', '\x2', '\x2', '\x2', '\x1D0', '\x1CE', '\x3', '\x2', '\x2', + '\x2', '\x1D1', '\x1CA', '\x3', '\x2', '\x2', '\x2', '\x1D1', '\x1D2', + '\x3', '\x2', '\x2', '\x2', '\x1D2', '\x1DC', '\x3', '\x2', '\x2', '\x2', + '\x1D3', '\x1D5', '\x5', '\x9B', 'N', '\x2', '\x1D4', '\x1D6', '\t', '\x3', + '\x2', '\x2', '\x1D5', '\x1D4', '\x3', '\x2', '\x2', '\x2', '\x1D5', '\x1D6', + '\x3', '\x2', '\x2', '\x2', '\x1D6', '\x1D8', '\x3', '\x2', '\x2', '\x2', + '\x1D7', '\x1D9', '\x5', '\x91', 'I', '\x2', '\x1D8', '\x1D7', '\x3', + '\x2', '\x2', '\x2', '\x1D9', '\x1DA', '\x3', '\x2', '\x2', '\x2', '\x1DA', + '\x1D8', '\x3', '\x2', '\x2', '\x2', '\x1DA', '\x1DB', '\x3', '\x2', '\x2', + '\x2', '\x1DB', '\x1DD', '\x3', '\x2', '\x2', '\x2', '\x1DC', '\x1D3', + '\x3', '\x2', '\x2', '\x2', '\x1DC', '\x1DD', '\x3', '\x2', '\x2', '\x2', + '\x1DD', '\x1F3', '\x3', '\x2', '\x2', '\x2', '\x1DE', '\x1E0', '\t', + '\x3', '\x2', '\x2', '\x1DF', '\x1DE', '\x3', '\x2', '\x2', '\x2', '\x1DF', + '\x1E0', '\x3', '\x2', '\x2', '\x2', '\x1E0', '\x1E1', '\x3', '\x2', '\x2', + '\x2', '\x1E1', '\x1E3', '\a', '\x30', '\x2', '\x2', '\x1E2', '\x1E4', + '\x5', '\x91', 'I', '\x2', '\x1E3', '\x1E2', '\x3', '\x2', '\x2', '\x2', + '\x1E4', '\x1E5', '\x3', '\x2', '\x2', '\x2', '\x1E5', '\x1E3', '\x3', + '\x2', '\x2', '\x2', '\x1E5', '\x1E6', '\x3', '\x2', '\x2', '\x2', '\x1E6', + '\x1F0', '\x3', '\x2', '\x2', '\x2', '\x1E7', '\x1E9', '\x5', '\x9B', + 'N', '\x2', '\x1E8', '\x1EA', '\t', '\x3', '\x2', '\x2', '\x1E9', '\x1E8', + '\x3', '\x2', '\x2', '\x2', '\x1E9', '\x1EA', '\x3', '\x2', '\x2', '\x2', + '\x1EA', '\x1EC', '\x3', '\x2', '\x2', '\x2', '\x1EB', '\x1ED', '\x5', + '\x91', 'I', '\x2', '\x1EC', '\x1EB', '\x3', '\x2', '\x2', '\x2', '\x1ED', + '\x1EE', '\x3', '\x2', '\x2', '\x2', '\x1EE', '\x1EC', '\x3', '\x2', '\x2', + '\x2', '\x1EE', '\x1EF', '\x3', '\x2', '\x2', '\x2', '\x1EF', '\x1F1', + '\x3', '\x2', '\x2', '\x2', '\x1F0', '\x1E7', '\x3', '\x2', '\x2', '\x2', + '\x1F0', '\x1F1', '\x3', '\x2', '\x2', '\x2', '\x1F1', '\x1F3', '\x3', + '\x2', '\x2', '\x2', '\x1F2', '\x1C3', '\x3', '\x2', '\x2', '\x2', '\x1F2', + '\x1DF', '\x3', '\x2', '\x2', '\x2', '\x1F3', '\x80', '\x3', '\x2', '\x2', + '\x2', '\x1F4', '\x1F9', '\a', '$', '\x2', '\x2', '\x1F5', '\x1F8', '\x5', + '\x83', '\x42', '\x2', '\x1F6', '\x1F8', '\x5', '\x8B', '\x46', '\x2', + '\x1F7', '\x1F5', '\x3', '\x2', '\x2', '\x2', '\x1F7', '\x1F6', '\x3', + '\x2', '\x2', '\x2', '\x1F8', '\x1FB', '\x3', '\x2', '\x2', '\x2', '\x1F9', + '\x1F7', '\x3', '\x2', '\x2', '\x2', '\x1F9', '\x1FA', '\x3', '\x2', '\x2', + '\x2', '\x1FA', '\x1FC', '\x3', '\x2', '\x2', '\x2', '\x1FB', '\x1F9', + '\x3', '\x2', '\x2', '\x2', '\x1FC', '\x207', '\a', '$', '\x2', '\x2', + '\x1FD', '\x202', '\a', ')', '\x2', '\x2', '\x1FE', '\x201', '\x5', '\x83', + '\x42', '\x2', '\x1FF', '\x201', '\x5', '\x89', '\x45', '\x2', '\x200', + '\x1FE', '\x3', '\x2', '\x2', '\x2', '\x200', '\x1FF', '\x3', '\x2', '\x2', + '\x2', '\x201', '\x204', '\x3', '\x2', '\x2', '\x2', '\x202', '\x200', + '\x3', '\x2', '\x2', '\x2', '\x202', '\x203', '\x3', '\x2', '\x2', '\x2', + '\x203', '\x205', '\x3', '\x2', '\x2', '\x2', '\x204', '\x202', '\x3', + '\x2', '\x2', '\x2', '\x205', '\x207', '\a', ')', '\x2', '\x2', '\x206', + '\x1F4', '\x3', '\x2', '\x2', '\x2', '\x206', '\x1FD', '\x3', '\x2', '\x2', + '\x2', '\x207', '\x82', '\x3', '\x2', '\x2', '\x2', '\x208', '\x20B', + '\a', '^', '\x2', '\x2', '\x209', '\x20C', '\t', '\x4', '\x2', '\x2', + '\x20A', '\x20C', '\x5', '\x85', '\x43', '\x2', '\x20B', '\x209', '\x3', + '\x2', '\x2', '\x2', '\x20B', '\x20A', '\x3', '\x2', '\x2', '\x2', '\x20C', + '\x84', '\x3', '\x2', '\x2', '\x2', '\x20D', '\x20E', '\a', 'w', '\x2', + '\x2', '\x20E', '\x20F', '\x5', '\x87', '\x44', '\x2', '\x20F', '\x210', + '\x5', '\x87', '\x44', '\x2', '\x210', '\x211', '\x5', '\x87', '\x44', + '\x2', '\x211', '\x212', '\x5', '\x87', '\x44', '\x2', '\x212', '\x86', + '\x3', '\x2', '\x2', '\x2', '\x213', '\x214', '\t', '\x5', '\x2', '\x2', + '\x214', '\x88', '\x3', '\x2', '\x2', '\x2', '\x215', '\x216', '\n', '\x6', + '\x2', '\x2', '\x216', '\x8A', '\x3', '\x2', '\x2', '\x2', '\x217', '\x218', + '\n', '\a', '\x2', '\x2', '\x218', '\x8C', '\x3', '\x2', '\x2', '\x2', + '\x219', '\x223', '\x3', '\x2', '\x2', '\x2', '\x21A', '\x21F', '\t', + '\b', '\x2', '\x2', '\x21B', '\x21E', '\t', '\b', '\x2', '\x2', '\x21C', + '\x21E', '\x5', '\x91', 'I', '\x2', '\x21D', '\x21B', '\x3', '\x2', '\x2', + '\x2', '\x21D', '\x21C', '\x3', '\x2', '\x2', '\x2', '\x21E', '\x221', + '\x3', '\x2', '\x2', '\x2', '\x21F', '\x21D', '\x3', '\x2', '\x2', '\x2', + '\x21F', '\x220', '\x3', '\x2', '\x2', '\x2', '\x220', '\x223', '\x3', + '\x2', '\x2', '\x2', '\x221', '\x21F', '\x3', '\x2', '\x2', '\x2', '\x222', + '\x219', '\x3', '\x2', '\x2', '\x2', '\x222', '\x21A', '\x3', '\x2', '\x2', + '\x2', '\x223', '\x8E', '\x3', '\x2', '\x2', '\x2', '\x224', '\x225', + '\a', '\x42', '\x2', '\x2', '\x225', '\x226', '\x5', '\x8D', 'G', '\x2', + '\x226', '\x90', '\x3', '\x2', '\x2', '\x2', '\x227', '\x228', '\t', '\t', + '\x2', '\x2', '\x228', '\x92', '\x3', '\x2', '\x2', '\x2', '\x229', '\x22A', + '\t', '\n', '\x2', '\x2', '\x22A', '\x94', '\x3', '\x2', '\x2', '\x2', + '\x22B', '\x22C', '\t', '\v', '\x2', '\x2', '\x22C', '\x96', '\x3', '\x2', + '\x2', '\x2', '\x22D', '\x22E', '\t', '\f', '\x2', '\x2', '\x22E', '\x98', + '\x3', '\x2', '\x2', '\x2', '\x22F', '\x230', '\t', '\r', '\x2', '\x2', + '\x230', '\x9A', '\x3', '\x2', '\x2', '\x2', '\x231', '\x232', '\t', '\xE', + '\x2', '\x2', '\x232', '\x9C', '\x3', '\x2', '\x2', '\x2', '\x233', '\x234', + '\t', '\xF', '\x2', '\x2', '\x234', '\x9E', '\x3', '\x2', '\x2', '\x2', + '\x235', '\x236', '\t', '\x10', '\x2', '\x2', '\x236', '\xA0', '\x3', + '\x2', '\x2', '\x2', '\x237', '\x238', '\t', '\x11', '\x2', '\x2', '\x238', + '\xA2', '\x3', '\x2', '\x2', '\x2', '\x239', '\x23A', '\t', '\x12', '\x2', + '\x2', '\x23A', '\xA4', '\x3', '\x2', '\x2', '\x2', '\x23B', '\x23C', + '\t', '\x13', '\x2', '\x2', '\x23C', '\xA6', '\x3', '\x2', '\x2', '\x2', + '\x23D', '\x23E', '\t', '\x14', '\x2', '\x2', '\x23E', '\xA8', '\x3', + '\x2', '\x2', '\x2', '\x23F', '\x240', '\t', '\x15', '\x2', '\x2', '\x240', + '\xAA', '\x3', '\x2', '\x2', '\x2', '\x241', '\x242', '\t', '\x16', '\x2', + '\x2', '\x242', '\xAC', '\x3', '\x2', '\x2', '\x2', '\x243', '\x244', + '\t', '\x17', '\x2', '\x2', '\x244', '\xAE', '\x3', '\x2', '\x2', '\x2', + '\x245', '\x246', '\t', '\x18', '\x2', '\x2', '\x246', '\xB0', '\x3', + '\x2', '\x2', '\x2', '\x247', '\x248', '\t', '\x19', '\x2', '\x2', '\x248', + '\xB2', '\x3', '\x2', '\x2', '\x2', '\x249', '\x24A', '\t', '\x1A', '\x2', + '\x2', '\x24A', '\xB4', '\x3', '\x2', '\x2', '\x2', '\x24B', '\x24C', + '\t', '\x1B', '\x2', '\x2', '\x24C', '\xB6', '\x3', '\x2', '\x2', '\x2', + '\x24D', '\x24E', '\t', '\x1C', '\x2', '\x2', '\x24E', '\xB8', '\x3', + '\x2', '\x2', '\x2', '\x24F', '\x250', '\t', '\x1D', '\x2', '\x2', '\x250', + '\xBA', '\x3', '\x2', '\x2', '\x2', '\x251', '\x252', '\t', '\x1E', '\x2', + '\x2', '\x252', '\xBC', '\x3', '\x2', '\x2', '\x2', '\x253', '\x254', + '\t', '\x1F', '\x2', '\x2', '\x254', '\xBE', '\x3', '\x2', '\x2', '\x2', + '\x255', '\x256', '\t', ' ', '\x2', '\x2', '\x256', '\xC0', '\x3', '\x2', + '\x2', '\x2', '\x257', '\x258', '\t', '!', '\x2', '\x2', '\x258', '\xC2', + '\x3', '\x2', '\x2', '\x2', '\x259', '\x25A', '\t', '\"', '\x2', '\x2', + '\x25A', '\xC4', '\x3', '\x2', '\x2', '\x2', '\x25B', '\x25C', '\t', '#', + '\x2', '\x2', '\x25C', '\xC6', '\x3', '\x2', '\x2', '\x2', '\x1A', '\x2', + '\x1BE', '\x1C3', '\x1C8', '\x1CE', '\x1D1', '\x1D5', '\x1DA', '\x1DC', + '\x1DF', '\x1E5', '\x1E9', '\x1EE', '\x1F0', '\x1F2', '\x1F7', '\x1F9', + '\x200', '\x202', '\x206', '\x20B', '\x21D', '\x21F', '\x222', '\x3', + '\b', '\x2', '\x2', }; public static readonly ATN _ATN = diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlParser.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlParser.cs index 53293f9382..e68b8e18f5 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlParser.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/sqlParser.cs @@ -40,11 +40,11 @@ public const int T__17=18, T__18=19, T__19=20, T__20=21, T__21=22, T__22=23, T__23=24, T__24=25, T__25=26, T__26=27, K_ALL=28, K_AND=29, K_ARRAY=30, K_AS=31, K_ASC=32, K_BETWEEN=33, K_BY=34, K_DESC=35, K_DISTINCT=36, K_ESCAPE=37, - K_EXISTS=38, K_FALSE=39, K_FROM=40, K_GROUP=41, K_IN=42, K_JOIN=43, K_LEFT=44, - K_LIKE=45, K_LIMIT=46, K_NOT=47, K_NULL=48, K_OFFSET=49, K_OR=50, K_ORDER=51, - K_RIGHT=52, K_SELECT=53, K_TOP=54, K_TRUE=55, K_UDF=56, K_UNDEFINED=57, - K_VALUE=58, K_WHERE=59, WS=60, NUMERIC_LITERAL=61, STRING_LITERAL=62, - LEX_IDENTIFIER=63, PARAMETER=64; + K_EXISTS=38, K_FIRST=39, K_FALSE=40, K_FROM=41, K_GROUP=42, K_IN=43, K_JOIN=44, + K_LAST=45, K_LEFT=46, K_LIKE=47, K_LIMIT=48, K_NOT=49, K_NULL=50, K_OFFSET=51, + K_OR=52, K_ORDER=53, K_RIGHT=54, K_SELECT=55, K_TOP=56, K_TRUE=57, K_UDF=58, + K_UNDEFINED=59, K_VALUE=60, K_WHERE=61, WS=62, NUMERIC_LITERAL=63, STRING_LITERAL=64, + LEX_IDENTIFIER=65, PARAMETER=66; public const int RULE_program = 0, RULE_sql_query = 1, RULE_select_clause = 2, RULE_top_spec = 3, RULE_selection = 4, RULE_select_star_spec = 5, RULE_select_value_spec = 6, @@ -81,19 +81,20 @@ public const int null, "'*'", "','", "'('", "')'", "'.'", "'['", "']'", "'?'", "':'", "'??'", "'/'", "'%'", "'+'", "'-'", "'<'", "'>'", "'>='", "'<='", "'='", "'!='", "'&'", "'^'", "'|'", "'||'", "'~'", "'{'", "'}'", null, null, null, null, - null, null, null, null, null, null, null, "'false'", null, null, null, - null, null, null, null, null, "'null'", null, null, null, null, null, - null, "'true'", "'udf'", "'undefined'" + null, null, null, null, null, null, null, null, "'false'", null, null, + null, null, null, null, null, null, null, "'null'", null, null, null, + null, null, null, "'true'", "'udf'", "'undefined'" }; private static readonly string[] _SymbolicNames = { null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, "K_ALL", "K_AND", "K_ARRAY", "K_AS", "K_ASC", - "K_BETWEEN", "K_BY", "K_DESC", "K_DISTINCT", "K_ESCAPE", "K_EXISTS", "K_FALSE", - "K_FROM", "K_GROUP", "K_IN", "K_JOIN", "K_LEFT", "K_LIKE", "K_LIMIT", - "K_NOT", "K_NULL", "K_OFFSET", "K_OR", "K_ORDER", "K_RIGHT", "K_SELECT", - "K_TOP", "K_TRUE", "K_UDF", "K_UNDEFINED", "K_VALUE", "K_WHERE", "WS", - "NUMERIC_LITERAL", "STRING_LITERAL", "LEX_IDENTIFIER", "PARAMETER" + "K_BETWEEN", "K_BY", "K_DESC", "K_DISTINCT", "K_ESCAPE", "K_EXISTS", "K_FIRST", + "K_FALSE", "K_FROM", "K_GROUP", "K_IN", "K_JOIN", "K_LAST", "K_LEFT", + "K_LIKE", "K_LIMIT", "K_NOT", "K_NULL", "K_OFFSET", "K_OR", "K_ORDER", + "K_RIGHT", "K_SELECT", "K_TOP", "K_TRUE", "K_UDF", "K_UNDEFINED", "K_VALUE", + "K_WHERE", "WS", "NUMERIC_LITERAL", "STRING_LITERAL", "LEX_IDENTIFIER", + "PARAMETER" }; public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames); @@ -463,7 +464,9 @@ public SelectionContext selection() { case K_ALL: case K_ARRAY: case K_EXISTS: + case K_FIRST: case K_FALSE: + case K_LAST: case K_LEFT: case K_NOT: case K_NULL: @@ -994,6 +997,8 @@ public CollectionContext collection() { ErrorHandler.Sync(this); switch (TokenStream.LA(1)) { case K_ALL: + case K_FIRST: + case K_LAST: case LEX_IDENTIFIER: _localctx = new InputPathCollectionContext(_localctx); EnterOuterAlt(_localctx, 1); @@ -2808,7 +2813,9 @@ public Unary_scalar_expressionContext unary_scalar_expression() { case K_ALL: case K_ARRAY: case K_EXISTS: + case K_FIRST: case K_FALSE: + case K_LAST: case K_LEFT: case K_NULL: case K_RIGHT: @@ -2971,6 +2978,26 @@ public override TResult Accept(IParseTreeVisitor visitor) { else return visitor.VisitChildren(this); } } + public partial class FirstScalarExpressionContext : Primary_expressionContext { + public ITerminalNode K_FIRST() { return GetToken(sqlParser.K_FIRST, 0); } + public Sql_queryContext sql_query() { + return GetRuleContext(0); + } + public FirstScalarExpressionContext(Primary_expressionContext context) { CopyFrom(context); } + public override void EnterRule(IParseTreeListener listener) { + IsqlListener typedListener = listener as IsqlListener; + if (typedListener != null) typedListener.EnterFirstScalarExpression(this); + } + public override void ExitRule(IParseTreeListener listener) { + IsqlListener typedListener = listener as IsqlListener; + if (typedListener != null) typedListener.ExitFirstScalarExpression(this); + } + public override TResult Accept(IParseTreeVisitor visitor) { + IsqlVisitor typedVisitor = visitor as IsqlVisitor; + if (typedVisitor != null) return typedVisitor.VisitFirstScalarExpression(this); + else return visitor.VisitChildren(this); + } + } public partial class ArrayCreateScalarExpressionContext : Primary_expressionContext { public Scalar_expression_listContext scalar_expression_list() { return GetRuleContext(0); @@ -3145,6 +3172,26 @@ public override TResult Accept(IParseTreeVisitor visitor) { else return visitor.VisitChildren(this); } } + public partial class LastScalarExpressionContext : Primary_expressionContext { + public ITerminalNode K_LAST() { return GetToken(sqlParser.K_LAST, 0); } + public Sql_queryContext sql_query() { + return GetRuleContext(0); + } + public LastScalarExpressionContext(Primary_expressionContext context) { CopyFrom(context); } + public override void EnterRule(IParseTreeListener listener) { + IsqlListener typedListener = listener as IsqlListener; + if (typedListener != null) typedListener.EnterLastScalarExpression(this); + } + public override void ExitRule(IParseTreeListener listener) { + IsqlListener typedListener = listener as IsqlListener; + if (typedListener != null) typedListener.ExitLastScalarExpression(this); + } + public override TResult Accept(IParseTreeVisitor visitor) { + IsqlVisitor typedVisitor = visitor as IsqlVisitor; + if (typedVisitor != null) return typedVisitor.VisitLastScalarExpression(this); + else return visitor.VisitChildren(this); + } + } public partial class PropertyRefScalarExpressionRecursiveContext : Primary_expressionContext { public Primary_expressionContext primary_expression() { return GetRuleContext(0); @@ -3185,7 +3232,7 @@ private Primary_expressionContext primary_expression(int _p) { int _alt; EnterOuterAlt(_localctx, 1); { - State = 397; + State = 407; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,35,Context) ) { case 1: @@ -3222,7 +3269,7 @@ private Primary_expressionContext primary_expression(int _p) { State = 365; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - if (((((_la - 3)) & ~0x3f) == 0 && ((1L << (_la - 3)) & ((1L << (T__2 - 3)) | (1L << (T__5 - 3)) | (1L << (T__12 - 3)) | (1L << (T__13 - 3)) | (1L << (T__24 - 3)) | (1L << (T__25 - 3)) | (1L << (K_ALL - 3)) | (1L << (K_ARRAY - 3)) | (1L << (K_EXISTS - 3)) | (1L << (K_FALSE - 3)) | (1L << (K_LEFT - 3)) | (1L << (K_NOT - 3)) | (1L << (K_NULL - 3)) | (1L << (K_RIGHT - 3)) | (1L << (K_TRUE - 3)) | (1L << (K_UDF - 3)) | (1L << (K_UNDEFINED - 3)) | (1L << (NUMERIC_LITERAL - 3)) | (1L << (STRING_LITERAL - 3)) | (1L << (LEX_IDENTIFIER - 3)) | (1L << (PARAMETER - 3)))) != 0)) { + if (((((_la - 3)) & ~0x3f) == 0 && ((1L << (_la - 3)) & ((1L << (T__2 - 3)) | (1L << (T__5 - 3)) | (1L << (T__12 - 3)) | (1L << (T__13 - 3)) | (1L << (T__24 - 3)) | (1L << (T__25 - 3)) | (1L << (K_ALL - 3)) | (1L << (K_ARRAY - 3)) | (1L << (K_EXISTS - 3)) | (1L << (K_FIRST - 3)) | (1L << (K_FALSE - 3)) | (1L << (K_LAST - 3)) | (1L << (K_LEFT - 3)) | (1L << (K_NOT - 3)) | (1L << (K_NULL - 3)) | (1L << (K_RIGHT - 3)) | (1L << (K_TRUE - 3)) | (1L << (K_UDF - 3)) | (1L << (K_UNDEFINED - 3)) | (1L << (NUMERIC_LITERAL - 3)) | (1L << (STRING_LITERAL - 3)) | (1L << (LEX_IDENTIFIER - 3)) | (1L << (PARAMETER - 3)))) != 0)) { { State = 364; scalar_expression_list(); } @@ -3303,16 +3350,38 @@ private Primary_expressionContext primary_expression(int _p) { } break; case 11: + { + _localctx = new FirstScalarExpressionContext(_localctx); + Context = _localctx; + _prevctx = _localctx; + State = 396; Match(K_FIRST); + State = 397; Match(T__2); + State = 398; sql_query(); + State = 399; Match(T__3); + } + break; + case 12: + { + _localctx = new LastScalarExpressionContext(_localctx); + Context = _localctx; + _prevctx = _localctx; + State = 401; Match(K_LAST); + State = 402; Match(T__2); + State = 403; sql_query(); + State = 404; Match(T__3); + } + break; + case 13: { _localctx = new FunctionCallScalarExpressionContext(_localctx); Context = _localctx; _prevctx = _localctx; - State = 396; function_call_scalar_expression(); + State = 406; function_call_scalar_expression(); } break; } Context.Stop = TokenStream.LT(-1); - State = 409; + State = 419; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,37,Context); while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) { @@ -3321,34 +3390,34 @@ private Primary_expressionContext primary_expression(int _p) { TriggerExitRuleEvent(); _prevctx = _localctx; { - State = 407; + State = 417; ErrorHandler.Sync(this); switch ( Interpreter.AdaptivePredict(TokenStream,36,Context) ) { case 1: { _localctx = new PropertyRefScalarExpressionRecursiveContext(new Primary_expressionContext(_parentctx, _parentState)); PushNewRecursionContext(_localctx, _startState, RULE_primary_expression); - State = 399; - if (!(Precpred(Context, 6))) throw new FailedPredicateException(this, "Precpred(Context, 6)"); - State = 400; Match(T__4); - State = 401; identifier(); + State = 409; + if (!(Precpred(Context, 8))) throw new FailedPredicateException(this, "Precpred(Context, 8)"); + State = 410; Match(T__4); + State = 411; identifier(); } break; case 2: { _localctx = new MemberIndexerScalarExpressionContext(new Primary_expressionContext(_parentctx, _parentState)); PushNewRecursionContext(_localctx, _startState, RULE_primary_expression); - State = 402; - if (!(Precpred(Context, 5))) throw new FailedPredicateException(this, "Precpred(Context, 5)"); - State = 403; Match(T__5); - State = 404; scalar_expression(0); - State = 405; Match(T__6); + State = 412; + if (!(Precpred(Context, 7))) throw new FailedPredicateException(this, "Precpred(Context, 7)"); + State = 413; Match(T__5); + State = 414; scalar_expression(0); + State = 415; Match(T__6); } break; } } } - State = 411; + State = 421; ErrorHandler.Sync(this); _alt = Interpreter.AdaptivePredict(TokenStream,37,Context); } @@ -3401,70 +3470,72 @@ public Function_call_scalar_expressionContext function_call_scalar_expression() EnterRule(_localctx, 78, RULE_function_call_scalar_expression); int _la; try { - State = 435; + State = 445; ErrorHandler.Sync(this); switch (TokenStream.LA(1)) { case K_ALL: + case K_FIRST: + case K_LAST: case K_UDF: case LEX_IDENTIFIER: EnterOuterAlt(_localctx, 1); { - State = 414; + State = 424; ErrorHandler.Sync(this); _la = TokenStream.LA(1); if (_la==K_UDF) { { - State = 412; Match(K_UDF); - State = 413; Match(T__4); + State = 422; Match(K_UDF); + State = 423; Match(T__4); } } - State = 416; identifier(); - State = 417; Match(T__2); - State = 419; + State = 426; identifier(); + State = 427; Match(T__2); + State = 429; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - if (((((_la - 3)) & ~0x3f) == 0 && ((1L << (_la - 3)) & ((1L << (T__2 - 3)) | (1L << (T__5 - 3)) | (1L << (T__12 - 3)) | (1L << (T__13 - 3)) | (1L << (T__24 - 3)) | (1L << (T__25 - 3)) | (1L << (K_ALL - 3)) | (1L << (K_ARRAY - 3)) | (1L << (K_EXISTS - 3)) | (1L << (K_FALSE - 3)) | (1L << (K_LEFT - 3)) | (1L << (K_NOT - 3)) | (1L << (K_NULL - 3)) | (1L << (K_RIGHT - 3)) | (1L << (K_TRUE - 3)) | (1L << (K_UDF - 3)) | (1L << (K_UNDEFINED - 3)) | (1L << (NUMERIC_LITERAL - 3)) | (1L << (STRING_LITERAL - 3)) | (1L << (LEX_IDENTIFIER - 3)) | (1L << (PARAMETER - 3)))) != 0)) { + if (((((_la - 3)) & ~0x3f) == 0 && ((1L << (_la - 3)) & ((1L << (T__2 - 3)) | (1L << (T__5 - 3)) | (1L << (T__12 - 3)) | (1L << (T__13 - 3)) | (1L << (T__24 - 3)) | (1L << (T__25 - 3)) | (1L << (K_ALL - 3)) | (1L << (K_ARRAY - 3)) | (1L << (K_EXISTS - 3)) | (1L << (K_FIRST - 3)) | (1L << (K_FALSE - 3)) | (1L << (K_LAST - 3)) | (1L << (K_LEFT - 3)) | (1L << (K_NOT - 3)) | (1L << (K_NULL - 3)) | (1L << (K_RIGHT - 3)) | (1L << (K_TRUE - 3)) | (1L << (K_UDF - 3)) | (1L << (K_UNDEFINED - 3)) | (1L << (NUMERIC_LITERAL - 3)) | (1L << (STRING_LITERAL - 3)) | (1L << (LEX_IDENTIFIER - 3)) | (1L << (PARAMETER - 3)))) != 0)) { { - State = 418; scalar_expression_list(); + State = 428; scalar_expression_list(); } } - State = 421; Match(T__3); + State = 431; Match(T__3); } break; case K_LEFT: EnterOuterAlt(_localctx, 2); { - State = 423; Match(K_LEFT); - State = 424; Match(T__2); - State = 426; + State = 433; Match(K_LEFT); + State = 434; Match(T__2); + State = 436; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - if (((((_la - 3)) & ~0x3f) == 0 && ((1L << (_la - 3)) & ((1L << (T__2 - 3)) | (1L << (T__5 - 3)) | (1L << (T__12 - 3)) | (1L << (T__13 - 3)) | (1L << (T__24 - 3)) | (1L << (T__25 - 3)) | (1L << (K_ALL - 3)) | (1L << (K_ARRAY - 3)) | (1L << (K_EXISTS - 3)) | (1L << (K_FALSE - 3)) | (1L << (K_LEFT - 3)) | (1L << (K_NOT - 3)) | (1L << (K_NULL - 3)) | (1L << (K_RIGHT - 3)) | (1L << (K_TRUE - 3)) | (1L << (K_UDF - 3)) | (1L << (K_UNDEFINED - 3)) | (1L << (NUMERIC_LITERAL - 3)) | (1L << (STRING_LITERAL - 3)) | (1L << (LEX_IDENTIFIER - 3)) | (1L << (PARAMETER - 3)))) != 0)) { + if (((((_la - 3)) & ~0x3f) == 0 && ((1L << (_la - 3)) & ((1L << (T__2 - 3)) | (1L << (T__5 - 3)) | (1L << (T__12 - 3)) | (1L << (T__13 - 3)) | (1L << (T__24 - 3)) | (1L << (T__25 - 3)) | (1L << (K_ALL - 3)) | (1L << (K_ARRAY - 3)) | (1L << (K_EXISTS - 3)) | (1L << (K_FIRST - 3)) | (1L << (K_FALSE - 3)) | (1L << (K_LAST - 3)) | (1L << (K_LEFT - 3)) | (1L << (K_NOT - 3)) | (1L << (K_NULL - 3)) | (1L << (K_RIGHT - 3)) | (1L << (K_TRUE - 3)) | (1L << (K_UDF - 3)) | (1L << (K_UNDEFINED - 3)) | (1L << (NUMERIC_LITERAL - 3)) | (1L << (STRING_LITERAL - 3)) | (1L << (LEX_IDENTIFIER - 3)) | (1L << (PARAMETER - 3)))) != 0)) { { - State = 425; scalar_expression_list(); + State = 435; scalar_expression_list(); } } - State = 428; Match(T__3); + State = 438; Match(T__3); } break; case K_RIGHT: EnterOuterAlt(_localctx, 3); { - State = 429; Match(K_RIGHT); - State = 430; Match(T__2); - State = 432; + State = 439; Match(K_RIGHT); + State = 440; Match(T__2); + State = 442; ErrorHandler.Sync(this); _la = TokenStream.LA(1); - if (((((_la - 3)) & ~0x3f) == 0 && ((1L << (_la - 3)) & ((1L << (T__2 - 3)) | (1L << (T__5 - 3)) | (1L << (T__12 - 3)) | (1L << (T__13 - 3)) | (1L << (T__24 - 3)) | (1L << (T__25 - 3)) | (1L << (K_ALL - 3)) | (1L << (K_ARRAY - 3)) | (1L << (K_EXISTS - 3)) | (1L << (K_FALSE - 3)) | (1L << (K_LEFT - 3)) | (1L << (K_NOT - 3)) | (1L << (K_NULL - 3)) | (1L << (K_RIGHT - 3)) | (1L << (K_TRUE - 3)) | (1L << (K_UDF - 3)) | (1L << (K_UNDEFINED - 3)) | (1L << (NUMERIC_LITERAL - 3)) | (1L << (STRING_LITERAL - 3)) | (1L << (LEX_IDENTIFIER - 3)) | (1L << (PARAMETER - 3)))) != 0)) { + if (((((_la - 3)) & ~0x3f) == 0 && ((1L << (_la - 3)) & ((1L << (T__2 - 3)) | (1L << (T__5 - 3)) | (1L << (T__12 - 3)) | (1L << (T__13 - 3)) | (1L << (T__24 - 3)) | (1L << (T__25 - 3)) | (1L << (K_ALL - 3)) | (1L << (K_ARRAY - 3)) | (1L << (K_EXISTS - 3)) | (1L << (K_FIRST - 3)) | (1L << (K_FALSE - 3)) | (1L << (K_LAST - 3)) | (1L << (K_LEFT - 3)) | (1L << (K_NOT - 3)) | (1L << (K_NULL - 3)) | (1L << (K_RIGHT - 3)) | (1L << (K_TRUE - 3)) | (1L << (K_UDF - 3)) | (1L << (K_UNDEFINED - 3)) | (1L << (NUMERIC_LITERAL - 3)) | (1L << (STRING_LITERAL - 3)) | (1L << (LEX_IDENTIFIER - 3)) | (1L << (PARAMETER - 3)))) != 0)) { { - State = 431; scalar_expression_list(); + State = 441; scalar_expression_list(); } } - State = 434; Match(T__3); + State = 444; Match(T__3); } break; default: @@ -3517,18 +3588,18 @@ public Scalar_expression_listContext scalar_expression_list() { try { EnterOuterAlt(_localctx, 1); { - State = 437; scalar_expression(0); - State = 442; + State = 447; scalar_expression(0); + State = 452; ErrorHandler.Sync(this); _la = TokenStream.LA(1); while (_la==T__1) { { { - State = 438; Match(T__1); - State = 439; scalar_expression(0); + State = 448; Match(T__1); + State = 449; scalar_expression(0); } } - State = 444; + State = 454; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } @@ -3580,18 +3651,18 @@ public Object_property_listContext object_property_list() { try { EnterOuterAlt(_localctx, 1); { - State = 445; object_property(); - State = 450; + State = 455; object_property(); + State = 460; ErrorHandler.Sync(this); _la = TokenStream.LA(1); while (_la==T__1) { { { - State = 446; Match(T__1); - State = 447; object_property(); + State = 456; Match(T__1); + State = 457; object_property(); } } - State = 452; + State = 462; ErrorHandler.Sync(this); _la = TokenStream.LA(1); } @@ -3640,9 +3711,9 @@ public Object_propertyContext object_property() { try { EnterOuterAlt(_localctx, 1); { - State = 453; Match(STRING_LITERAL); - State = 454; Match(T__8); - State = 455; scalar_expression(0); + State = 463; Match(STRING_LITERAL); + State = 464; Match(T__8); + State = 465; scalar_expression(0); } } catch (RecognitionException re) { @@ -3659,6 +3730,8 @@ public Object_propertyContext object_property() { public partial class IdentifierContext : ParserRuleContext { public ITerminalNode LEX_IDENTIFIER() { return GetToken(sqlParser.LEX_IDENTIFIER, 0); } public ITerminalNode K_ALL() { return GetToken(sqlParser.K_ALL, 0); } + public ITerminalNode K_FIRST() { return GetToken(sqlParser.K_FIRST, 0); } + public ITerminalNode K_LAST() { return GetToken(sqlParser.K_LAST, 0); } public IdentifierContext(ParserRuleContext parent, int invokingState) : base(parent, invokingState) { @@ -3687,9 +3760,9 @@ public IdentifierContext identifier() { try { EnterOuterAlt(_localctx, 1); { - State = 457; + State = 467; _la = TokenStream.LA(1); - if ( !(_la==K_ALL || _la==LEX_IDENTIFIER) ) { + if ( !(((((_la - 28)) & ~0x3f) == 0 && ((1L << (_la - 28)) & ((1L << (K_ALL - 28)) | (1L << (K_FIRST - 28)) | (1L << (K_LAST - 28)) | (1L << (LEX_IDENTIFIER - 28)))) != 0)) ) { ErrorHandler.RecoverInline(this); } else { @@ -3744,9 +3817,9 @@ public LiteralContext literal() { try { EnterOuterAlt(_localctx, 1); { - State = 459; + State = 469; _la = TokenStream.LA(1); - if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & ((1L << K_FALSE) | (1L << K_NULL) | (1L << K_TRUE) | (1L << K_UNDEFINED) | (1L << NUMERIC_LITERAL) | (1L << STRING_LITERAL))) != 0)) ) { + if ( !(((((_la - 40)) & ~0x3f) == 0 && ((1L << (_la - 40)) & ((1L << (K_FALSE - 40)) | (1L << (K_NULL - 40)) | (1L << (K_TRUE - 40)) | (1L << (K_UNDEFINED - 40)) | (1L << (NUMERIC_LITERAL - 40)) | (1L << (STRING_LITERAL - 40)))) != 0)) ) { ErrorHandler.RecoverInline(this); } else { @@ -3820,15 +3893,15 @@ private bool binary_scalar_expression_sempred(Binary_scalar_expressionContext _l } private bool primary_expression_sempred(Primary_expressionContext _localctx, int predIndex) { switch (predIndex) { - case 16: return Precpred(Context, 6); - case 17: return Precpred(Context, 5); + case 16: return Precpred(Context, 8); + case 17: return Precpred(Context, 7); } return true; } private static char[] _serializedATN = { '\x3', '\x608B', '\xA72A', '\x8133', '\xB9ED', '\x417C', '\x3BE7', '\x7786', - '\x5964', '\x3', '\x42', '\x1D0', '\x4', '\x2', '\t', '\x2', '\x4', '\x3', + '\x5964', '\x3', '\x44', '\x1DA', '\x4', '\x2', '\t', '\x2', '\x4', '\x3', '\t', '\x3', '\x4', '\x4', '\t', '\x4', '\x4', '\x5', '\t', '\x5', '\x4', '\x6', '\t', '\x6', '\x4', '\a', '\t', '\a', '\x4', '\b', '\t', '\b', '\x4', '\t', '\t', '\t', '\x4', '\n', '\t', '\n', '\x4', '\v', '\t', '\v', @@ -3906,29 +3979,31 @@ private bool primary_expression_sempred(Primary_expressionContext _localctx, int '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', - '\x3', '(', '\x3', '(', '\x5', '(', '\x190', '\n', '(', '\x3', '(', '\x3', - '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', - '(', '\a', '(', '\x19A', '\n', '(', '\f', '(', '\xE', '(', '\x19D', '\v', - '(', '\x3', ')', '\x3', ')', '\x5', ')', '\x1A1', '\n', ')', '\x3', ')', - '\x3', ')', '\x3', ')', '\x5', ')', '\x1A6', '\n', ')', '\x3', ')', '\x3', - ')', '\x3', ')', '\x3', ')', '\x3', ')', '\x5', ')', '\x1AD', '\n', ')', - '\x3', ')', '\x3', ')', '\x3', ')', '\x3', ')', '\x5', ')', '\x1B3', '\n', - ')', '\x3', ')', '\x5', ')', '\x1B6', '\n', ')', '\x3', '*', '\x3', '*', - '\x3', '*', '\a', '*', '\x1BB', '\n', '*', '\f', '*', '\xE', '*', '\x1BE', - '\v', '*', '\x3', '+', '\x3', '+', '\x3', '+', '\a', '+', '\x1C3', '\n', - '+', '\f', '+', '\xE', '+', '\x1C6', '\v', '+', '\x3', ',', '\x3', ',', - '\x3', ',', '\x3', ',', '\x3', '-', '\x3', '-', '\x3', '.', '\x3', '.', - '\x3', '.', '\x2', '\b', '\x16', '\x1A', '.', '\x30', '\x38', 'N', '/', - '\x2', '\x4', '\x6', '\b', '\n', '\f', '\xE', '\x10', '\x12', '\x14', - '\x16', '\x18', '\x1A', '\x1C', '\x1E', ' ', '\"', '$', '&', '(', '*', - ',', '.', '\x30', '\x32', '\x34', '\x36', '\x38', ':', '<', '>', '@', - '\x42', '\x44', '\x46', 'H', 'J', 'L', 'N', 'P', 'R', 'T', 'V', 'X', 'Z', - '\x2', '\v', '\x4', '\x2', '?', '?', '\x42', '\x42', '\x4', '\x2', '\"', - '\"', '%', '%', '\x4', '\x2', '\x3', '\x3', '\r', '\xE', '\x3', '\x2', - '\xF', '\x10', '\x3', '\x2', '\x11', '\x14', '\x3', '\x2', '\x15', '\x16', - '\x5', '\x2', '\xF', '\x10', '\x1B', '\x1B', '\x31', '\x31', '\x4', '\x2', - '\x1E', '\x1E', '\x41', '\x41', '\a', '\x2', ')', ')', '\x32', '\x32', - '\x39', '\x39', ';', ';', '?', '@', '\x2', '\x1E2', '\x2', '\\', '\x3', + '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', + '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', + '\x5', '(', '\x19A', '\n', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', + '(', '\x3', '(', '\x3', '(', '\x3', '(', '\x3', '(', '\a', '(', '\x1A4', + '\n', '(', '\f', '(', '\xE', '(', '\x1A7', '\v', '(', '\x3', ')', '\x3', + ')', '\x5', ')', '\x1AB', '\n', ')', '\x3', ')', '\x3', ')', '\x3', ')', + '\x5', ')', '\x1B0', '\n', ')', '\x3', ')', '\x3', ')', '\x3', ')', '\x3', + ')', '\x3', ')', '\x5', ')', '\x1B7', '\n', ')', '\x3', ')', '\x3', ')', + '\x3', ')', '\x3', ')', '\x5', ')', '\x1BD', '\n', ')', '\x3', ')', '\x5', + ')', '\x1C0', '\n', ')', '\x3', '*', '\x3', '*', '\x3', '*', '\a', '*', + '\x1C5', '\n', '*', '\f', '*', '\xE', '*', '\x1C8', '\v', '*', '\x3', + '+', '\x3', '+', '\x3', '+', '\a', '+', '\x1CD', '\n', '+', '\f', '+', + '\xE', '+', '\x1D0', '\v', '+', '\x3', ',', '\x3', ',', '\x3', ',', '\x3', + ',', '\x3', '-', '\x3', '-', '\x3', '.', '\x3', '.', '\x3', '.', '\x2', + '\b', '\x16', '\x1A', '.', '\x30', '\x38', 'N', '/', '\x2', '\x4', '\x6', + '\b', '\n', '\f', '\xE', '\x10', '\x12', '\x14', '\x16', '\x18', '\x1A', + '\x1C', '\x1E', ' ', '\"', '$', '&', '(', '*', ',', '.', '\x30', '\x32', + '\x34', '\x36', '\x38', ':', '<', '>', '@', '\x42', '\x44', '\x46', 'H', + 'J', 'L', 'N', 'P', 'R', 'T', 'V', 'X', 'Z', '\x2', '\v', '\x4', '\x2', + '\x41', '\x41', '\x44', '\x44', '\x4', '\x2', '\"', '\"', '%', '%', '\x4', + '\x2', '\x3', '\x3', '\r', '\xE', '\x3', '\x2', '\xF', '\x10', '\x3', + '\x2', '\x11', '\x14', '\x3', '\x2', '\x15', '\x16', '\x5', '\x2', '\xF', + '\x10', '\x1B', '\x1B', '\x33', '\x33', '\x6', '\x2', '\x1E', '\x1E', + ')', ')', '/', '/', '\x43', '\x43', '\a', '\x2', '*', '*', '\x34', '\x34', + ';', ';', '=', '=', '\x41', '\x42', '\x2', '\x1EE', '\x2', '\\', '\x3', '\x2', '\x2', '\x2', '\x4', '_', '\x3', '\x2', '\x2', '\x2', '\x6', 'o', '\x3', '\x2', '\x2', '\x2', '\b', 'x', '\x3', '\x2', '\x2', '\x2', '\n', '~', '\x3', '\x2', '\x2', '\x2', '\f', '\x80', '\x3', '\x2', '\x2', '\x2', @@ -3950,11 +4025,11 @@ private bool primary_expression_sempred(Primary_expressionContext _localctx, int '\x2', '\x2', '\x2', '\x42', '\x159', '\x3', '\x2', '\x2', '\x2', '\x44', '\x15B', '\x3', '\x2', '\x2', '\x2', '\x46', '\x15D', '\x3', '\x2', '\x2', '\x2', 'H', '\x15F', '\x3', '\x2', '\x2', '\x2', 'J', '\x165', '\x3', - '\x2', '\x2', '\x2', 'L', '\x167', '\x3', '\x2', '\x2', '\x2', 'N', '\x18F', - '\x3', '\x2', '\x2', '\x2', 'P', '\x1B5', '\x3', '\x2', '\x2', '\x2', - 'R', '\x1B7', '\x3', '\x2', '\x2', '\x2', 'T', '\x1BF', '\x3', '\x2', - '\x2', '\x2', 'V', '\x1C7', '\x3', '\x2', '\x2', '\x2', 'X', '\x1CB', - '\x3', '\x2', '\x2', '\x2', 'Z', '\x1CD', '\x3', '\x2', '\x2', '\x2', + '\x2', '\x2', '\x2', 'L', '\x167', '\x3', '\x2', '\x2', '\x2', 'N', '\x199', + '\x3', '\x2', '\x2', '\x2', 'P', '\x1BF', '\x3', '\x2', '\x2', '\x2', + 'R', '\x1C1', '\x3', '\x2', '\x2', '\x2', 'T', '\x1C9', '\x3', '\x2', + '\x2', '\x2', 'V', '\x1D1', '\x3', '\x2', '\x2', '\x2', 'X', '\x1D5', + '\x3', '\x2', '\x2', '\x2', 'Z', '\x1D7', '\x3', '\x2', '\x2', '\x2', '\\', ']', '\x5', '\x4', '\x3', '\x2', ']', '^', '\a', '\x2', '\x2', '\x3', '^', '\x3', '\x3', '\x2', '\x2', '\x2', '_', '\x61', '\x5', '\x6', '\x4', '\x2', '`', '\x62', '\x5', '\x14', '\v', '\x2', '\x61', '`', '\x3', '\x2', @@ -3968,89 +4043,89 @@ private bool primary_expression_sempred(Primary_expressionContext _localctx, int 'j', 'k', '\x3', '\x2', '\x2', '\x2', 'k', 'm', '\x3', '\x2', '\x2', '\x2', 'l', 'n', '\x5', '(', '\x15', '\x2', 'm', 'l', '\x3', '\x2', '\x2', '\x2', 'm', 'n', '\x3', '\x2', '\x2', '\x2', 'n', '\x5', '\x3', '\x2', '\x2', - '\x2', 'o', 'q', '\a', '\x37', '\x2', '\x2', 'p', 'r', '\a', '&', '\x2', + '\x2', 'o', 'q', '\a', '\x39', '\x2', '\x2', 'p', 'r', '\a', '&', '\x2', '\x2', 'q', 'p', '\x3', '\x2', '\x2', '\x2', 'q', 'r', '\x3', '\x2', '\x2', '\x2', 'r', 't', '\x3', '\x2', '\x2', '\x2', 's', 'u', '\x5', '\b', '\x5', '\x2', 't', 's', '\x3', '\x2', '\x2', '\x2', 't', 'u', '\x3', '\x2', '\x2', '\x2', 'u', 'v', '\x3', '\x2', '\x2', '\x2', 'v', 'w', '\x5', '\n', '\x6', - '\x2', 'w', '\a', '\x3', '\x2', '\x2', '\x2', 'x', 'y', '\a', '\x38', - '\x2', '\x2', 'y', 'z', '\t', '\x2', '\x2', '\x2', 'z', '\t', '\x3', '\x2', - '\x2', '\x2', '{', '\x7F', '\x5', '\f', '\a', '\x2', '|', '\x7F', '\x5', - '\xE', '\b', '\x2', '}', '\x7F', '\x5', '\x10', '\t', '\x2', '~', '{', - '\x3', '\x2', '\x2', '\x2', '~', '|', '\x3', '\x2', '\x2', '\x2', '~', - '}', '\x3', '\x2', '\x2', '\x2', '\x7F', '\v', '\x3', '\x2', '\x2', '\x2', - '\x80', '\x81', '\a', '\x3', '\x2', '\x2', '\x81', '\r', '\x3', '\x2', - '\x2', '\x2', '\x82', '\x83', '\a', '<', '\x2', '\x2', '\x83', '\x84', - '\x5', '.', '\x18', '\x2', '\x84', '\xF', '\x3', '\x2', '\x2', '\x2', - '\x85', '\x8A', '\x5', '\x12', '\n', '\x2', '\x86', '\x87', '\a', '\x4', - '\x2', '\x2', '\x87', '\x89', '\x5', '\x12', '\n', '\x2', '\x88', '\x86', - '\x3', '\x2', '\x2', '\x2', '\x89', '\x8C', '\x3', '\x2', '\x2', '\x2', - '\x8A', '\x88', '\x3', '\x2', '\x2', '\x2', '\x8A', '\x8B', '\x3', '\x2', - '\x2', '\x2', '\x8B', '\x11', '\x3', '\x2', '\x2', '\x2', '\x8C', '\x8A', - '\x3', '\x2', '\x2', '\x2', '\x8D', '\x90', '\x5', '.', '\x18', '\x2', - '\x8E', '\x8F', '\a', '!', '\x2', '\x2', '\x8F', '\x91', '\x5', 'X', '-', - '\x2', '\x90', '\x8E', '\x3', '\x2', '\x2', '\x2', '\x90', '\x91', '\x3', - '\x2', '\x2', '\x2', '\x91', '\x13', '\x3', '\x2', '\x2', '\x2', '\x92', - '\x93', '\a', '*', '\x2', '\x2', '\x93', '\x94', '\x5', '\x16', '\f', - '\x2', '\x94', '\x15', '\x3', '\x2', '\x2', '\x2', '\x95', '\x96', '\b', - '\f', '\x1', '\x2', '\x96', '\x9B', '\x5', '\x18', '\r', '\x2', '\x97', - '\x99', '\a', '!', '\x2', '\x2', '\x98', '\x97', '\x3', '\x2', '\x2', - '\x2', '\x98', '\x99', '\x3', '\x2', '\x2', '\x2', '\x99', '\x9A', '\x3', - '\x2', '\x2', '\x2', '\x9A', '\x9C', '\x5', 'X', '-', '\x2', '\x9B', '\x98', - '\x3', '\x2', '\x2', '\x2', '\x9B', '\x9C', '\x3', '\x2', '\x2', '\x2', - '\x9C', '\xA2', '\x3', '\x2', '\x2', '\x2', '\x9D', '\x9E', '\x5', 'X', - '-', '\x2', '\x9E', '\x9F', '\a', ',', '\x2', '\x2', '\x9F', '\xA0', '\x5', - '\x18', '\r', '\x2', '\xA0', '\xA2', '\x3', '\x2', '\x2', '\x2', '\xA1', - '\x95', '\x3', '\x2', '\x2', '\x2', '\xA1', '\x9D', '\x3', '\x2', '\x2', - '\x2', '\xA2', '\xA8', '\x3', '\x2', '\x2', '\x2', '\xA3', '\xA4', '\f', - '\x3', '\x2', '\x2', '\xA4', '\xA5', '\a', '-', '\x2', '\x2', '\xA5', - '\xA7', '\x5', '\x16', '\f', '\x4', '\xA6', '\xA3', '\x3', '\x2', '\x2', - '\x2', '\xA7', '\xAA', '\x3', '\x2', '\x2', '\x2', '\xA8', '\xA6', '\x3', - '\x2', '\x2', '\x2', '\xA8', '\xA9', '\x3', '\x2', '\x2', '\x2', '\xA9', - '\x17', '\x3', '\x2', '\x2', '\x2', '\xAA', '\xA8', '\x3', '\x2', '\x2', - '\x2', '\xAB', '\xAD', '\x5', 'X', '-', '\x2', '\xAC', '\xAE', '\x5', - '\x1A', '\xE', '\x2', '\xAD', '\xAC', '\x3', '\x2', '\x2', '\x2', '\xAD', - '\xAE', '\x3', '\x2', '\x2', '\x2', '\xAE', '\xB4', '\x3', '\x2', '\x2', - '\x2', '\xAF', '\xB0', '\a', '\x5', '\x2', '\x2', '\xB0', '\xB1', '\x5', - '\x4', '\x3', '\x2', '\xB1', '\xB2', '\a', '\x6', '\x2', '\x2', '\xB2', - '\xB4', '\x3', '\x2', '\x2', '\x2', '\xB3', '\xAB', '\x3', '\x2', '\x2', - '\x2', '\xB3', '\xAF', '\x3', '\x2', '\x2', '\x2', '\xB4', '\x19', '\x3', - '\x2', '\x2', '\x2', '\xB5', '\xC3', '\b', '\xE', '\x1', '\x2', '\xB6', - '\xB7', '\f', '\x6', '\x2', '\x2', '\xB7', '\xB8', '\a', '\a', '\x2', - '\x2', '\xB8', '\xC2', '\x5', 'X', '-', '\x2', '\xB9', '\xBA', '\f', '\x5', - '\x2', '\x2', '\xBA', '\xBB', '\a', '\b', '\x2', '\x2', '\xBB', '\xBC', - '\a', '?', '\x2', '\x2', '\xBC', '\xC2', '\a', '\t', '\x2', '\x2', '\xBD', - '\xBE', '\f', '\x4', '\x2', '\x2', '\xBE', '\xBF', '\a', '\b', '\x2', - '\x2', '\xBF', '\xC0', '\a', '@', '\x2', '\x2', '\xC0', '\xC2', '\a', - '\t', '\x2', '\x2', '\xC1', '\xB6', '\x3', '\x2', '\x2', '\x2', '\xC1', - '\xB9', '\x3', '\x2', '\x2', '\x2', '\xC1', '\xBD', '\x3', '\x2', '\x2', - '\x2', '\xC2', '\xC5', '\x3', '\x2', '\x2', '\x2', '\xC3', '\xC1', '\x3', - '\x2', '\x2', '\x2', '\xC3', '\xC4', '\x3', '\x2', '\x2', '\x2', '\xC4', - '\x1B', '\x3', '\x2', '\x2', '\x2', '\xC5', '\xC3', '\x3', '\x2', '\x2', - '\x2', '\xC6', '\xC7', '\a', '=', '\x2', '\x2', '\xC7', '\xC8', '\x5', - '.', '\x18', '\x2', '\xC8', '\x1D', '\x3', '\x2', '\x2', '\x2', '\xC9', - '\xCA', '\a', '+', '\x2', '\x2', '\xCA', '\xCB', '\a', '$', '\x2', '\x2', - '\xCB', '\xCC', '\x5', 'R', '*', '\x2', '\xCC', '\x1F', '\x3', '\x2', - '\x2', '\x2', '\xCD', '\xCE', '\a', '\x35', '\x2', '\x2', '\xCE', '\xCF', - '\a', '$', '\x2', '\x2', '\xCF', '\xD0', '\x5', '\"', '\x12', '\x2', '\xD0', - '!', '\x3', '\x2', '\x2', '\x2', '\xD1', '\xD6', '\x5', '$', '\x13', '\x2', - '\xD2', '\xD3', '\a', '\x4', '\x2', '\x2', '\xD3', '\xD5', '\x5', '$', - '\x13', '\x2', '\xD4', '\xD2', '\x3', '\x2', '\x2', '\x2', '\xD5', '\xD8', - '\x3', '\x2', '\x2', '\x2', '\xD6', '\xD4', '\x3', '\x2', '\x2', '\x2', - '\xD6', '\xD7', '\x3', '\x2', '\x2', '\x2', '\xD7', '#', '\x3', '\x2', - '\x2', '\x2', '\xD8', '\xD6', '\x3', '\x2', '\x2', '\x2', '\xD9', '\xDB', - '\x5', '.', '\x18', '\x2', '\xDA', '\xDC', '\x5', '&', '\x14', '\x2', - '\xDB', '\xDA', '\x3', '\x2', '\x2', '\x2', '\xDB', '\xDC', '\x3', '\x2', - '\x2', '\x2', '\xDC', '%', '\x3', '\x2', '\x2', '\x2', '\xDD', '\xDE', - '\t', '\x3', '\x2', '\x2', '\xDE', '\'', '\x3', '\x2', '\x2', '\x2', '\xDF', - '\xE0', '\a', '\x33', '\x2', '\x2', '\xE0', '\xE1', '\x5', '*', '\x16', - '\x2', '\xE1', '\xE2', '\a', '\x30', '\x2', '\x2', '\xE2', '\xE3', '\x5', + '\x2', 'w', '\a', '\x3', '\x2', '\x2', '\x2', 'x', 'y', '\a', ':', '\x2', + '\x2', 'y', 'z', '\t', '\x2', '\x2', '\x2', 'z', '\t', '\x3', '\x2', '\x2', + '\x2', '{', '\x7F', '\x5', '\f', '\a', '\x2', '|', '\x7F', '\x5', '\xE', + '\b', '\x2', '}', '\x7F', '\x5', '\x10', '\t', '\x2', '~', '{', '\x3', + '\x2', '\x2', '\x2', '~', '|', '\x3', '\x2', '\x2', '\x2', '~', '}', '\x3', + '\x2', '\x2', '\x2', '\x7F', '\v', '\x3', '\x2', '\x2', '\x2', '\x80', + '\x81', '\a', '\x3', '\x2', '\x2', '\x81', '\r', '\x3', '\x2', '\x2', + '\x2', '\x82', '\x83', '\a', '>', '\x2', '\x2', '\x83', '\x84', '\x5', + '.', '\x18', '\x2', '\x84', '\xF', '\x3', '\x2', '\x2', '\x2', '\x85', + '\x8A', '\x5', '\x12', '\n', '\x2', '\x86', '\x87', '\a', '\x4', '\x2', + '\x2', '\x87', '\x89', '\x5', '\x12', '\n', '\x2', '\x88', '\x86', '\x3', + '\x2', '\x2', '\x2', '\x89', '\x8C', '\x3', '\x2', '\x2', '\x2', '\x8A', + '\x88', '\x3', '\x2', '\x2', '\x2', '\x8A', '\x8B', '\x3', '\x2', '\x2', + '\x2', '\x8B', '\x11', '\x3', '\x2', '\x2', '\x2', '\x8C', '\x8A', '\x3', + '\x2', '\x2', '\x2', '\x8D', '\x90', '\x5', '.', '\x18', '\x2', '\x8E', + '\x8F', '\a', '!', '\x2', '\x2', '\x8F', '\x91', '\x5', 'X', '-', '\x2', + '\x90', '\x8E', '\x3', '\x2', '\x2', '\x2', '\x90', '\x91', '\x3', '\x2', + '\x2', '\x2', '\x91', '\x13', '\x3', '\x2', '\x2', '\x2', '\x92', '\x93', + '\a', '+', '\x2', '\x2', '\x93', '\x94', '\x5', '\x16', '\f', '\x2', '\x94', + '\x15', '\x3', '\x2', '\x2', '\x2', '\x95', '\x96', '\b', '\f', '\x1', + '\x2', '\x96', '\x9B', '\x5', '\x18', '\r', '\x2', '\x97', '\x99', '\a', + '!', '\x2', '\x2', '\x98', '\x97', '\x3', '\x2', '\x2', '\x2', '\x98', + '\x99', '\x3', '\x2', '\x2', '\x2', '\x99', '\x9A', '\x3', '\x2', '\x2', + '\x2', '\x9A', '\x9C', '\x5', 'X', '-', '\x2', '\x9B', '\x98', '\x3', + '\x2', '\x2', '\x2', '\x9B', '\x9C', '\x3', '\x2', '\x2', '\x2', '\x9C', + '\xA2', '\x3', '\x2', '\x2', '\x2', '\x9D', '\x9E', '\x5', 'X', '-', '\x2', + '\x9E', '\x9F', '\a', '-', '\x2', '\x2', '\x9F', '\xA0', '\x5', '\x18', + '\r', '\x2', '\xA0', '\xA2', '\x3', '\x2', '\x2', '\x2', '\xA1', '\x95', + '\x3', '\x2', '\x2', '\x2', '\xA1', '\x9D', '\x3', '\x2', '\x2', '\x2', + '\xA2', '\xA8', '\x3', '\x2', '\x2', '\x2', '\xA3', '\xA4', '\f', '\x3', + '\x2', '\x2', '\xA4', '\xA5', '\a', '.', '\x2', '\x2', '\xA5', '\xA7', + '\x5', '\x16', '\f', '\x4', '\xA6', '\xA3', '\x3', '\x2', '\x2', '\x2', + '\xA7', '\xAA', '\x3', '\x2', '\x2', '\x2', '\xA8', '\xA6', '\x3', '\x2', + '\x2', '\x2', '\xA8', '\xA9', '\x3', '\x2', '\x2', '\x2', '\xA9', '\x17', + '\x3', '\x2', '\x2', '\x2', '\xAA', '\xA8', '\x3', '\x2', '\x2', '\x2', + '\xAB', '\xAD', '\x5', 'X', '-', '\x2', '\xAC', '\xAE', '\x5', '\x1A', + '\xE', '\x2', '\xAD', '\xAC', '\x3', '\x2', '\x2', '\x2', '\xAD', '\xAE', + '\x3', '\x2', '\x2', '\x2', '\xAE', '\xB4', '\x3', '\x2', '\x2', '\x2', + '\xAF', '\xB0', '\a', '\x5', '\x2', '\x2', '\xB0', '\xB1', '\x5', '\x4', + '\x3', '\x2', '\xB1', '\xB2', '\a', '\x6', '\x2', '\x2', '\xB2', '\xB4', + '\x3', '\x2', '\x2', '\x2', '\xB3', '\xAB', '\x3', '\x2', '\x2', '\x2', + '\xB3', '\xAF', '\x3', '\x2', '\x2', '\x2', '\xB4', '\x19', '\x3', '\x2', + '\x2', '\x2', '\xB5', '\xC3', '\b', '\xE', '\x1', '\x2', '\xB6', '\xB7', + '\f', '\x6', '\x2', '\x2', '\xB7', '\xB8', '\a', '\a', '\x2', '\x2', '\xB8', + '\xC2', '\x5', 'X', '-', '\x2', '\xB9', '\xBA', '\f', '\x5', '\x2', '\x2', + '\xBA', '\xBB', '\a', '\b', '\x2', '\x2', '\xBB', '\xBC', '\a', '\x41', + '\x2', '\x2', '\xBC', '\xC2', '\a', '\t', '\x2', '\x2', '\xBD', '\xBE', + '\f', '\x4', '\x2', '\x2', '\xBE', '\xBF', '\a', '\b', '\x2', '\x2', '\xBF', + '\xC0', '\a', '\x42', '\x2', '\x2', '\xC0', '\xC2', '\a', '\t', '\x2', + '\x2', '\xC1', '\xB6', '\x3', '\x2', '\x2', '\x2', '\xC1', '\xB9', '\x3', + '\x2', '\x2', '\x2', '\xC1', '\xBD', '\x3', '\x2', '\x2', '\x2', '\xC2', + '\xC5', '\x3', '\x2', '\x2', '\x2', '\xC3', '\xC1', '\x3', '\x2', '\x2', + '\x2', '\xC3', '\xC4', '\x3', '\x2', '\x2', '\x2', '\xC4', '\x1B', '\x3', + '\x2', '\x2', '\x2', '\xC5', '\xC3', '\x3', '\x2', '\x2', '\x2', '\xC6', + '\xC7', '\a', '?', '\x2', '\x2', '\xC7', '\xC8', '\x5', '.', '\x18', '\x2', + '\xC8', '\x1D', '\x3', '\x2', '\x2', '\x2', '\xC9', '\xCA', '\a', ',', + '\x2', '\x2', '\xCA', '\xCB', '\a', '$', '\x2', '\x2', '\xCB', '\xCC', + '\x5', 'R', '*', '\x2', '\xCC', '\x1F', '\x3', '\x2', '\x2', '\x2', '\xCD', + '\xCE', '\a', '\x37', '\x2', '\x2', '\xCE', '\xCF', '\a', '$', '\x2', + '\x2', '\xCF', '\xD0', '\x5', '\"', '\x12', '\x2', '\xD0', '!', '\x3', + '\x2', '\x2', '\x2', '\xD1', '\xD6', '\x5', '$', '\x13', '\x2', '\xD2', + '\xD3', '\a', '\x4', '\x2', '\x2', '\xD3', '\xD5', '\x5', '$', '\x13', + '\x2', '\xD4', '\xD2', '\x3', '\x2', '\x2', '\x2', '\xD5', '\xD8', '\x3', + '\x2', '\x2', '\x2', '\xD6', '\xD4', '\x3', '\x2', '\x2', '\x2', '\xD6', + '\xD7', '\x3', '\x2', '\x2', '\x2', '\xD7', '#', '\x3', '\x2', '\x2', + '\x2', '\xD8', '\xD6', '\x3', '\x2', '\x2', '\x2', '\xD9', '\xDB', '\x5', + '.', '\x18', '\x2', '\xDA', '\xDC', '\x5', '&', '\x14', '\x2', '\xDB', + '\xDA', '\x3', '\x2', '\x2', '\x2', '\xDB', '\xDC', '\x3', '\x2', '\x2', + '\x2', '\xDC', '%', '\x3', '\x2', '\x2', '\x2', '\xDD', '\xDE', '\t', + '\x3', '\x2', '\x2', '\xDE', '\'', '\x3', '\x2', '\x2', '\x2', '\xDF', + '\xE0', '\a', '\x35', '\x2', '\x2', '\xE0', '\xE1', '\x5', '*', '\x16', + '\x2', '\xE1', '\xE2', '\a', '\x32', '\x2', '\x2', '\xE2', '\xE3', '\x5', ',', '\x17', '\x2', '\xE3', ')', '\x3', '\x2', '\x2', '\x2', '\xE4', '\xE5', '\t', '\x2', '\x2', '\x2', '\xE5', '+', '\x3', '\x2', '\x2', '\x2', '\xE6', '\xE7', '\t', '\x2', '\x2', '\x2', '\xE7', '-', '\x3', '\x2', '\x2', '\x2', '\xE8', '\xE9', '\b', '\x18', '\x1', '\x2', '\xE9', '\xF4', '\x5', '\x30', '\x19', '\x2', '\xEA', '\xEC', '\x5', '\x38', '\x1D', '\x2', '\xEB', '\xED', - '\a', '\x31', '\x2', '\x2', '\xEC', '\xEB', '\x3', '\x2', '\x2', '\x2', + '\a', '\x33', '\x2', '\x2', '\xEC', '\xEB', '\x3', '\x2', '\x2', '\x2', '\xEC', '\xED', '\x3', '\x2', '\x2', '\x2', '\xED', '\xEE', '\x3', '\x2', '\x2', '\x2', '\xEE', '\xEF', '\a', '#', '\x2', '\x2', '\xEF', '\xF0', '\x5', '\x38', '\x1D', '\x2', '\xF0', '\xF1', '\a', '\x1F', '\x2', '\x2', @@ -4074,27 +4149,27 @@ private bool primary_expression_sempred(Primary_expressionContext _localctx, int '\x2', '\x108', '\x111', '\x3', '\x2', '\x2', '\x2', '\x109', '\x10A', '\f', '\x4', '\x2', '\x2', '\x10A', '\x10B', '\a', '\x1F', '\x2', '\x2', '\x10B', '\x110', '\x5', '\x30', '\x19', '\x5', '\x10C', '\x10D', '\f', - '\x3', '\x2', '\x2', '\x10D', '\x10E', '\a', '\x34', '\x2', '\x2', '\x10E', + '\x3', '\x2', '\x2', '\x10D', '\x10E', '\a', '\x36', '\x2', '\x2', '\x10E', '\x110', '\x5', '\x30', '\x19', '\x4', '\x10F', '\x109', '\x3', '\x2', '\x2', '\x2', '\x10F', '\x10C', '\x3', '\x2', '\x2', '\x2', '\x110', '\x113', '\x3', '\x2', '\x2', '\x2', '\x111', '\x10F', '\x3', '\x2', '\x2', '\x2', '\x111', '\x112', '\x3', '\x2', '\x2', '\x2', '\x112', '\x31', '\x3', '\x2', '\x2', '\x2', '\x113', '\x111', '\x3', '\x2', '\x2', '\x2', '\x114', - '\x116', '\x5', '\x38', '\x1D', '\x2', '\x115', '\x117', '\a', '\x31', + '\x116', '\x5', '\x38', '\x1D', '\x2', '\x115', '\x117', '\a', '\x33', '\x2', '\x2', '\x116', '\x115', '\x3', '\x2', '\x2', '\x2', '\x116', '\x117', '\x3', '\x2', '\x2', '\x2', '\x117', '\x118', '\x3', '\x2', '\x2', '\x2', - '\x118', '\x119', '\a', ',', '\x2', '\x2', '\x119', '\x11A', '\a', '\x5', + '\x118', '\x119', '\a', '-', '\x2', '\x2', '\x119', '\x11A', '\a', '\x5', '\x2', '\x2', '\x11A', '\x11B', '\x5', 'R', '*', '\x2', '\x11B', '\x11C', '\a', '\x6', '\x2', '\x2', '\x11C', '\x33', '\x3', '\x2', '\x2', '\x2', '\x11D', '\x11F', '\x5', '\x38', '\x1D', '\x2', '\x11E', '\x120', '\a', - '\x31', '\x2', '\x2', '\x11F', '\x11E', '\x3', '\x2', '\x2', '\x2', '\x11F', + '\x33', '\x2', '\x2', '\x11F', '\x11E', '\x3', '\x2', '\x2', '\x2', '\x11F', '\x120', '\x3', '\x2', '\x2', '\x2', '\x120', '\x121', '\x3', '\x2', '\x2', - '\x2', '\x121', '\x122', '\a', '/', '\x2', '\x2', '\x122', '\x124', '\x5', - '\x38', '\x1D', '\x2', '\x123', '\x125', '\x5', '\x36', '\x1C', '\x2', - '\x124', '\x123', '\x3', '\x2', '\x2', '\x2', '\x124', '\x125', '\x3', - '\x2', '\x2', '\x2', '\x125', '\x35', '\x3', '\x2', '\x2', '\x2', '\x126', - '\x127', '\a', '\'', '\x2', '\x2', '\x127', '\x128', '\a', '@', '\x2', - '\x2', '\x128', '\x37', '\x3', '\x2', '\x2', '\x2', '\x129', '\x12A', + '\x2', '\x121', '\x122', '\a', '\x31', '\x2', '\x2', '\x122', '\x124', + '\x5', '\x38', '\x1D', '\x2', '\x123', '\x125', '\x5', '\x36', '\x1C', + '\x2', '\x124', '\x123', '\x3', '\x2', '\x2', '\x2', '\x124', '\x125', + '\x3', '\x2', '\x2', '\x2', '\x125', '\x35', '\x3', '\x2', '\x2', '\x2', + '\x126', '\x127', '\a', '\'', '\x2', '\x2', '\x127', '\x128', '\a', '\x42', + '\x2', '\x2', '\x128', '\x37', '\x3', '\x2', '\x2', '\x2', '\x129', '\x12A', '\b', '\x1D', '\x1', '\x2', '\x12A', '\x12B', '\x5', 'J', '&', '\x2', '\x12B', '\x14E', '\x3', '\x2', '\x2', '\x2', '\x12C', '\x12D', '\f', '\n', '\x2', '\x2', '\x12D', '\x12E', '\x5', ':', '\x1E', '\x2', '\x12E', @@ -4140,87 +4215,95 @@ private bool primary_expression_sempred(Primary_expressionContext _localctx, int '\x3', '\x2', '\x2', '\x2', '\x165', '\x162', '\x3', '\x2', '\x2', '\x2', '\x166', 'K', '\x3', '\x2', '\x2', '\x2', '\x167', '\x168', '\t', '\b', '\x2', '\x2', '\x168', 'M', '\x3', '\x2', '\x2', '\x2', '\x169', '\x16A', - '\b', '(', '\x1', '\x2', '\x16A', '\x190', '\x5', 'X', '-', '\x2', '\x16B', - '\x190', '\a', '\x42', '\x2', '\x2', '\x16C', '\x190', '\x5', 'Z', '.', + '\b', '(', '\x1', '\x2', '\x16A', '\x19A', '\x5', 'X', '-', '\x2', '\x16B', + '\x19A', '\a', '\x44', '\x2', '\x2', '\x16C', '\x19A', '\x5', 'Z', '.', '\x2', '\x16D', '\x16F', '\a', '\b', '\x2', '\x2', '\x16E', '\x170', '\x5', 'R', '*', '\x2', '\x16F', '\x16E', '\x3', '\x2', '\x2', '\x2', '\x16F', '\x170', '\x3', '\x2', '\x2', '\x2', '\x170', '\x171', '\x3', '\x2', '\x2', - '\x2', '\x171', '\x190', '\a', '\t', '\x2', '\x2', '\x172', '\x174', '\a', + '\x2', '\x171', '\x19A', '\a', '\t', '\x2', '\x2', '\x172', '\x174', '\a', '\x1C', '\x2', '\x2', '\x173', '\x175', '\x5', 'T', '+', '\x2', '\x174', '\x173', '\x3', '\x2', '\x2', '\x2', '\x174', '\x175', '\x3', '\x2', '\x2', - '\x2', '\x175', '\x176', '\x3', '\x2', '\x2', '\x2', '\x176', '\x190', + '\x2', '\x175', '\x176', '\x3', '\x2', '\x2', '\x2', '\x176', '\x19A', '\a', '\x1D', '\x2', '\x2', '\x177', '\x178', '\a', '\x5', '\x2', '\x2', '\x178', '\x179', '\x5', '.', '\x18', '\x2', '\x179', '\x17A', '\a', '\x6', - '\x2', '\x2', '\x17A', '\x190', '\x3', '\x2', '\x2', '\x2', '\x17B', '\x17C', + '\x2', '\x2', '\x17A', '\x19A', '\x3', '\x2', '\x2', '\x2', '\x17B', '\x17C', '\a', '\x5', '\x2', '\x2', '\x17C', '\x17D', '\x5', '\x4', '\x3', '\x2', - '\x17D', '\x17E', '\a', '\x6', '\x2', '\x2', '\x17E', '\x190', '\x3', + '\x17D', '\x17E', '\a', '\x6', '\x2', '\x2', '\x17E', '\x19A', '\x3', '\x2', '\x2', '\x2', '\x17F', '\x180', '\a', '(', '\x2', '\x2', '\x180', '\x181', '\a', '\x5', '\x2', '\x2', '\x181', '\x182', '\x5', '\x4', '\x3', - '\x2', '\x182', '\x183', '\a', '\x6', '\x2', '\x2', '\x183', '\x190', + '\x2', '\x182', '\x183', '\a', '\x6', '\x2', '\x2', '\x183', '\x19A', '\x3', '\x2', '\x2', '\x2', '\x184', '\x185', '\a', ' ', '\x2', '\x2', '\x185', '\x186', '\a', '\x5', '\x2', '\x2', '\x186', '\x187', '\x5', '\x4', '\x3', '\x2', '\x187', '\x188', '\a', '\x6', '\x2', '\x2', '\x188', - '\x190', '\x3', '\x2', '\x2', '\x2', '\x189', '\x18A', '\a', '\x1E', '\x2', + '\x19A', '\x3', '\x2', '\x2', '\x2', '\x189', '\x18A', '\a', '\x1E', '\x2', '\x2', '\x18A', '\x18B', '\a', '\x5', '\x2', '\x2', '\x18B', '\x18C', '\x5', '\x4', '\x3', '\x2', '\x18C', '\x18D', '\a', '\x6', '\x2', '\x2', - '\x18D', '\x190', '\x3', '\x2', '\x2', '\x2', '\x18E', '\x190', '\x5', - 'P', ')', '\x2', '\x18F', '\x169', '\x3', '\x2', '\x2', '\x2', '\x18F', - '\x16B', '\x3', '\x2', '\x2', '\x2', '\x18F', '\x16C', '\x3', '\x2', '\x2', - '\x2', '\x18F', '\x16D', '\x3', '\x2', '\x2', '\x2', '\x18F', '\x172', - '\x3', '\x2', '\x2', '\x2', '\x18F', '\x177', '\x3', '\x2', '\x2', '\x2', - '\x18F', '\x17B', '\x3', '\x2', '\x2', '\x2', '\x18F', '\x17F', '\x3', - '\x2', '\x2', '\x2', '\x18F', '\x184', '\x3', '\x2', '\x2', '\x2', '\x18F', - '\x189', '\x3', '\x2', '\x2', '\x2', '\x18F', '\x18E', '\x3', '\x2', '\x2', - '\x2', '\x190', '\x19B', '\x3', '\x2', '\x2', '\x2', '\x191', '\x192', - '\f', '\b', '\x2', '\x2', '\x192', '\x193', '\a', '\a', '\x2', '\x2', - '\x193', '\x19A', '\x5', 'X', '-', '\x2', '\x194', '\x195', '\f', '\a', - '\x2', '\x2', '\x195', '\x196', '\a', '\b', '\x2', '\x2', '\x196', '\x197', - '\x5', '.', '\x18', '\x2', '\x197', '\x198', '\a', '\t', '\x2', '\x2', - '\x198', '\x19A', '\x3', '\x2', '\x2', '\x2', '\x199', '\x191', '\x3', - '\x2', '\x2', '\x2', '\x199', '\x194', '\x3', '\x2', '\x2', '\x2', '\x19A', - '\x19D', '\x3', '\x2', '\x2', '\x2', '\x19B', '\x199', '\x3', '\x2', '\x2', - '\x2', '\x19B', '\x19C', '\x3', '\x2', '\x2', '\x2', '\x19C', 'O', '\x3', - '\x2', '\x2', '\x2', '\x19D', '\x19B', '\x3', '\x2', '\x2', '\x2', '\x19E', - '\x19F', '\a', ':', '\x2', '\x2', '\x19F', '\x1A1', '\a', '\a', '\x2', - '\x2', '\x1A0', '\x19E', '\x3', '\x2', '\x2', '\x2', '\x1A0', '\x1A1', - '\x3', '\x2', '\x2', '\x2', '\x1A1', '\x1A2', '\x3', '\x2', '\x2', '\x2', - '\x1A2', '\x1A3', '\x5', 'X', '-', '\x2', '\x1A3', '\x1A5', '\a', '\x5', - '\x2', '\x2', '\x1A4', '\x1A6', '\x5', 'R', '*', '\x2', '\x1A5', '\x1A4', - '\x3', '\x2', '\x2', '\x2', '\x1A5', '\x1A6', '\x3', '\x2', '\x2', '\x2', - '\x1A6', '\x1A7', '\x3', '\x2', '\x2', '\x2', '\x1A7', '\x1A8', '\a', - '\x6', '\x2', '\x2', '\x1A8', '\x1B6', '\x3', '\x2', '\x2', '\x2', '\x1A9', - '\x1AA', '\a', '.', '\x2', '\x2', '\x1AA', '\x1AC', '\a', '\x5', '\x2', - '\x2', '\x1AB', '\x1AD', '\x5', 'R', '*', '\x2', '\x1AC', '\x1AB', '\x3', - '\x2', '\x2', '\x2', '\x1AC', '\x1AD', '\x3', '\x2', '\x2', '\x2', '\x1AD', - '\x1AE', '\x3', '\x2', '\x2', '\x2', '\x1AE', '\x1B6', '\a', '\x6', '\x2', - '\x2', '\x1AF', '\x1B0', '\a', '\x36', '\x2', '\x2', '\x1B0', '\x1B2', - '\a', '\x5', '\x2', '\x2', '\x1B1', '\x1B3', '\x5', 'R', '*', '\x2', '\x1B2', - '\x1B1', '\x3', '\x2', '\x2', '\x2', '\x1B2', '\x1B3', '\x3', '\x2', '\x2', - '\x2', '\x1B3', '\x1B4', '\x3', '\x2', '\x2', '\x2', '\x1B4', '\x1B6', - '\a', '\x6', '\x2', '\x2', '\x1B5', '\x1A0', '\x3', '\x2', '\x2', '\x2', - '\x1B5', '\x1A9', '\x3', '\x2', '\x2', '\x2', '\x1B5', '\x1AF', '\x3', - '\x2', '\x2', '\x2', '\x1B6', 'Q', '\x3', '\x2', '\x2', '\x2', '\x1B7', - '\x1BC', '\x5', '.', '\x18', '\x2', '\x1B8', '\x1B9', '\a', '\x4', '\x2', - '\x2', '\x1B9', '\x1BB', '\x5', '.', '\x18', '\x2', '\x1BA', '\x1B8', - '\x3', '\x2', '\x2', '\x2', '\x1BB', '\x1BE', '\x3', '\x2', '\x2', '\x2', - '\x1BC', '\x1BA', '\x3', '\x2', '\x2', '\x2', '\x1BC', '\x1BD', '\x3', - '\x2', '\x2', '\x2', '\x1BD', 'S', '\x3', '\x2', '\x2', '\x2', '\x1BE', - '\x1BC', '\x3', '\x2', '\x2', '\x2', '\x1BF', '\x1C4', '\x5', 'V', ',', - '\x2', '\x1C0', '\x1C1', '\a', '\x4', '\x2', '\x2', '\x1C1', '\x1C3', - '\x5', 'V', ',', '\x2', '\x1C2', '\x1C0', '\x3', '\x2', '\x2', '\x2', - '\x1C3', '\x1C6', '\x3', '\x2', '\x2', '\x2', '\x1C4', '\x1C2', '\x3', - '\x2', '\x2', '\x2', '\x1C4', '\x1C5', '\x3', '\x2', '\x2', '\x2', '\x1C5', - 'U', '\x3', '\x2', '\x2', '\x2', '\x1C6', '\x1C4', '\x3', '\x2', '\x2', - '\x2', '\x1C7', '\x1C8', '\a', '@', '\x2', '\x2', '\x1C8', '\x1C9', '\a', - '\v', '\x2', '\x2', '\x1C9', '\x1CA', '\x5', '.', '\x18', '\x2', '\x1CA', - 'W', '\x3', '\x2', '\x2', '\x2', '\x1CB', '\x1CC', '\t', '\t', '\x2', - '\x2', '\x1CC', 'Y', '\x3', '\x2', '\x2', '\x2', '\x1CD', '\x1CE', '\t', - '\n', '\x2', '\x2', '\x1CE', '[', '\x3', '\x2', '\x2', '\x2', '/', '\x61', - '\x64', 'g', 'j', 'm', 'q', 't', '~', '\x8A', '\x90', '\x98', '\x9B', - '\xA1', '\xA8', '\xAD', '\xB3', '\xC1', '\xC3', '\xD6', '\xDB', '\xEC', - '\xF3', '\xFE', '\x100', '\x107', '\x10F', '\x111', '\x116', '\x11F', - '\x124', '\x14C', '\x14E', '\x165', '\x16F', '\x174', '\x18F', '\x199', - '\x19B', '\x1A0', '\x1A5', '\x1AC', '\x1B2', '\x1B5', '\x1BC', '\x1C4', + '\x18D', '\x19A', '\x3', '\x2', '\x2', '\x2', '\x18E', '\x18F', '\a', + ')', '\x2', '\x2', '\x18F', '\x190', '\a', '\x5', '\x2', '\x2', '\x190', + '\x191', '\x5', '\x4', '\x3', '\x2', '\x191', '\x192', '\a', '\x6', '\x2', + '\x2', '\x192', '\x19A', '\x3', '\x2', '\x2', '\x2', '\x193', '\x194', + '\a', '/', '\x2', '\x2', '\x194', '\x195', '\a', '\x5', '\x2', '\x2', + '\x195', '\x196', '\x5', '\x4', '\x3', '\x2', '\x196', '\x197', '\a', + '\x6', '\x2', '\x2', '\x197', '\x19A', '\x3', '\x2', '\x2', '\x2', '\x198', + '\x19A', '\x5', 'P', ')', '\x2', '\x199', '\x169', '\x3', '\x2', '\x2', + '\x2', '\x199', '\x16B', '\x3', '\x2', '\x2', '\x2', '\x199', '\x16C', + '\x3', '\x2', '\x2', '\x2', '\x199', '\x16D', '\x3', '\x2', '\x2', '\x2', + '\x199', '\x172', '\x3', '\x2', '\x2', '\x2', '\x199', '\x177', '\x3', + '\x2', '\x2', '\x2', '\x199', '\x17B', '\x3', '\x2', '\x2', '\x2', '\x199', + '\x17F', '\x3', '\x2', '\x2', '\x2', '\x199', '\x184', '\x3', '\x2', '\x2', + '\x2', '\x199', '\x189', '\x3', '\x2', '\x2', '\x2', '\x199', '\x18E', + '\x3', '\x2', '\x2', '\x2', '\x199', '\x193', '\x3', '\x2', '\x2', '\x2', + '\x199', '\x198', '\x3', '\x2', '\x2', '\x2', '\x19A', '\x1A5', '\x3', + '\x2', '\x2', '\x2', '\x19B', '\x19C', '\f', '\n', '\x2', '\x2', '\x19C', + '\x19D', '\a', '\a', '\x2', '\x2', '\x19D', '\x1A4', '\x5', 'X', '-', + '\x2', '\x19E', '\x19F', '\f', '\t', '\x2', '\x2', '\x19F', '\x1A0', '\a', + '\b', '\x2', '\x2', '\x1A0', '\x1A1', '\x5', '.', '\x18', '\x2', '\x1A1', + '\x1A2', '\a', '\t', '\x2', '\x2', '\x1A2', '\x1A4', '\x3', '\x2', '\x2', + '\x2', '\x1A3', '\x19B', '\x3', '\x2', '\x2', '\x2', '\x1A3', '\x19E', + '\x3', '\x2', '\x2', '\x2', '\x1A4', '\x1A7', '\x3', '\x2', '\x2', '\x2', + '\x1A5', '\x1A3', '\x3', '\x2', '\x2', '\x2', '\x1A5', '\x1A6', '\x3', + '\x2', '\x2', '\x2', '\x1A6', 'O', '\x3', '\x2', '\x2', '\x2', '\x1A7', + '\x1A5', '\x3', '\x2', '\x2', '\x2', '\x1A8', '\x1A9', '\a', '<', '\x2', + '\x2', '\x1A9', '\x1AB', '\a', '\a', '\x2', '\x2', '\x1AA', '\x1A8', '\x3', + '\x2', '\x2', '\x2', '\x1AA', '\x1AB', '\x3', '\x2', '\x2', '\x2', '\x1AB', + '\x1AC', '\x3', '\x2', '\x2', '\x2', '\x1AC', '\x1AD', '\x5', 'X', '-', + '\x2', '\x1AD', '\x1AF', '\a', '\x5', '\x2', '\x2', '\x1AE', '\x1B0', + '\x5', 'R', '*', '\x2', '\x1AF', '\x1AE', '\x3', '\x2', '\x2', '\x2', + '\x1AF', '\x1B0', '\x3', '\x2', '\x2', '\x2', '\x1B0', '\x1B1', '\x3', + '\x2', '\x2', '\x2', '\x1B1', '\x1B2', '\a', '\x6', '\x2', '\x2', '\x1B2', + '\x1C0', '\x3', '\x2', '\x2', '\x2', '\x1B3', '\x1B4', '\a', '\x30', '\x2', + '\x2', '\x1B4', '\x1B6', '\a', '\x5', '\x2', '\x2', '\x1B5', '\x1B7', + '\x5', 'R', '*', '\x2', '\x1B6', '\x1B5', '\x3', '\x2', '\x2', '\x2', + '\x1B6', '\x1B7', '\x3', '\x2', '\x2', '\x2', '\x1B7', '\x1B8', '\x3', + '\x2', '\x2', '\x2', '\x1B8', '\x1C0', '\a', '\x6', '\x2', '\x2', '\x1B9', + '\x1BA', '\a', '\x38', '\x2', '\x2', '\x1BA', '\x1BC', '\a', '\x5', '\x2', + '\x2', '\x1BB', '\x1BD', '\x5', 'R', '*', '\x2', '\x1BC', '\x1BB', '\x3', + '\x2', '\x2', '\x2', '\x1BC', '\x1BD', '\x3', '\x2', '\x2', '\x2', '\x1BD', + '\x1BE', '\x3', '\x2', '\x2', '\x2', '\x1BE', '\x1C0', '\a', '\x6', '\x2', + '\x2', '\x1BF', '\x1AA', '\x3', '\x2', '\x2', '\x2', '\x1BF', '\x1B3', + '\x3', '\x2', '\x2', '\x2', '\x1BF', '\x1B9', '\x3', '\x2', '\x2', '\x2', + '\x1C0', 'Q', '\x3', '\x2', '\x2', '\x2', '\x1C1', '\x1C6', '\x5', '.', + '\x18', '\x2', '\x1C2', '\x1C3', '\a', '\x4', '\x2', '\x2', '\x1C3', '\x1C5', + '\x5', '.', '\x18', '\x2', '\x1C4', '\x1C2', '\x3', '\x2', '\x2', '\x2', + '\x1C5', '\x1C8', '\x3', '\x2', '\x2', '\x2', '\x1C6', '\x1C4', '\x3', + '\x2', '\x2', '\x2', '\x1C6', '\x1C7', '\x3', '\x2', '\x2', '\x2', '\x1C7', + 'S', '\x3', '\x2', '\x2', '\x2', '\x1C8', '\x1C6', '\x3', '\x2', '\x2', + '\x2', '\x1C9', '\x1CE', '\x5', 'V', ',', '\x2', '\x1CA', '\x1CB', '\a', + '\x4', '\x2', '\x2', '\x1CB', '\x1CD', '\x5', 'V', ',', '\x2', '\x1CC', + '\x1CA', '\x3', '\x2', '\x2', '\x2', '\x1CD', '\x1D0', '\x3', '\x2', '\x2', + '\x2', '\x1CE', '\x1CC', '\x3', '\x2', '\x2', '\x2', '\x1CE', '\x1CF', + '\x3', '\x2', '\x2', '\x2', '\x1CF', 'U', '\x3', '\x2', '\x2', '\x2', + '\x1D0', '\x1CE', '\x3', '\x2', '\x2', '\x2', '\x1D1', '\x1D2', '\a', + '\x42', '\x2', '\x2', '\x1D2', '\x1D3', '\a', '\v', '\x2', '\x2', '\x1D3', + '\x1D4', '\x5', '.', '\x18', '\x2', '\x1D4', 'W', '\x3', '\x2', '\x2', + '\x2', '\x1D5', '\x1D6', '\t', '\t', '\x2', '\x2', '\x1D6', 'Y', '\x3', + '\x2', '\x2', '\x2', '\x1D7', '\x1D8', '\t', '\n', '\x2', '\x2', '\x1D8', + '[', '\x3', '\x2', '\x2', '\x2', '/', '\x61', '\x64', 'g', 'j', 'm', 'q', + 't', '~', '\x8A', '\x90', '\x98', '\x9B', '\xA1', '\xA8', '\xAD', '\xB3', + '\xC1', '\xC3', '\xD6', '\xDB', '\xEC', '\xF3', '\xFE', '\x100', '\x107', + '\x10F', '\x111', '\x116', '\x11F', '\x124', '\x14C', '\x14E', '\x165', + '\x16F', '\x174', '\x199', '\x1A3', '\x1A5', '\x1AA', '\x1AF', '\x1B6', + '\x1BC', '\x1BF', '\x1C6', '\x1CE', }; public static readonly ATN _ATN = diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs index 744d98bf44..e276466f9d 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs @@ -1004,6 +1004,12 @@ public override bool Visit(SqlExistsScalarExpression sqlExistsScalarExpression) return false; } + public override bool Visit(SqlFirstScalarExpression sqlFirstScalarExpression) + { + // No need to worry about aggregates within the subquery (they will recursively get rewritten). + return false; + } + public override bool Visit(SqlFunctionCallScalarExpression sqlFunctionCallScalarExpression) { return !sqlFunctionCallScalarExpression.IsUdf && @@ -1021,6 +1027,12 @@ public override bool Visit(SqlInScalarExpression sqlInScalarExpression) return hasAggregates; } + public override bool Visit(SqlLastScalarExpression sqlLastScalarExpression) + { + // No need to worry about aggregates within the subquery (they will recursively get rewritten). + return false; + } + public override bool Visit(SqlLiteralScalarExpression sqlLiteralScalarExpression) { return false; diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/SqlFirstScalarExpression.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/SqlFirstScalarExpression.cs new file mode 100644 index 0000000000..556da872e8 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/SqlFirstScalarExpression.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.SqlObjects +{ + using System; + using Microsoft.Azure.Cosmos.SqlObjects.Visitors; + +#if INTERNAL +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +#pragma warning disable SA1600 // Elements should be documented + public +#else + internal +#endif + sealed class SqlFirstScalarExpression : SqlScalarExpression + { + private SqlFirstScalarExpression(SqlQuery subquery) + { + this.Subquery = subquery ?? throw new ArgumentNullException(nameof(subquery)); + } + + public SqlQuery Subquery { get; } + + public static SqlFirstScalarExpression Create(SqlQuery subquery) => new SqlFirstScalarExpression(subquery); + + public override void Accept(SqlObjectVisitor visitor) => visitor.Visit(this); + + public override TResult Accept(SqlObjectVisitor visitor) => visitor.Visit(this); + + public override TResult Accept(SqlObjectVisitor visitor, T input) => visitor.Visit(this, input); + + public override void Accept(SqlScalarExpressionVisitor visitor) => visitor.Visit(this); + + public override TResult Accept(SqlScalarExpressionVisitor visitor) => visitor.Visit(this); + + public override TResult Accept(SqlScalarExpressionVisitor visitor, T input) => visitor.Visit(this, input); + } +} diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/SqlLastScalarExpression.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/SqlLastScalarExpression.cs new file mode 100644 index 0000000000..36707d1c80 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/SqlLastScalarExpression.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.SqlObjects +{ + using System; + using Microsoft.Azure.Cosmos.SqlObjects.Visitors; + +#if INTERNAL +#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member +#pragma warning disable SA1600 // Elements should be documented + public +#else + internal +#endif + sealed class SqlLastScalarExpression : SqlScalarExpression + { + private SqlLastScalarExpression(SqlQuery subquery) + { + this.Subquery = subquery ?? throw new ArgumentNullException(nameof(subquery)); + } + + public SqlQuery Subquery { get; } + + public static SqlLastScalarExpression Create(SqlQuery subquery) => new SqlLastScalarExpression(subquery); + + public override void Accept(SqlObjectVisitor visitor) => visitor.Visit(this); + + public override TResult Accept(SqlObjectVisitor visitor) => visitor.Visit(this); + + public override TResult Accept(SqlObjectVisitor visitor, T input) => visitor.Visit(this, input); + + public override void Accept(SqlScalarExpressionVisitor visitor) => visitor.Visit(this); + + public override TResult Accept(SqlScalarExpressionVisitor visitor) => visitor.Visit(this); + + public override TResult Accept(SqlScalarExpressionVisitor visitor, T input) => visitor.Visit(this, input); + } +} diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectEqualityVisitor.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectEqualityVisitor.cs index 3a9bf01970..8d7770ba9e 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectEqualityVisitor.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectEqualityVisitor.cs @@ -231,6 +231,21 @@ public override bool Visit(SqlExistsScalarExpression first, SqlObject secondAsOb return true; } + public override bool Visit(SqlFirstScalarExpression first, SqlObject secondAsObject) + { + if (!(secondAsObject is SqlFirstScalarExpression second)) + { + return false; + } + + if (!Equals(first.Subquery, second.Subquery)) + { + return false; + } + + return true; + } + public override bool Visit(SqlFromClause first, SqlObject secondAsObject) { if (!(secondAsObject is SqlFromClause second)) @@ -386,6 +401,21 @@ public override bool Visit(SqlJoinCollectionExpression first, SqlObject secondAs return true; } + public override bool Visit(SqlLastScalarExpression first, SqlObject secondAsObject) + { + if (!(secondAsObject is SqlLastScalarExpression second)) + { + return false; + } + + if (!Equals(first.Subquery, second.Subquery)) + { + return false; + } + + return true; + } + public override bool Visit(SqlLikeScalarExpression first, SqlObject secondAsObject) { if (!(secondAsObject is SqlLikeScalarExpression second)) diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectHasher.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectHasher.cs index dfbab84bc0..f4f55009ec 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectHasher.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectHasher.cs @@ -25,6 +25,7 @@ internal sealed class SqlObjectHasher : SqlObjectVisitor private const int SqlCoalesceScalarExpressionHashCode = -1400659633; private const int SqlConditionalScalarExpressionHashCode = -421337832; private const int SqlExistsScalarExpressionHashCode = 1168675587; + private const int SqlFirstScalarExpressionHashCode = -754458752; private const int SqlFromClauseHashCode = 52588336; private const int SqlFunctionCallScalarExpressionHashCode = 496783446; private const int SqlFunctionCallScalarExpressionUdfHashCode = 1547906315; @@ -35,6 +36,7 @@ internal sealed class SqlObjectHasher : SqlObjectVisitor private const int SqlInScalarExpressionHashCode = 1439386783; private const int SqlInScalarExpressionNotHashCode = -1131398119; private const int SqlJoinCollectionExpressionHashCode = 1000382226; + private const int SqlLastScalarExpressionHashCode = 2018370813; private const int SqlLikeScalarExpressionHashCode = 317861; private const int SqlLimitSpecHashCode = 92601316; private const int SqlLiteralScalarExpressionHashCode = -158339101; @@ -207,6 +209,13 @@ public override int Visit(SqlExistsScalarExpression sqlExistsScalarExpression) return hashCode; } + public override int Visit(SqlFirstScalarExpression sqlFirstScalarExpression) + { + int hashCode = SqlFirstScalarExpressionHashCode; + hashCode = CombineHashes(hashCode, sqlFirstScalarExpression.Subquery.Accept(this)); + return hashCode; + } + public override int Visit(SqlFromClause sqlFromClause) { int hashCode = SqlFromClauseHashCode; @@ -298,6 +307,13 @@ public override int Visit(SqlJoinCollectionExpression sqlJoinCollectionExpressio return hashCode; } + public override int Visit(SqlLastScalarExpression sqlLastScalarExpression) + { + int hashCode = SqlLastScalarExpressionHashCode; + hashCode = CombineHashes(hashCode, sqlLastScalarExpression.Subquery.Accept(this)); + return hashCode; + } + public override int Visit(SqlLimitSpec sqlObject) { int hashCode = SqlLimitSpecHashCode; diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectObfuscator.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectObfuscator.cs index 5e6faaef45..2120f16567 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectObfuscator.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectObfuscator.cs @@ -46,7 +46,7 @@ public override SqlObject Visit(SqlAliasedCollectionExpression sqlAliasedCollect public override SqlObject Visit(SqlAllScalarExpression sqlAllScalarExpression) { - return SqlExistsScalarExpression.Create(sqlAllScalarExpression.Subquery.Accept(this) as SqlQuery); + return SqlAllScalarExpression.Create(sqlAllScalarExpression.Subquery.Accept(this) as SqlQuery); } public override SqlObject Visit(SqlArrayCreateScalarExpression sqlArrayCreateScalarExpression) @@ -115,6 +115,11 @@ public override SqlObject Visit(SqlExistsScalarExpression sqlExistsScalarExpress return SqlExistsScalarExpression.Create(sqlExistsScalarExpression.Subquery.Accept(this) as SqlQuery); } + public override SqlObject Visit(SqlFirstScalarExpression sqlFirstScalarExpression) + { + return SqlFirstScalarExpression.Create(sqlFirstScalarExpression.Subquery.Accept(this) as SqlQuery); + } + public override SqlObject Visit(SqlFromClause sqlFromClause) { return SqlFromClause.Create(sqlFromClause.Expression.Accept(this) as SqlCollectionExpression); @@ -189,6 +194,11 @@ public override SqlObject Visit(SqlJoinCollectionExpression sqlJoinCollectionExp sqlJoinCollectionExpression.Right.Accept(this) as SqlCollectionExpression); } + public override SqlObject Visit(SqlLastScalarExpression sqlLastScalarExpression) + { + return SqlLastScalarExpression.Create(sqlLastScalarExpression.Subquery.Accept(this) as SqlQuery); + } + public override SqlObject Visit(SqlLikeScalarExpression sqlLikeScalarExpression) { return SqlLikeScalarExpression.Create( diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectTextSerializer.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectTextSerializer.cs index 75076e512c..a29435744d 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectTextSerializer.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectTextSerializer.cs @@ -154,6 +154,14 @@ public override void Visit(SqlExistsScalarExpression sqlExistsScalarExpression) this.WriteEndContext(")"); } + public override void Visit(SqlFirstScalarExpression sqlFirstScalarExpression) + { + this.writer.Write("FIRST"); + this.WriteStartContext("("); + sqlFirstScalarExpression.Subquery.Accept(this); + this.WriteEndContext(")"); + } + public override void Visit(SqlFromClause sqlFromClause) { this.writer.Write("FROM "); @@ -284,6 +292,14 @@ public override void Visit(SqlJoinCollectionExpression sqlJoinCollectionExpressi sqlJoinCollectionExpression.Right.Accept(this); } + public override void Visit(SqlLastScalarExpression sqlLastScalarExpression) + { + this.writer.Write("LAST"); + this.WriteStartContext("("); + sqlLastScalarExpression.Subquery.Accept(this); + this.WriteEndContext(")"); + } + public override void Visit(SqlLimitSpec sqlObject) { this.writer.Write("LIMIT "); diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor.cs index d8d8899395..3dfe3a9193 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor.cs @@ -24,6 +24,7 @@ abstract class SqlObjectVisitor public abstract void Visit(SqlCoalesceScalarExpression sqlObject); public abstract void Visit(SqlConditionalScalarExpression sqlObject); public abstract void Visit(SqlExistsScalarExpression sqlObject); + public abstract void Visit(SqlFirstScalarExpression sqlObject); public abstract void Visit(SqlFromClause sqlObject); public abstract void Visit(SqlFunctionCallScalarExpression sqlObject); public abstract void Visit(SqlGroupByClause sqlObject); @@ -32,6 +33,7 @@ abstract class SqlObjectVisitor public abstract void Visit(SqlInputPathCollection sqlObject); public abstract void Visit(SqlInScalarExpression sqlObject); public abstract void Visit(SqlJoinCollectionExpression sqlObject); + public abstract void Visit(SqlLastScalarExpression sqlObject); public abstract void Visit(SqlLikeScalarExpression sqlObject); public abstract void Visit(SqlLimitSpec sqlObject); public abstract void Visit(SqlLiteralScalarExpression sqlObject); diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor{TArg,TOutput}.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor{TArg,TOutput}.cs index 3ba9878ae6..449cd6adaf 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor{TArg,TOutput}.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor{TArg,TOutput}.cs @@ -24,6 +24,7 @@ abstract class SqlObjectVisitor public abstract TOutput Visit(SqlCoalesceScalarExpression sqlObject, TArg input); public abstract TOutput Visit(SqlConditionalScalarExpression sqlObject, TArg input); public abstract TOutput Visit(SqlExistsScalarExpression sqlObject, TArg input); + public abstract TOutput Visit(SqlFirstScalarExpression sqlObject, TArg input); public abstract TOutput Visit(SqlFromClause sqlObject, TArg input); public abstract TOutput Visit(SqlFunctionCallScalarExpression sqlObject, TArg input); public abstract TOutput Visit(SqlGroupByClause sqlObject, TArg input); @@ -32,6 +33,7 @@ abstract class SqlObjectVisitor public abstract TOutput Visit(SqlInputPathCollection sqlObject, TArg input); public abstract TOutput Visit(SqlInScalarExpression sqlObject, TArg input); public abstract TOutput Visit(SqlJoinCollectionExpression sqlObject, TArg input); + public abstract TOutput Visit(SqlLastScalarExpression sqlObject, TArg input); public abstract TOutput Visit(SqlLikeScalarExpression sqlObject, TArg input); public abstract TOutput Visit(SqlLimitSpec sqlObject, TArg input); public abstract TOutput Visit(SqlLiteralScalarExpression sqlObject, TArg input); diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor{TResult}.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor{TResult}.cs index 6f0ce75e99..3d1000a171 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor{TResult}.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlObjectVisitor{TResult}.cs @@ -24,6 +24,7 @@ abstract class SqlObjectVisitor public abstract TResult Visit(SqlCoalesceScalarExpression sqlObject); public abstract TResult Visit(SqlConditionalScalarExpression sqlObject); public abstract TResult Visit(SqlExistsScalarExpression sqlObject); + public abstract TResult Visit(SqlFirstScalarExpression sqlObject); public abstract TResult Visit(SqlFromClause sqlObject); public abstract TResult Visit(SqlFunctionCallScalarExpression sqlObject); public abstract TResult Visit(SqlGroupByClause sqlObject); @@ -31,6 +32,7 @@ abstract class SqlObjectVisitor public abstract TResult Visit(SqlIdentifierPathExpression sqlObject); public abstract TResult Visit(SqlInputPathCollection sqlObject); public abstract TResult Visit(SqlJoinCollectionExpression sqlObject); + public abstract TResult Visit(SqlLastScalarExpression sqlObject); public abstract TResult Visit(SqlLikeScalarExpression sqlObject); public abstract TResult Visit(SqlInScalarExpression sqlObject); public abstract TResult Visit(SqlLimitSpec sqlObject); diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor.cs index 8e6e75b7f0..d807395055 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor.cs @@ -20,8 +20,10 @@ abstract class SqlScalarExpressionVisitor public abstract void Visit(SqlCoalesceScalarExpression scalarExpression); public abstract void Visit(SqlConditionalScalarExpression scalarExpression); public abstract void Visit(SqlExistsScalarExpression scalarExpression); + public abstract void Visit(SqlFirstScalarExpression scalarExpression); public abstract void Visit(SqlFunctionCallScalarExpression scalarExpression); public abstract void Visit(SqlInScalarExpression scalarExpression); + public abstract void Visit(SqlLastScalarExpression scalarExpression); public abstract void Visit(SqlLikeScalarExpression scalarExpression); public abstract void Visit(SqlLiteralScalarExpression scalarExpression); public abstract void Visit(SqlMemberIndexerScalarExpression scalarExpression); diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor{TArg,TOutput}.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor{TArg,TOutput}.cs index ff5cdbc019..256482b151 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor{TArg,TOutput}.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor{TArg,TOutput}.cs @@ -21,8 +21,10 @@ abstract class SqlScalarExpressionVisitor public abstract TOutput Visit(SqlCoalesceScalarExpression scalarExpression, TArg input); public abstract TOutput Visit(SqlConditionalScalarExpression scalarExpression, TArg input); public abstract TOutput Visit(SqlExistsScalarExpression scalarExpression, TArg input); + public abstract TOutput Visit(SqlFirstScalarExpression scalarExpression, TArg input); public abstract TOutput Visit(SqlFunctionCallScalarExpression scalarExpression, TArg input); public abstract TOutput Visit(SqlInScalarExpression scalarExpression, TArg input); + public abstract TOutput Visit(SqlLastScalarExpression scalarExpression, TArg input); public abstract TOutput Visit(SqlLikeScalarExpression scalarExpression, TArg input); public abstract TOutput Visit(SqlLiteralScalarExpression scalarExpression, TArg input); public abstract TOutput Visit(SqlMemberIndexerScalarExpression scalarExpression, TArg input); diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor{TResult}.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor{TResult}.cs index bdc7b5f04f..e419b9758d 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor{TResult}.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/Visitors/SqlScalarExpressionVisitor{TResult}.cs @@ -21,8 +21,10 @@ abstract class SqlScalarExpressionVisitor public abstract TResult Visit(SqlCoalesceScalarExpression scalarExpression); public abstract TResult Visit(SqlConditionalScalarExpression scalarExpression); public abstract TResult Visit(SqlExistsScalarExpression scalarExpression); + public abstract TResult Visit(SqlFirstScalarExpression scalarExpression); public abstract TResult Visit(SqlFunctionCallScalarExpression scalarExpression); public abstract TResult Visit(SqlInScalarExpression scalarExpression); + public abstract TResult Visit(SqlLastScalarExpression scalarExpression); public abstract TResult Visit(SqlLikeScalarExpression scalarExpression); public abstract TResult Visit(SqlLiteralScalarExpression scalarExpression); public abstract TResult Visit(SqlMemberIndexerScalarExpression scalarExpression); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/AggregateSubquerySqlParserBaselineTests.First.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/AggregateSubquerySqlParserBaselineTests.First.xml new file mode 100644 index 0000000000..ae098baddc --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/AggregateSubquerySqlParserBaselineTests.First.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/AggregateSubquerySqlParserBaselineTests.Last.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/AggregateSubquerySqlParserBaselineTests.Last.xml new file mode 100644 index 0000000000..68b61ba3f1 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/AggregateSubquerySqlParserBaselineTests.Last.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ScalarExpressionSqlParserBaselineTests.First.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ScalarExpressionSqlParserBaselineTests.First.xml new file mode 100644 index 0000000000..10b917f519 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ScalarExpressionSqlParserBaselineTests.First.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ScalarExpressionSqlParserBaselineTests.Last.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ScalarExpressionSqlParserBaselineTests.Last.xml new file mode 100644 index 0000000000..ba5694ca80 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ScalarExpressionSqlParserBaselineTests.Last.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj index dc5f2c8e41..1d4e4e166c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj @@ -9,7 +9,7 @@ false false Microsoft.Azure.Cosmos.Tests - $(LangVersion) + $(LangVersion) @@ -174,12 +174,24 @@ PreserveNewest - - PreserveNewest - - - PreserveNewest - + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + PreserveNewest @@ -198,9 +210,9 @@ PreserveNewest - + PreserveNewest - + PreserveNewest diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/AggregateProjectionDector.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/AggregateProjectionDector.cs index ca162fc467..18c59fcc49 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/AggregateProjectionDector.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/AggregateProjectionDector.cs @@ -111,6 +111,12 @@ public override bool Visit(SqlExistsScalarExpression sqlExistsScalarExpression) return false; } + public override bool Visit(SqlFirstScalarExpression sqlFirstScalarExpression) + { + // No need to worry about aggregates within the subquery (they will recursively get rewritten). + return false; + } + public override bool Visit(SqlFunctionCallScalarExpression sqlFunctionCallScalarExpression) { Aggregate aggregate; @@ -129,6 +135,12 @@ public override bool Visit(SqlInScalarExpression sqlInScalarExpression) return hasAggregates; } + public override bool Visit(SqlLastScalarExpression sqlLastScalarExpression) + { + // No need to worry about aggregates within the subquery (they will recursively get rewritten). + return false; + } + public override bool Visit(SqlLikeScalarExpression sqlLikeScalarExpression) { return false; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/AggregateProjectionTransformer.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/AggregateProjectionTransformer.cs index 1ce82d3c98..e644eeee43 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/AggregateProjectionTransformer.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/AggregateProjectionTransformer.cs @@ -140,6 +140,12 @@ public override SqlScalarExpression Visit(SqlExistsScalarExpression sqlExistsSca return sqlExistsScalarExpression; } + public override SqlScalarExpression Visit(SqlFirstScalarExpression sqlFirstScalarExpression) + { + // No need to worry about aggregates within the subquery (they will recursively get rewritten). + return sqlFirstScalarExpression; + } + public override SqlScalarExpression Visit(SqlFunctionCallScalarExpression sqlFunctionCallScalarExpression) { SqlScalarExpression rewrittenExpression; @@ -293,6 +299,12 @@ public override SqlScalarExpression Visit(SqlInScalarExpression sqlInScalarExpre items); } + public override SqlScalarExpression Visit(SqlLastScalarExpression sqlLastScalarExpression) + { + // No need to worry about aggregates within the subquery (they will recursively get rewritten). + return sqlLastScalarExpression; + } + public override SqlScalarExpression Visit(SqlLikeScalarExpression sqlLikeScalarExpression) { return sqlLikeScalarExpression; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/ScalarExpressionEvaluator.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/ScalarExpressionEvaluator.cs index 2a671f2568..4c0cda94dc 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/ScalarExpressionEvaluator.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/ScalarExpressionEvaluator.cs @@ -257,6 +257,16 @@ public override CosmosElement Visit(SqlExistsScalarExpression scalarExpression, return CosmosBoolean.Create(subqueryResults.Any()); } + public override CosmosElement Visit(SqlFirstScalarExpression scalarExpression, CosmosElement document) + { + // Only run on the current document since the subquery is always correlated. + IEnumerable subqueryResults = SqlInterpreter.ExecuteQuery( + new CosmosElement[] { document }, + scalarExpression.Subquery); + + return subqueryResults.FirstOrDefault(CosmosUndefined.Create()); + } + public override CosmosElement Visit(SqlFunctionCallScalarExpression scalarExpression, CosmosElement document) { List arguments = new List(); @@ -304,6 +314,16 @@ public override CosmosElement Visit(SqlInScalarExpression scalarExpression, Cosm return CosmosBoolean.Create(contains); } + public override CosmosElement Visit(SqlLastScalarExpression scalarExpression, CosmosElement document) + { + // Only run on the current document since the subquery is always correlated. + IEnumerable subqueryResults = SqlInterpreter.ExecuteQuery( + new CosmosElement[] { document }, + scalarExpression.Subquery); + + return subqueryResults.LastOrDefault(CosmosUndefined.Create()); + } + public override CosmosElement Visit(SqlLikeScalarExpression scalarExpression, CosmosElement document) { // Consider the necessity of having v3 offline engine. Should we remove this altogether? diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/SqlInterpreter.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/SqlInterpreter.cs index ba45092faa..c9da37b7c4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/SqlInterpreter.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OfflineEngine/SqlInterpreter.cs @@ -755,6 +755,11 @@ public override bool Visit(SqlExistsScalarExpression scalarExpression) return false; } + public override bool Visit(SqlFirstScalarExpression scalarExpression) + { + return false; + } + public override bool Visit(SqlFunctionCallScalarExpression scalarExpression) { if (this.MatchesGroupByExpression(scalarExpression)) @@ -805,6 +810,11 @@ public override bool Visit(SqlInScalarExpression scalarExpression) return true; } + public override bool Visit(SqlLastScalarExpression scalarExpression) + { + return false; + } + public override bool Visit(SqlLikeScalarExpression scalarExpression) { return false; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/AggregateSubquerySqlParserBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/AggregateSubquerySqlParserBaselineTests.cs index 079fbbba46..92c6d6056b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/AggregateSubquerySqlParserBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/AggregateSubquerySqlParserBaselineTests.cs @@ -54,12 +54,109 @@ public void All() " FROM (SELECT udf.ALL(1, 2)) AS ALL " + " WHERE ALL( SELECT VALUE 1) " + ")") - }; this.ExecuteTestSuite(inputs); } + [TestMethod] + public void First() + { + List inputs = new List() + { + CreateInput( + description: "FIRST in an SqlSelectItem as an alias", + query: "SELECT 1 AS FIRST"), + CreateInput( + description: "FIRST in an AliasedCollectionExpression as an alias", + query: "SELECT * " + + "FROM (SELECT VALUE 1) AS FIRST"), + CreateInput( + description: "FIRST in an ArrayIteratorCollectionExpression", + query: "SELECT * " + + "FROM FIRST IN (SELECT VALUE 1)"), + CreateInput( + description: "FIRST in an InputPathCollection and IdentifierPathExpression", + query: "SELECT * " + + "FROM FIRST.FIRST"), + CreateInput( + description: "FIRST in a PropertyRefScalarExpression", + query: "SELECT FIRST"), + CreateInput( + description: "FIRST in a PropertyRefScalarExpression as child", + query: "SELECT c.FIRST"), + CreateInput( + description: "FIRST in a PropertyRefScalarExpression as parent and child", + query: "SELECT FIRST.FIRST"), + CreateInput( + description: "FIRST in a function cFIRST", + query: "SELECT FIRST(1, 2)"), + CreateInput( + description: "FIRST in a UDF function cFIRST", + query: "SELECT udf.FIRST(1, 2)"), + CreateInput( + description: "FIRST in every possible grammar rule at the same time", + query: "SELECT FIRST(1, 2) AS FIRST " + + "FROM FIRST IN (SELECT FIRST.FIRST) " + + "WHERE FIRST( " + + " SELECT FIRST " + + " FROM (SELECT udf.FIRST(1, 2)) AS FIRST " + + " WHERE FIRST( SELECT VALUE 1) " + + ")") + }; + + this.ExecuteTestSuite(inputs); + } + + [TestMethod] + public void Last() + { + List inputs = new List() + { + CreateInput( + description: "LAST in an SqlSelectItem as an alias", + query: "SELECT 1 AS LAST"), + CreateInput( + description: "LAST in an AliasedCollectionExpression as an alias", + query: "SELECT * " + + "FROM (SELECT VALUE 1) AS LAST"), + CreateInput( + description: "LAST in an ArrayIteratorCollectionExpression", + query: "SELECT * " + + "FROM LAST IN (SELECT VALUE 1)"), + CreateInput( + description: "LAST in an InputPathCollection and IdentifierPathExpression", + query: "SELECT * " + + "FROM LAST.LAST"), + CreateInput( + description: "LAST in a PropertyRefScalarExpression", + query: "SELECT LAST"), + CreateInput( + description: "LAST in a PropertyRefScalarExpression as child", + query: "SELECT c.LAST"), + CreateInput( + description: "LAST in a PropertyRefScalarExpression as parent and child", + query: "SELECT LAST.LAST"), + CreateInput( + description: "LAST in a function cLAST", + query: "SELECT LAST(1, 2)"), + CreateInput( + description: "LAST in a UDF function cLAST", + query: "SELECT udf.LAST(1, 2)"), + CreateInput( + description: "LAST in every possible grammar rule at the same time", + query: "SELECT LAST(1, 2) AS LAST " + + "FROM LAST IN (SELECT LAST.LAST) " + + "WHERE LAST( " + + " SELECT LAST " + + " FROM (SELECT udf.LAST(1, 2)) AS LAST " + + " WHERE LAST( SELECT VALUE 1) " + + ")") + }; + + this.ExecuteTestSuite(inputs); + } + public static SqlParserBaselineTestInput CreateInput(string description, string query) { return new SqlParserBaselineTestInput(description, query); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/ScalarExpressionSqlParserBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/ScalarExpressionSqlParserBaselineTests.cs index 2faed74686..43377f0074 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/ScalarExpressionSqlParserBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/ScalarExpressionSqlParserBaselineTests.cs @@ -246,6 +246,38 @@ public void Exists() this.ExecuteTestSuite(inputs); } + [TestMethod] + public void First() + { + List inputs = new List() + { + // Positive + CreateInput(description: "Basic", scalarExpression: "FIRST(SELECT *)"), + CreateInput(description: "case insensitive", scalarExpression: "FIRST(SELECT *)"), + CreateInput(description: "nested", scalarExpression:"FIRST( SELECT * WHERE FIRST( SELECT *))"), + CreateInput( + description: "multiple nested", + scalarExpression: + "FIRST( " + + " SELECT * " + + " WHERE FIRST( " + + " SELECT *" + + " WHERE FIRST(" + + " SELECT *" + + " WHERE FIRST(" + + " SELECT VALUE 1" + + " )" + + " )" + + " )" + + ")"), + + // Negative + CreateInput(description: "No closing parens", scalarExpression: "FIRST(SELECT *") + }; + + this.ExecuteTestSuite(inputs); + } + [TestMethod] public void FunctionCall() { @@ -291,6 +323,38 @@ public void In() this.ExecuteTestSuite(inputs); } + [TestMethod] + public void Last() + { + List inputs = new List() + { + // Positive + CreateInput(description: "Basic", scalarExpression: "LAST(SELECT *)"), + CreateInput(description: "case insensitive", scalarExpression: "LAST(SELECT *)"), + CreateInput(description: "nested", scalarExpression:"LAST( SELECT * WHERE LAST( SELECT *))"), + CreateInput( + description: "multiple nested", + scalarExpression: + "LAST( " + + " SELECT * " + + " WHERE LAST( " + + " SELECT *" + + " WHERE LAST(" + + " SELECT *" + + " WHERE LAST(" + + " SELECT VALUE 1" + + " )" + + " )" + + " )" + + ")"), + + // Negative + CreateInput(description: "No closing parens", scalarExpression: "LAST(SELECT *") + }; + + this.ExecuteTestSuite(inputs); + } + [TestMethod] public void Literal() { From dc3d0377cab69bf79449d3fcc72da9ea60082f72 Mon Sep 17 00:00:00 2001 From: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com> Date: Tue, 7 Mar 2023 14:39:57 -0500 Subject: [PATCH 070/240] Subpartitioning: Adds support for Prefix Partition Key searches for sub partitioned containers (#3109) * 1st round of changes to support subpartitioning for ChangeFeed * name change and moved a method to FeedRangePartitionKey * support for prefix partition change feed and query including unit and emulator tests. need to verify using FeedRange with QueryIterator * splitting out unit tests from emulator tests * 1st round of changes to support subpartitioning for ChangeFeed * name change and moved a method to FeedRangePartitionKey * support for prefix partition change feed and query including unit and emulator tests. need to verify using FeedRange with QueryIterator * splitting out unit tests from emulator tests * moved logic to choose for prefix partition query and change feed * additional conditional to check for MultiHash partitionkeydefinition kind * removed unnecessary using * cleanup * unnecessary using * removed PREVIEW from proj * unit tests for ResolveFeedRangeBasedOnPrefixContainerAsync * change access modifier * since I changed to static, needed to fix tests * dealing with some testing nits * removed Console.Writeline * slight change in test use containerProperties and partitionKeyDefinition * big fix for resolve feedrange, changes to error behavior, added additional test coverage * test changes * ran updateContracts.ps1 * reverting to 3ad5309e9e22a7376e836cfdbe11fa2438a59133 * Ran Update Contracts * ran updateContracts.ps1 * UpdateContracts.ps1 * updatecontracts * removed bad check from test, removed changes from updatecontracts.ps1 * revert UpdateContracts changes * Reverting to 756a123160d14c424c5e11c4f3520094115aa5d4 * removed accidental change from changelog * removed unwanted change from Directory.build.props * added test clean up * removed console.writelines * updates to query test * removed preview flag * ran UpdateContrats.ps1 * no longer recread feedRange for queries unless using prefix pk * simplified if statement * fixed bug --------- Co-authored-by: Nalu Tripician --- .../src/Handler/RequestInvokerHandler.cs | 29 ++ .../Resource/Container/ContainerCore.Items.cs | 6 - ...riterBaselineTests.BulkOperationsAsync.xml | 42 +- .../CosmosMultiHashTest.cs | 426 ++++++++++-------- ...reateFromPartitionKeyAsyncEmulatorTests.cs | 344 ++++++++++++++ .../HandlerTests.cs | 148 ++++++ 6 files changed, 809 insertions(+), 186 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedRangeCreateFromPartitionKeyAsyncEmulatorTests.cs diff --git a/Microsoft.Azure.Cosmos/src/Handler/RequestInvokerHandler.cs b/Microsoft.Azure.Cosmos/src/Handler/RequestInvokerHandler.cs index 96b889832e..bb322f19b1 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/RequestInvokerHandler.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/RequestInvokerHandler.cs @@ -161,6 +161,14 @@ public virtual async Task SendAsync( if (feedRange != null) { + if (!request.OperationType.IsPointOperation()) + { + feedRange = await RequestInvokerHandler.ResolveFeedRangeBasedOnPrefixContainerAsync( + feedRange: feedRange, + cosmosContainerCore: cosmosContainerCore, + cancellationToken: cancellationToken); + } + if (feedRange is FeedRangePartitionKey feedRangePartitionKey) { if (cosmosContainerCore == null && object.ReferenceEquals(feedRangePartitionKey.PartitionKey, Cosmos.PartitionKey.None)) @@ -480,5 +488,26 @@ private static bool IsClientNoResponseSet(CosmosClientOptions clientOptions, Ope && clientOptions.EnableContentResponseOnWrite.HasValue && RequestInvokerHandler.IsItemNoRepsonseSet(clientOptions.EnableContentResponseOnWrite.Value, operationType); } + + internal static async Task ResolveFeedRangeBasedOnPrefixContainerAsync( + FeedRange feedRange, + ContainerInternal cosmosContainerCore, + CancellationToken cancellationToken) + { + if (feedRange is FeedRangePartitionKey feedRangePartitionKey) + { + PartitionKeyDefinition partitionKeyDefinition = await cosmosContainerCore + .GetPartitionKeyDefinitionAsync(cancellationToken) + .ConfigureAwait(false); + + if (partitionKeyDefinition != null && partitionKeyDefinition.Kind == PartitionKind.MultiHash + && feedRangePartitionKey.PartitionKey.InternalKey?.Components?.Count < partitionKeyDefinition.Paths?.Count) + { + feedRange = new FeedRangeEpk(feedRangePartitionKey.PartitionKey.InternalKey.GetEPKRangeForPrefixPartitionKey(partitionKeyDefinition)); + } + } + + return feedRange; + } } } diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs index 0018eca9b7..31a3ccc5ca 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs @@ -959,12 +959,6 @@ private async Task ExtractPartitionKeyAndProcessItemStreamAsync // User specified PK value, no need to extract it if (partitionKey.HasValue) { - PartitionKeyDefinition pKeyDefinition = await this.GetPartitionKeyDefinitionAsync(); - if (partitionKey.HasValue && partitionKey.Value != PartitionKey.None && partitionKey.Value.InternalKey.Components.Count != pKeyDefinition.Paths.Count) - { - throw new ArgumentException(RMResources.MissingPartitionKeyValue); - } - return await this.ProcessItemStreamAsync( partitionKey, itemId, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index ed39221a61..041523ff8a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -38,6 +38,12 @@ │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds + │ └── Waiting for Initialization of client to complete(00000000-0000-0000-0000-000000000000) Unknown-Component 00:00:00:000 0.00 milliseconds + ├── Read Collection(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ ( + │ [Client Side Request Stats] + │ Redacted To Not Change The Baselines From Run To Run + │ ) ├── Batch Dispatch Async(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds │ ├── Using Wait(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds │ ├── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -72,7 +78,20 @@ }, { "name": "Get Collection Cache", - "duration in milliseconds": 0 + "duration in milliseconds": 0, + "children": [ + { + "name": "Waiting for Initialization of client to complete", + "duration in milliseconds": 0 + } + ] + }, + { + "name": "Read Collection", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } }, { "name": "Batch Dispatch Async", @@ -1634,6 +1653,12 @@ │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds + │ └── Waiting for Initialization of client to complete(00000000-0000-0000-0000-000000000000) Unknown-Component 00:00:00:000 0.00 milliseconds + ├── Read Collection(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ ( + │ [Client Side Request Stats] + │ Redacted To Not Change The Baselines From Run To Run + │ ) ├── Batch Dispatch Async(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds │ ├── Using Wait(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds │ ├── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -1808,7 +1833,20 @@ }, { "name": "Get Collection Cache", - "duration in milliseconds": 0 + "duration in milliseconds": 0, + "children": [ + { + "name": "Waiting for Initialization of client to complete", + "duration in milliseconds": 0 + } + ] + }, + { + "name": "Read Collection", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } }, { "name": "Batch Dispatch Async", diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs index c77352d07f..3c590092db 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs @@ -1,5 +1,4 @@ -#if PREVIEW -namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests +namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests { using System; using System.Collections.Generic; @@ -13,9 +12,9 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests [TestClass] public class CosmosMultiHashTest { + private CosmosClient client = null; private Cosmos.Database database = null; - private CosmosClient client = null; private Container container = null; private ContainerProperties containerProperties = null; @@ -29,7 +28,7 @@ public async Task TestInitialize() this.client = TestCommon.CreateCosmosClient(true); this.database = await this.client.CreateDatabaseIfNotExistsAsync("mydb"); - this.containerProperties = new ContainerProperties("mycoll", new List { "/ZipCode", "/Address" }); + this.containerProperties = new ContainerProperties("mycoll", new List { "/ZipCode", "/City" }); this.container = await this.database.CreateContainerAsync(this.containerProperties); } @@ -37,6 +36,8 @@ public async Task TestInitialize() public async Task Cleanup() { await this.database.DeleteAsync(); + this.client.Dispose(); + HttpConstants.Versions.CurrentVersion = this.currentVersion; this.client.Dispose(); } @@ -44,25 +45,38 @@ public async Task Cleanup() [TestMethod] public async Task MultiHashCreateDocumentTest() { + Cosmos.PartitionKey pKey; //Document create test ItemResponse[] documents = new ItemResponse[3]; - Document doc1 = new Document { Id = "document1" }; - doc1.SetValue("ZipCode", "500026"); - doc1.SetValue("Address", "Secunderabad"); - doc1.SetValue("Type", "Residence"); - documents[0] = await this.container.CreateItemAsync(doc1); - - doc1 = new Document { Id = "document2" }; - doc1.SetValue("ZipCode", "15232"); - doc1.SetValue("Address", "Pittsburgh"); - doc1.SetValue("Type", "Business"); - documents[1] = await this.container.CreateItemAsync(doc1); - - doc1 = new Document { Id = "document3" }; - doc1.SetValue("ZipCode", "11790"); - doc1.SetValue("Address", "Stonybrook"); - doc1.SetValue("Type", "Goverment"); - documents[2] = await this.container.CreateItemAsync(doc1); + Document doc = new Document { Id = "document1" }; + doc.SetValue("ZipCode", "500026"); + doc.SetValue("City", "Secunderabad"); + doc.SetValue("Type", "Residence"); + pKey= new PartitionKeyBuilder() + .Add(doc.GetPropertyValue("ZipCode")) + .Add(doc.GetPropertyValue("City")) + .Build(); + documents[0] = await this.container.CreateItemAsync(doc, pKey); + + doc = new Document { Id = "document2" }; + doc.SetValue("ZipCode", "15232"); + doc.SetValue("City", "Pittsburgh"); + doc.SetValue("Type", "Business"); + pKey = new PartitionKeyBuilder() + .Add(doc.GetPropertyValue("ZipCode")) + .Add(doc.GetPropertyValue("City")) + .Build(); + documents[1] = await this.container.CreateItemAsync(doc); + + doc = new Document { Id = "document3" }; + doc.SetValue("ZipCode", "11790"); + doc.SetValue("City", "Stonybrook"); + doc.SetValue("Type", "Goverment"); + pKey = new PartitionKeyBuilder() + .Add(doc.GetPropertyValue("ZipCode")) + .Add(doc.GetPropertyValue("City")) + .Build(); + documents[2] = await this.container.CreateItemAsync(doc); Assert.AreEqual(3, documents.Select(document => ((Document)document).SelfLink).Distinct().Count()); @@ -72,14 +86,16 @@ public async Task MultiHashCreateDocumentTest() foreach (Document document in documents) { badPKey = new PartitionKeyBuilder() - .Add(document.GetPropertyValue("Address")) + .Add(document.GetPropertyValue("ZipCode")) .Build(); document.Id += "Bad"; - ArgumentException createException = await Assert.ThrowsExceptionAsync(() => + CosmosException createException = await Assert.ThrowsExceptionAsync(() => this.container.CreateItemAsync(document, badPKey) ); + + Assert.AreEqual(createException.StatusCode, HttpStatusCode.BadRequest); } } @@ -91,45 +107,44 @@ public async Task MultiHashDeleteDocumentTest() //Create Items for test ItemResponse[] documents = new ItemResponse[3]; - Document doc1 = new Document { Id = "document1" }; - doc1.SetValue("ZipCode", "500026"); - doc1.SetValue("Address", "Secunderabad"); - doc1.SetValue("Type", "Residence"); - documents[0] = await this.container.CreateItemAsync(doc1); - - doc1 = new Document { Id = "document2" }; - doc1.SetValue("ZipCode", "15232"); - doc1.SetValue("Address", "Pittsburgh"); - doc1.SetValue("Type", "Business"); - documents[1] = await this.container.CreateItemAsync(doc1); - - doc1 = new Document { Id = "document3" }; - doc1.SetValue("ZipCode", "11790"); - doc1.SetValue("Address", "Stonybrook"); - doc1.SetValue("Type", "Goverment"); - documents[2] = await this.container.CreateItemAsync(doc1); + Document doc = new Document { Id = "document1" }; + doc.SetValue("ZipCode", "500026"); + doc.SetValue("City", "Secunderabad"); + doc.SetValue("Type", "Residence"); + documents[0] = await this.container.CreateItemAsync(doc); + + doc = new Document { Id = "document2" }; + doc.SetValue("ZipCode", "15232"); + doc.SetValue("City", "Pittsburgh"); + doc.SetValue("Type", "Business"); + documents[1] = await this.container.CreateItemAsync(doc); + + doc = new Document { Id = "document3" }; + doc.SetValue("ZipCode", "11790"); + doc.SetValue("City", "Stonybrook"); + doc.SetValue("Type", "Goverment"); + documents[2] = await this.container.CreateItemAsync(doc); //Document Delete Test foreach (Document document in documents) { - //Negative test - using incomplete partition key + //Negative test - using incomplete partition key (try one with more values too) badPKey = new PartitionKeyBuilder() - .Add(document.GetPropertyValue("Address")) + .Add(document.GetPropertyValue("ZipCode")) .Build(); CosmosException deleteException = await Assert.ThrowsExceptionAsync(() => this.container.DeleteItemAsync(document.Id, badPKey) ); - Assert.AreEqual(deleteException.StatusCode, HttpStatusCode.BadRequest); //Positive test pKey = new PartitionKeyBuilder() .Add(document.GetPropertyValue("ZipCode")) - .Add(document.GetPropertyValue("Address")) + .Add(document.GetPropertyValue("City")) .Build(); - Document readDocument = (await this.container.DeleteItemAsync(document.Id, pKey)).Resource; + Document deleteDocument = (await this.container.DeleteItemAsync(document.Id, pKey)).Resource; CosmosException clientException = await Assert.ThrowsExceptionAsync(() => this.container.ReadItemAsync(document.Id, pKey) @@ -147,30 +162,30 @@ public async Task MultiHashReadItemTest() //Create Items for test ItemResponse[] documents = new ItemResponse[3]; - Document doc1 = new Document { Id = "document1" }; - doc1.SetValue("ZipCode", "500026"); - doc1.SetValue("Address", "Secunderabad"); - doc1.SetValue("Type", "Residence"); - documents[0] = await this.container.CreateItemAsync(doc1); - - doc1 = new Document { Id = "document2" }; - doc1.SetValue("ZipCode", "15232"); - doc1.SetValue("Address", "Pittsburgh"); - doc1.SetValue("Type", "Business"); - documents[1] = await this.container.CreateItemAsync(doc1); - - doc1 = new Document { Id = "document3" }; - doc1.SetValue("ZipCode", "11790"); - doc1.SetValue("Address", "Stonybrook"); - doc1.SetValue("Type", "Goverment"); - documents[2] = await this.container.CreateItemAsync(doc1); + Document doc = new Document { Id = "document1" }; + doc.SetValue("ZipCode", "500026"); + doc.SetValue("City", "Secunderabad"); + doc.SetValue("Type", "Residence"); + documents[0] = await this.container.CreateItemAsync(doc); + + doc = new Document { Id = "document2" }; + doc.SetValue("ZipCode", "15232"); + doc.SetValue("City", "Pittsburgh"); + doc.SetValue("Type", "Business"); + documents[1] = await this.container.CreateItemAsync(doc); + + doc = new Document { Id = "document3" }; + doc.SetValue("ZipCode", "11790"); + doc.SetValue("City", "Stonybrook"); + doc.SetValue("Type", "Goverment"); + documents[2] = await this.container.CreateItemAsync(doc); //Document Read Test foreach (Document document in documents) { pKey = new PartitionKeyBuilder() .Add(document.GetPropertyValue("ZipCode")) - .Add(document.GetPropertyValue("Address")) + .Add(document.GetPropertyValue("City")) .Build(); Document readDocument = (await this.container.ReadItemAsync(document.Id, pKey)).Resource; @@ -178,7 +193,7 @@ public async Task MultiHashReadItemTest() //Negative test - using incomplete partition key badPKey = new PartitionKeyBuilder() - .Add(document.GetPropertyValue("Address")) + .Add(document.GetPropertyValue("ZipCode")) .Build(); CosmosException clientException = await Assert.ThrowsExceptionAsync(() => @@ -193,40 +208,47 @@ public async Task MultiHashReadItemTest() public async Task MultiHashReadManyTest() { Cosmos.PartitionKey pKey; + Cosmos.PartitionKey badPKey; //Create Items for test ItemResponse[] documents = new ItemResponse[3]; - Document doc1 = new Document { Id = "document1" }; - doc1.SetValue("ZipCode", "500026"); - doc1.SetValue("Address", "Secunderabad"); - doc1.SetValue("Type", "Residence"); - documents[0] = await this.container.CreateItemAsync(doc1); - - doc1 = new Document { Id = "document2" }; - doc1.SetValue("ZipCode", "15232"); - doc1.SetValue("Address", "Pittsburgh"); - doc1.SetValue("Type", "Business"); - documents[1] = await this.container.CreateItemAsync(doc1); - - doc1 = new Document { Id = "document3" }; - doc1.SetValue("ZipCode", "11790"); - doc1.SetValue("Address", "Stonybrook"); - doc1.SetValue("Type", "Goverment"); - documents[2] = await this.container.CreateItemAsync(doc1); + Document doc = new Document { Id = "document1" }; + doc.SetValue("ZipCode", "500026"); + doc.SetValue("City", "Secunderabad"); + doc.SetValue("Type", "Residence"); + documents[0] = await this.container.CreateItemAsync(doc); + + doc = new Document { Id = "document2" }; + doc.SetValue("ZipCode", "15232"); + doc.SetValue("City", "Pittsburgh"); + doc.SetValue("Type", "Business"); + documents[1] = await this.container.CreateItemAsync(doc); + + doc = new Document { Id = "document3" }; + doc.SetValue("ZipCode", "11790"); + doc.SetValue("City", "Stonybrook"); + doc.SetValue("Type", "Goverment"); + documents[2] = await this.container.CreateItemAsync(doc); //Read Many Test List<(string, Cosmos.PartitionKey)> itemList = new List<(string, Cosmos.PartitionKey)>(); + List<(string, Cosmos.PartitionKey)> incompleteList = new List<(string, Cosmos.PartitionKey)>(); foreach (Document document in documents) { pKey = new PartitionKeyBuilder() .Add(document.GetPropertyValue("ZipCode")) - .Add(document.GetPropertyValue("Address")) + .Add(document.GetPropertyValue("City")) + .Build(); + + badPKey = new PartitionKeyBuilder() + .Add(document.GetPropertyValue("ZipCode")) .Build(); itemList.Add((document.Id, pKey)); + incompleteList.Add((document.Id, badPKey)); } - FeedResponse feedResponse = await this.container.ReadManyItemsAsync(itemList); + FeedResponse feedResponse = await this.container.ReadManyItemsAsync(itemList); Assert.IsNotNull(feedResponse); Assert.AreEqual(feedResponse.Count, 3); @@ -234,17 +256,25 @@ public async Task MultiHashReadManyTest() Assert.IsNotNull(feedResponse.Diagnostics); int count = 0; - foreach (ToDoActivity item in feedResponse) + foreach (Document item in feedResponse) { count++; Assert.IsNotNull(item); - Assert.IsNotNull(item.pk); } Assert.AreEqual(count, 3); + + //Negative test - using incomplete partition key + await Assert.ThrowsExceptionAsync(() => + this.container.ReadManyItemsAsync(incompleteList)); } + public record DatabaseItem( + string Id, + string Pk + ); + [TestMethod] - public async Task MultiHashUpsetItemTest() + public async Task MultiHashUpsertItemTest() { Cosmos.PartitionKey pKey; Cosmos.PartitionKey badPKey; @@ -252,90 +282,92 @@ public async Task MultiHashUpsetItemTest() //Create Items for test ItemResponse[] documents = new ItemResponse[3]; - Document doc1 = new Document { Id = "document1" }; - doc1.SetValue("ZipCode", "500026"); - doc1.SetValue("Address", "Secunderabad"); - doc1.SetValue("Type", "Residence"); - documents[0] = await this.container.CreateItemAsync(doc1); - - doc1 = new Document { Id = "document2" }; - doc1.SetValue("ZipCode", "15232"); - doc1.SetValue("Address", "Pittsburgh"); - doc1.SetValue("Type", "Business"); - documents[1] = await this.container.CreateItemAsync(doc1); - - doc1 = new Document { Id = "document3" }; - doc1.SetValue("ZipCode", "11790"); - doc1.SetValue("Address", "Stonybrook"); - doc1.SetValue("Type", "Goverment"); - documents[2] = await this.container.CreateItemAsync(doc1); + Document doc = new Document { Id = "document1" }; + doc.SetValue("ZipCode", "500026"); + doc.SetValue("City", "Secunderabad"); + doc.SetValue("Type", "Residence"); + documents[0] = await this.container.CreateItemAsync(doc); + + doc = new Document { Id = "document2" }; + doc.SetValue("ZipCode", "15232"); + doc.SetValue("City", "Pittsburgh"); + doc.SetValue("Type", "Business"); + documents[1] = await this.container.CreateItemAsync(doc); + + doc = new Document { Id = "document3" }; + doc.SetValue("ZipCode", "11790"); + doc.SetValue("City", "Stonybrook"); + doc.SetValue("Type", "Goverment"); + documents[2] = await this.container.CreateItemAsync(doc); //Document Upsert Test - doc1 = new Document { Id = "document4" }; - doc1.SetValue("ZipCode", "97756"); - doc1.SetValue("Address", "Redmond"); - doc1.SetValue("Type", "Residence"); + doc = new Document { Id = "document4" }; + doc.SetValue("ZipCode", "97756"); + doc.SetValue("City", "Redmond"); + doc.SetValue("Type", "Residence"); pKey = new PartitionKeyBuilder() - .Add(doc1.GetPropertyValue("ZipCode")) - .Add(doc1.GetPropertyValue("Address")) + .Add(doc.GetPropertyValue("ZipCode")) + .Add(doc.GetPropertyValue("City")) .Build(); //insert check - await this.container.UpsertItemAsync(doc1, pKey); + await this.container.UpsertItemAsync(doc, pKey); - Document readCheck = (await this.container.ReadItemAsync(doc1.Id, pKey)).Resource; + Document readCheck = (await this.container.ReadItemAsync(doc.Id, pKey)).Resource; - Assert.AreEqual(doc1.GetPropertyValue("ZipCode"), readCheck.GetPropertyValue("ZipCode")); - Assert.AreEqual(doc1.GetPropertyValue("Address"), readCheck.GetPropertyValue("Address")); - Assert.AreEqual(doc1.GetPropertyValue("Type"), readCheck.GetPropertyValue("Type")); + Assert.AreEqual(doc.GetPropertyValue("ZipCode"), readCheck.GetPropertyValue("ZipCode")); + Assert.AreEqual(doc.GetPropertyValue("City"), readCheck.GetPropertyValue("City")); + Assert.AreEqual(doc.GetPropertyValue("Type"), readCheck.GetPropertyValue("Type")); - doc1 = new Document { Id = "document4" }; - doc1.SetValue("ZipCode", "97756"); - doc1.SetValue("Address", "Redmond"); - doc1.SetValue("Type", "Business"); + doc = new Document { Id = "document4" }; + doc.SetValue("ZipCode", "97756"); + doc.SetValue("City", "Redmond"); + doc.SetValue("Type", "Business"); //update check pKey = new PartitionKeyBuilder() - .Add(doc1.GetPropertyValue("ZipCode")) - .Add(doc1.GetPropertyValue("Address")) + .Add(doc.GetPropertyValue("ZipCode")) + .Add(doc.GetPropertyValue("City")) .Build(); - documents.Append>(await this.container.UpsertItemAsync(doc1, pKey)); + documents.Append>(await this.container.UpsertItemAsync(doc, pKey)); - readCheck = (await this.container.ReadItemAsync(doc1.Id, pKey)).Resource; + readCheck = (await this.container.ReadItemAsync(doc.Id, pKey)).Resource; - Assert.AreEqual(doc1.GetPropertyValue("ZipCode"), readCheck.GetPropertyValue("ZipCode")); - Assert.AreEqual(doc1.GetPropertyValue("Address"), readCheck.GetPropertyValue("Address")); - Assert.AreEqual(doc1.GetPropertyValue("Type"), readCheck.GetPropertyValue("Type")); + Assert.AreEqual(doc.GetPropertyValue("ZipCode"), readCheck.GetPropertyValue("ZipCode")); + Assert.AreEqual(doc.GetPropertyValue("City"), readCheck.GetPropertyValue("City")); + Assert.AreEqual(doc.GetPropertyValue("Type"), readCheck.GetPropertyValue("Type")); count = 0; - foreach (Document doc in this.container.GetItemLinqQueryable(true)) + foreach (Document document in this.container.GetItemLinqQueryable(true)) { count++; } Assert.AreEqual(4, count); //Negative test - using incomplete partition key - doc1 = new Document { Id = "document4" }; - doc1.SetValue("ZipCode", "97756"); - doc1.SetValue("Address", "Redmond"); - doc1.SetValue("Type", "Residence"); + doc = new Document { Id = "document4" }; + doc.SetValue("ZipCode", "97756"); + doc.SetValue("City", "Redmond"); + doc.SetValue("Type", "Residence"); badPKey = new PartitionKeyBuilder() - .Add(doc1.GetPropertyValue("ZipCode")) + .Add(doc.GetPropertyValue("ZipCode")) .Build(); - await Assert.ThrowsExceptionAsync(() => - this.container.UpsertItemAsync(doc1, badPKey) + CosmosException clientException = await Assert.ThrowsExceptionAsync(() => + this.container.UpsertItemAsync(doc, badPKey) ); - readCheck = (await this.container.ReadItemAsync(doc1.Id, pKey)).Resource; + Assert.AreEqual(clientException.StatusCode, HttpStatusCode.BadRequest); + + readCheck = (await this.container.ReadItemAsync(doc.Id, pKey)).Resource; - Assert.AreEqual(doc1.GetPropertyValue("ZipCode"), readCheck.GetPropertyValue("ZipCode")); - Assert.AreEqual(doc1.GetPropertyValue("Address"), readCheck.GetPropertyValue("Address")); - Assert.AreNotEqual(doc1.GetPropertyValue("Type"), readCheck.GetPropertyValue("Type")); + Assert.AreEqual(doc.GetPropertyValue("ZipCode"), readCheck.GetPropertyValue("ZipCode")); + Assert.AreEqual(doc.GetPropertyValue("City"), readCheck.GetPropertyValue("City")); + Assert.AreNotEqual(doc.GetPropertyValue("Type"), readCheck.GetPropertyValue("Type")); } [TestMethod] @@ -346,30 +378,30 @@ public async Task MultiHashReplaceItemTest() //Create items for test ItemResponse[] documents = new ItemResponse[3]; - Document doc1 = new Document { Id = "document1" }; - doc1.SetValue("ZipCode", "500026"); - doc1.SetValue("Address", "Secunderabad"); - doc1.SetValue("Type", "Residence"); - documents[0] = await this.container.CreateItemAsync(doc1); - - doc1 = new Document { Id = "document2" }; - doc1.SetValue("ZipCode", "15232"); - doc1.SetValue("Address", "Pittsburgh"); - doc1.SetValue("Type", "Business"); - documents[1] = await this.container.CreateItemAsync(doc1); - - doc1 = new Document { Id = "document3" }; - doc1.SetValue("ZipCode", "11790"); - doc1.SetValue("Address", "Stonybrook"); - doc1.SetValue("Type", "Goverment"); - documents[2] = await this.container.CreateItemAsync(doc1); + Document doc = new Document { Id = "document1" }; + doc.SetValue("ZipCode", "500026"); + doc.SetValue("City", "Secunderabad"); + doc.SetValue("Type", "Residence"); + documents[0] = await this.container.CreateItemAsync(doc); + + doc = new Document { Id = "document2" }; + doc.SetValue("ZipCode", "15232"); + doc.SetValue("City", "Pittsburgh"); + doc.SetValue("Type", "Business"); + documents[1] = await this.container.CreateItemAsync(doc); + + doc = new Document { Id = "document3" }; + doc.SetValue("ZipCode", "11790"); + doc.SetValue("City", "Stonybrook"); + doc.SetValue("Type", "Goverment"); + documents[2] = await this.container.CreateItemAsync(doc); //Document Replace Test foreach (Document document in documents) { pKey = new PartitionKeyBuilder() .Add(document.GetPropertyValue("ZipCode")) - .Add(document.GetPropertyValue("Address")) + .Add(document.GetPropertyValue("City")) .Build(); @@ -383,14 +415,16 @@ public async Task MultiHashReplaceItemTest() //Negative test - using incomplete partition key badPKey = new PartitionKeyBuilder() - .Add(document.GetPropertyValue("Address")) + .Add(document.GetPropertyValue("ZipCode")) .Build(); readDocument.SetValue("Type", "Goverment"); - await Assert.ThrowsExceptionAsync(() => + CosmosException clientException = await Assert.ThrowsExceptionAsync(() => this.container.ReplaceItemAsync(document, document.Id, partitionKey: badPKey) ); + + Assert.AreEqual(clientException.StatusCode, HttpStatusCode.BadRequest); } } @@ -398,37 +432,59 @@ await Assert.ThrowsExceptionAsync(() => public async Task MultiHashQueryItemTest() { Cosmos.PartitionKey pKey; + Cosmos.PartitionKey badPKey; //Create items for test ItemResponse[] documents = new ItemResponse[3]; - Document doc1 = new Document { Id = "document1" }; - doc1.SetValue("ZipCode", "500026"); - doc1.SetValue("Address", "Secunderabad"); - doc1.SetValue("Type", "Residence"); - documents[0] = await this.container.CreateItemAsync(doc1); - - doc1 = new Document { Id = "document2" }; - doc1.SetValue("ZipCode", "15232"); - doc1.SetValue("Address", "Pittsburgh"); - doc1.SetValue("Type", "Business"); - documents[1] = await this.container.CreateItemAsync(doc1); - - doc1 = new Document { Id = "document3" }; - doc1.SetValue("ZipCode", "11790"); - doc1.SetValue("Address", "Stonybrook"); - doc1.SetValue("Type", "Goverment"); - documents[2] = await this.container.CreateItemAsync(doc1); + Document doc = new Document { Id = "document1" }; + doc.SetValue("ZipCode", "500026"); + doc.SetValue("City", "Secunderabad"); + doc.SetValue("Type", "Residence"); + documents[0] = await this.container.CreateItemAsync(doc); + + doc = new Document { Id = "document2" }; + doc.SetValue("ZipCode", "15232"); + doc.SetValue("City", "Pittsburgh"); + doc.SetValue("Type", "Business"); + documents[1] = await this.container.CreateItemAsync(doc); + + doc = new Document { Id = "document3" }; + doc.SetValue("ZipCode", "11790"); + doc.SetValue("City", "Stonybrook"); + doc.SetValue("Type", "Goverment"); + documents[2] = await this.container.CreateItemAsync(doc); //Query foreach (Document document in documents) { pKey = new PartitionKeyBuilder() .Add(document.GetPropertyValue("ZipCode")) - .Add(document.GetPropertyValue("Address")) + .Add(document.GetPropertyValue("City")) .Build(); - String query = $"SELECT * from c where c.id = {document.GetPropertyValue("Id")}"; + badPKey = new PartitionKeyBuilder() + .Add(document.GetPropertyValue("City")) + .Build(); + + String query = $"SELECT * from c where c.id = \"{document.GetPropertyValue("id")}\""; + + using (FeedIterator feedIterator = this.container.GetItemQueryIterator( + query, + null, + new QueryRequestOptions() { PartitionKey = pKey })) + { + Assert.IsTrue(feedIterator.HasMoreResults); + + FeedResponse queryDoc = await feedIterator.ReadNextAsync(); + queryDoc.First(); + Assert.IsTrue(queryDoc.Count == 1); + feedIterator.Dispose(); + } + //Using an incomplete partition key with prefix of PK path definition + pKey = new PartitionKeyBuilder() + .Add(document.GetPropertyValue("ZipCode")) + .Build(); using (FeedIterator feedIterator = this.container.GetItemQueryIterator( query, null, @@ -437,11 +493,25 @@ public async Task MultiHashQueryItemTest() Assert.IsTrue(feedIterator.HasMoreResults); FeedResponse queryDoc = await feedIterator.ReadNextAsync(); + queryDoc.First(); + Assert.IsTrue(queryDoc.Count == 1); + feedIterator.Dispose(); } + //Negative test - using incomplete partition key + using (FeedIterator badFeedIterator = this.container.GetItemQueryIterator( + query, + null, + new QueryRequestOptions() { PartitionKey = badPKey})) + { + FeedResponse queryDocBad = await badFeedIterator.ReadNextAsync(); + Assert.ThrowsException(() => + queryDocBad.First() + ); + badFeedIterator.Dispose(); + } } } } -} -#endif +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedRangeCreateFromPartitionKeyAsyncEmulatorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedRangeCreateFromPartitionKeyAsyncEmulatorTests.cs new file mode 100644 index 0000000000..6df5b0a66f --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedRangeCreateFromPartitionKeyAsyncEmulatorTests.cs @@ -0,0 +1,344 @@ +namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Threading.Tasks; + using System.Xml; + using Microsoft.Azure.Cosmos; + using Microsoft.Azure.Documents; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + using Database = Database; + using PartitionKey = PartitionKey; + using PartitionKeyDefinitionVersion = PartitionKeyDefinitionVersion; + + /// + /// Testing Prefix and Full Partition for , against a with Hierarchical Partition Keys. + /// + /// + [TestClass] + public class FeedRangeCreateFromPartitionKeyAsyncEmulatorTests + { + private CosmosClient client = null; + private Database database = null; + + private readonly string currentVersion = HttpConstants.Versions.CurrentVersion; + + [TestInitialize] + public async Task TestInit() + { + HttpConstants.Versions.CurrentVersion = "2020-07-15"; + this.client = TestCommon.CreateCosmosClient(true); + + string databaseName = Guid.NewGuid().ToString(); + DatabaseResponse databaseResponse = await this.client.CreateDatabaseIfNotExistsAsync(databaseName); + this.database = databaseResponse; + } + + [TestCleanup] + public async Task TestCleanup() + { + await this.database.DeleteAsync(); + this.client.Dispose(); + + HttpConstants.Versions.CurrentVersion = this.currentVersion; + } + + /// + /// Using to create a new with Hierarchical Partition Keys. + /// Using with a Prefix partition on a MultiHash V2 . + /// + /// + /// + [TestMethod] + public async Task GetChangeFeedIteratorWithPrefixPartitionKeyReturnsFeedIterator() + { + Container container = await this.database.CreateContainerIfNotExistsAsync(new(id: @"TestMultiHashedContainer", partitionKeyPaths: new List() { "/city", "/state", "/zipCode" })); + ContainerProperties containerProperties = await container.ReadContainerAsync(); + + Assert.AreEqual(expected: PartitionKeyDefinitionVersion.V2, actual: containerProperties.PartitionKeyDefinitionVersion); + Assert.AreEqual(expected: 3, actual: containerProperties.PartitionKey.Paths.Count); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/city")); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/state")); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/zipCode")); + Assert.AreEqual(expected: Documents.PartitionKind.MultiHash, actual: containerProperties.PartitionKey.Kind); + + dynamic item = new { id = Guid.NewGuid().ToString(), city = "Redmond", state = "WA", zipCode = "98502" }; + PartitionKey partitionKey = new PartitionKeyBuilder() + .Add(item.city) + .Add(item.state) + .Add(item.zipCode) + .Build(); + + _ = await container.CreateItemAsync(item: item, partitionKey: partitionKey); + + partitionKey = new PartitionKeyBuilder() + .Add(item.city) + .Add(item.state) + .Build(); + + FeedRange feedRange = new FeedRangePartitionKey(partitionKey); + FeedIterator iterator = container.GetChangeFeedIterator(ChangeFeedStartFrom.Beginning(feedRange), ChangeFeedMode.Incremental); + FeedResponse response = await iterator.ReadNextAsync(); + + string json = JsonConvert.SerializeObject(response.First()); + JObject @object = JObject.Parse(json); + + Assert.AreEqual(expected: item.id, actual: @object["id"]); + Assert.AreEqual(expected: item.city, actual: @object["city"]); + Assert.AreEqual(expected: item.state, actual: @object["state"]); + Assert.AreEqual(expected: item.zipCode, actual: @object["zipCode"]); + } + + /// + /// Using to create a new with hierarchical partition keys. + /// Using with a Prefix Partition on a MultiHash . + /// + /// + /// + [TestMethod] + public async Task GetChangeFeedStreamIteratorWithPrefixPartitionKeyReturnsFeedIterator() + { + Container container = await this.database.CreateContainerIfNotExistsAsync(new(id: @"TestMultiHashedContainer", partitionKeyPaths: new List() { "/city", "/state", "/zipCode" })); + ContainerProperties containerProperties = await container.ReadContainerAsync(); + + Assert.AreEqual(expected: PartitionKeyDefinitionVersion.V2, actual: containerProperties.PartitionKeyDefinitionVersion); + Assert.AreEqual(expected: 3, actual: containerProperties.PartitionKey.Paths.Count); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/city")); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/state")); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/zipCode")); + Assert.AreEqual(expected: Documents.PartitionKind.MultiHash, actual: containerProperties.PartitionKey.Kind); + + dynamic item = new { id = Guid.NewGuid().ToString(), city = "Redmond", state = "WA", zipCode = "98502" }; + PartitionKey partitionKey = new PartitionKeyBuilder() + .Add(item.city) + .Add(item.state) + .Add(item.zipCode) + .Build(); + + _ = await container.CreateItemAsync(item: item, partitionKey: partitionKey); + + partitionKey = new PartitionKeyBuilder() + .Add(item.city) + .Add(item.state) + .Build(); + + FeedRange feedRange = new FeedRangePartitionKey(partitionKey); + using (FeedIterator iterator = container.GetChangeFeedStreamIterator(ChangeFeedStartFrom.Beginning(feedRange), ChangeFeedMode.Incremental)) + { + ResponseMessage responseMessage = await iterator.ReadNextAsync(); + + using (StreamReader streamReader = new(responseMessage.Content)) + { + string content = await streamReader.ReadToEndAsync(); + + JObject @object = JObject.Parse(content); + JToken token = @object["Documents"].First(); + + Assert.AreEqual(expected: item.id, actual: token["id"]); + Assert.AreEqual(expected: item.city, actual: token["city"]); + Assert.AreEqual(expected: item.state, actual: token["state"]); + Assert.AreEqual(expected: item.zipCode, actual: token["zipCode"]); + } + } + } + + /// + /// Using to create a new with Hierarchical Partition Keys. + /// using with a Prefix partition on a MultiHash V2 . + /// + /// + /// + [TestMethod] + [Ignore("Query is returning 'Partition key provided either doesn't correspond to definition in the collection or doesn't match partition key field values specified in the document.' Investigation.")] + [Owner("naga.naravamakula")] + public async Task GetItemQueryIteratorWithPrefixPartitionKeyReturnsFeedIterator() + { + Container container = await this.database.CreateContainerIfNotExistsAsync(new(id: @"TestMultiHashedContainer", partitionKeyPaths: new List() { "/city", "/state", "/zipCode" })); + ContainerProperties containerProperties = await container.ReadContainerAsync(); + + Assert.AreEqual(expected: PartitionKeyDefinitionVersion.V2, actual: containerProperties.PartitionKeyDefinitionVersion); + Assert.AreEqual(expected: 3, actual: containerProperties.PartitionKey.Paths.Count); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/city")); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/state")); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/zipCode")); + Assert.AreEqual(expected: Documents.PartitionKind.MultiHash, actual: containerProperties.PartitionKey.Kind); + + dynamic item = new { id = Guid.NewGuid().ToString(), city = "Redmond", state = "WA", zipCode = "98052" }; + PartitionKey partitionKey = new PartitionKeyBuilder() + .Add(item.city) + .Add(item.state) + .Add(item.zipCode) + .Build(); + + _ = await container.CreateItemAsync(item: item, partitionKey: partitionKey); + + QueryDefinition queryDefinition = new QueryDefinition(query: "SELECT * FROM c WHERE c.city = @cityInput AND c.state = @stateInput") + .WithParameter("@cityInput", "Redmond") + .WithParameter("@stateInput", "WA"); + + partitionKey = new PartitionKeyBuilder() + .Add(item.city) + .Add(item.state) + .Build(); + + FeedRange feedRange = new FeedRangePartitionKey(partitionKey); + Console.WriteLine(feedRange.ToJsonString()); + using (FeedIterator iterator = container.GetItemQueryIterator(feedRange: feedRange, queryDefinition: queryDefinition, requestOptions: new() { PartitionKey = partitionKey })) + { + FeedResponse feedResponse = await iterator.ReadNextAsync(); + + string content = JsonConvert.SerializeObject(feedResponse.First()); + JObject @object = JObject.Parse(content); + + Assert.AreEqual(expected: item.id, actual: @object["id"]); + Assert.AreEqual(expected: item.city, actual: @object["city"]); + Assert.AreEqual(expected: item.state, actual: @object["state"]); + Assert.AreEqual(expected: item.zipCode, actual: @object["zipCode"]); + } + } + + /// + /// Using to create a new with Hierarchical Partition Keys. + /// Using with a Prefix Partition on a MultiHash V2 . + /// + /// + /// + [TestMethod] + public async Task GetItemQueryStreamIteratorWithPrefixPartitionKeyReturnsFeedIterator() + { + Container container = await this.database.CreateContainerIfNotExistsAsync(new(id: @"TestMultiHashedContainer", partitionKeyPaths: new List() { "/city", "/state", "/zipCode" })); + ContainerProperties containerProperties = await container.ReadContainerAsync(); + + Assert.AreEqual(expected: PartitionKeyDefinitionVersion.V2, actual: containerProperties.PartitionKeyDefinitionVersion); + Assert.AreEqual(expected: 3, actual: containerProperties.PartitionKey.Paths.Count); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/city")); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/state")); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/zipCode")); + Assert.AreEqual(expected: Documents.PartitionKind.MultiHash, actual: containerProperties.PartitionKey.Kind); + + dynamic item = new { id = Guid.NewGuid().ToString(), city = "Redmond", state = "WA", zipCode = "98052" }; + PartitionKey partitionKey = new PartitionKeyBuilder() + .Add(item.city) + .Add(item.state) + .Add(item.zipCode) + .Build(); + + _ = await container.CreateItemAsync(item: item, partitionKey: partitionKey); + + QueryDefinition queryDefinition = new QueryDefinition(query: "SELECT * FROM c WHERE c.city = @cityInput AND c.state = @stateInput") + .WithParameter("@cityInput", "Redmond") + .WithParameter("@stateInput", "WA"); + + using (FeedIterator iterator = container.GetItemQueryStreamIterator(queryDefinition: queryDefinition, requestOptions: new() { PartitionKey = partitionKey })) + { + ResponseMessage responseMessage = await iterator.ReadNextAsync(); + + using (StreamReader streamReader = new(responseMessage.Content)) + { + string content = await streamReader.ReadToEndAsync(); + + JObject @object = JObject.Parse(content); + JToken token = @object["Documents"].First(); + + Assert.AreEqual(expected: item.id, actual: token["id"]); + Assert.AreEqual(expected: item.city, actual: token["city"]); + Assert.AreEqual(expected: item.state, actual: token["state"]); + Assert.AreEqual(expected: item.zipCode, actual: token["zipCode"]); + } + } + } + + /// + /// Using to create a new with Hierarchical Partition Keys. + /// Using with a Full Partition on a MultiHash V2 . + /// + /// + /// + [TestMethod] + public async Task ReadItemWithFullPartitionKeyReturnsFeedIterator() + { + ContainerProperties containerProperties = new(id: @"TestMultiHashedContainer", partitionKeyDefinition: new Documents.PartitionKeyDefinition + { + Kind = Documents.PartitionKind.MultiHash, + Version = Documents.PartitionKeyDefinitionVersion.V2, + Paths = new System.Collections.ObjectModel.Collection(new List() { "/city", "/state", "/zipCode" }) + }); + + Container container = await this.database.CreateContainerIfNotExistsAsync(containerProperties: containerProperties); + + Assert.AreEqual(expected: PartitionKeyDefinitionVersion.V2, actual: containerProperties.PartitionKeyDefinitionVersion); + Assert.AreEqual(expected: 3, actual: containerProperties.PartitionKey.Paths.Count); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/city")); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/state")); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/zipCode")); + Assert.AreEqual(expected: Documents.PartitionKind.MultiHash, actual: containerProperties.PartitionKey.Kind); + + dynamic item = new { id = Guid.NewGuid().ToString(), city = "Redmond", state = "WA", zipCode = "98052" }; + PartitionKey partitionKey = new PartitionKeyBuilder() + .Add(item.city) + .Add(item.state) + .Add(item.zipCode) + .Build(); + + _ = await container.CreateItemAsync(item: item, partitionKey: partitionKey); + + ItemResponse itemResponse = await container.ReadItemAsync(id: item.id, partitionKey: partitionKey); + + string content = JsonConvert.SerializeObject(itemResponse.Resource); + JObject @object = JObject.Parse(content); + + Assert.AreEqual(expected: item.id, actual: @object["id"]); + Assert.AreEqual(expected: item.city, actual: @object["city"]); + Assert.AreEqual(expected: item.state, actual: @object["state"]); + Assert.AreEqual(expected: item.zipCode, actual: @object["zipCode"]); + } + + /// + /// Using to create a new with Hierarchical Partition Keys. + /// Using + /// Using with a Full Partition on a MultiHash V2 . + /// + /// + /// + [TestMethod] + public async Task ReadItemStreamWithFullPartitionKeyReturnsFeedIterator() + { + Container container = await this.database.CreateContainerIfNotExistsAsync(new(id: @"TestMultiHashedContainer", partitionKeyPaths: new List() { "/city", "/state", "/zipCode" })); + ContainerProperties containerProperties = await container.ReadContainerAsync(); + + Assert.AreEqual(expected: PartitionKeyDefinitionVersion.V2, actual: containerProperties.PartitionKeyDefinitionVersion); + Assert.AreEqual(expected: 3, actual: containerProperties.PartitionKey.Paths.Count); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/city")); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/state")); + Assert.IsTrue(containerProperties.PartitionKey.Paths.Contains("/zipCode")); + Assert.AreEqual(expected: Documents.PartitionKind.MultiHash, actual: containerProperties.PartitionKey.Kind); + + dynamic item = new { id = Guid.NewGuid().ToString(), city = "Redmond", state = "WA", zipCode = "98052" }; + PartitionKey partitionKey = new PartitionKeyBuilder() + .Add(item.city) + .Add(item.state) + .Add(item.zipCode) + .Build(); + + _ = await container.CreateItemAsync(item: item, partitionKey: partitionKey); + + using (ResponseMessage responseMessage = await container.ReadItemStreamAsync(id: item.id, partitionKey: partitionKey)) + { + using (StreamReader streamReader = new(responseMessage.Content)) + { + string content = await streamReader.ReadToEndAsync(); + JObject @object = JObject.Parse(content); + + Assert.AreEqual(expected: item.id, actual: @object["id"]); + Assert.AreEqual(expected: item.city, actual: @object["city"]); + Assert.AreEqual(expected: item.state, actual: @object["state"]); + Assert.AreEqual(expected: item.zipCode, actual: @object["zipCode"]); + } + } + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/HandlerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/HandlerTests.cs index 8884e22815..ae5dccd2c8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/HandlerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/HandlerTests.cs @@ -7,6 +7,7 @@ namespace Microsoft.Azure.Cosmos.Tests using System; using System.Collections; using System.Collections.Generic; + using System.Collections.ObjectModel; using System.Globalization; using System.IO; using System.Linq; @@ -438,6 +439,153 @@ public void TestAggregateExceptionConverter() Assert.IsTrue(response.ErrorMessage.Contains(errorMessage)); } + [TestMethod] + public async Task TestResolveFeedRangeBasedOnPrefixWithFeedRangePartitionKeyAndMultiHashContainerAsync() + { + dynamic item = new { id = Guid.NewGuid().ToString(), city = "Redmond", state = "WA", zipCode = "98502" }; + Cosmos.PartitionKey partitionKey = new PartitionKeyBuilder() + .Add(item.city) + .Add(item.state) + .Build(); + + await HandlerTests.TestResolveFeedRangeBasedOnPrefixAsync( + partitionKeyDefinition: new PartitionKeyDefinition() + { + Kind = PartitionKind.MultiHash, + Paths = new Collection(new List() { "/city", "/state", "/zipCode" }) + }, + inputFeedRange: new FeedRangePartitionKey(partitionKey), + expectedFeedRange: new FeedRangeEpk(new Documents.Routing.Range( + min: "01620B162169497AFD85FA66E99F73760845FB119899DE50766A2C4CEFC2FA73", + max: "01620B162169497AFD85FA66E99F73760845FB119899DE50766A2C4CEFC2FA73FF", + isMinInclusive: true, + isMaxInclusive: default)), + getPartitionKeyDefinitionAsyncExecutions: Moq.Times.Once()); + } + + [TestMethod] + public async Task TestResolveFeedRangeBasedOnPrefixWithFeedRangePartitionKeyOnHashContainerAsync() + { + dynamic item = new { id = Guid.NewGuid().ToString(), city = "Redmond" }; + Cosmos.PartitionKey partitionKey = new PartitionKeyBuilder() + .Add(item.city) + .Build(); + + await HandlerTests.TestResolveFeedRangeBasedOnPrefixAsync( + partitionKeyDefinition: new PartitionKeyDefinition() + { + Kind = PartitionKind.Hash, + Paths = new Collection(new List() { "/city" }) + }, + inputFeedRange: new FeedRangePartitionKey(partitionKey), + expectedFeedRange: new FeedRangePartitionKey(partitionKey), + getPartitionKeyDefinitionAsyncExecutions: Moq.Times.Once()); + } + + [TestMethod] + public async Task TestResolveFeedRangeBasedOnPrefixWithFeedRangePartitionKeyOnRangeContainerAsync() + { + dynamic item = new { id = Guid.NewGuid().ToString(), city = "Redmond" }; + Cosmos.PartitionKey partitionKey = new PartitionKeyBuilder() + .Add(item.city) + .Build(); + + await HandlerTests.TestResolveFeedRangeBasedOnPrefixAsync( + partitionKeyDefinition: new PartitionKeyDefinition() + { + Kind = PartitionKind.Range, + Paths = new Collection(new List() { "/city" }) + }, + inputFeedRange: new FeedRangePartitionKey(partitionKey), + expectedFeedRange: new FeedRangePartitionKey(partitionKey), + getPartitionKeyDefinitionAsyncExecutions: Moq.Times.Once()); + } + + [TestMethod] + public async Task TestResolveFeedRangeBasedOnPrefixWithFeedRangeEpkOnMultiHashContainerAsync() + { + await HandlerTests.TestResolveFeedRangeBasedOnPrefixAsync( + partitionKeyDefinition: new PartitionKeyDefinition() + { + Kind = PartitionKind.MultiHash, + Paths = new Collection(new List() { "/city", "/state", "/zipCode" }) + }, + inputFeedRange: FeedRangeEpk.FullRange, + expectedFeedRange: FeedRangeEpk.FullRange, + getPartitionKeyDefinitionAsyncExecutions: Moq.Times.Never()); + } + + [TestMethod] + public async Task TestResolveFeedRangeBasedOnPrefixWithFeedRangeEpkOnHashContainerAsync() + { + await HandlerTests.TestResolveFeedRangeBasedOnPrefixAsync( + partitionKeyDefinition: new PartitionKeyDefinition() + { + Kind = PartitionKind.Hash, + Paths = new Collection(new List() { "/city" }) + }, + inputFeedRange: FeedRangeEpk.FullRange, + expectedFeedRange: FeedRangeEpk.FullRange, + getPartitionKeyDefinitionAsyncExecutions: Moq.Times.Never()); + } + + [TestMethod] + public async Task TestResolveFeedRangeBasedOnPrefixWithFeedRangeEpkOnRangeContainerAsync() + { + await HandlerTests.TestResolveFeedRangeBasedOnPrefixAsync( + partitionKeyDefinition: new PartitionKeyDefinition() + { + Kind = PartitionKind.Range, + Paths = new Collection(new List() { "/city" }) + }, + inputFeedRange: FeedRangeEpk.FullRange, + expectedFeedRange: FeedRangeEpk.FullRange, + getPartitionKeyDefinitionAsyncExecutions: Moq.Times.Never()); + } + + private static async Task TestResolveFeedRangeBasedOnPrefixAsync( + PartitionKeyDefinition partitionKeyDefinition, + FeedRangeInternal inputFeedRange, + FeedRangeInternal expectedFeedRange, + Moq.Times getPartitionKeyDefinitionAsyncExecutions) + where TFeedRange : FeedRangeInternal + { + using CosmosClient client = MockCosmosUtil.CreateMockCosmosClient( + accountConsistencyLevel: Cosmos.ConsistencyLevel.Strong, + customizeClientBuilder: builder => builder.WithConsistencyLevel(Cosmos.ConsistencyLevel.Eventual)); + + Moq.Mock mockContainer = MockCosmosUtil.CreateMockContainer( + dbName: Guid.NewGuid().ToString(), + containerName: Guid.NewGuid().ToString()); + + CancellationToken cancellationToken = CancellationToken.None; + + mockContainer + .Setup(container => container.GetPartitionKeyDefinitionAsync(cancellationToken)) + .Returns(Task.FromResult(partitionKeyDefinition)); + + RequestInvokerHandler invoker = new( + client: client, + requestedClientConsistencyLevel: default); + + Cosmos.FeedRange feedRange = await RequestInvokerHandler.ResolveFeedRangeBasedOnPrefixContainerAsync( + feedRange: inputFeedRange, + cosmosContainerCore: mockContainer.Object, + cancellationToken: cancellationToken); + + mockContainer.Verify(x => x.GetPartitionKeyDefinitionAsync(Moq.It.IsAny()), getPartitionKeyDefinitionAsyncExecutions); + + Assert.IsNotNull(feedRange, "FeedRange did not initialize"); + + Assert.IsInstanceOfType( + value: feedRange, + expectedType: typeof(TFeedRange)); + + Assert.AreEqual( + expected: expectedFeedRange.ToJsonString(), + actual: feedRange.ToJsonString()); + } + private class SomePayload { public string V1 { get; set; } From 6ebb8d4c22fc1f7d4329ac1956c6102d3f0f883c Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Thu, 9 Mar 2023 21:07:11 +0530 Subject: [PATCH 071/240] [Internal] ClientTelemetry: Adds logic to limit payload size to 2 MB (#3717) * first draft wip fix test and logic * resolve conflicts * limit 2 mb * ad callback * fix tests * code refactor * cosmos json to newtosoft json * clean up files * fix logging to argumrnt based * code refactor * add null check --- .../src/Telemetry/ClientTelemetry.cs | 184 +++---------- .../src/Telemetry/ClientTelemetryHelper.cs | 117 +++----- .../src/Telemetry/ClientTelemetryOptions.cs | 8 +- .../Telemetry/ClientTelemetryPayloadWriter.cs | 161 +++++++++++ .../src/Telemetry/ClientTelemetryProcessor.cs | 142 ++++++++++ .../Models/ClientTelemetryProperties.cs | 72 +++++ .../ClientTelemetryTests.cs | 36 +-- .../Microsoft.Azure.Cosmos.Tests.csproj | 4 + .../ClientTelemetryPayloadWithoutMetrics.json | 135 +++++++++ .../Telemetry/ClientTelemetryTests.cs | 258 ++++++++++++++++++ 10 files changed, 859 insertions(+), 258 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryPayloadWriter.cs create mode 100644 Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryProcessor.cs create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryPayloadWithoutMetrics.json create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryTests.cs diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs index 82e212f7f3..d0ca7d8ac8 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs @@ -8,8 +8,6 @@ namespace Microsoft.Azure.Cosmos.Telemetry using System.Collections.Concurrent; using System.Collections.Generic; using System.Net; - using System.Net.Http; - using System.Text; using System.Threading; using System.Threading.Tasks; using Handler; @@ -20,9 +18,6 @@ namespace Microsoft.Azure.Cosmos.Telemetry using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; using Microsoft.Azure.Documents; - using Microsoft.Azure.Documents.Collections; - using Microsoft.Azure.Documents.Rntbd; - using Newtonsoft.Json; using Util; using static Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum; @@ -36,12 +31,10 @@ internal class ClientTelemetry : IDisposable { private const int allowedNumberOfFailures = 3; - private static readonly Uri endpointUrl = ClientTelemetryOptions.GetClientTelemetryEndpoint(); private static readonly TimeSpan observingWindow = ClientTelemetryOptions.GetScheduledTimeSpan(); private readonly ClientTelemetryProperties clientTelemetryInfo; - private readonly CosmosHttpClient httpClient; - private readonly AuthorizationTokenProvider tokenProvider; + private readonly ClientTelemetryProcessor processor; private readonly DiagnosticsHandlerHelper diagnosticsHelper; private readonly CancellationTokenSource cancellationTokenSource; @@ -108,7 +101,7 @@ public static ClientTelemetry CreateAndStartBackgroundTelemetry( return clientTelemetry; } - private ClientTelemetry( + internal ClientTelemetry( string clientId, CosmosHttpClient httpClient, string userAgent, @@ -118,9 +111,8 @@ private ClientTelemetry( IReadOnlyList preferredRegions, GlobalEndpointManager globalEndpointManager) { - this.httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient)); this.diagnosticsHelper = diagnosticsHelper ?? throw new ArgumentNullException(nameof(diagnosticsHelper)); - this.tokenProvider = authorizationTokenProvider ?? throw new ArgumentNullException(nameof(authorizationTokenProvider)); + this.processor = new ClientTelemetryProcessor(httpClient, authorizationTokenProvider); this.clientTelemetryInfo = new ClientTelemetryProperties( clientId: clientId, @@ -170,6 +162,7 @@ private async Task EnrichAndSendAsync() await Task.Delay(observingWindow, this.cancellationTokenSource.Token); + this.clientTelemetryInfo.DateTimeUtc = DateTime.UtcNow.ToString(ClientTelemetryOptions.DateFormat); this.clientTelemetryInfo.MachineId = VmMetadataApiHandler.GetMachineId(); // Load host information from cache @@ -177,32 +170,37 @@ private async Task EnrichAndSendAsync() this.clientTelemetryInfo.ApplicationRegion = vmInformation?.Location; this.clientTelemetryInfo.HostEnvInfo = ClientTelemetryOptions.GetHostInformation(vmInformation); - // If cancellation is requested after the delay then return from here. - if (this.cancellationTokenSource.IsCancellationRequested) - { - DefaultTrace.TraceInformation("Observer Task Cancelled."); - - break; - } - - this.RecordSystemUtilization(); + this.clientTelemetryInfo.SystemInfo = ClientTelemetryHelper.RecordSystemUtilization(this.diagnosticsHelper, + this.clientTelemetryInfo.IsDirectConnectionMode); - this.clientTelemetryInfo.DateTimeUtc = DateTime.UtcNow.ToString(ClientTelemetryOptions.DateFormat); - - ConcurrentDictionary operationInfoSnapshot + // Take the copy for further processing i.e. serializing and dividing into chunks + ConcurrentDictionary operationInfoSnapshot = Interlocked.Exchange(ref this.operationInfoMap, new ConcurrentDictionary()); ConcurrentDictionary cacheRefreshInfoSnapshot - = Interlocked.Exchange(ref this.cacheRefreshInfoMap, new ConcurrentDictionary()); + = Interlocked.Exchange(ref this.cacheRefreshInfoMap, new ConcurrentDictionary()); ConcurrentDictionary requestInfoSnapshot = Interlocked.Exchange(ref this.requestInfoMap, new ConcurrentDictionary()); - this.clientTelemetryInfo.OperationInfo = ClientTelemetryHelper.ToListWithMetricsInfo(operationInfoSnapshot); - this.clientTelemetryInfo.CacheRefreshInfo = ClientTelemetryHelper.ToListWithMetricsInfo(cacheRefreshInfoSnapshot); - this.clientTelemetryInfo.RequestInfo = ClientTelemetryHelper.ToListWithMetricsInfo(requestInfoSnapshot); - - await this.SendAsync(); + try + { + await this.processor + .ProcessAndSendAsync( + clientTelemetryInfo: this.clientTelemetryInfo, + operationInfoSnapshot: operationInfoSnapshot, + cacheRefreshInfoSnapshot: cacheRefreshInfoSnapshot, + requestInfoSnapshot: requestInfoSnapshot, + cancellationToken: this.cancellationTokenSource.Token); + + this.numberOfFailures = 0; + } + catch (Exception ex) + { + this.numberOfFailures++; + + DefaultTrace.TraceError("Telemetry Job Processor failed with error : {0}", ex); + } } } catch (Exception ex) @@ -233,8 +231,8 @@ internal void CollectCacheInfo(string cacheRefreshSource, throw new ArgumentNullException(nameof(cacheRefreshSource)); } - DefaultTrace.TraceVerbose($"Collecting cacheRefreshSource {cacheRefreshSource} data for Telemetry."); - + DefaultTrace.TraceVerbose($"Collecting cacheRefreshSource {0} data for Telemetry.", cacheRefreshSource); + string regionsContacted = ClientTelemetryHelper.GetContactedRegions(regionsContactedList); // Recording Request Latency @@ -290,7 +288,7 @@ internal void CollectOperationInfo(CosmosDiagnostics cosmosDiagnostics, ITrace trace) { DefaultTrace.TraceVerbose("Collecting Operation data for Telemetry."); - + if (cosmosDiagnostics == null) { throw new ArgumentNullException(nameof(cosmosDiagnostics)); @@ -301,7 +299,7 @@ internal void CollectOperationInfo(CosmosDiagnostics cosmosDiagnostics, this.RecordRntbdResponses(containerId, databaseId, summaryDiagnostics.StoreResponseStatistics.Value); string regionsContacted = ClientTelemetryHelper.GetContactedRegions(cosmosDiagnostics.GetContactedRegions()); - + // Recording Request Latency and Request Charge OperationInfo payloadKey = new OperationInfo(regionsContacted: regionsContacted?.ToString(), responseSizeInBytes: responseSizeInBytes, @@ -370,126 +368,6 @@ private void RecordRntbdResponses(string containerId, string databaseId, List - /// Record CPU and memory usage which will be sent as part of telemetry information - /// - private void RecordSystemUtilization() - { - try - { - DefaultTrace.TraceVerbose("Started Recording System Usage for telemetry."); - - SystemUsageHistory systemUsageHistory = this.diagnosticsHelper.GetClientTelemetrySystemHistory(); - - if (systemUsageHistory != null ) - { - ClientTelemetryHelper.RecordSystemUsage( - systemUsageHistory: systemUsageHistory, - systemInfoCollection: this.clientTelemetryInfo.SystemInfo, - isDirectConnectionMode: this.clientTelemetryInfo.IsDirectConnectionMode); - } - else - { - DefaultTrace.TraceWarning("System Usage History not available"); - } - } - catch (Exception ex) - { - DefaultTrace.TraceError("System Usage Recording Error : {0} ", ex); - } - } - - /// - /// Task to send telemetry information to configured Juno endpoint. - /// If endpoint is not configured then it won't even try to send information. It will just trace an error message. - /// In any case it resets the telemetry information to collect the latest one. - /// - /// Async Task - private async Task SendAsync() - { - if (endpointUrl == null) - { - DefaultTrace.TraceError("Telemetry is enabled but endpoint is not configured"); - return; - } - - try - { - DefaultTrace.TraceInformation("Sending Telemetry Data to {0}", endpointUrl.AbsoluteUri); - - string json = JsonConvert.SerializeObject(this.clientTelemetryInfo, ClientTelemetryOptions.JsonSerializerSettings); - - using HttpRequestMessage request = new HttpRequestMessage - { - Method = HttpMethod.Post, - RequestUri = endpointUrl, - Content = new StringContent(json, Encoding.UTF8, "application/json") - }; - - async ValueTask CreateRequestMessage() - { - INameValueCollection headersCollection = new StoreResponseNameValueCollection(); - await this.tokenProvider.AddAuthorizationHeaderAsync( - headersCollection, - endpointUrl, - "POST", - AuthorizationTokenType.PrimaryMasterKey); - - foreach (string key in headersCollection.AllKeys()) - { - request.Headers.Add(key, headersCollection[key]); - } - - request.Headers.Add(HttpConstants.HttpHeaders.DatabaseAccountName, this.clientTelemetryInfo.GlobalDatabaseAccountName); - String envName = ClientTelemetryOptions.GetEnvironmentName(); - if (!String.IsNullOrEmpty(envName)) - { - request.Headers.Add(HttpConstants.HttpHeaders.EnvironmentName, envName); - } - - return request; - } - - using HttpResponseMessage response = await this.httpClient.SendHttpAsync(CreateRequestMessage, - ResourceType.Telemetry, - HttpTimeoutPolicyNoRetry.Instance, - null, - this.cancellationTokenSource.Token); - - if (!response.IsSuccessStatusCode) - { - this.numberOfFailures++; - - DefaultTrace.TraceError("Juno API response not successful. Status Code : {0}, Message : {1}", response.StatusCode, response.ReasonPhrase); - } - else - { - this.numberOfFailures = 0; // Ressetting failure counts on success call. - DefaultTrace.TraceInformation("Telemetry data sent successfully."); - } - - } - catch (Exception ex) - { - this.numberOfFailures++; - - DefaultTrace.TraceError("Exception while sending telemetry data : {0}", ex); - } - finally - { - // Reset SystemInfo Dictionary for new data. - this.Reset(); - } - } - - /// - /// Reset all the operation, System Utilization and Cache refresh related collections - /// - private void Reset() - { - this.clientTelemetryInfo.SystemInfo.Clear(); - } /// /// Dispose of cosmos client.It will get disposed with client so not making it thread safe. diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryHelper.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryHelper.cs index 2a29ef9454..2399bcb9fb 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryHelper.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryHelper.cs @@ -8,8 +8,8 @@ namespace Microsoft.Azure.Cosmos.Telemetry using System.Linq; using System.Text; using System.Threading.Tasks; - using HdrHistogram; using Microsoft.Azure.Cosmos.Core.Trace; + using Microsoft.Azure.Cosmos.Handler; using Microsoft.Azure.Cosmos.Routing; using Microsoft.Azure.Cosmos.Telemetry.Models; using Microsoft.Azure.Documents.Rntbd; @@ -46,115 +46,62 @@ internal static async Task SetAccountNameAsync(GlobalEndpoint /// /// /// - /// /// - internal static void RecordSystemUsage( + private static List RecordSystemUsage( SystemUsageHistory systemUsageHistory, - List systemInfoCollection, bool isDirectConnectionMode) { if (systemUsageHistory.Values == null) { - return; + return null; } DefaultTrace.TraceVerbose("System Usage recorded by telemetry is : {0}", systemUsageHistory); - - systemInfoCollection.Add(TelemetrySystemUsage.GetCpuInfo(systemUsageHistory.Values)); - systemInfoCollection.Add(TelemetrySystemUsage.GetMemoryRemainingInfo(systemUsageHistory.Values)); - systemInfoCollection.Add(TelemetrySystemUsage.GetAvailableThreadsInfo(systemUsageHistory.Values)); - systemInfoCollection.Add(TelemetrySystemUsage.GetThreadWaitIntervalInMs(systemUsageHistory.Values)); - systemInfoCollection.Add(TelemetrySystemUsage.GetThreadStarvationSignalCount(systemUsageHistory.Values)); + + List systemInfoCollection = new List(6) + { + TelemetrySystemUsage.GetCpuInfo(systemUsageHistory.Values), + TelemetrySystemUsage.GetMemoryRemainingInfo(systemUsageHistory.Values), + TelemetrySystemUsage.GetAvailableThreadsInfo(systemUsageHistory.Values), + TelemetrySystemUsage.GetThreadWaitIntervalInMs(systemUsageHistory.Values), + TelemetrySystemUsage.GetThreadStarvationSignalCount(systemUsageHistory.Values) + }; // Reset System Information if (isDirectConnectionMode) { systemInfoCollection.Add(TelemetrySystemUsage.GetTcpConnectionCount(systemUsageHistory.Values)); } + return systemInfoCollection; } - + /// - /// Convert map with operation information to list of operations along with request latency and request charge metrics + /// Record CPU and memory usage which will be sent as part of telemetry information /// - /// - /// Collection of ReportPayload - internal static List ToListWithMetricsInfo( - IDictionary metrics) + internal static List RecordSystemUtilization(DiagnosticsHandlerHelper helper, bool isDirectMode) { - DefaultTrace.TraceVerbose("Aggregating operation information to list started"); - - List payloadWithMetricInformation = new List(); - foreach (KeyValuePair entry in metrics) + try { - OperationInfo payloadForLatency = entry.Key; - payloadForLatency.MetricInfo = new MetricInfo(ClientTelemetryOptions.RequestLatencyName, ClientTelemetryOptions.RequestLatencyUnit); - payloadForLatency.SetAggregators(entry.Value.latency, ClientTelemetryOptions.TicksToMsFactor); - - payloadWithMetricInformation.Add(payloadForLatency); + DefaultTrace.TraceVerbose("Started Recording System Usage for telemetry."); - OperationInfo payloadForRequestCharge = payloadForLatency.Copy(); - payloadForRequestCharge.MetricInfo = new MetricInfo(ClientTelemetryOptions.RequestChargeName, ClientTelemetryOptions.RequestChargeUnit); - payloadForRequestCharge.SetAggregators(entry.Value.requestcharge, ClientTelemetryOptions.HistogramPrecisionFactor); - - payloadWithMetricInformation.Add(payloadForRequestCharge); - } + SystemUsageHistory systemUsageHistory = helper.GetClientTelemetrySystemHistory(); - DefaultTrace.TraceVerbose("Aggregating operation information to list done"); - - return payloadWithMetricInformation; - } - - /// - /// Convert map with request information to list of operations along with request latency and request charge metrics - /// - /// - /// Collection of ReportPayload - internal static List ToListWithMetricsInfo( - IDictionary metrics) - { - DefaultTrace.TraceVerbose("Aggregating RequestInfo information to list started"); - - List payloadWithMetricInformation = new List(); - foreach (KeyValuePair entry in metrics) - { - MetricInfo metricInfo = new MetricInfo(ClientTelemetryOptions.RequestLatencyName, ClientTelemetryOptions.RequestLatencyUnit); - metricInfo.SetAggregators(entry.Value, ClientTelemetryOptions.TicksToMsFactor); - - RequestInfo payloadForLatency = entry.Key; - payloadForLatency.Metrics.Add(metricInfo); - - payloadWithMetricInformation.Add(payloadForLatency); + if (systemUsageHistory != null) + { + return ClientTelemetryHelper.RecordSystemUsage( + systemUsageHistory: systemUsageHistory, + isDirectConnectionMode: isDirectMode); + } + else + { + DefaultTrace.TraceWarning("System Usage History not available"); + } } - - DefaultTrace.TraceVerbose("Aggregating RequestInfo information to list done"); - - return payloadWithMetricInformation; - } - - /// - /// Convert map with CacheRefreshInfo information to list of operations along with request latency and request charge metrics - /// - /// - /// Collection of ReportPayload - internal static List ToListWithMetricsInfo(IDictionary metrics) - { - DefaultTrace.TraceVerbose("Aggregating CacheRefreshInfo information to list started"); - - List payloadWithMetricInformation = new List(); - foreach (KeyValuePair entry in metrics) + catch (Exception ex) { - CacheRefreshInfo payloadForLatency = entry.Key; - payloadForLatency.MetricInfo = new MetricInfo(ClientTelemetryOptions.RequestLatencyName, ClientTelemetryOptions.RequestLatencyUnit); - payloadForLatency.SetAggregators(entry.Value, ClientTelemetryOptions.TicksToMsFactor); - - payloadWithMetricInformation.Add(payloadForLatency); + DefaultTrace.TraceError("System Usage Recording Error : {0} ", ex); } - - DefaultTrace.TraceVerbose("Aggregating CacheRefreshInfo information to list done"); - - return payloadWithMetricInformation; + return null; } /// diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs index 3b69e0c621..f2caaf50d5 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs @@ -18,7 +18,7 @@ internal static class ClientTelemetryOptions internal const int KbToMbFactor = 1024; internal const int OneKbToBytes = 1024; - + // Expecting histogram to have Minimum Latency of 1 and Maximum Latency of 1 hour (which is never going to happen) internal const long RequestLatencyMax = TimeSpan.TicksPerHour; internal const long RequestLatencyMin = 1; @@ -94,9 +94,11 @@ internal static class ClientTelemetryOptions NullValueHandling = NullValueHandling.Ignore, MaxDepth = 64, // https://github.com/advisories/GHSA-5crp-9r3c-p9vr }; - - private static readonly List ExcludedStatusCodes = new List { 404, 409 }; + private static readonly List ExcludedStatusCodes = new List { 404, 409 }; + + internal static int PayloadSizeThreshold = 1024 * 1024 * 2; // 2MB + private static Uri clientTelemetryEndpoint; private static string environmentName; private static TimeSpan scheduledTimeSpan = TimeSpan.Zero; diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryPayloadWriter.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryPayloadWriter.cs new file mode 100644 index 0000000000..1158c7d639 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryPayloadWriter.cs @@ -0,0 +1,161 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Telemetry +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using HdrHistogram; + using Microsoft.Azure.Cosmos.Telemetry.Models; + using Newtonsoft.Json; + + internal static class ClientTelemetryPayloadWriter + { + public static async Task SerializedPayloadChunksAsync( + ClientTelemetryProperties properties, + ConcurrentDictionary operationInfoSnapshot, + ConcurrentDictionary cacheRefreshInfoSnapshot, + ConcurrentDictionary requestInfoSnapshot, + Func callback) + { + if (properties == null) + { + throw new ArgumentNullException(nameof(properties)); + } + + StringBuilder stringBuilder = new StringBuilder(ClientTelemetryOptions.PayloadSizeThreshold); + + JsonWriter writer = ClientTelemetryPayloadWriter.GetWriterWithSectionStartTag(stringBuilder, properties, "operationInfo"); + + if (operationInfoSnapshot?.Any() == true) + { + foreach (KeyValuePair entry in operationInfoSnapshot) + { + long lengthNow = stringBuilder.Length; + + OperationInfo payloadForLatency = entry.Key; + payloadForLatency.MetricInfo = new MetricInfo(ClientTelemetryOptions.RequestLatencyName, ClientTelemetryOptions.RequestLatencyUnit); + payloadForLatency.SetAggregators(entry.Value.latency, ClientTelemetryOptions.TicksToMsFactor); + + OperationInfo payloadForRequestCharge = payloadForLatency.Copy(); + payloadForRequestCharge.MetricInfo = new MetricInfo(ClientTelemetryOptions.RequestChargeName, ClientTelemetryOptions.RequestChargeUnit); + payloadForRequestCharge.SetAggregators(entry.Value.requestcharge, ClientTelemetryOptions.HistogramPrecisionFactor); + + string latencyMetrics = JsonConvert.SerializeObject(payloadForLatency); + string requestChargeMetrics = JsonConvert.SerializeObject(payloadForRequestCharge); + + if (lengthNow + latencyMetrics.Length + requestChargeMetrics.Length > ClientTelemetryOptions.PayloadSizeThreshold) + { + writer.WriteEndArray(); + writer.WriteEndObject(); + + await callback.Invoke(stringBuilder.ToString()); + + writer = ClientTelemetryPayloadWriter.GetWriterWithSectionStartTag(stringBuilder, properties, "operationInfo"); + } + + writer.WriteRawValue(latencyMetrics); + writer.WriteRawValue(requestChargeMetrics); + } + + } + writer.WriteEndArray(); + + if (cacheRefreshInfoSnapshot?.Any() == true) + { + writer.WritePropertyName("cacheRefreshInfo"); + writer.WriteStartArray(); + + foreach (KeyValuePair entry in cacheRefreshInfoSnapshot) + { + long lengthNow = stringBuilder.Length; + + CacheRefreshInfo payloadForLatency = entry.Key; + payloadForLatency.MetricInfo = new MetricInfo(ClientTelemetryOptions.RequestLatencyName, ClientTelemetryOptions.RequestLatencyUnit); + payloadForLatency.SetAggregators(entry.Value, ClientTelemetryOptions.TicksToMsFactor); + + string latencyMetrics = JsonConvert.SerializeObject(payloadForLatency); + + if (lengthNow + latencyMetrics.Length > ClientTelemetryOptions.PayloadSizeThreshold) + { + writer.WriteEndArray(); + writer.WriteEndObject(); + + await callback.Invoke(stringBuilder.ToString()); + + writer = ClientTelemetryPayloadWriter.GetWriterWithSectionStartTag(stringBuilder, properties, "cacheRefreshInfo"); + } + + writer.WriteRawValue(latencyMetrics); + } + writer.WriteEndArray(); + + } + + if (requestInfoSnapshot?.Any() == true) + { + writer.WritePropertyName("requestInfo"); + writer.WriteStartArray(); + + foreach (KeyValuePair entry in requestInfoSnapshot) + { + long lengthNow = stringBuilder.Length; + + MetricInfo metricInfo = new MetricInfo(ClientTelemetryOptions.RequestLatencyName, ClientTelemetryOptions.RequestLatencyUnit); + metricInfo.SetAggregators(entry.Value, ClientTelemetryOptions.TicksToMsFactor); + + RequestInfo payloadForLatency = entry.Key; + payloadForLatency.Metrics.Add(metricInfo); + string latencyMetrics = JsonConvert.SerializeObject(payloadForLatency); + + if (lengthNow + latencyMetrics.Length > ClientTelemetryOptions.PayloadSizeThreshold) + { + writer.WriteEndArray(); + writer.WriteEndObject(); + + await callback.Invoke(stringBuilder.ToString()); + + writer = ClientTelemetryPayloadWriter.GetWriterWithSectionStartTag(stringBuilder, properties, "requestInfo"); + } + + writer.WriteRawValue(latencyMetrics); + } + writer.WriteEndArray(); + } + + writer.WriteEndObject(); + + await callback.Invoke(stringBuilder.ToString()); + } + + private static JsonWriter GetWriterWithSectionStartTag( + StringBuilder stringBuilder, + ClientTelemetryProperties properties, + string sectionName) + { + stringBuilder.Clear(); + + StringWriter stringWriter = new StringWriter(stringBuilder); + + JsonWriter writer = new JsonTextWriter(stringWriter) + { + AutoCompleteOnClose = false + }; + + writer.WriteStartObject(); + + properties.Write(writer); + + writer.WritePropertyName(sectionName); + + writer.WriteStartArray(); + return writer; + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryProcessor.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryProcessor.cs new file mode 100644 index 0000000000..b91eb96832 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryProcessor.cs @@ -0,0 +1,142 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Telemetry +{ + using System; + using System.Collections.Concurrent; + using System.Net.Http; + using System.Text; + using System.Threading; + using System.Threading.Tasks; + using HdrHistogram; + using Microsoft.Azure.Cosmos.Core.Trace; + using Microsoft.Azure.Cosmos.Telemetry.Models; + using Microsoft.Azure.Documents; + using Microsoft.Azure.Documents.Collections; + + internal class ClientTelemetryProcessor + { + private static readonly Uri endpointUrl = ClientTelemetryOptions.GetClientTelemetryEndpoint(); + + private readonly AuthorizationTokenProvider tokenProvider; + private readonly CosmosHttpClient httpClient; + + internal ClientTelemetryProcessor(CosmosHttpClient httpClient, AuthorizationTokenProvider tokenProvider) + { + this.httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient)); + this.tokenProvider = tokenProvider ?? throw new ArgumentNullException(nameof(tokenProvider)); + } + + /// + /// It will create Task to process and send client telemetry payload to Client Telemetry Service. + /// + /// + /// + /// + /// + /// + /// Task + internal async Task ProcessAndSendAsync( + ClientTelemetryProperties clientTelemetryInfo, + ConcurrentDictionary operationInfoSnapshot, + ConcurrentDictionary cacheRefreshInfoSnapshot, + ConcurrentDictionary requestInfoSnapshot, + CancellationToken cancellationToken) + { + try + { + await ClientTelemetryPayloadWriter.SerializedPayloadChunksAsync( + properties: clientTelemetryInfo, + operationInfoSnapshot: operationInfoSnapshot, + cacheRefreshInfoSnapshot: cacheRefreshInfoSnapshot, + requestInfoSnapshot: requestInfoSnapshot, + callback: async (payload) => await this.SendAsync(clientTelemetryInfo.GlobalDatabaseAccountName, payload, cancellationToken)); + } + catch (Exception ex) + { + DefaultTrace.TraceError($"Exception while serializing telemetry payload: {ex}"); + throw; + } + + } + + /// + /// Task to send telemetry information to configured Juno endpoint. + /// If endpoint is not configured then it won't even try to send information. It will just trace an error message. + /// In any case it resets the telemetry information to collect the latest one. + /// + /// Async Task + private async Task SendAsync( + string globalDatabaseAccountName, + string jsonPayload, + CancellationToken cancellationToken) + { + if (endpointUrl == null) + { + DefaultTrace.TraceError("Telemetry is enabled but endpoint is not configured"); + return; + } + + try + { + DefaultTrace.TraceInformation("Sending Telemetry Data to {0}", endpointUrl.AbsoluteUri); + + using HttpRequestMessage request = new HttpRequestMessage + { + Method = HttpMethod.Post, + RequestUri = endpointUrl, + Content = new StringContent(jsonPayload, Encoding.UTF8, "application/json") + }; + + async ValueTask CreateRequestMessage() + { + INameValueCollection headersCollection = new StoreResponseNameValueCollection(); + await this.tokenProvider.AddAuthorizationHeaderAsync( + headersCollection, + endpointUrl, + "POST", + AuthorizationTokenType.PrimaryMasterKey); + + foreach (string key in headersCollection.AllKeys()) + { + request.Headers.Add(key, headersCollection[key]); + } + + request.Headers.Add(HttpConstants.HttpHeaders.DatabaseAccountName, globalDatabaseAccountName); + String envName = ClientTelemetryOptions.GetEnvironmentName(); + if (!String.IsNullOrEmpty(envName)) + { + request.Headers.Add(HttpConstants.HttpHeaders.EnvironmentName, envName); + } + + return request; + } + + using HttpResponseMessage response = await this.httpClient.SendHttpAsync(CreateRequestMessage, + ResourceType.Telemetry, + HttpTimeoutPolicyNoRetry.Instance, + null, + cancellationToken); + + if (!response.IsSuccessStatusCode) + { + DefaultTrace.TraceError("Telemetry Service API response not successful. Status Code : {0}, Message : {1}", response.StatusCode, response.ReasonPhrase); + throw new Exception(string.Format("Telemetry Service API response not successful. Status Code : {0}, Message : {1}", response.StatusCode, response.ReasonPhrase)); + } + else + { + DefaultTrace.TraceInformation("Telemetry data sent successfully."); + } + + } + catch (Exception ex) + { + DefaultTrace.TraceError("Exception while sending telemetry data : {0}", ex.Message); + throw; + } + } + + } +} diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/Models/ClientTelemetryProperties.cs b/Microsoft.Azure.Cosmos/src/Telemetry/Models/ClientTelemetryProperties.cs index 6ad08f694e..22089191fd 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/Models/ClientTelemetryProperties.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/Models/ClientTelemetryProperties.cs @@ -119,5 +119,77 @@ public ClientTelemetryProperties(string dateTimeUtc, this.PreferredRegions = preferredRegions; this.MachineId = machineId; } + + public void Write(JsonWriter writer) + { + writer.WritePropertyName("timeStamp"); + writer.WriteValue(this.DateTimeUtc); + + writer.WritePropertyName("clientId"); + writer.WriteValue(this.ClientId); + + writer.WritePropertyName("machineId"); + writer.WriteValue(this.MachineId); + + writer.WritePropertyName("processId"); + writer.WriteValue(this.ProcessId); + + writer.WritePropertyName("userAgent"); + writer.WriteValue(this.UserAgent); + + writer.WritePropertyName("connectionMode"); + writer.WriteValue(this.ConnectionMode); + + writer.WritePropertyName("globalDatabaseAccountName"); + writer.WriteValue(this.GlobalDatabaseAccountName); + + writer.WritePropertyName("applicationRegion"); + if (this.ApplicationRegion != null) + { + writer.WriteValue(this.ApplicationRegion); + } + else + { + writer.WriteNull(); + } + + writer.WritePropertyName("hostEnvInfo"); + writer.WriteValue(this.HostEnvInfo); + + writer.WritePropertyName("acceleratedNetworking"); + if (this.AcceleratedNetworking.HasValue) + { + writer.WriteValue(this.AcceleratedNetworking.Value); + } + else + { + writer.WriteNull(); + } + + writer.WritePropertyName("preferredRegions"); + + if (this.PreferredRegions != null) + { + writer.WriteStartArray(); + foreach (string region in this.PreferredRegions) + { + writer.WriteValue(region); + } + writer.WriteEndArray(); + } + else + { + writer.WriteNull(); + } + + writer.WritePropertyName("aggregationIntervalInSec"); + writer.WriteValue(this.AggregationIntervalInSec); + + if (this.SystemInfo != null && this.SystemInfo.Count > 0) + { + writer.WritePropertyName("systemInfo"); + writer.WriteRawValue(JsonConvert.SerializeObject(this.SystemInfo)); + } + } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs index be6dfcd332..7e924ffd53 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs @@ -988,9 +988,23 @@ private static void AssertAccountLevelInformation( // Asserting If basic client telemetry object is as expected foreach (ClientTelemetryProperties telemetryInfo in localCopyOfActualInfo) { - actualOperationList.AddRange(telemetryInfo.OperationInfo); - actualSystemInformation.AddRange(telemetryInfo.SystemInfo); - actualRequestInformation.AddRange(telemetryInfo.RequestInfo); + if (telemetryInfo.OperationInfo != null) + { + actualOperationList.AddRange(telemetryInfo.OperationInfo); + } + + if (telemetryInfo.SystemInfo != null) + { + foreach (SystemInfo sysInfo in telemetryInfo.SystemInfo) + { + actualSystemInformation.Add(sysInfo); + } + } + + if (telemetryInfo.RequestInfo != null) + { + actualRequestInformation.AddRange(telemetryInfo.RequestInfo); + } if (telemetryInfo.ConnectionMode == ConnectionMode.Direct.ToString().ToUpperInvariant()) { @@ -1083,20 +1097,8 @@ public async Task CheckMisconfiguredTelemetryEndpoint_should_stop_the_job() mode: ConnectionMode.Direct, customHttpHandler: customHttpHandler); - // Create an item - ToDoActivity testItem = ToDoActivity.CreateRandomToDoActivity("MyTestPkValue"); - ItemResponse createResponse = await container.CreateItemAsync(testItem); - ToDoActivity testItemCreated = createResponse.Resource; - - // Read an Item - ItemResponse response = await container.ReadItemAsync(testItem.id, new Cosmos.PartitionKey(testItem.id)); - - await Task.Delay(1500); - - response = await container.ReadItemAsync(testItem.id, new Cosmos.PartitionKey(testItem.id)); - - await Task.Delay(3500); - + await Task.Delay(TimeSpan.FromMilliseconds(5000)); // wait for 5 sec, ideally telemetry would be sent 5 times but client telemetry endpoint is not functional (in this test), it should try 3 times maximum and after that client telemetry job should be stopped. + Assert.AreEqual(3, retryCounter); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj index 1d4e4e166c..4d25f7e5a7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj @@ -34,6 +34,7 @@ + @@ -375,6 +376,9 @@ PreserveNewest + + PreserveNewest + diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryPayloadWithoutMetrics.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryPayloadWithoutMetrics.json new file mode 100644 index 0000000000..a17f0fd74c --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryPayloadWithoutMetrics.json @@ -0,0 +1,135 @@ +{ + "timeStamp": "2022-07-12T10:37:40Z", + "clientId": "1d5a40cf-d1a3-4ac5-ad34-307ad9243985", + "machineId": "vmId:d0cb93eb-214b-4c2b-bd3d-cc93e90d9efd", + "processId": "dotnet", + "userAgent": "cosmos-netstandard-sdk/3.28.0|8|X64|Microsoft Windows 10.0.22000|.NET 6.0.6|L|F 00000010|", + "connectionMode": "DIRECT", + "globalDatabaseAccountName": "localhost", + "applicationRegion": "eastus", + "hostEnvInfo": "Linux|18.04-LTS|Standard_D2s_v3|AzurePublicCloud", + "preferredRegions": [ "region1", "region2" ], + "aggregationIntervalInSec": 1, + "acceleratedNetworking": false, + "systemInfo": [ + { + "resource": "HostMachine", + "metricInfo": { + "metricsName": "CPU", + "unitName": "Percentage", + "mean": 38.55, + "count": 4, + "min": 10.96, + "max": 73.27, + "percentiles": { + "50": 33.11, + "90": 73.27, + "95": 73.27, + "99": 73.27, + "99.9": 73.27 + } + } + }, + { + "resource": "HostMachine", + "metricInfo": { + "metricsName": "MemoryRemaining", + "unitName": "MB", + "mean": 31904.0, + "count": 4, + "min": 31744.0, + "max": 31999.9990234375, + "percentiles": { + "50": 31999.9990234375, + "90": 31999.9990234375, + "95": 31999.9990234375, + "99": 31999.9990234375, + "99.9": 31999.9990234375 + } + } + }, + { + "resource": "HostMachine", + "metricInfo": { + "metricsName": "SystemPool_AvailableThreads", + "unitName": "ThreadCount", + "mean": 32704.0, + "count": 4, + "min": 32640.0, + "max": 32767.0, + "percentiles": { + "50": 32767.0, + "90": 32767.0, + "95": 32767.0, + "99": 32767.0, + "99.9": 32767.0 + } + } + }, + { + "resource": "HostMachine", + "metricInfo": { + "metricsName": "SystemPool_ThreadWaitInterval", + "unitName": "MilliSecond", + "mean": 0.1743, + "count": 3, + "min": 0.0488, + "max": 0.3359, + "percentiles": { + "50": 0.1391, + "90": 0.3359, + "95": 0.3359, + "99": 0.3359, + "99.9": 0.3359 + } + } + }, + { + "resource": "HostMachine", + "metricInfo": { + "metricsName": "SystemPool_IsThreadStarving_True", + "unitName": "Count", + "mean": 0.1, + "count": 2, + "min": 0.1, + "max": 0.1 + } + }, + { + "resource": "HostMachine", + "metricInfo": { + "metricsName": "RntbdOpenConnections", + "unitName": "Count", + "mean": 0.25, + "count": 4, + "min": 0.1, + "max": 1.0, + "percentiles": { + "50": 0.1, + "90": 1.0, + "95": 1.0, + "99": 1.0, + "99.9": 1.0 + } + } + }, + { + "resource": "HostMachine", + "metricInfo": { + "metricsName": "TcpNewChannelOpenLatency", + "unitName": "MilliSecond", + "mean": 0.25, + "count": 4, + "min": 0.1, + "max": 1.0, + "percentiles": { + "50": 0.1, + "90": 1.0, + "95": 1.0, + "99": 1.0, + "99.9": 1.0 + } + } + } + ] +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryTests.cs new file mode 100644 index 0000000000..48cb0d1e42 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryTests.cs @@ -0,0 +1,258 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Tests.Telemetry +{ + using System; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using HdrHistogram; + using Newtonsoft.Json; + using Microsoft.Azure.Cosmos.Telemetry; + using System.Collections.Generic; + using Microsoft.Azure.Cosmos.Telemetry.Models; + using System.Text; + using System.IO; + using System.Net.Http; + using Moq; + using System.Threading.Tasks; + using System.Threading; + using System.Net; + using System.Collections.Concurrent; + + /// + /// Tests for . + /// + [TestClass] + public class ClientTelemetryTests + { + [TestCleanup] + public void Cleanup() + { + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, null); + } + + [TestMethod] + public void CheckMetricsAggregationLogic() + { + MetricInfo metrics = new MetricInfo("metricsName", "unitName"); + + LongConcurrentHistogram histogram = new LongConcurrentHistogram(1, + long.MaxValue, + 5); + + histogram.RecordValue(10); + histogram.RecordValue(20); + histogram.RecordValue(30); + histogram.RecordValue(40); + + metrics.SetAggregators(histogram); + + Assert.AreEqual(40, metrics.Max); + Assert.AreEqual(10, metrics.Min); + Assert.AreEqual(4, metrics.Count); + Assert.AreEqual(25, metrics.Mean); + + Assert.AreEqual(20, metrics.Percentiles[ClientTelemetryOptions.Percentile50]); + Assert.AreEqual(40, metrics.Percentiles[ClientTelemetryOptions.Percentile90]); + Assert.AreEqual(40, metrics.Percentiles[ClientTelemetryOptions.Percentile95]); + Assert.AreEqual(40, metrics.Percentiles[ClientTelemetryOptions.Percentile99]); + Assert.AreEqual(40, metrics.Percentiles[ClientTelemetryOptions.Percentile999]); + } + + [TestMethod] + public void CheckMetricsAggregationLogicWithAdjustment() + { + MetricInfo metrics = new MetricInfo("metricsName", "unitName"); + long adjustmentFactor = 1000; + + LongConcurrentHistogram histogram = new LongConcurrentHistogram(1, + long.MaxValue, + 5); + + histogram.RecordValue(10 * adjustmentFactor); + histogram.RecordValue(20 * adjustmentFactor); + histogram.RecordValue(30 * adjustmentFactor); + histogram.RecordValue(40 * adjustmentFactor); + + metrics.SetAggregators(histogram, adjustmentFactor); + + Assert.AreEqual(40, metrics.Max); + Assert.AreEqual(10, metrics.Min); + Assert.AreEqual(4, metrics.Count); + + Assert.AreEqual(25, metrics.Mean); + + Assert.AreEqual(20, metrics.Percentiles[ClientTelemetryOptions.Percentile50]); + Assert.AreEqual(40, metrics.Percentiles[ClientTelemetryOptions.Percentile90]); + Assert.AreEqual(40, metrics.Percentiles[ClientTelemetryOptions.Percentile95]); + Assert.AreEqual(40, metrics.Percentiles[ClientTelemetryOptions.Percentile99]); + Assert.AreEqual(40, metrics.Percentiles[ClientTelemetryOptions.Percentile999]); + } + + [TestMethod] + public void CheckJsonSerializerContract() + { + string json = JsonConvert.SerializeObject(new ClientTelemetryProperties(clientId: "clientId", + processId: "", + userAgent: null, + connectionMode: ConnectionMode.Direct, + preferredRegions: null, + aggregationIntervalInSec: 10), ClientTelemetryOptions.JsonSerializerSettings); + Assert.AreEqual("{\"clientId\":\"clientId\",\"processId\":\"\",\"connectionMode\":\"DIRECT\",\"aggregationIntervalInSec\":10,\"systemInfo\":[]}", json); + } + + [TestMethod] + public void CheckJsonSerializerContractWithPreferredRegions() + { + List preferredRegion = new List + { + "region1" + }; + string json = JsonConvert.SerializeObject(new ClientTelemetryProperties(clientId: "clientId", + processId: "", + userAgent: null, + connectionMode: ConnectionMode.Direct, + preferredRegions: preferredRegion, + aggregationIntervalInSec: 1), ClientTelemetryOptions.JsonSerializerSettings); + Assert.AreEqual("{\"clientId\":\"clientId\",\"processId\":\"\",\"connectionMode\":\"DIRECT\",\"preferredRegions\":[\"region1\"],\"aggregationIntervalInSec\":1,\"systemInfo\":[]}", json); + } + + [TestMethod] + [DataRow(100, 50, 200)] // When operation, cacherefresh and request info is there in payload + [DataRow(0, 50, 0)] // When only cacherefresh info is there in payload + [DataRow(100, 50, 0)] // When only operation and cacherefresh info is there in payload + [DataRow(100, 0, 0)] // When only operation info is there in payload + public async Task CheckIfPayloadIsDividedCorrectlyAsync(int expectedOperationInfoSize, int expectedCacheRefreshInfoSize, int expectedRequestInfoSize) + { + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, "http://dummy.telemetry.endpoint/"); + ClientTelemetryOptions.PayloadSizeThreshold = 1024 * 15; //15 Kb + + string data = File.ReadAllText("Telemetry/ClientTelemetryPayloadWithoutMetrics.json", Encoding.UTF8); + ClientTelemetryProperties clientTelemetryProperties = JsonConvert.DeserializeObject(data); + + int totalPayloadSizeInBytes = data.Length; + + int actualOperationInfoSize = 0; + int actualCacheRefreshInfoSize = 0; + int actualRequestInfoSize = 0; + + Mock mockHttpHandler = new Mock(); + _ = mockHttpHandler.Setup(x => x.SendAsync( + It.IsAny(), + It.IsAny())) + .Callback( + (request, cancellationToken) => + { + string payloadJson = request.Content.ReadAsStringAsync().Result; + Assert.IsTrue(payloadJson.Length <= ClientTelemetryOptions.PayloadSizeThreshold, "Payload Size is " + payloadJson.Length); + + ClientTelemetryProperties propertiesToSend = JsonConvert.DeserializeObject(payloadJson); + + Assert.AreEqual(7, propertiesToSend.SystemInfo.Count, "System Info is not correct"); + + actualOperationInfoSize += propertiesToSend.OperationInfo?.Count ?? 0; + actualCacheRefreshInfoSize += propertiesToSend.CacheRefreshInfo?.Count ?? 0; + actualRequestInfoSize += propertiesToSend.RequestInfo?.Count ?? 0; + }) + .Returns(Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK))); + + ClientTelemetryProcessor processor = new ClientTelemetryProcessor( + MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(new HttpHandlerHelper(mockHttpHandler.Object))), + Mock.Of()); + + ConcurrentDictionary operationInfoSnapshot + = new ConcurrentDictionary(); + + for (int i = 0; i < (expectedOperationInfoSize/2); i++) + { + OperationInfo opeInfo = new OperationInfo(Regions.WestUS, + 0, + Documents.ConsistencyLevel.Session.ToString(), + "databaseName" + i, + "containerName", + Documents.OperationType.Read, + Documents.ResourceType.Document, + 200, + 0); + + LongConcurrentHistogram latency = new LongConcurrentHistogram(ClientTelemetryOptions.RequestLatencyMin, + ClientTelemetryOptions.RequestLatencyMax, + ClientTelemetryOptions.RequestLatencyPrecision); + latency.RecordValue(10l); + + LongConcurrentHistogram requestcharge = new LongConcurrentHistogram(ClientTelemetryOptions.RequestChargeMin, + ClientTelemetryOptions.RequestChargeMax, + ClientTelemetryOptions.RequestChargePrecision); + requestcharge.RecordValue(11l); + + operationInfoSnapshot.TryAdd(opeInfo, (latency, requestcharge)); + } + + ConcurrentDictionary cacheRefreshInfoSnapshot + = new ConcurrentDictionary(); + for (int i = 0; i < expectedCacheRefreshInfoSize; i++) + { + CacheRefreshInfo crInfo = new CacheRefreshInfo(Regions.WestUS, + 10, + Documents.ConsistencyLevel.Session.ToString(), + "databaseName" + i, + "containerName", + Documents.OperationType.Read, + Documents.ResourceType.Document, + 200, + 1002, + "dummycache") ; + + LongConcurrentHistogram latency = new LongConcurrentHistogram(ClientTelemetryOptions.RequestLatencyMin, + ClientTelemetryOptions.RequestLatencyMax, + ClientTelemetryOptions.RequestLatencyPrecision); + latency.RecordValue(10l); + + cacheRefreshInfoSnapshot.TryAdd(crInfo, latency); + } + + ConcurrentDictionary requestInfoInfoSnapshot + = new ConcurrentDictionary(); + for (int i = 0; i < expectedRequestInfoSize; i++) + { + RequestInfo reqInfo = new RequestInfo + { + Uri = "https://dummyuri.com", + DatabaseName = "databaseName" + i, + ContainerName = "containerName" + i, + Operation = Documents.OperationType.Read.ToString(), + Resource = Documents.ResourceType.Document.ToString(), + StatusCode = 200, + SubStatusCode = 0 + }; + + LongConcurrentHistogram latency = new LongConcurrentHistogram(ClientTelemetryOptions.RequestLatencyMin, + ClientTelemetryOptions.RequestLatencyMax, + ClientTelemetryOptions.RequestLatencyPrecision); + latency.RecordValue(10l); + + requestInfoInfoSnapshot.TryAdd(reqInfo, latency); + } + + await processor.ProcessAndSendAsync( + clientTelemetryProperties, + operationInfoSnapshot, + cacheRefreshInfoSnapshot, + requestInfoInfoSnapshot, + new CancellationToken()); + + Assert.AreEqual(expectedOperationInfoSize, actualOperationInfoSize, "Operation Info is not correct"); + Assert.AreEqual(expectedCacheRefreshInfoSize, actualCacheRefreshInfoSize, "Cache Refresh Info is not correct"); + Assert.AreEqual(expectedRequestInfoSize, actualRequestInfoSize, "Request Info is not correct"); + } + + [TestMethod] + [ExpectedException(typeof(FormatException))] + public void CheckMisconfiguredTelemetry_should_fail() + { + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, "non-boolean"); + using CosmosClient client = MockCosmosUtil.CreateMockCosmosClient(); + } + } +} From 682b0011dd8224fbbd8f66691abf28cb53929e28 Mon Sep 17 00:00:00 2001 From: leminh98 Date: Fri, 10 Mar 2023 09:51:03 -0800 Subject: [PATCH 072/240] Query: Fixes regression from LINQ custom serializer fix (#3749) Co-authored-by: Minh Le Co-authored-by: Matias Quaranta --- .../src/Linq/ExpressionToSQL.cs | 17 -- .../Resource/Container/ContainerCore.Items.cs | 7 +- .../Serializer/CosmosLinqSerializerOptions.cs | 9 - ...BaselineTests.TestLiteralSerialization.xml | 2 +- ...rializerBaseline.TestMemberInitializer.xml | 48 ------ .../LinqTestsCommon.cs | 4 +- .../LinqTranslationBaselineTests.cs | 2 +- ...TranslationWithCustomSerializerBaseline.cs | 159 ------------------ ...icrosoft.Azure.Cosmos.EmulatorTests.csproj | 4 - 9 files changed, 7 insertions(+), 245 deletions(-) delete mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializer.xml delete mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationWithCustomSerializerBaseline.cs diff --git a/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs b/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs index d15f67fece..476774e137 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Cosmos.Linq using System.Collections.ObjectModel; using System.Diagnostics; using System.Globalization; - using System.IO; using System.Linq; using System.Linq.Expressions; using System.Reflection; @@ -713,22 +712,6 @@ public static SqlScalarExpression VisitConstant(ConstantExpression inputExpressi return SqlArrayCreateScalarExpression.Create(arrayItems.ToImmutableArray()); } - if (context.linqSerializerOptions?.CustomCosmosSerializer != null) - { - StringWriter writer = new StringWriter(CultureInfo.InvariantCulture); - - // Use the user serializer for the parameter values so custom conversions are correctly handled - using (Stream stream = context.linqSerializerOptions.CustomCosmosSerializer.ToStream(inputExpression.Value)) - { - using (StreamReader streamReader = new StreamReader(stream)) - { - string propertyValue = streamReader.ReadToEnd(); - writer.Write(propertyValue); - return CosmosElement.Parse(writer.ToString()).Accept(CosmosElementToSqlScalarExpressionVisitor.Singleton); - } - } - } - return CosmosElement.Parse(JsonConvert.SerializeObject(inputExpression.Value)).Accept(CosmosElementToSqlScalarExpressionVisitor.Singleton); } diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs index 31a3ccc5ca..a694b78019 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs @@ -505,14 +505,11 @@ public override IOrderedQueryable GetItemLinqQueryable( { requestOptions ??= new QueryRequestOptions(); - if (linqSerializerOptions == null && this.ClientContext.ClientOptions != null) + if (linqSerializerOptions == null && this.ClientContext.ClientOptions.SerializerOptions != null) { linqSerializerOptions = new CosmosLinqSerializerOptions { - PropertyNamingPolicy = this.ClientContext.ClientOptions.SerializerOptions != null - ? this.ClientContext.ClientOptions.SerializerOptions.PropertyNamingPolicy - : CosmosPropertyNamingPolicy.Default, - CustomCosmosSerializer = this.ClientContext.ClientOptions.Serializer + PropertyNamingPolicy = this.ClientContext.ClientOptions.SerializerOptions.PropertyNamingPolicy }; } diff --git a/Microsoft.Azure.Cosmos/src/Serializer/CosmosLinqSerializerOptions.cs b/Microsoft.Azure.Cosmos/src/Serializer/CosmosLinqSerializerOptions.cs index 0affdde976..b7523b2c6a 100644 --- a/Microsoft.Azure.Cosmos/src/Serializer/CosmosLinqSerializerOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Serializer/CosmosLinqSerializerOptions.cs @@ -22,15 +22,6 @@ public CosmosLinqSerializerOptions() this.PropertyNamingPolicy = CosmosPropertyNamingPolicy.Default; } - /// - /// Gets or sets the user defined customer serializer. If no customer serializer was defined, - /// then the value is set to the default value - /// - /// - /// The default value is null - /// - internal CosmosSerializer CustomCosmosSerializer { get; set; } - /// /// Gets or sets whether the naming policy used to convert a string-based name to another format, /// such as a camel-casing format. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestLiteralSerialization.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestLiteralSerialization.xml index b72807f399..c4c2fb38dd 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestLiteralSerialization.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestLiteralSerialization.xml @@ -435,7 +435,7 @@ FROM root]]> diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializer.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializer.xml deleted file mode 100644 index 8763ef6866..0000000000 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializer.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - (doc == new DataObject() {NumericField = 12, StringField = "12"}))]]> - - - - - - - - - new DataObject() {NumericField = 12, StringField = "12"})]]> - - - - - - - - - IIF((doc.NumericField > 12), new DataObject() {NumericField = 12, StringField = "12"}, new DataObject() {NumericField = 12, StringField = "12"}))]]> - - - 12) ? {"number": 12, "String_value": "12", "id": null, "Pk": null} : {"number": 12, "String_value": "12", "id": null, "Pk": null}) -FROM root]]> - - - - - - (doc == new DataObject() {NumericField = doc.NumericField, StringField = doc.StringField})).Select(b => "A")]]> - - - - - - \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestsCommon.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestsCommon.cs index 2b8f5c2d4a..5907d861fc 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestsCommon.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestsCommon.cs @@ -455,7 +455,9 @@ Family createDataObj(Random random) return getQuery; } - public static Func> GenerateSimpleCosmosData(Cosmos.Database cosmosDatabase) + public static Func> GenerateSimpleCosmosData( + Cosmos.Database cosmosDatabase + ) { const int DocumentCount = 10; PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection(new[] { "/Pk" }), Kind = PartitionKind.Hash }; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs index 01b64cd4fd..14aadd354f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs @@ -1,5 +1,5 @@ //----------------------------------------------------------------------- -// +// // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------- diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationWithCustomSerializerBaseline.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationWithCustomSerializerBaseline.cs deleted file mode 100644 index c81beaaeb8..0000000000 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationWithCustomSerializerBaseline.cs +++ /dev/null @@ -1,159 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//----------------------------------------------------------------------- -namespace Microsoft.Azure.Cosmos.Services.Management.Tests.LinqProviderTests -{ - using BaselineTest; - using Microsoft.Azure.Cosmos.Linq; - using Microsoft.Azure.Cosmos.Spatial; - using Microsoft.VisualStudio.TestTools.UnitTesting; - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Linq; - using System.Linq.Dynamic; - using System.Text; - using System.Text.Json; - using Microsoft.Azure.Documents; - using Microsoft.Azure.Cosmos.SDK.EmulatorTests; - using System.Threading.Tasks; - using global::Azure.Core.Serialization; - using System.IO; - using System.Text.Json.Serialization; - - [Microsoft.Azure.Cosmos.SDK.EmulatorTests.TestClass] - public class LinqTranslationWithCustomSerializerBaseline : BaselineTests - { - private static CosmosClient cosmosClient; - private static Cosmos.Database testDb; - private static Container testContainer; - - [ClassInitialize] - public async static Task Initialize(TestContext textContext) - { - cosmosClient = TestCommon.CreateCosmosClient((cosmosClientBuilder) - => cosmosClientBuilder.WithCustomSerializer(new SystemTextJsonSerializer(new JsonSerializerOptions())).WithConnectionModeGateway()); - - string dbName = $"{nameof(LinqTranslationBaselineTests)}-{Guid.NewGuid().ToString("N")}"; - testDb = await cosmosClient.CreateDatabaseAsync(dbName); - } - - [ClassCleanup] - public async static Task CleanUp() - { - if (testDb != null) - { - await testDb.DeleteStreamAsync(); - } - - cosmosClient?.Dispose(); - } - - [TestInitialize] - public async Task TestInitialize() - { - testContainer = await testDb.CreateContainerAsync(new ContainerProperties(id: Guid.NewGuid().ToString(), partitionKeyPath: "/Pk")); - } - - [TestCleanup] - public async Task TestCleanUp() - { - await testContainer.DeleteContainerStreamAsync(); - } - - // Custom serializer that uses System.Text.Json.JsonSerializer instead of NewtonsoftJson.JsonSerializer - private class SystemTextJsonSerializer : CosmosSerializer - { - private readonly JsonObjectSerializer systemTextJsonSerializer; - - public SystemTextJsonSerializer(JsonSerializerOptions jsonSerializerOptions) - { - this.systemTextJsonSerializer = new JsonObjectSerializer(jsonSerializerOptions); - } - - public override T FromStream(Stream stream) - { - if (stream == null) - throw new ArgumentNullException(nameof(stream)); - - using (stream) - { - if (stream.CanSeek && stream.Length == 0) - { - return default; - } - - if (typeof(Stream).IsAssignableFrom(typeof(T))) - { - return (T)(object)stream; - } - - return (T)this.systemTextJsonSerializer.Deserialize(stream, typeof(T), default); - } - } - - public override Stream ToStream(T input) - { - MemoryStream streamPayload = new MemoryStream(); - this.systemTextJsonSerializer.Serialize(streamPayload, input, typeof(T), default); - streamPayload.Position = 0; - return streamPayload; - } - } - - internal class DataObject : LinqTestObject - { - [JsonPropertyName("number")] - public double NumericField { get; set; } - - [JsonPropertyName("String_value")] - public string StringField { get; set; } - - [JsonPropertyName("id")] - public string Id { get; set; } - - [JsonPropertyName("Pk")] - public string Pk { get; set; } - } - - [TestMethod] - public void TestMemberInitializer() - { - const int Records = 100; - const int NumAbsMax = 500; - const int MaxStringLength = 100; - DataObject createDataObj(Random random) - { - DataObject obj = new DataObject - { - NumericField = random.Next(NumAbsMax * 2) - NumAbsMax, - StringField = LinqTestsCommon.RandomString(random, random.Next(MaxStringLength)), - Id = Guid.NewGuid().ToString(), - Pk = "Test" - }; - return obj; - } - Func> getQuery = LinqTestsCommon.GenerateTestCosmosData(createDataObj, Records, testContainer); - - List inputs = new List - { - new LinqTestInput("Filter w/ DataObject initializer with constant value", b => getQuery(b).Where(doc => doc == new DataObject() { NumericField = 12, StringField = "12" })), - new LinqTestInput("Select w/ DataObject initializer", b => getQuery(b).Select(doc => new DataObject() { NumericField = 12, StringField = "12" })), - new LinqTestInput("Deeper than top level reference", b => getQuery(b).Select(doc => doc.NumericField > 12 ? new DataObject() { NumericField = 12, StringField = "12" } : new DataObject() { NumericField = 12, StringField = "12" })), - - - // Negative test case: serializing only field name using custom serializer not currently supported - new LinqTestInput("Filter w/ DataObject initializer with member initialization", b => getQuery(b).Where(doc => doc == new DataObject() { NumericField = doc.NumericField, StringField = doc.StringField }).Select(b => "A")) - }; - this.ExecuteTestSuite(inputs); - } - - - public override LinqTestOutput ExecuteTest(LinqTestInput input) - { - return LinqTestsCommon.ExecuteTest(input); - } - } -} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj index 10e0462cef..a504adc855 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj @@ -37,7 +37,6 @@ - @@ -248,9 +247,6 @@ PreserveNewest - - PreserveNewest - PreserveNewest From f2a3078bdb796d1234c2a7d52b3639bb8ddddc7a Mon Sep 17 00:00:00 2001 From: Kiran Kumar Kolli Date: Fri, 10 Mar 2023 15:55:11 -0800 Subject: [PATCH 073/240] [Internal] LocalQuorum: Refactors override (i.e. strong) to allow from any account consistency (#3753) - Localquorum override (i.e. strong) to allow from any account consistency - Facilitates no-downtime downgrade of existing accounts (i.e. existing Strong/bounded accounts migration to Eventual) --- .../src/ValidationHelpers.cs | 9 +- .../ValidationHelpersTests.cs | 98 +++++++++++-------- 2 files changed, 56 insertions(+), 51 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ValidationHelpers.cs b/Microsoft.Azure.Cosmos/src/ValidationHelpers.cs index 58a7a55ddb..4810d99f66 100644 --- a/Microsoft.Azure.Cosmos/src/ValidationHelpers.cs +++ b/Microsoft.Azure.Cosmos/src/ValidationHelpers.cs @@ -55,7 +55,6 @@ public static bool IsValidConsistencyLevelOverwrite( { if (isLocalQuorumConsistency && ValidationHelpers.IsLocalQuorumConsistency( - backendConsistency: backendConsistency, desiredConsistency: desiredConsistency, operationType: operationType, resourceType: resourceType)) @@ -109,21 +108,15 @@ private static bool IsValidConsistencyLevelOverwrite( /// /// Condition to check Quorum(i.e. Strong) read with either an eventual consistency account or a consistent prefix account. /// - /// /// /// /// /// true/false - private static bool IsLocalQuorumConsistency(Documents.ConsistencyLevel backendConsistency, + private static bool IsLocalQuorumConsistency( Documents.ConsistencyLevel desiredConsistency, OperationType? operationType, ResourceType? resourceType) { - if (backendConsistency != Documents.ConsistencyLevel.Eventual && backendConsistency != Documents.ConsistencyLevel.ConsistentPrefix) - { - return false; - } - if (desiredConsistency != Documents.ConsistencyLevel.Strong) { return false; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ValidationHelpersTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ValidationHelpersTests.cs index 2c9db33cec..dbfc45eb36 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ValidationHelpersTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ValidationHelpersTests.cs @@ -4,6 +4,8 @@ namespace Microsoft.Azure.Cosmos.Tests { + using System; + using System.Collections.Generic; using System.Data; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -11,62 +13,72 @@ namespace Microsoft.Azure.Cosmos.Tests public class ValidationHelpersTest { [TestMethod] - [DataRow(true, ConsistencyLevel.Eventual, ConsistencyLevel.Strong)] - [DataRow(true, ConsistencyLevel.ConsistentPrefix, ConsistencyLevel.Strong)] - [DataRow(false, ConsistencyLevel.Eventual, ConsistencyLevel.BoundedStaleness)] - [DataRow(false, ConsistencyLevel.ConsistentPrefix, ConsistencyLevel.BoundedStaleness)] - [DataRow(false, ConsistencyLevel.Session, ConsistencyLevel.Strong)] - [DataRow(false, ConsistencyLevel.BoundedStaleness, ConsistencyLevel.Strong)] - public void TestIsValidConsistencyLevelOverwrite(bool isValidConsistencyLevelOverwrite, - ConsistencyLevel backendConsistencyLevel, - ConsistencyLevel desiredConsistencyLevel) + [DataRow(true)] + [DataRow(false)] + public void TestIsValidConsistencyLevelOverwrite_AllCombinations( + bool isValidConsistencyLevelOverwrite) { - bool result = ValidationHelpers.IsValidConsistencyLevelOverwrite(backendConsistencyLevel, - desiredConsistencyLevel, - true, - Documents.OperationType.Read, - Documents.ResourceType.Document); + ConsistencyLevel[] allConsistencies = Enum.GetValues(); + + // All overrides when target is 'Strong' are VALID + ConsistencyLevel desiredConsistencyLevel = ConsistencyLevel.Strong; + foreach (ConsistencyLevel backendConsistencyLevel in allConsistencies) + { + if (backendConsistencyLevel == desiredConsistencyLevel) + { + continue; + } + + foreach (KeyValuePair entry in ValidationHelpersTest.GetPerOperationExpectations()) + { + bool result = ValidationHelpers.IsValidConsistencyLevelOverwrite(backendConsistencyLevel, + desiredConsistencyLevel, + isValidConsistencyLevelOverwrite, + (Documents.OperationType)entry.Key, + Documents.ResourceType.Document); - Assert.AreEqual(isValidConsistencyLevelOverwrite, result); + Assert.AreEqual(isValidConsistencyLevelOverwrite && entry.Value, result, + $"({isValidConsistencyLevelOverwrite}, {backendConsistencyLevel}, {desiredConsistencyLevel}) ({entry.Key}, {entry.Value})"); + } + } } [TestMethod] - [DataRow(false, ConsistencyLevel.Eventual, ConsistencyLevel.Strong)] - [DataRow(false, ConsistencyLevel.ConsistentPrefix, ConsistencyLevel.Strong)] - public void TestIsValidConsistencyLevelOverwrite_OnlyWhenSpecifyingExplicitOverwrite(bool isValidConsistencyLevelOverwrite, + [DataRow(ConsistencyLevel.Eventual, ConsistencyLevel.BoundedStaleness)] + [DataRow(ConsistencyLevel.ConsistentPrefix, ConsistencyLevel.BoundedStaleness)] + [DataRow(ConsistencyLevel.Session, ConsistencyLevel.BoundedStaleness)] + public void TestIsValidConsistencyLevelOverwrite_BoundedPromotionsRejected( ConsistencyLevel backendConsistencyLevel, ConsistencyLevel desiredConsistencyLevel) { - bool result = ValidationHelpers.IsValidConsistencyLevelOverwrite(backendConsistencyLevel, - desiredConsistencyLevel, - false, - Documents.OperationType.Read, - Documents.ResourceType.Document); + foreach (KeyValuePair entry in ValidationHelpersTest.GetPerOperationExpectations()) + { + bool result = ValidationHelpers.IsValidConsistencyLevelOverwrite(backendConsistencyLevel, + desiredConsistencyLevel, + true, + (Documents.OperationType)entry.Key, + Documents.ResourceType.Document); - Assert.AreEqual(isValidConsistencyLevelOverwrite, result); + Assert.AreEqual(false, result, + $"({backendConsistencyLevel}, {desiredConsistencyLevel}) ({entry.Key}, {entry.Value})"); + } } - [TestMethod] - [DataRow(true, ConsistencyLevel.Eventual, ConsistencyLevel.Strong, Documents.OperationType.Read)] - [DataRow(true, ConsistencyLevel.Eventual, ConsistencyLevel.Strong, Documents.OperationType.ReadFeed)] - [DataRow(true, ConsistencyLevel.ConsistentPrefix, ConsistencyLevel.Strong, Documents.OperationType.Query)] - [DataRow(true, ConsistencyLevel.ConsistentPrefix, ConsistencyLevel.Strong, Documents.OperationType.SqlQuery)] - [DataRow(false, ConsistencyLevel.Eventual, ConsistencyLevel.Strong, Documents.OperationType.QueryPlan)] - [DataRow(false, ConsistencyLevel.ConsistentPrefix, ConsistencyLevel.Strong, Documents.OperationType.Create)] - [DataRow(false, ConsistencyLevel.ConsistentPrefix, ConsistencyLevel.Strong, Documents.OperationType.Batch)] - public void TestIsValidConsistencyLevelOverwrite_OnlyAllowedForCertainOperationTypes( - bool isValidConsistencyLevelOverwrite, - ConsistencyLevel backendConsistencyLevel, - ConsistencyLevel desiredConsistencyLevel, - dynamic operationType) + private static Dictionary GetPerOperationExpectations() { - bool result = ValidationHelpers.IsValidConsistencyLevelOverwrite(backendConsistencyLevel, - desiredConsistencyLevel, - true, - (Documents.OperationType) operationType, - Documents.ResourceType.Document); + Dictionary perOperationOverride = new Dictionary(); + + foreach (Documents.OperationType operationType in Enum.GetValues()) + { + perOperationOverride.Add( + operationType, + Documents.OperationTypeExtensions.IsReadOperation(operationType) + && operationType != Documents.OperationType.Head + && operationType != Documents.OperationType.HeadFeed + && operationType != Documents.OperationType.QueryPlan); + } - Assert.AreEqual(isValidConsistencyLevelOverwrite, result); + return perOperationOverride; } } } \ No newline at end of file From d41f0995618cb344fcaf3c16e002960493aaa016 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Fri, 10 Mar 2023 18:07:24 -0800 Subject: [PATCH 074/240] Release: Adds SDK version and change log for 3.32.2 (#3752) * version bump * contract * changelog * version bump * Fixing changelog text * Add another PR --- Directory.Build.props | 4 +- .../contracts/API_3.32.2-preview.txt | 1531 +++++++++++++++++ .../contracts/API_3.32.2.txt | 1478 ++++++++++++++++ changelog.md | 7 + 4 files changed, 3018 insertions(+), 2 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.32.2-preview.txt create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.32.2.txt diff --git a/Directory.Build.props b/Directory.Build.props index aa8918e3b1..e7ca7a8727 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 3.32.1 - 3.32.1 + 3.32.2 + 3.32.2 preview 3.30.2 2.0.1 diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.32.2-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.32.2-preview.txt new file mode 100644 index 0000000000..69b7a4b83e --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.32.2-preview.txt @@ -0,0 +1,1531 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool IsDistributedTracingEnabled { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithDistributedTracing(bool isEnabled=true); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsPrimitive(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.32.2.txt b/Microsoft.Azure.Cosmos/contracts/API_3.32.2.txt new file mode 100644 index 0000000000..5218206b0e --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.32.2.txt @@ -0,0 +1,1478 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsPrimitive(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/changelog.md b/changelog.md index b201ba77fb..a8a156b922 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,13 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [3.32.2](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.32.2) - 2023-03-10 +### [3.32.2-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.32.2-preview) - 2023-03-10 + +#### Fixed +- [#3713](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3713) CosmosNullReferenceException: Refactors CosmosNullReferenceException to pass along InnerException property on parent NullReferenceException. +- [#3749](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3749) Query: Fixes regression from LINQ custom serializer fix. Introduced in 3.32.0 PR [3749](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3749) + ### [3.32.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.32.1) - 2023-03-01 ### [3.32.1-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.32.1-preview) - 2023-03-01 From 1acfaa280561286d661605b3a793b4e2d1790ada Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Tue, 21 Mar 2023 16:21:35 -0700 Subject: [PATCH 075/240] Subpartitioning: Adds APIs for public release and increase REST API version (#3763) * initial commit, Http version issues still needs to be resolved * updateContracts + update Http Version * updateded version in test * update contracts * requested changed * changed name in comments to subpartitioning from multihash * undid changes to TestLiteralSerialization.xml * removed changes to non API.json files * removed non XXXAPI.json file changes * changed verbage on public comments * changed error message to reflect verbage change --- Microsoft.Azure.Cosmos/src/CosmosClient.cs | 5 +- .../src/PartitionKeyBuilder.cs | 7 +-- .../src/Resource/Database/DatabaseCore.cs | 8 +-- .../Resource/Settings/ContainerProperties.cs | 26 ++------ .../CosmosContainerTests.cs | 4 +- .../CosmosMultiHashTest.cs | 7 --- .../CosmosReadManyItemsTests.cs | 39 +----------- .../Contracts/ContractTests.cs | 6 +- .../Contracts/DotNetPreviewSDKAPI.json | 63 ------------------- .../Contracts/DotNetSDKAPI.json | 63 +++++++++++++++++++ 10 files changed, 77 insertions(+), 151 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/CosmosClient.cs b/Microsoft.Azure.Cosmos/src/CosmosClient.cs index e5ca2d8b53..d4fe7dcb9b 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClient.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClient.cs @@ -115,11 +115,8 @@ public class CosmosClient : IDisposable static CosmosClient() { -#if PREVIEW HttpConstants.Versions.CurrentVersion = HttpConstants.Versions.v2020_07_15; -#else - HttpConstants.Versions.CurrentVersion = HttpConstants.Versions.v2018_12_31; -#endif + HttpConstants.Versions.CurrentVersionUTF8 = Encoding.UTF8.GetBytes(HttpConstants.Versions.CurrentVersion); ServiceInteropWrapper.AssembliesExist = new Lazy(() => diff --git a/Microsoft.Azure.Cosmos/src/PartitionKeyBuilder.cs b/Microsoft.Azure.Cosmos/src/PartitionKeyBuilder.cs index 6154921a86..e9b0e70a7d 100644 --- a/Microsoft.Azure.Cosmos/src/PartitionKeyBuilder.cs +++ b/Microsoft.Azure.Cosmos/src/PartitionKeyBuilder.cs @@ -11,12 +11,7 @@ namespace Microsoft.Azure.Cosmos /// /// Represents a partition key value list in the Azure Cosmos DB service. /// -#if PREVIEW - public -#else - internal -#endif - sealed class PartitionKeyBuilder + public sealed class PartitionKeyBuilder { private readonly List partitionKeyValues; diff --git a/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseCore.cs index f8bbb95276..5f97a15286 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseCore.cs @@ -5,6 +5,7 @@ namespace Microsoft.Azure.Cosmos { using System; + using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; @@ -15,10 +16,6 @@ namespace Microsoft.Azure.Cosmos using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; -#if PREVIEW - using System.Collections.Generic; -#endif - /// /// Operations for reading or deleting an existing database. /// @@ -219,7 +216,6 @@ public async Task CreateContainerIfNotExistsAsync( nameof(containerProperties.PartitionKey)); } } -#if PREVIEW else { IReadOnlyList retrivedPartitionKeyPaths = retrivedContainerResponse.Resource.PartitionKeyPaths; @@ -236,7 +232,7 @@ public async Task CreateContainerIfNotExistsAsync( nameof(containerProperties.PartitionKey)); } } -#endif + return retrivedContainerResponse; } } diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs index b95efb99c8..94cb93cff5 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs @@ -112,14 +112,8 @@ public ContainerProperties(string id, string partitionKeyPath) /// Initializes a new instance of the class for the Azure Cosmos DB service. /// /// The Id of the resource in the Azure Cosmos service. - /// The path to the partition key. Example: /location -#if PREVIEW - public -#else - internal -#endif - - ContainerProperties(string id, IReadOnlyList partitionKeyPaths) + /// The paths of the hierarchical partition keys. Example: ["/tenantId", "/userId"] + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths) { this.Id = id; @@ -347,12 +341,11 @@ public string PartitionKeyPath { get { -#if PREVIEW if (this.PartitionKey?.Kind == PartitionKind.MultiHash && this.PartitionKey?.Paths.Count > 1) { - throw new NotImplementedException($"This MultiHash collection has more than 1 partition key path please use `PartitionKeyPaths`"); + throw new NotImplementedException($"This subpartitioned container has more than 1 partition key path please use `PartitionKeyPaths`"); } -#endif + return this.PartitionKey?.Paths != null && this.PartitionKey.Paths.Count > 0 ? this.PartitionKey?.Paths[0] : null; } set @@ -377,15 +370,10 @@ public string PartitionKeyPath } /// - /// JSON path used for containers partitioning + /// List of JSON paths used for containers with hierarchical partition keys /// [JsonIgnore] -#if PREVIEW - public -#else - internal -#endif - IReadOnlyList PartitionKeyPaths + public IReadOnlyList PartitionKeyPaths { get => this.PartitionKey?.Paths; set @@ -657,12 +645,10 @@ internal IReadOnlyList> PartitionKeyPathTokens throw new ArgumentOutOfRangeException($"Container {this.Id} is not partitioned"); } -#if PREVIEW if (this.PartitionKey.Kind == Documents.PartitionKind.MultiHash && this.PartitionKeyPaths == null) { throw new ArgumentOutOfRangeException($"Container {this.Id} is not partitioned"); } -#endif List> partitionKeyPathTokensList = new List>(); foreach (string path in this.PartitionKey?.Paths) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs index 07cb6a4dca..f3befc588b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs @@ -11,6 +11,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Linq; using System.Net; using System.Threading.Tasks; + using HttpConstants = Microsoft.Azure.Documents.HttpConstants; using Microsoft.Azure.Cosmos.Resource.CosmosExceptions; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -22,6 +23,7 @@ public class CosmosContainerTests { private CosmosClient cosmosClient = null; private Cosmos.Database cosmosDatabase = null; + private static long ToEpoch(DateTime dateTime) { return (long)(dateTime - new DateTime(1970, 1, 1)).TotalSeconds; @@ -713,7 +715,6 @@ public async Task GetFeedRangeOnContainerRecreateScenariosTestAsync() } } -#if PREVIEW //MultiHash container checks. [TestMethod] public async Task CreateContainerIfNotExistsAsyncForMultiHashCollectionsTest() @@ -798,7 +799,6 @@ public async Task CreateContainerIfNotExistsAsyncForMultiHashCollectionsTest() } -#endif [TestMethod] public async Task StreamPartitionedCreateWithPathDelete() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs index 3c590092db..5307145dfc 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs @@ -18,13 +18,9 @@ public class CosmosMultiHashTest private Container container = null; private ContainerProperties containerProperties = null; - private readonly string currentVersion = HttpConstants.Versions.CurrentVersion; - - [TestInitialize] public async Task TestInitialize() { - HttpConstants.Versions.CurrentVersion = "2020-07-15"; this.client = TestCommon.CreateCosmosClient(true); this.database = await this.client.CreateDatabaseIfNotExistsAsync("mydb"); @@ -37,9 +33,6 @@ public async Task Cleanup() { await this.database.DeleteAsync(); this.client.Dispose(); - - HttpConstants.Versions.CurrentVersion = this.currentVersion; - this.client.Dispose(); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs index c3949d763f..d215b6b18b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs @@ -510,44 +510,7 @@ await container.CreateItemAsync( await database.DeleteAsync(); client.Dispose(); - } - -#if PREVIEW - [TestMethod] - public async Task ReadManyMultiplePK() - { - IReadOnlyList pkPaths = new List { "/pk", "/description" }; - ContainerProperties containerSettings = new ContainerProperties(id: Guid.NewGuid().ToString(), partitionKeyPaths: pkPaths); - Container container = await this.database.CreateContainerAsync(containerSettings); - - for (int i = 0; i < 5; i++) - { - ToDoActivity item = ToDoActivity.CreateRandomToDoActivity(); - item.pk = "pk" + i.ToString(); - item.id = i.ToString(); - item.description = "description" + i; - ItemResponse itemResponse = await container.CreateItemAsync(item); - Assert.AreEqual(HttpStatusCode.Created, itemResponse.StatusCode); - } - - List<(string, PartitionKey)> itemList = new List<(string, PartitionKey)>(); - for (int i = 0; i < 5; i++) - { - PartitionKey partitionKey = new PartitionKeyBuilder() - .Add("pk" + i) - .Add("description" + i) - .Build(); - - itemList.Add((i.ToString(), partitionKey)); - } - - FeedResponse feedResponse = await container.ReadManyItemsAsync(itemList); - Assert.IsNotNull(feedResponse); - Assert.AreEqual(feedResponse.Count, 5); - Assert.IsTrue(feedResponse.Headers.RequestCharge > 0); - Assert.IsNotNull(feedResponse.Diagnostics); - } -#endif + } private class NestedToDoActivity { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/ContractTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/ContractTests.cs index 9501dee4ce..a4d295a634 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/ContractTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/ContractTests.cs @@ -23,13 +23,9 @@ public void ApiVersionTest() } catch(ArgumentNullException) { } -#if PREVIEW + Assert.AreEqual(HttpConstants.Versions.v2020_07_15, HttpConstants.Versions.CurrentVersion); CollectionAssert.AreEqual(Encoding.UTF8.GetBytes(HttpConstants.Versions.v2020_07_15), HttpConstants.Versions.CurrentVersionUTF8); -#else - Assert.AreEqual(HttpConstants.Versions.v2018_12_31, HttpConstants.Versions.CurrentVersion); - CollectionAssert.AreEqual(Encoding.UTF8.GetBytes(HttpConstants.Versions.v2018_12_31), HttpConstants.Versions.CurrentVersionUTF8); -#endif ulong capabilitites = SDKSupportedCapabilitiesHelpers.GetSDKSupportedCapabilities(); Assert.AreEqual(capabilitites & (ulong)SDKSupportedCapabilities.PartitionMerge, (ulong)SDKSupportedCapabilities.PartitionMerge); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index 43801584fe..39ae1d2eca 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -284,32 +284,10 @@ "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedPolicy get_ChangeFeedPolicy();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, - "System.Collections.Generic.IReadOnlyList`1[System.String] get_PartitionKeyPaths()": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "System.Collections.Generic.IReadOnlyList`1[System.String] get_PartitionKeyPaths();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "System.Collections.Generic.IReadOnlyList`1[System.String] PartitionKeyPaths[Newtonsoft.Json.JsonIgnoreAttribute()]": { - "Type": "Property", - "Attributes": [ - "JsonIgnoreAttribute" - ], - "MethodInfo": "System.Collections.Generic.IReadOnlyList`1[System.String] PartitionKeyPaths;CanRead:True;CanWrite:True;System.Collections.Generic.IReadOnlyList`1[System.String] get_PartitionKeyPaths();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_PartitionKeyPaths(System.Collections.Generic.IReadOnlyList`1[System.String]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Void .ctor(System.String, System.Collections.Generic.IReadOnlyList`1[System.String])": { - "Type": "Constructor", - "Attributes": [], - "MethodInfo": "[Void .ctor(System.String, System.Collections.Generic.IReadOnlyList`1[System.String]), Void .ctor(System.String, System.Collections.Generic.IReadOnlyList`1[System.String])]" - }, "Void set_ChangeFeedPolicy(Microsoft.Azure.Cosmos.ChangeFeedPolicy)": { "Type": "Method", "Attributes": [], "MethodInfo": "Void set_ChangeFeedPolicy(Microsoft.Azure.Cosmos.ChangeFeedPolicy);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Void set_PartitionKeyPaths(System.Collections.Generic.IReadOnlyList`1[System.String])": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Void set_PartitionKeyPaths(System.Collections.Generic.IReadOnlyList`1[System.String]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {} @@ -384,47 +362,6 @@ } }, "NestedTypes": {} - }, - "Microsoft.Azure.Cosmos.PartitionKeyBuilder;System.Object;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { - "Subclasses": {}, - "Members": { - "Microsoft.Azure.Cosmos.PartitionKey Build()": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKey Build();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(Boolean)": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(Double)": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(Double);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(System.String)": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.PartitionKeyBuilder AddNoneType()": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder AddNoneType();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.PartitionKeyBuilder AddNullValue()": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder AddNullValue();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Void .ctor()": { - "Type": "Constructor", - "Attributes": [], - "MethodInfo": "[Void .ctor(), Void .ctor()]" - } - }, - "NestedTypes": {} } }, "Members": {}, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 9edd8d6de1..3cf5c017c2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -2167,6 +2167,18 @@ ], "MethodInfo": "Microsoft.Azure.Cosmos.UniqueKeyPolicy UniqueKeyPolicy;CanRead:True;CanWrite:True;Microsoft.Azure.Cosmos.UniqueKeyPolicy get_UniqueKeyPolicy();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_UniqueKeyPolicy(Microsoft.Azure.Cosmos.UniqueKeyPolicy);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "System.Collections.Generic.IReadOnlyList`1[System.String] get_PartitionKeyPaths()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.Collections.Generic.IReadOnlyList`1[System.String] get_PartitionKeyPaths();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Collections.Generic.IReadOnlyList`1[System.String] PartitionKeyPaths[Newtonsoft.Json.JsonIgnoreAttribute()]": { + "Type": "Property", + "Attributes": [ + "JsonIgnoreAttribute" + ], + "MethodInfo": "System.Collections.Generic.IReadOnlyList`1[System.String] PartitionKeyPaths;CanRead:True;CanWrite:True;System.Collections.Generic.IReadOnlyList`1[System.String] get_PartitionKeyPaths();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_PartitionKeyPaths(System.Collections.Generic.IReadOnlyList`1[System.String]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "System.Nullable`1[Microsoft.Azure.Cosmos.PartitionKeyDefinitionVersion] get_PartitionKeyDefinitionVersion()": { "Type": "Method", "Attributes": [], @@ -2294,6 +2306,11 @@ "Attributes": [], "MethodInfo": "[Void .ctor(), Void .ctor()]" }, + "Void .ctor(System.String, System.Collections.Generic.IReadOnlyList`1[System.String])": { + "Type": "Constructor", + "Attributes": [], + "MethodInfo": "[Void .ctor(System.String, System.Collections.Generic.IReadOnlyList`1[System.String]), Void .ctor(System.String, System.Collections.Generic.IReadOnlyList`1[System.String])]" + }, "Void .ctor(System.String, System.String)": { "Type": "Constructor", "Attributes": [], @@ -2348,6 +2365,11 @@ "Attributes": [], "MethodInfo": "Void set_PartitionKeyPath(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Void set_PartitionKeyPaths(System.Collections.Generic.IReadOnlyList`1[System.String])": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Void set_PartitionKeyPaths(System.Collections.Generic.IReadOnlyList`1[System.String]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Void set_TimeToLivePropertyPath(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ @@ -5589,6 +5611,47 @@ }, "NestedTypes": {} }, + "Microsoft.Azure.Cosmos.PartitionKeyBuilder;System.Object;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "Microsoft.Azure.Cosmos.PartitionKey Build()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKey Build();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(Boolean)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(Double)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(Double);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(System.String)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.PartitionKeyBuilder AddNoneType()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder AddNoneType();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.PartitionKeyBuilder AddNullValue()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder AddNullValue();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void .ctor()": { + "Type": "Constructor", + "Attributes": [], + "MethodInfo": "[Void .ctor(), Void .ctor()]" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.PartitionKeyDefinitionVersion;System.Enum;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:True;IsClass:False;IsValueType:True;IsNested:False;IsGenericType:False;IsSerializable:True": { "Subclasses": {}, "Members": { From d0c05781c6953128167b0a0eb4b023d2e56066c2 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Wed, 22 Mar 2023 19:47:03 -0700 Subject: [PATCH 076/240] Change Feed Processor: Fixes LeaseLostException leaks on notification APIs for Renew scenarios (#3775) * Adding cases * Tests --- .../DocumentServiceLeaseManagerCosmos.cs | 48 ++++- .../DocumentServiceLeaseManagerCosmosTests.cs | 195 ++++++++++++++++++ 2 files changed, 239 insertions(+), 4 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/LeaseManagement/DocumentServiceLeaseManagerCosmos.cs b/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/LeaseManagement/DocumentServiceLeaseManagerCosmos.cs index 260bff3161..d5a75abb47 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/LeaseManagement/DocumentServiceLeaseManagerCosmos.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/LeaseManagement/DocumentServiceLeaseManagerCosmos.cs @@ -190,7 +190,17 @@ await this.leaseUpdater.UpdateLeaseAsync( if (serverLease.Owner != lease.Owner) { DefaultTrace.TraceInformation("Lease with token {0} no need to release lease. The lease was already taken by another host '{1}'.", lease.CurrentLeaseToken, serverLease.Owner); - throw new LeaseLostException(lease); + throw new LeaseLostException( + lease, + CosmosExceptionFactory.Create( + statusCode: HttpStatusCode.PreconditionFailed, + message: $"{lease.CurrentLeaseToken} lease token was taken over by owner '{serverLease.Owner}'", + headers: new Headers(), + stackTrace: default, + trace: NoOpTrace.Singleton, + error: default, + innerException: default), + isGone: false); } serverLease.Owner = null; return serverLease; @@ -232,7 +242,17 @@ public override async Task RenewAsync(DocumentServiceLease if (serverLease.Owner != lease.Owner) { DefaultTrace.TraceInformation("Lease with token {0} was taken over by owner '{1}'", lease.CurrentLeaseToken, serverLease.Owner); - throw new LeaseLostException(lease); + throw new LeaseLostException( + lease, + CosmosExceptionFactory.Create( + statusCode: HttpStatusCode.PreconditionFailed, + message: $"{lease.CurrentLeaseToken} lease token was taken over by owner '{serverLease.Owner}'", + headers: new Headers(), + stackTrace: default, + trace: NoOpTrace.Singleton, + error: default, + innerException: default), + isGone: false); } return serverLease; }).ConfigureAwait(false); @@ -245,7 +265,17 @@ public override async Task UpdatePropertiesAsync(DocumentS if (lease.Owner != this.options.HostName) { DefaultTrace.TraceInformation("Lease with token '{0}' was taken over by owner '{1}' before lease properties update", lease.CurrentLeaseToken, lease.Owner); - throw new LeaseLostException(lease); + throw new LeaseLostException( + lease, + CosmosExceptionFactory.Create( + statusCode: HttpStatusCode.PreconditionFailed, + message: $"{lease.CurrentLeaseToken} lease token was taken over by owner '{lease.Owner}'", + headers: new Headers(), + stackTrace: default, + trace: NoOpTrace.Singleton, + error: default, + innerException: default), + isGone: false); } return await this.leaseUpdater.UpdateLeaseAsync( @@ -257,7 +287,17 @@ public override async Task UpdatePropertiesAsync(DocumentS if (serverLease.Owner != lease.Owner) { DefaultTrace.TraceInformation("Lease with token '{0}' was taken over by owner '{1}'", lease.CurrentLeaseToken, serverLease.Owner); - throw new LeaseLostException(lease); + throw new LeaseLostException( + lease, + CosmosExceptionFactory.Create( + statusCode: HttpStatusCode.PreconditionFailed, + message: $"{lease.CurrentLeaseToken} lease token was taken over by owner '{serverLease.Owner}'", + headers: new Headers(), + stackTrace: default, + trace: NoOpTrace.Singleton, + error: default, + innerException: default), + isGone: false); } serverLease.Properties = lease.Properties; return serverLease; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/DocumentServiceLeaseManagerCosmosTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/DocumentServiceLeaseManagerCosmosTests.cs index 19a0710e66..88f945ae43 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/DocumentServiceLeaseManagerCosmosTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ChangeFeed/DocumentServiceLeaseManagerCosmosTests.cs @@ -356,6 +356,201 @@ public async Task IfOwnerChangedThrow() && innerCosmosException.StatusCode == HttpStatusCode.PreconditionFailed); } + /// + /// Verifies that if the renewed read a different Owner from the captured in memory, throws a LeaseLost + /// + [TestMethod] + public async Task IfOwnerChangedThrowOnRenew() + { + DocumentServiceLeaseStoreManagerOptions options = new DocumentServiceLeaseStoreManagerOptions + { + HostName = Guid.NewGuid().ToString() + }; + + DocumentServiceLeaseCore lease = new DocumentServiceLeaseCore() + { + LeaseToken = "0", + Owner = Guid.NewGuid().ToString(), + FeedRange = new FeedRangePartitionKeyRange("0") + }; + + Mock mockUpdater = new Mock(); + + Func, bool> validateUpdater = (Func updater) => + { + // Simulate dirty read from db + DocumentServiceLeaseCore serverLease = new DocumentServiceLeaseCore() + { + LeaseToken = "0", + Owner = Guid.NewGuid().ToString(), + FeedRange = new FeedRangePartitionKeyRange("0") + }; + DocumentServiceLease afterUpdateLease = updater(serverLease); + return true; + }; + + mockUpdater.Setup(c => c.UpdateLeaseAsync( + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.Is>(f => validateUpdater(f)))) + .ReturnsAsync(lease); + + ResponseMessage leaseResponse = new ResponseMessage(System.Net.HttpStatusCode.OK) + { + Content = new CosmosJsonDotNetSerializer().ToStream(lease) + }; + + Mock leaseContainer = new Mock(); + leaseContainer.Setup(c => c.ReadItemStreamAsync( + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny())).ReturnsAsync(leaseResponse); + + DocumentServiceLeaseManagerCosmos documentServiceLeaseManagerCosmos = new DocumentServiceLeaseManagerCosmos( + Mock.Of(), + leaseContainer.Object, + mockUpdater.Object, + options, + Mock.Of()); + + LeaseLostException leaseLost = await Assert.ThrowsExceptionAsync(() => documentServiceLeaseManagerCosmos.RenewAsync(lease)); + + Assert.IsTrue(leaseLost.InnerException is CosmosException innerCosmosException + && innerCosmosException.StatusCode == HttpStatusCode.PreconditionFailed); + } + + /// + /// Verifies that if the update properties read a different Owner from the captured in memory, throws a LeaseLost + /// + [TestMethod] + public async Task IfOwnerChangedThrowOnUpdateProperties() + { + DocumentServiceLeaseCore lease = new DocumentServiceLeaseCore() + { + LeaseToken = "0", + Owner = Guid.NewGuid().ToString(), + FeedRange = new FeedRangePartitionKeyRange("0") + }; + + DocumentServiceLeaseStoreManagerOptions options = new DocumentServiceLeaseStoreManagerOptions + { + HostName = lease.Owner + }; + + Mock mockUpdater = new Mock(); + + Func, bool> validateUpdater = (Func updater) => + { + // Simulate dirty read from db + DocumentServiceLeaseCore serverLease = new DocumentServiceLeaseCore() + { + LeaseToken = "0", + Owner = Guid.NewGuid().ToString(), + FeedRange = new FeedRangePartitionKeyRange("0") + }; + DocumentServiceLease afterUpdateLease = updater(serverLease); + return true; + }; + + mockUpdater.Setup(c => c.UpdateLeaseAsync( + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.Is>(f => validateUpdater(f)))) + .ReturnsAsync(lease); + + ResponseMessage leaseResponse = new ResponseMessage(System.Net.HttpStatusCode.OK) + { + Content = new CosmosJsonDotNetSerializer().ToStream(lease) + }; + + Mock leaseContainer = new Mock(); + leaseContainer.Setup(c => c.ReadItemStreamAsync( + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny())).ReturnsAsync(leaseResponse); + + DocumentServiceLeaseManagerCosmos documentServiceLeaseManagerCosmos = new DocumentServiceLeaseManagerCosmos( + Mock.Of(), + leaseContainer.Object, + mockUpdater.Object, + options, + Mock.Of()); + + LeaseLostException leaseLost = await Assert.ThrowsExceptionAsync(() => documentServiceLeaseManagerCosmos.UpdatePropertiesAsync(lease)); + + Assert.IsTrue(leaseLost.InnerException is CosmosException innerCosmosException + && innerCosmosException.StatusCode == HttpStatusCode.PreconditionFailed); + } + + /// + /// Verifies that if the update properties read a different Owner from the captured in memory, throws a LeaseLost + /// + [TestMethod] + public async Task IfOwnerChangedThrowOnRelease() + { + DocumentServiceLeaseStoreManagerOptions options = new DocumentServiceLeaseStoreManagerOptions + { + HostName = Guid.NewGuid().ToString() + }; + + DocumentServiceLeaseCore lease = new DocumentServiceLeaseCore() + { + LeaseToken = "0", + Owner = Guid.NewGuid().ToString(), + FeedRange = new FeedRangePartitionKeyRange("0") + }; + + Mock mockUpdater = new Mock(); + + Func, bool> validateUpdater = (Func updater) => + { + // Simulate dirty read from db + DocumentServiceLeaseCore serverLease = new DocumentServiceLeaseCore() + { + LeaseToken = "0", + Owner = Guid.NewGuid().ToString(), + FeedRange = new FeedRangePartitionKeyRange("0") + }; + DocumentServiceLease afterUpdateLease = updater(serverLease); + return true; + }; + + mockUpdater.Setup(c => c.UpdateLeaseAsync( + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.Is>(f => validateUpdater(f)))) + .ReturnsAsync(lease); + + ResponseMessage leaseResponse = new ResponseMessage(System.Net.HttpStatusCode.OK) + { + Content = new CosmosJsonDotNetSerializer().ToStream(lease) + }; + + Mock leaseContainer = new Mock(); + leaseContainer.Setup(c => c.ReadItemStreamAsync( + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny())).ReturnsAsync(leaseResponse); + + DocumentServiceLeaseManagerCosmos documentServiceLeaseManagerCosmos = new DocumentServiceLeaseManagerCosmos( + Mock.Of(), + leaseContainer.Object, + mockUpdater.Object, + options, + Mock.Of()); + + LeaseLostException leaseLost = await Assert.ThrowsExceptionAsync(() => documentServiceLeaseManagerCosmos.ReleaseAsync(lease)); + + Assert.IsTrue(leaseLost.InnerException is CosmosException innerCosmosException + && innerCosmosException.StatusCode == HttpStatusCode.PreconditionFailed); + } + /// /// When a lease is missing the range information, check that we are adding it /// From 4ab62933d2e8ab33c5ad1be7d2d9e711d1a51776 Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Thu, 23 Mar 2023 10:57:39 -0700 Subject: [PATCH 077/240] Upgrade Resiliency: Refactors GatewayAddressCache to Mark TransportAddresses to Unhealthy when Connection Reset Event Occurs (#3768) * Code changes to mark the transport uri to unhealthy for which a connection reset event occures through the connection state listener. * Code changes to bump up the direct version. * Code changes to clean up Gateway Address Cache. * Code changes to fix pipeline build. * Code changes to fix serilization test failures. * Code changes to add force refresh to the gateway function callback delegate. --- Directory.Build.props | 2 +- .../src/Routing/GatewayAddressCache.cs | 61 ++++++++++--------- .../src/Routing/GlobalAddressResolver.cs | 25 ++------ .../GatewayAddressCacheTests.cs | 38 ++++++++---- .../Tracing/TraceTests.cs | 2 + 5 files changed, 66 insertions(+), 62 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index e7ca7a8727..39004a08ab 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,7 +3,7 @@ 3.32.2 3.32.2 preview - 3.30.2 + 3.30.4 2.0.1 2.0.1 preview diff --git a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs index b577443761..eba425fb0d 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs @@ -387,7 +387,13 @@ private static void LogPartitionCacheRefresh( } } - public void TryRemoveAddresses( + /// + /// Marks the to Unhealthy that matches with the faulted + /// server key. + /// + /// An instance of that contains the host and + /// port of the backend replica. + public async Task MarkAddressesToUnhealthyAsync( ServerKey serverKey) { if (serverKey == null) @@ -395,7 +401,7 @@ public void TryRemoveAddresses( throw new ArgumentNullException(nameof(serverKey)); } - if (this.serverPartitionAddressToPkRangeIdMap.TryRemove(serverKey, out HashSet pkRangeIds)) + if (this.serverPartitionAddressToPkRangeIdMap.TryGetValue(serverKey, out HashSet pkRangeIds)) { PartitionKeyRangeIdentity[] pkRangeIdsCopy; lock (pkRangeIds) @@ -405,36 +411,35 @@ public void TryRemoveAddresses( foreach (PartitionKeyRangeIdentity pkRangeId in pkRangeIdsCopy) { - DefaultTrace.TraceInformation("Remove addresses for collectionRid :{0}, pkRangeId: {1}, serviceEndpoint: {2}", - pkRangeId.CollectionRid, - pkRangeId.PartitionKeyRangeId, - this.serviceEndpoint); - - this.serverPartitionAddressCache.TryRemove(pkRangeId); - } - } - } - - public async Task UpdateAsync( - PartitionKeyRangeIdentity partitionKeyRangeIdentity, - CancellationToken cancellationToken) - { - if (partitionKeyRangeIdentity == null) - { - throw new ArgumentNullException(nameof(partitionKeyRangeIdentity)); - } - - cancellationToken.ThrowIfCancellationRequested(); - - return await this.serverPartitionAddressCache.GetAsync( - key: partitionKeyRangeIdentity, + // The forceRefresh flag is set to true for the callback delegate is because, if the GetAsync() from the async + // non-blocking cache fails to look up the pkRangeId, then there are some inconsistency present in the cache, and it is + // more safe to do a force refresh to fetch the addresses from the gateway, instead of fetching it from the cache itself. + // Please note that, the chances of encountering such scenario is highly unlikely. + PartitionAddressInformation addressInfo = await this.serverPartitionAddressCache.GetAsync( + key: pkRangeId, singleValueInitFunc: (_) => this.GetAddressesForRangeIdAsync( null, cachedAddresses: null, - partitionKeyRangeIdentity.CollectionRid, - partitionKeyRangeIdentity.PartitionKeyRangeId, + pkRangeId.CollectionRid, + pkRangeId.PartitionKeyRangeId, forceRefresh: true), - forceRefresh: (_) => true); + forceRefresh: (_) => false); + + IReadOnlyList transportAddresses = addressInfo.Get(Protocol.Tcp)?.ReplicaTransportAddressUris; + foreach (TransportAddressUri address in from TransportAddressUri transportAddress in transportAddresses + where serverKey.Equals(transportAddress.ReplicaServerKey) + select transportAddress) + { + DefaultTrace.TraceInformation("Marking a backend replica to Unhealthy for collectionRid :{0}, pkRangeId: {1}, serviceEndpoint: {2}, transportAddress: {3}", + pkRangeId.CollectionRid, + pkRangeId.PartitionKeyRangeId, + this.serviceEndpoint, + address.ToString()); + + address.SetUnhealthy(); + } + } + } } private async Task> ResolveMasterAsync(DocumentServiceRequest request, bool forceRefresh) diff --git a/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs b/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs index 51a6c6d2f3..344f994395 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs @@ -228,33 +228,16 @@ public async Task ResolveAsync( } public async Task UpdateAsync( - IReadOnlyList addressCacheTokens, - CancellationToken cancellationToken) - { - List tasks = new List(); - - foreach (AddressCacheToken cacheToken in addressCacheTokens) - { - if (this.addressCacheByEndpoint.TryGetValue(cacheToken.ServiceEndpoint, out EndpointCache endpointCache)) - { - tasks.Add(endpointCache.AddressCache.UpdateAsync(cacheToken.PartitionKeyRangeIdentity, cancellationToken)); - } - } - - await Task.WhenAll(tasks); - } - - public Task UpdateAsync( ServerKey serverKey, CancellationToken cancellationToken) { foreach (KeyValuePair addressCache in this.addressCacheByEndpoint) { - // since we don't know which address cache contains the pkRanges mapped to this node, we do a tryRemove on all AddressCaches of all regions - addressCache.Value.AddressCache.TryRemoveAddresses(serverKey); + // since we don't know which address cache contains the pkRanges mapped to this node, + // we mark all transport uris that has the same server key to unhealthy status in the + // AddressCaches of all regions. + await addressCache.Value.AddressCache.MarkAddressesToUnhealthyAsync(serverKey); } - - return Task.CompletedTask; } /// diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs index 9e3b87ec83..809814aef1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs @@ -18,6 +18,8 @@ namespace Microsoft.Azure.Cosmos using Microsoft.Azure.Cosmos.Tests; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; + using Microsoft.Azure.Documents.Client; + using Microsoft.Azure.Documents.Rntbd; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; @@ -108,8 +110,11 @@ public void TestGatewayAddressCacheAutoRefreshOnSuboptimalPartition() public async Task TestGatewayAddressCacheUpdateOnConnectionResetAsync() { FakeMessageHandler messageHandler = new FakeMessageHandler(); - HttpClient httpClient = new HttpClient(messageHandler); - httpClient.Timeout = TimeSpan.FromSeconds(120); + HttpClient httpClient = new HttpClient(messageHandler) + { + Timeout = TimeSpan.FromSeconds(120) + }; + GatewayAddressCache cache = new GatewayAddressCache( new Uri(GatewayAddressCacheTests.DatabaseAccountApiEndpoint), Documents.Client.Protocol.Tcp, @@ -129,8 +134,9 @@ public async Task TestGatewayAddressCacheUpdateOnConnectionResetAsync() Assert.IsNotNull(addresses.AllAddresses.Select(address => address.PhysicalUri == "https://blabla.com")); - // call updateAddress - cache.TryRemoveAddresses(new Documents.Rntbd.ServerKey(new Uri("https://blabla.com"))); + // Mark transport addresses to Unhealthy depcting a connection reset event. + ServerKey faultyServerKey = new (new Uri("https://blabla2.com")); + await cache.MarkAddressesToUnhealthyAsync(faultyServerKey); // check if the addresss is updated addresses = await cache.TryGetAddressesAsync( @@ -140,7 +146,15 @@ public async Task TestGatewayAddressCacheUpdateOnConnectionResetAsync() false, CancellationToken.None); - Assert.IsNotNull(addresses.AllAddresses.Select(address => address.PhysicalUri == "https://blabla5.com")); + // Validate that the above transport uri with host blabla2.com has been marked Unhealthy. + IReadOnlyList transportAddressUris = addresses + .Get(Protocol.Tcp)? + .ReplicaTransportAddressUris; + + TransportAddressUri transportAddressUri = transportAddressUris + .Single(x => x.ReplicaServerKey.Equals(faultyServerKey)); + + Assert.IsTrue(condition: transportAddressUri.GetCurrentHealthState().GetHealthStatus().Equals(TransportAddressHealthState.HealthStatus.Unhealthy)); } [TestMethod] @@ -1458,23 +1472,23 @@ public int GetMethodInvocationCount() } Task IOpenConnectionsHandler.TryOpenRntbdChannelsAsync( - IReadOnlyList addresses) + IEnumerable addresses) { - this.totalReceivedAddressesCounter = addresses.Count; - for (int i = 0; i < addresses.Count; i++) + this.totalReceivedAddressesCounter = addresses.Count(); + for (int i = 0; i < addresses.Count(); i++) { if (this.useAttemptBasedFailingIndexs) { if (this.failIndexesByAttempts.ContainsKey(i) && this.failIndexesByAttempts[i].Contains(this.methodInvocationCounter)) { this.ExecuteFailureCondition( - addresses: addresses, + addresses: addresses.ToList(), index: i); } else { this.ExecuteSuccessCondition( - addresses: addresses, + addresses: addresses.ToList(), index: i); } } @@ -1483,13 +1497,13 @@ Task IOpenConnectionsHandler.TryOpenRntbdChannelsAsync( if (this.failingIndexes.Contains(i)) { this.ExecuteFailureCondition( - addresses: addresses, + addresses: addresses.ToList(), index: i); } else { this.ExecuteSuccessCondition( - addresses: addresses, + addresses: addresses.ToList(), index: i); } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs index f747d35d22..ff27842308 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs @@ -125,6 +125,8 @@ public void ValidateStoreResultSerialization() storeResultProperties.Remove(nameof(storeResult.Target.Exception)); storeResultProperties.Add("transportRequestTimeline"); storeResultProperties.Remove(nameof(storeResult.Target.TransportRequestStats)); + storeResultProperties.Add("ReplicaHealthStatuses"); + storeResultProperties.Remove(nameof(storeResult.Target.ReplicaHealthStatuses)); foreach (string key in jsonPropertyNames) { From d822239439c6b42973525fd2910720b69c464253 Mon Sep 17 00:00:00 2001 From: Achint-Agrawal <45819170+Achint-Agrawal@users.noreply.github.com> Date: Tue, 28 Mar 2023 01:50:11 +0530 Subject: [PATCH 078/240] [Preview] PriorityBasedExecution: Adds PriorityLevel as a RequestOption (#3672) * Added Priority Level as a Request Option * Changed Priority Level Low and High to 1 and 2 respectively * Bumped DirectVersion * Added made PriorityLevel internal for non preview packages * Deleted PriorityLevelTests.cs * Added description of Priority Level in RequestOptions.cs * Modified comments for PriorityLevel in RequestOptions.cs * Updated Contracts * Modified Remarks for PriorityLevel and added see also link. * Updated contracts --------- Co-authored-by: Matias Quaranta --- Microsoft.Azure.Cosmos/src/DocumentClient.cs | 5 ++ .../src/RequestOptions/RequestOptions.cs | 28 ++++++++++- .../src/Resource/Settings/PriorityLevel.cs | 39 ++++++++++++++++ .../Contracts/DotNetPreviewSDKAPI.json | 46 +++++++++++++++++++ 4 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 Microsoft.Azure.Cosmos/src/Resource/Settings/PriorityLevel.cs diff --git a/Microsoft.Azure.Cosmos/src/DocumentClient.cs b/Microsoft.Azure.Cosmos/src/DocumentClient.cs index c7504d312c..cbd4e06674 100644 --- a/Microsoft.Azure.Cosmos/src/DocumentClient.cs +++ b/Microsoft.Azure.Cosmos/src/DocumentClient.cs @@ -6909,6 +6909,11 @@ private INameValueCollection GetRequestHeaders( headers.Set(HttpConstants.HttpHeaders.ConsistencyLevel, options.ConsistencyLevel.ToString()); } + if (options.PriorityLevel.HasValue) + { + headers.Set(HttpConstants.HttpHeaders.PriorityLevel, options.PriorityLevel.ToString()); + } + if (options.IndexingDirective.HasValue) { headers.Set(HttpConstants.HttpHeaders.IndexingDirective, options.IndexingDirective.ToString()); diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs index 5387a0fbac..dc02f9a248 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs @@ -42,11 +42,32 @@ public class RequestOptions /// public Action AddRequestHeaders { get; set; } + /// + /// Gets or sets the priority level for a request. + /// + /// + /// Setting priority level only has an effect if Priority Based Execution is enabled. + /// If it is not enabled, the priority level is ignored by the backend. + /// Default PriorityLevel for each request is treated as High. It can be explicitly set to Low for some requests. + /// When Priority based execution is enabled, if there are more requests than the configured RU/S in a second, + /// then Cosmos DB will throttle low priority requests to allow high priority requests to execute. + /// This does not limit the throughput available to each priority level. Each priority level can consume the complete + /// provisioned throughput in absence of the other. If both priorities are present and the user goes above the + /// configured RU/s, low priority requests start getting throttled first to allow execution of mission critical workloads. + /// + /// +#if PREVIEW + public +#else + internal +#endif + PriorityLevel? PriorityLevel { get; set; } + /// /// Set Request Level Distributed Tracing Options. /// internal DistributedTracingOptions DistributedTracingOptions { get; set; } - + /// /// Gets or sets the boolean to use effective partition key routing in the cosmos db request. /// @@ -91,6 +112,11 @@ internal virtual void PopulateRequestOptions(RequestMessage request) request.Headers.Add(HttpConstants.HttpHeaders.IfNoneMatch, this.IfNoneMatchEtag); } + if (this.PriorityLevel.HasValue) + { + request.Headers.Add(HttpConstants.HttpHeaders.PriorityLevel, this.PriorityLevel.ToString()); + } + this.AddRequestHeaders?.Invoke(request.Headers); } diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/PriorityLevel.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/PriorityLevel.cs new file mode 100644 index 0000000000..6644d0931f --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/PriorityLevel.cs @@ -0,0 +1,39 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos +{ + /// + /// Valid values of Priority Level for a request + /// + /// + /// Setting priority level only has an effect if Priority Based Execution is enabled. + /// If it is not enabled, the priority level is ignored by the backend. + /// Default PriorityLevel for each request is treated as High. It can be explicitly set to Low for some requests. + /// When Priority based execution is enabled, if there are more requests than the configured RU/S in a second, + /// then Cosmos DB will throttle low priority requests to allow high priority requests to execute. + /// This does not limit the throughput available to each priority level. Each priority level can consume the complete + /// provisioned throughput in absence of the other. If both priorities are present and the user goes above the + /// configured RU/s, low priority requests start getting throttled first to allow execution of mission critical workloads. + /// + /// + +#if PREVIEW + public +#else + internal +#endif + enum PriorityLevel + { + /// + /// High Priority + /// + High = 1, + + /// + /// Low Priority + /// + Low = 2, + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index 39ae1d2eca..8a3d326d50 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -362,6 +362,52 @@ } }, "NestedTypes": {} + }, + "Microsoft.Azure.Cosmos.PriorityLevel;System.Enum;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:True;IsClass:False;IsValueType:True;IsNested:False;IsGenericType:False;IsSerializable:True": { + "Subclasses": {}, + "Members": { + "Int32 value__": { + "Type": "Field", + "Attributes": [], + "MethodInfo": "Int32 value__;IsInitOnly:False;IsStatic:False;" + }, + "Microsoft.Azure.Cosmos.PriorityLevel High": { + "Type": "Field", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.PriorityLevel High;IsInitOnly:False;IsStatic:True;" + }, + "Microsoft.Azure.Cosmos.PriorityLevel Low": { + "Type": "Field", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.PriorityLevel Low;IsInitOnly:False;IsStatic:True;" + } + }, + "NestedTypes": {} + }, + "Microsoft.Azure.Cosmos.RequestOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "System.Nullable`1[Microsoft.Azure.Cosmos.PriorityLevel] get_PriorityLevel()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.Nullable`1[Microsoft.Azure.Cosmos.PriorityLevel] get_PriorityLevel();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Nullable`1[Microsoft.Azure.Cosmos.PriorityLevel] PriorityLevel": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.Nullable`1[Microsoft.Azure.Cosmos.PriorityLevel] PriorityLevel;CanRead:True;CanWrite:True;System.Nullable`1[Microsoft.Azure.Cosmos.PriorityLevel] get_PriorityLevel();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_PriorityLevel(System.Nullable`1[Microsoft.Azure.Cosmos.PriorityLevel]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_PriorityLevel(System.Nullable`1[Microsoft.Azure.Cosmos.PriorityLevel])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_PriorityLevel(System.Nullable`1[Microsoft.Azure.Cosmos.PriorityLevel]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} } }, "Members": {}, From 1c544bf651e097aaa696bff0abe8a7a3d651f512 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Wed, 29 Mar 2023 20:50:33 +0530 Subject: [PATCH 079/240] [Internal] Client Telemetry: Adds sampling logic for network level telemetry (#3750) * sampling logic add * throttlinfix * fix tests * fix tests * remove dispose from sampler * add 412 * draft push * refactor code for sampling * clean up * start testing * adding tests * wip * test fix * fix test * fix tests * deleted extra file * remove one toList * add custome logic for sampling * code refactor * replace key * remove commented code from test * added more comments * simpler sampler logic * refactor code --- .../src/Telemetry/ClientTelemetry.cs | 55 ++----- .../src/Telemetry/ClientTelemetryOptions.cs | 34 +---- .../Telemetry/ClientTelemetryPayloadWriter.cs | 22 ++- .../src/Telemetry/ClientTelemetryProcessor.cs | 14 +- .../src/Telemetry/Models/RequestInfo.cs | 31 +++- .../src/Telemetry/NetworkDataRecorder.cs | 139 ++++++++++++++++++ .../src/Telemetry/Sampler/DataSampler.cs | 84 +++++++++++ .../ClientTelemetryTests.cs | 134 ----------------- .../Telemetry/ClientTelemetryTests.cs | 40 ++--- .../Telemetry/DataSamplerTests.cs | 119 +++++++++++++++ .../Telemetry/DiagnosticsFilterHelperTest.cs | 3 - .../Telemetry/NetworkDataRecorderTest.cs | 92 ++++++++++++ 12 files changed, 516 insertions(+), 251 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/src/Telemetry/NetworkDataRecorder.cs create mode 100644 Microsoft.Azure.Cosmos/src/Telemetry/Sampler/DataSampler.cs delete mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientTelemetryTests.cs create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DataSamplerTests.cs create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/NetworkDataRecorderTest.cs diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs index d0ca7d8ac8..8a83778fdb 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs @@ -36,7 +36,8 @@ internal class ClientTelemetry : IDisposable private readonly ClientTelemetryProperties clientTelemetryInfo; private readonly ClientTelemetryProcessor processor; private readonly DiagnosticsHandlerHelper diagnosticsHelper; - + private readonly NetworkDataRecorder networkDataRecorder; + private readonly CancellationTokenSource cancellationTokenSource; private readonly GlobalEndpointManager globalEndpointManager; @@ -49,11 +50,8 @@ internal class ClientTelemetry : IDisposable private ConcurrentDictionary cacheRefreshInfoMap = new ConcurrentDictionary(); - private ConcurrentDictionary requestInfoMap - = new ConcurrentDictionary(); - private int numberOfFailures = 0; - + /// /// Only for Mocking in tests /// @@ -112,6 +110,8 @@ internal ClientTelemetry( GlobalEndpointManager globalEndpointManager) { this.diagnosticsHelper = diagnosticsHelper ?? throw new ArgumentNullException(nameof(diagnosticsHelper)); + this.globalEndpointManager = globalEndpointManager; + this.processor = new ClientTelemetryProcessor(httpClient, authorizationTokenProvider); this.clientTelemetryInfo = new ClientTelemetryProperties( @@ -122,8 +122,9 @@ internal ClientTelemetry( preferredRegions: preferredRegions, aggregationIntervalInSec: (int)observingWindow.TotalSeconds); + this.networkDataRecorder = new NetworkDataRecorder(); + this.cancellationTokenSource = new CancellationTokenSource(); - this.globalEndpointManager = globalEndpointManager; } /// @@ -179,18 +180,15 @@ private async Task EnrichAndSendAsync() ConcurrentDictionary cacheRefreshInfoSnapshot = Interlocked.Exchange(ref this.cacheRefreshInfoMap, new ConcurrentDictionary()); - - ConcurrentDictionary requestInfoSnapshot - = Interlocked.Exchange(ref this.requestInfoMap, new ConcurrentDictionary()); - + try { await this.processor - .ProcessAndSendAsync( + .ProcessAndSendAsync( clientTelemetryInfo: this.clientTelemetryInfo, operationInfoSnapshot: operationInfoSnapshot, cacheRefreshInfoSnapshot: cacheRefreshInfoSnapshot, - requestInfoSnapshot: requestInfoSnapshot, + requestInfoSnapshot: this.networkDataRecorder.GetRequests(), cancellationToken: this.cancellationTokenSource.Token); this.numberOfFailures = 0; @@ -296,7 +294,7 @@ internal void CollectOperationInfo(CosmosDiagnostics cosmosDiagnostics, // Record Network/Replica Information SummaryDiagnostics summaryDiagnostics = new SummaryDiagnostics(trace); - this.RecordRntbdResponses(containerId, databaseId, summaryDiagnostics.StoreResponseStatistics.Value); + this.networkDataRecorder.Record(summaryDiagnostics.StoreResponseStatistics.Value, databaseId, containerId); string regionsContacted = ClientTelemetryHelper.GetContactedRegions(cosmosDiagnostics.GetContactedRegions()); @@ -338,37 +336,6 @@ internal void CollectOperationInfo(CosmosDiagnostics cosmosDiagnostics, } } - /// - /// Records RNTBD calls statistics - /// - /// - /// - /// - private void RecordRntbdResponses(string containerId, string databaseId, List storeResponseStatistics) - { - foreach (StoreResponseStatistics storetatistics in storeResponseStatistics) - { - if (ClientTelemetryOptions.IsEligible((int)storetatistics.StoreResult.StatusCode, (int)storetatistics.StoreResult.SubStatusCode, storetatistics.RequestLatency)) - { - RequestInfo requestInfo = new RequestInfo() - { - DatabaseName = databaseId, - ContainerName = containerId, - Uri = storetatistics.StoreResult.StorePhysicalAddress.ToString(), - StatusCode = (int)storetatistics.StoreResult.StatusCode, - SubStatusCode = (int)storetatistics.StoreResult.SubStatusCode, - Resource = storetatistics.RequestResourceType.ToString(), - Operation = storetatistics.RequestOperationType.ToString(), - }; - - LongConcurrentHistogram latencyHist = this.requestInfoMap.GetOrAdd(requestInfo, x => new LongConcurrentHistogram(ClientTelemetryOptions.RequestLatencyMin, - ClientTelemetryOptions.RequestLatencyMax, - ClientTelemetryOptions.RequestLatencyPrecision)); - latencyHist.RecordValue(storetatistics.RequestLatency.Ticks); - } - } - } - /// /// Dispose of cosmos client.It will get disposed with client so not making it thread safe. /// diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs index f2caaf50d5..47232a187e 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs @@ -88,15 +88,18 @@ internal static class ClientTelemetryOptions internal static readonly ResourceType AllowedResourceTypes = ResourceType.Document; // Why 5 sec? As of now, if any network request is taking more than 5 millisecond sec, we will consider it slow request this value can be revisited in future - private static readonly TimeSpan NetworkLatencyThreshold = TimeSpan.FromMilliseconds(5); + internal static readonly TimeSpan NetworkLatencyThreshold = TimeSpan.FromMilliseconds(5); + internal static readonly int NetworkRequestsSampleSizeThreshold = 10; + internal static readonly JsonSerializerSettings JsonSerializerSettings = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore, MaxDepth = 64, // https://github.com/advisories/GHSA-5crp-9r3c-p9vr }; - private static readonly List ExcludedStatusCodes = new List { 404, 409 }; + internal static readonly List ExcludedStatusCodes = new List { 404, 409, 412 }; + internal static readonly int NetworkTelemetrySampleSize = 200; internal static int PayloadSizeThreshold = 1024 * 1024 * 2; // 2MB private static Uri clientTelemetryEndpoint; @@ -180,32 +183,5 @@ internal static string GetEnvironmentName() } return environmentName; } - - /// - /// This method will return true if the request is failed with User or Server Exception and not excluded from telemetry. - /// This method will return true if the request latency is more than the threshold. - /// otherwise return false - /// - /// - /// - /// - /// true/false - internal static bool IsEligible(int statusCode, int subStatusCode, TimeSpan latencyInMs) - { - return - ClientTelemetryOptions.IsStatusCodeNotExcluded(statusCode, subStatusCode) && - (ClientTelemetryOptions.IsUserOrServerError(statusCode) || latencyInMs >= ClientTelemetryOptions.NetworkLatencyThreshold); - } - - private static bool IsUserOrServerError(int statusCode) - { - return statusCode >= 400 && statusCode <= 599; - } - - private static bool IsStatusCodeNotExcluded(int statusCode, int subStatusCode) - { - return !(ClientTelemetryOptions.ExcludedStatusCodes.Contains(statusCode) && subStatusCode == 0); - } - } } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryPayloadWriter.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryPayloadWriter.cs index 1158c7d639..370d576fcc 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryPayloadWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryPayloadWriter.cs @@ -21,7 +21,7 @@ public static async Task SerializedPayloadChunksAsync( ClientTelemetryProperties properties, ConcurrentDictionary operationInfoSnapshot, ConcurrentDictionary cacheRefreshInfoSnapshot, - ConcurrentDictionary requestInfoSnapshot, + IReadOnlyList sampledRequestInfo, Func callback) { if (properties == null) @@ -46,11 +46,12 @@ public static async Task SerializedPayloadChunksAsync( OperationInfo payloadForRequestCharge = payloadForLatency.Copy(); payloadForRequestCharge.MetricInfo = new MetricInfo(ClientTelemetryOptions.RequestChargeName, ClientTelemetryOptions.RequestChargeUnit); payloadForRequestCharge.SetAggregators(entry.Value.requestcharge, ClientTelemetryOptions.HistogramPrecisionFactor); - + string latencyMetrics = JsonConvert.SerializeObject(payloadForLatency); string requestChargeMetrics = JsonConvert.SerializeObject(payloadForRequestCharge); - - if (lengthNow + latencyMetrics.Length + requestChargeMetrics.Length > ClientTelemetryOptions.PayloadSizeThreshold) + + int thisSectionLength = latencyMetrics.Length + requestChargeMetrics.Length; + if (lengthNow + thisSectionLength > ClientTelemetryOptions.PayloadSizeThreshold) { writer.WriteEndArray(); writer.WriteEndObject(); @@ -98,21 +99,16 @@ public static async Task SerializedPayloadChunksAsync( } - if (requestInfoSnapshot?.Any() == true) + if (sampledRequestInfo?.Any() == true) { writer.WritePropertyName("requestInfo"); writer.WriteStartArray(); - foreach (KeyValuePair entry in requestInfoSnapshot) + foreach (RequestInfo entry in sampledRequestInfo) { long lengthNow = stringBuilder.Length; - - MetricInfo metricInfo = new MetricInfo(ClientTelemetryOptions.RequestLatencyName, ClientTelemetryOptions.RequestLatencyUnit); - metricInfo.SetAggregators(entry.Value, ClientTelemetryOptions.TicksToMsFactor); - - RequestInfo payloadForLatency = entry.Key; - payloadForLatency.Metrics.Add(metricInfo); - string latencyMetrics = JsonConvert.SerializeObject(payloadForLatency); + + string latencyMetrics = JsonConvert.SerializeObject(entry); if (lengthNow + latencyMetrics.Length > ClientTelemetryOptions.PayloadSizeThreshold) { diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryProcessor.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryProcessor.cs index b91eb96832..c9511cb4e4 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryProcessor.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryProcessor.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos.Telemetry { using System; using System.Collections.Concurrent; + using System.Collections.Generic; using System.Net.Http; using System.Text; using System.Threading; @@ -22,7 +23,7 @@ internal class ClientTelemetryProcessor private readonly AuthorizationTokenProvider tokenProvider; private readonly CosmosHttpClient httpClient; - + internal ClientTelemetryProcessor(CosmosHttpClient httpClient, AuthorizationTokenProvider tokenProvider) { this.httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient)); @@ -32,17 +33,12 @@ internal ClientTelemetryProcessor(CosmosHttpClient httpClient, AuthorizationToke /// /// It will create Task to process and send client telemetry payload to Client Telemetry Service. /// - /// - /// - /// - /// - /// /// Task internal async Task ProcessAndSendAsync( ClientTelemetryProperties clientTelemetryInfo, - ConcurrentDictionary operationInfoSnapshot, + ConcurrentDictionary operationInfoSnapshot, ConcurrentDictionary cacheRefreshInfoSnapshot, - ConcurrentDictionary requestInfoSnapshot, + IReadOnlyList requestInfoSnapshot, CancellationToken cancellationToken) { try @@ -51,7 +47,7 @@ await ClientTelemetryPayloadWriter.SerializedPayloadChunksAsync( properties: clientTelemetryInfo, operationInfoSnapshot: operationInfoSnapshot, cacheRefreshInfoSnapshot: cacheRefreshInfoSnapshot, - requestInfoSnapshot: requestInfoSnapshot, + sampledRequestInfo: requestInfoSnapshot, callback: async (payload) => await this.SendAsync(clientTelemetryInfo.GlobalDatabaseAccountName, payload, cancellationToken)); } catch (Exception ex) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/Models/RequestInfo.cs b/Microsoft.Azure.Cosmos/src/Telemetry/Models/RequestInfo.cs index d71f0fa446..382f37260d 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/Models/RequestInfo.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/Models/RequestInfo.cs @@ -37,8 +37,14 @@ internal sealed class RequestInfo public override int GetHashCode() { - int hash = 3; + int hash = this.GetHashCodeForSampler(); hash = (hash * 7) ^ (this.Uri == null ? 0 : this.Uri.GetHashCode()); + return hash; + } + + public int GetHashCodeForSampler() + { + int hash = 3; hash = (hash * 7) ^ (this.DatabaseName == null ? 0 : this.DatabaseName.GetHashCode()); hash = (hash * 7) ^ (this.ContainerName == null ? 0 : this.ContainerName.GetHashCode()); hash = (hash * 7) ^ (this.Operation == null ? 0 : this.Operation.GetHashCode()); @@ -47,7 +53,7 @@ public override int GetHashCode() hash = (hash * 7) ^ (this.SubStatusCode.GetHashCode()); return hash; } - + public override bool Equals(object obj) { bool isequal = obj is RequestInfo payload && @@ -62,5 +68,26 @@ public override bool Equals(object obj) return isequal; } + public double GetP99Latency() + { + foreach (MetricInfo metric in this.Metrics) + { + if (metric.MetricsName.Equals(ClientTelemetryOptions.RequestLatencyName, StringComparison.OrdinalIgnoreCase)) + { + return metric.Percentiles[ClientTelemetryOptions.Percentile99]; + } + } + return Double.MinValue; // least prioity for request info w/o latency info + } + + public double GetSampleCount() + { + return (double)this.Metrics[0].Count; + } + + public override string ToString() + { + return "Latency : " + this.GetP99Latency() + ", SampleCount : " + this.GetSampleCount(); + } } } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/NetworkDataRecorder.cs b/Microsoft.Azure.Cosmos/src/Telemetry/NetworkDataRecorder.cs new file mode 100644 index 0000000000..20e6f975da --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Telemetry/NetworkDataRecorder.cs @@ -0,0 +1,139 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Telemetry +{ + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Threading; + using HdrHistogram; + using Microsoft.Azure.Cosmos.Telemetry.Models; + using static Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum; + + internal class NetworkDataRecorder + { + private ConcurrentDictionary RequestInfoHighLatencyBucket + = new ConcurrentDictionary(); + private ConcurrentDictionary RequestInfoErrorBucket + = new ConcurrentDictionary(); + + public void Record(List storeResponseStatistics, string databaseId, string containerId) + { + foreach (StoreResponseStatistics storeStatistics in storeResponseStatistics) + { + if (NetworkDataRecorder.IsStatusCodeNotExcluded((int)storeStatistics.StoreResult.StatusCode, (int)storeStatistics.StoreResult.SubStatusCode)) + { + if (NetworkDataRecorder.IsUserOrServerError((int)storeStatistics.StoreResult.StatusCode)) + { + RequestInfo requestInfo = this.CreateRequestInfo(storeStatistics, databaseId, containerId); + LongConcurrentHistogram latencyHist = this.RequestInfoErrorBucket.GetOrAdd(requestInfo, x => new LongConcurrentHistogram(ClientTelemetryOptions.RequestLatencyMin, + ClientTelemetryOptions.RequestLatencyMax, + ClientTelemetryOptions.RequestLatencyPrecision)); + latencyHist.RecordValue(storeStatistics.RequestLatency.Ticks); + + } + else + { + RequestInfo requestInfo = this.CreateRequestInfo(storeStatistics, databaseId, containerId); + LongConcurrentHistogram latencyHist = this.RequestInfoHighLatencyBucket.GetOrAdd(requestInfo, x => new LongConcurrentHistogram(ClientTelemetryOptions.RequestLatencyMin, + ClientTelemetryOptions.RequestLatencyMax, + ClientTelemetryOptions.RequestLatencyPrecision)); + latencyHist.RecordValue(storeStatistics.RequestLatency.Ticks); + } + } + } + } + + internal void GetErroredRequests(List requestInfoList) + { + ConcurrentDictionary requestInfoErrorList + = Interlocked.Exchange(ref this.RequestInfoErrorBucket, new ConcurrentDictionary()); + + List allRequests = new List(); + foreach (KeyValuePair entry in requestInfoErrorList) + { + MetricInfo metricInfo = new MetricInfo(ClientTelemetryOptions.RequestLatencyName, ClientTelemetryOptions.RequestLatencyUnit); + metricInfo.SetAggregators(entry.Value, ClientTelemetryOptions.TicksToMsFactor); + + RequestInfo payloadForLatency = entry.Key; + payloadForLatency.Metrics.Add(metricInfo); + + allRequests.Add(payloadForLatency); + } + + requestInfoList.AddRange(DataSampler.OrderAndSample(allRequests, DataSampleCountComparer.Instance)); + } + + internal void GetHighLatencyRequests(List requestInfoList) + { + ConcurrentDictionary requestInfoHighLatencyList + = Interlocked.Exchange(ref this.RequestInfoHighLatencyBucket, new ConcurrentDictionary()); + + List allRequests = new List(); + foreach (KeyValuePair entry in requestInfoHighLatencyList) + { + MetricInfo metricInfo = new MetricInfo(ClientTelemetryOptions.RequestLatencyName, ClientTelemetryOptions.RequestLatencyUnit); + metricInfo.SetAggregators(entry.Value, ClientTelemetryOptions.TicksToMsFactor); + + // Don't record if p99 latency is less than threshold + if (!NetworkDataRecorder.IsHighLatency(metricInfo.Percentiles[ClientTelemetryOptions.Percentile99])) + { + continue; + } + + RequestInfo payloadForLatency = entry.Key; + payloadForLatency.Metrics.Add(metricInfo); + + allRequests.Add(payloadForLatency); + } + + requestInfoList.AddRange(DataSampler.OrderAndSample(allRequests, DataLatencyComparer.Instance)); + } + + internal RequestInfo CreateRequestInfo(StoreResponseStatistics storeResponseStatistic, string databaseId, string containerId) + { + return new RequestInfo() + { + DatabaseName = databaseId, + ContainerName = containerId, + Uri = storeResponseStatistic.StoreResult?.StorePhysicalAddress?.ToString(), + StatusCode = (int)storeResponseStatistic.StoreResult?.StatusCode, + SubStatusCode = (int)storeResponseStatistic.StoreResult?.SubStatusCode, + Resource = storeResponseStatistic.RequestResourceType.ToString(), + Operation = storeResponseStatistic.RequestOperationType.ToString(), + }; + + } + + public List GetRequests() + { + List requestInfoList = new List(); + this.GetErroredRequests(requestInfoList); + this.GetHighLatencyRequests(requestInfoList); + + return requestInfoList; + } + + internal static bool IsHighLatency(double latency) + { + return + latency >= ClientTelemetryOptions.NetworkLatencyThreshold.TotalMilliseconds; + } + + /// + /// This method will return true if the request is failed with User or Server Exception and not excluded from telemetry. + /// otherwise return false + /// + /// true/false + internal static bool IsUserOrServerError(int statusCode) + { + return statusCode >= 400 && statusCode <= 599; + } + + internal static bool IsStatusCodeNotExcluded(int statusCode, int subStatusCode) + { + return !(ClientTelemetryOptions.ExcludedStatusCodes.Contains(statusCode) && subStatusCode == 0); + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/Sampler/DataSampler.cs b/Microsoft.Azure.Cosmos/src/Telemetry/Sampler/DataSampler.cs new file mode 100644 index 0000000000..b01e723365 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Telemetry/Sampler/DataSampler.cs @@ -0,0 +1,84 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Telemetry +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using Microsoft.Azure.Cosmos.Query.Core.Pipeline.CrossPartition.OrderBy; + using Microsoft.Azure.Cosmos.Telemetry.Models; + using Newtonsoft.Json.Linq; + + /// + /// Sampler to select top N unique records and return true/false on the basis of elements already selected. + /// + internal sealed class DataSampler + { + public static List OrderAndSample(List requestInfoList, IComparer comparer) + { + // It will store final result + List sampledData = new List(capacity: requestInfoList.Count); + + // Processing (Grouping, Sorting will happen in this collection) + IDictionary> sampledRawData = new Dictionary>(); + + foreach (RequestInfo requestInfo in requestInfoList) + { + // Get a unique key identifier for an object + int key = requestInfo.GetHashCodeForSampler(); + + // Check if similar object is already present otherwise create a new list and add + if (sampledRawData.TryGetValue(key, out List groupedData)) + { + groupedData.Add(requestInfo); + sampledRawData[key] = groupedData; + } + else + { + sampledRawData.Add(key, new List() { requestInfo }); + } + } + + // If list is greater than threshold then sort it and get top N objects otherwise add list as it is + foreach (List sampledRequestInfo in sampledRawData.Values) + { + if (sampledRequestInfo.Count > ClientTelemetryOptions.NetworkRequestsSampleSizeThreshold) + { + sampledRequestInfo.Sort(comparer); + sampledData.AddRange(sampledRequestInfo.GetRange( + index: 0, + count: ClientTelemetryOptions.NetworkRequestsSampleSizeThreshold)); + } + else + { + sampledData.AddRange(sampledRequestInfo); + } + } + + return sampledData; + } + + } + + internal class DataLatencyComparer : IComparer + { + public static DataLatencyComparer Instance = new DataLatencyComparer(); + public int Compare(RequestInfo a, RequestInfo b) + { + return b.GetP99Latency().CompareTo(a.GetP99Latency()); + } + } + + internal class DataSampleCountComparer : IComparer + { + public static DataSampleCountComparer Instance = new DataSampleCountComparer(); + public int Compare(RequestInfo a, RequestInfo b) + { + return b.GetSampleCount().CompareTo(a.GetSampleCount()); + } + } + +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientTelemetryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientTelemetryTests.cs deleted file mode 100644 index b7e5d1f08e..0000000000 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientTelemetryTests.cs +++ /dev/null @@ -1,134 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ - -namespace Microsoft.Azure.Cosmos.Tests -{ - using System; - using Microsoft.VisualStudio.TestTools.UnitTesting; - using HdrHistogram; - using Newtonsoft.Json; - using Microsoft.Azure.Cosmos.Telemetry; - using System.Collections.Generic; - using Microsoft.Azure.Cosmos.Telemetry.Models; - - /// - /// Tests for . - /// - [TestClass] - public class ClientTelemetryTests - { - [TestCleanup] - public void Cleanup() - { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, null); - } - - [TestMethod] - public void CheckMetricsAggregationLogic() - { - MetricInfo metrics = new MetricInfo("metricsName", "unitName"); - - LongConcurrentHistogram histogram = new LongConcurrentHistogram(1, - long.MaxValue, - 5); - - histogram.RecordValue(10); - histogram.RecordValue(20); - histogram.RecordValue(30); - histogram.RecordValue(40); - - metrics.SetAggregators(histogram); - - Assert.AreEqual(40, metrics.Max); - Assert.AreEqual(10, metrics.Min); - Assert.AreEqual(4, metrics.Count); - Assert.AreEqual(25, metrics.Mean); - - Assert.AreEqual(20, metrics.Percentiles[ClientTelemetryOptions.Percentile50]); - Assert.AreEqual(40, metrics.Percentiles[ClientTelemetryOptions.Percentile90]); - Assert.AreEqual(40, metrics.Percentiles[ClientTelemetryOptions.Percentile95]); - Assert.AreEqual(40, metrics.Percentiles[ClientTelemetryOptions.Percentile99]); - Assert.AreEqual(40, metrics.Percentiles[ClientTelemetryOptions.Percentile999]); - } - - [TestMethod] - public void CheckMetricsAggregationLogicWithAdjustment() - { - MetricInfo metrics = new MetricInfo("metricsName", "unitName"); - long adjustmentFactor = 1000; - - LongConcurrentHistogram histogram = new LongConcurrentHistogram(1, - long.MaxValue, - 5); - - histogram.RecordValue(10 * adjustmentFactor); - histogram.RecordValue(20 * adjustmentFactor); - histogram.RecordValue(30 * adjustmentFactor); - histogram.RecordValue(40 * adjustmentFactor); - - metrics.SetAggregators(histogram, adjustmentFactor); - - Assert.AreEqual(40, metrics.Max); - Assert.AreEqual(10, metrics.Min); - Assert.AreEqual(4, metrics.Count); - - Assert.AreEqual(25, metrics.Mean); - - Assert.AreEqual(20, metrics.Percentiles[ClientTelemetryOptions.Percentile50]); - Assert.AreEqual(40, metrics.Percentiles[ClientTelemetryOptions.Percentile90]); - Assert.AreEqual(40, metrics.Percentiles[ClientTelemetryOptions.Percentile95]); - Assert.AreEqual(40, metrics.Percentiles[ClientTelemetryOptions.Percentile99]); - Assert.AreEqual(40, metrics.Percentiles[ClientTelemetryOptions.Percentile999]); - } - - [TestMethod] - public void CheckJsonSerializerContract() - { - string json = JsonConvert.SerializeObject(new ClientTelemetryProperties(clientId: "clientId", - processId: "", - userAgent: null, - connectionMode: ConnectionMode.Direct, - preferredRegions: null, - aggregationIntervalInSec: 10), ClientTelemetryOptions.JsonSerializerSettings); - Assert.AreEqual("{\"clientId\":\"clientId\",\"processId\":\"\",\"connectionMode\":\"DIRECT\",\"aggregationIntervalInSec\":10,\"systemInfo\":[]}", json); - } - - [TestMethod] - public void CheckJsonSerializerContractWithPreferredRegions() - { - List preferredRegion = new List - { - "region1" - }; - string json = JsonConvert.SerializeObject(new ClientTelemetryProperties(clientId: "clientId", - processId: "", - userAgent: null, - connectionMode: ConnectionMode.Direct, - preferredRegions: preferredRegion, - aggregationIntervalInSec: 1), ClientTelemetryOptions.JsonSerializerSettings); - Assert.AreEqual("{\"clientId\":\"clientId\",\"processId\":\"\",\"connectionMode\":\"DIRECT\",\"preferredRegions\":[\"region1\"],\"aggregationIntervalInSec\":1,\"systemInfo\":[]}", json); - } - - [TestMethod] - [ExpectedException(typeof(FormatException))] - public void CheckMisconfiguredTelemetry_should_fail() - { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, "non-boolean"); - using CosmosClient client = MockCosmosUtil.CreateMockCosmosClient(); - } - - [TestMethod] - [DataRow(200, 0 ,1, false)] - [DataRow(404, 0, 1, false)] - [DataRow(404, 1002, 1, true)] - [DataRow(409, 0, 1, false)] - [DataRow(409, 1002, 1, true)] - [DataRow(503, 2001, 1, true)] - [DataRow(200, 0, 6, true)] - public void CheckEligibleStatistics(int statusCode, int subStatusCode, int latencyInMs, bool expectedFlag) - { - Assert.AreEqual(expectedFlag, ClientTelemetryOptions.IsEligible(statusCode, subStatusCode, TimeSpan.FromMilliseconds(latencyInMs))); - } - } -} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryTests.cs index 48cb0d1e42..4a6b077baa 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryTests.cs @@ -119,10 +119,10 @@ public void CheckJsonSerializerContractWithPreferredRegions() } [TestMethod] - [DataRow(100, 50, 200)] // When operation, cacherefresh and request info is there in payload + [DataRow(150, 50, 200)] // When operation, cacherefresh and request info is there in payload [DataRow(0, 50, 0)] // When only cacherefresh info is there in payload - [DataRow(100, 50, 0)] // When only operation and cacherefresh info is there in payload - [DataRow(100, 0, 0)] // When only operation info is there in payload + [DataRow(150, 50, 0)] // When only operation and cacherefresh info is there in payload + [DataRow(150, 0, 0)] // When only operation info is there in payload public async Task CheckIfPayloadIsDividedCorrectlyAsync(int expectedOperationInfoSize, int expectedCacheRefreshInfoSize, int expectedRequestInfoSize) { Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, "http://dummy.telemetry.endpoint/"); @@ -147,6 +147,7 @@ public async Task CheckIfPayloadIsDividedCorrectlyAsync(int expectedOperationInf string payloadJson = request.Content.ReadAsStringAsync().Result; Assert.IsTrue(payloadJson.Length <= ClientTelemetryOptions.PayloadSizeThreshold, "Payload Size is " + payloadJson.Length); + Console.WriteLine(payloadJson); ClientTelemetryProperties propertiesToSend = JsonConvert.DeserializeObject(payloadJson); Assert.AreEqual(7, propertiesToSend.SystemInfo.Count, "System Info is not correct"); @@ -162,9 +163,10 @@ public async Task CheckIfPayloadIsDividedCorrectlyAsync(int expectedOperationInf Mock.Of()); ConcurrentDictionary operationInfoSnapshot - = new ConcurrentDictionary(); + = new ConcurrentDictionary (); - for (int i = 0; i < (expectedOperationInfoSize/2); i++) + int numberOfMetricsInOperationSection = 2; + for (int i = 0; i < (expectedOperationInfoSize/ numberOfMetricsInOperationSection); i++) { OperationInfo opeInfo = new OperationInfo(Regions.WestUS, 0, @@ -179,12 +181,12 @@ public async Task CheckIfPayloadIsDividedCorrectlyAsync(int expectedOperationInf LongConcurrentHistogram latency = new LongConcurrentHistogram(ClientTelemetryOptions.RequestLatencyMin, ClientTelemetryOptions.RequestLatencyMax, ClientTelemetryOptions.RequestLatencyPrecision); - latency.RecordValue(10l); + latency.RecordValue(10); LongConcurrentHistogram requestcharge = new LongConcurrentHistogram(ClientTelemetryOptions.RequestChargeMin, ClientTelemetryOptions.RequestChargeMax, ClientTelemetryOptions.RequestChargePrecision); - requestcharge.RecordValue(11l); + requestcharge.RecordValue(11); operationInfoSnapshot.TryAdd(opeInfo, (latency, requestcharge)); } @@ -207,13 +209,12 @@ ConcurrentDictionary cacheRefreshInfo LongConcurrentHistogram latency = new LongConcurrentHistogram(ClientTelemetryOptions.RequestLatencyMin, ClientTelemetryOptions.RequestLatencyMax, ClientTelemetryOptions.RequestLatencyPrecision); - latency.RecordValue(10l); + latency.RecordValue(10); cacheRefreshInfoSnapshot.TryAdd(crInfo, latency); } - ConcurrentDictionary requestInfoInfoSnapshot - = new ConcurrentDictionary(); + List requestInfoList = new List(); for (int i = 0; i < expectedRequestInfoSize; i++) { RequestInfo reqInfo = new RequestInfo @@ -227,19 +228,24 @@ ConcurrentDictionary requestInfoInfoSnapsh SubStatusCode = 0 }; - LongConcurrentHistogram latency = new LongConcurrentHistogram(ClientTelemetryOptions.RequestLatencyMin, - ClientTelemetryOptions.RequestLatencyMax, - ClientTelemetryOptions.RequestLatencyPrecision); - latency.RecordValue(10l); + MetricInfo metricInfo = new MetricInfo(ClientTelemetryOptions.RequestLatencyName, ClientTelemetryOptions.RequestLatencyUnit); - requestInfoInfoSnapshot.TryAdd(reqInfo, latency); - } + LongConcurrentHistogram histogram = new LongConcurrentHistogram(ClientTelemetryOptions.RequestLatencyMin, + ClientTelemetryOptions.RequestLatencyMax, + ClientTelemetryOptions.RequestLatencyPrecision); + histogram.RecordValue(TimeSpan.FromMinutes(1).Ticks); + + metricInfo.SetAggregators(histogram, ClientTelemetryOptions.TicksToMsFactor); + reqInfo.Metrics.Add(metricInfo); + requestInfoList.Add(reqInfo); ; + } + await processor.ProcessAndSendAsync( clientTelemetryProperties, operationInfoSnapshot, cacheRefreshInfoSnapshot, - requestInfoInfoSnapshot, + requestInfoList, new CancellationToken()); Assert.AreEqual(expectedOperationInfoSize, actualOperationInfoSize, "Operation Info is not correct"); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DataSamplerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DataSamplerTests.cs new file mode 100644 index 0000000000..d6ad3dbb8c --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DataSamplerTests.cs @@ -0,0 +1,119 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Tests.Telemetry +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using System.Linq; + using Microsoft.Azure.Cosmos.Telemetry; + using Microsoft.Azure.Cosmos.Telemetry.Models; + using Microsoft.Azure.Documents; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + [TestClass] + public class DataSamplerTests + { + [TestMethod] + public void TestNetworkRequestSamplerForThreshold() + { + int numberOfElementsInEachGroup = ClientTelemetryOptions.NetworkRequestsSampleSizeThreshold; + int numberOfGroups = 5; + + List requestInfoList = new List(); + + for (int counter = 0; counter < 100; counter++) + { + RequestInfo requestInfo = new RequestInfo() + { + DatabaseName = "dbId " + (counter % numberOfGroups), // To repeat similar elements + ContainerName = "containerId", + Uri = "rntbd://host/partition/replica", + StatusCode = 429, + SubStatusCode = 1002, + Resource = ResourceType.Document.ToResourceTypeString(), + Operation = OperationType.Create.ToOperationTypeString(), + Metrics = new List() + { + new MetricInfo(ClientTelemetryOptions.RequestLatencyName, ClientTelemetryOptions.RequestLatencyUnit) + { + Percentiles = new Dictionary() + { + { ClientTelemetryOptions.Percentile50, 10 }, + { ClientTelemetryOptions.Percentile90, 20 }, + { ClientTelemetryOptions.Percentile95, 30 }, + { ClientTelemetryOptions.Percentile99, Random.Shared.Next(1, 100) }, + { ClientTelemetryOptions.Percentile999, 50 } + }, + Count = Random.Shared.Next(1, 100) + } + } + }; + requestInfoList.Add(requestInfo); + } + + List sampleDataByLatency = DataSampler.OrderAndSample(requestInfoList, DataLatencyComparer.Instance); + Assert.AreEqual(numberOfGroups * numberOfElementsInEachGroup, sampleDataByLatency.Count); + + List sampleDataBySampleCount = DataSampler.OrderAndSample(requestInfoList, DataSampleCountComparer.Instance); + Assert.AreEqual(numberOfGroups * numberOfElementsInEachGroup, sampleDataBySampleCount.Count); + } + + [TestMethod] + public void TestNetworkRequestSamplerWithoutData() + { + List requestInfoList = new List(); + + Assert.AreEqual(0, DataSampler.OrderAndSample(requestInfoList, DataSampleCountComparer.Instance).Count); + Assert.AreEqual(0, DataSampler.OrderAndSample(requestInfoList, DataLatencyComparer.Instance).Count); + } + + [TestMethod] + public void TestNetworkRequestSamplerForLessThanThresholdSize() + { + int numberOfElementsInEachGroup = ClientTelemetryOptions.NetworkRequestsSampleSizeThreshold; + int numberOfGroups = 3; + + List requestInfoList = new List(); + + for (int counter = 0; counter < 10; counter++) + { + RequestInfo requestInfo = new RequestInfo() + { + DatabaseName = "dbId " + (counter % numberOfGroups), // To repeat similar elements + ContainerName = "containerId", + Uri = "rntbd://host/partition/replica", + StatusCode = 429, + SubStatusCode = 1002, + Resource = ResourceType.Document.ToResourceTypeString(), + Operation = OperationType.Create.ToOperationTypeString(), + Metrics = new List() + { + new MetricInfo(ClientTelemetryOptions.RequestLatencyName, ClientTelemetryOptions.RequestLatencyUnit) + { + Percentiles = new Dictionary() + { + { ClientTelemetryOptions.Percentile50, 10 }, + { ClientTelemetryOptions.Percentile90, 20 }, + { ClientTelemetryOptions.Percentile95, 30 }, + { ClientTelemetryOptions.Percentile99, Random.Shared.Next(1, 100) }, + { ClientTelemetryOptions.Percentile999, 50 } + }, + Count = Random.Shared.Next(1, 100) + } + } + }; + requestInfoList.Add(requestInfo); + } + + List sampleDataByLatency = DataSampler.OrderAndSample(requestInfoList, DataLatencyComparer.Instance); + Assert.AreEqual(10, sampleDataByLatency.Count); + + List sampleDataBySampleCount = DataSampler.OrderAndSample(requestInfoList, DataSampleCountComparer.Instance); + Assert.AreEqual(10, sampleDataBySampleCount.Count); + } + + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs index 698b99524e..c04c0d6faf 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs @@ -5,10 +5,7 @@ namespace Microsoft.Azure.Cosmos.Tests.Telemetry { using System; - using System.Collections.Generic; - using System.Linq; using System.Net; - using System.Text; using System.Threading.Tasks; using Cosmos.Telemetry; using Cosmos.Telemetry.Diagnostics; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/NetworkDataRecorderTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/NetworkDataRecorderTest.cs new file mode 100644 index 0000000000..c08282cd0f --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/NetworkDataRecorderTest.cs @@ -0,0 +1,92 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Tests.Telemetry +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Security.AccessControl; + using System.Text; + using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Telemetry; + using Microsoft.Azure.Cosmos.Telemetry.Models; + using Microsoft.Azure.Documents; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using static Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum; + + [TestClass] + public class NetworkDataRecorderTest + { + [TestMethod] + public void TestRecordWithErroredAndHighLatencyRequests() + { + NetworkDataRecorder recorder = new NetworkDataRecorder(); + + List stats = new List() + { + new StoreResponseStatistics( + requestStartTime: DateTime.Now, + requestResponseTime: DateTime.Now.AddMilliseconds(10), + storeResult: StoreResult.CreateForTesting(storeResponse: new StoreResponse() + { + Status = 200 + }).Target, + resourceType: Documents.ResourceType.Document, + operationType: OperationType.Create, + requestSessionToken: default, + locationEndpoint: new Uri("https://dummy.url")), + + new StoreResponseStatistics( + requestStartTime: DateTime.Now, + requestResponseTime: DateTime.Now.AddMilliseconds(10), + storeResult: StoreResult.CreateForTesting(storeResponse: new StoreResponse() + { + Status = 401 + }).Target, + resourceType: Documents.ResourceType.Document, + operationType: OperationType.Create, + requestSessionToken: default, + locationEndpoint: new Uri("https://dummy.url")) + }; + + recorder.Record(stats, "databaseId", "containerId"); + + List highLatencyRequests = new List(); + recorder.GetHighLatencyRequests(highLatencyRequests); + Assert.AreEqual(1, highLatencyRequests.Count); + + List erroredRequests = new List(); + recorder.GetErroredRequests(erroredRequests); + Assert.AreEqual(1, erroredRequests.Count); + + // you can get the values only once + List requests = new List(); + recorder.GetHighLatencyRequests(requests); + recorder.GetErroredRequests(requests); + + Assert.AreEqual(0, requests.Count); + } + + [TestMethod] + [DataRow(200, 0, 1, false)] + [DataRow(404, 0, 1, false)] + [DataRow(404, 1002, 1, true)] + [DataRow(409, 0, 1, false)] + [DataRow(409, 1002, 1, true)] + [DataRow(503, 2001, 1, true)] + [DataRow(200, 0, 6, true)] + public void CheckEligibleStatistics(int statusCode, int subStatusCode, int latencyInMs, bool expectedFlag) + { + Assert.AreEqual(expectedFlag, NetworkDataRecorderTest.IsEligible(statusCode, subStatusCode, TimeSpan.FromMilliseconds(latencyInMs))); + } + + private static bool IsEligible(int statusCode, int subStatusCode, TimeSpan latencyInMs) + { + return + NetworkDataRecorder.IsStatusCodeNotExcluded(statusCode, subStatusCode) && + (NetworkDataRecorder.IsUserOrServerError(statusCode) || NetworkDataRecorder.IsHighLatency(latencyInMs.TotalMilliseconds)); + } + } +} From 6553a70b3ff7bf9a46486297bd115947e318ae10 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Thu, 30 Mar 2023 00:30:11 +0530 Subject: [PATCH 080/240] [Internal] Emulator Test : Fixes test when running with distributed tracing enabled. (#3751) * enable DT for everything * try1 * code refactoring * fix pipeline * try 2 * Revert "try 2" This reverts commit 61643f9b4dcd2ab1898fd68b111897bed0bc6bcf. * Revert "fix pipeline" This reverts commit 4b217f5f6a087b1dd889b804fd8b477accd46419. * Revert "code refactoring" This reverts commit d1ff0ddc17ad655360988d171bd033617752f91f. * Revert "try1" This reverts commit bf9c41b43684f59719c3673d6f9c7450bbdc5142. * lazy factory and threadsafe * scope factory in function * try non static * add flag * fix test * add consoles * more console with fix * fix tests * temporarily enable dt * fuix tests * dispose listener * fix tests * remove delay * revert flag change * dynamically get number of test in trace class --- .../EndToEndTraceWriterBaselineTests.cs | 129 +++++++++++------- .../Utils/Util.cs | 7 +- 2 files changed, 82 insertions(+), 54 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs index e81eda0d01..c32c756121 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs @@ -24,7 +24,8 @@ namespace Microsoft.Azure.Cosmos.EmulatorTests.Tracing using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json.Linq; using static Microsoft.Azure.Cosmos.SDK.EmulatorTests.TransportClientHelper; - + using AzureCore = global::Azure.Core.Pipeline; + [VisualStudio.TestTools.UnitTesting.TestClass] [TestCategory("UpdateContract")] public sealed class EndToEndTraceWriterBaselineTests : BaselineTests @@ -41,10 +42,14 @@ public sealed class EndToEndTraceWriterBaselineTests : BaselineTests m.GetCustomAttributes(typeof(TestMethodAttribute), false).Length > 0).Count(); + + private static int MethodCount = 0; + + [ClassInitialize] public static async Task ClassInitAsync(TestContext context) { - testListener = Util.ConfigureOpenTelemetryAndCustomListeners(); + EndToEndTraceWriterBaselineTests.testListener = Util.ConfigureOpenTelemetryAndCustomListeners(); client = Microsoft.Azure.Cosmos.SDK.EmulatorTests.TestCommon.CreateCosmosClient( useGateway: false, @@ -87,30 +92,41 @@ public static async Task ClassInitAsync(TestContext context) EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } - - [ClassCleanup()] + + [TestCleanup] + public async Task CleanUp() + { + await EndToEndTraceWriterBaselineTests.ClassCleanupAsync(); + } + public static async Task ClassCleanupAsync() { - if(database != null) - { - await EndToEndTraceWriterBaselineTests.database.DeleteStreamAsync(); - } + EndToEndTraceWriterBaselineTests.MethodCount++; - Util.DisposeOpenTelemetryAndCustomListeners(); + if (EndToEndTraceWriterBaselineTests.MethodCount == EndToEndTraceWriterBaselineTests.TotalTestMethod) + { + if (database != null) + { + await EndToEndTraceWriterBaselineTests.database.DeleteStreamAsync(); + } + + EndToEndTraceWriterBaselineTests.client?.Dispose(); + EndToEndTraceWriterBaselineTests.bulkClient?.Dispose(); + EndToEndTraceWriterBaselineTests.miscCosmosClient?.Dispose(); - EndToEndTraceWriterBaselineTests.client?.Dispose(); - EndToEndTraceWriterBaselineTests.bulkClient?.Dispose(); - EndToEndTraceWriterBaselineTests.miscCosmosClient?.Dispose(); + Util.DisposeOpenTelemetryAndCustomListeners(); - await Task.Delay(5000); + EndToEndTraceWriterBaselineTests.testListener.Dispose(); + + } } - + private static void AssertAndResetActivityInformation() { AssertActivity.AreEqualAcrossListeners(); CustomOtelExporter.CollectedActivities = new(); - testListener?.ResetAttributes(); + EndToEndTraceWriterBaselineTests.testListener?.ResetAttributes(); } [TestMethod] @@ -147,10 +163,9 @@ public async Task ReadFeedAsync() trace: traceForest, startLineNumber: startLineNumber, endLineNumber: endLineNumber, - oTelActivities: testListener?.GetRecordedAttributes())); + oTelActivities: EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); - } //---------------------------------------------------------------- @@ -178,7 +193,7 @@ public async Task ReadFeedAsync() trace: traceForest, startLineNumber: startLineNumber, endLineNumber: endLineNumber, - oTelActivities: testListener?.GetRecordedAttributes())); + oTelActivities: EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -209,7 +224,7 @@ public async Task ReadFeedAsync() trace: traceForest, startLineNumber: startLineNumber, endLineNumber: endLineNumber, - oTelActivities: testListener?.GetRecordedAttributes())); + oTelActivities: EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -235,7 +250,7 @@ public async Task ReadFeedAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("ReadFeed Public API Typed", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("ReadFeed Public API Typed", traceForest, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -277,7 +292,7 @@ public async Task ChangeFeedAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("ChangeFeed", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("ChangeFeed", traceForest, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -309,7 +324,7 @@ public async Task ChangeFeedAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("ChangeFeed Typed", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("ChangeFeed Typed", traceForest, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -342,7 +357,7 @@ public async Task ChangeFeedAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("ChangeFeed Public API", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("ChangeFeed Public API", traceForest, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -375,7 +390,7 @@ public async Task ChangeFeedAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("ChangeFeed Public API Typed", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("ChangeFeed Public API Typed", traceForest, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -436,7 +451,7 @@ public async Task ChangeFeedAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Change Feed Estimator", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Change Feed Estimator", traceForest, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -472,7 +487,7 @@ public async Task QueryAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Query", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Query", traceForest, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -497,7 +512,7 @@ public async Task QueryAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Query Typed", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Query Typed", traceForest, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -523,7 +538,7 @@ public async Task QueryAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Query Public API", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Query Public API", traceForest, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -549,7 +564,7 @@ public async Task QueryAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Query Public API Typed", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Query Public API Typed", traceForest, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -578,7 +593,7 @@ public async Task QueryAsync() Documents.ServiceInteropWrapper.AssembliesExist = currentLazy; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Query - Without ServiceInterop", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Query - Without ServiceInterop", traceForest, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -606,7 +621,7 @@ public async Task QueryAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Query Public API with FeedRanges", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Query Public API with FeedRanges", traceForest, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -634,7 +649,7 @@ public async Task QueryAsync() ITrace traceForest = TraceJoiner.JoinTraces(traces); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Query Public API Typed with FeedRanges", traceForest, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Query Public API Typed with FeedRanges", traceForest, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -650,9 +665,17 @@ public async Task ValidateInvalidCredentialsTraceAsync() string endpoint = Utils.ConfigurationManager.AppSettings["GatewayEndpoint"]; AzureKeyCredential masterKeyCredential = new AzureKeyCredential(authKey); + + // It is not baseline test hence disable distributed tracing for this test + CosmosClientOptions clientOptions = new CosmosClientOptions() + { + IsDistributedTracingEnabled = false + }; + using (CosmosClient client = new CosmosClient( endpoint, - masterKeyCredential)) + masterKeyCredential, + clientOptions)) { try @@ -705,7 +728,7 @@ public async Task TypedPointOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Write", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Point Write", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -723,7 +746,7 @@ public async Task TypedPointOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Read", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Point Read", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -749,7 +772,7 @@ public async Task TypedPointOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Replace", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Point Replace", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -791,7 +814,7 @@ public async Task TypedPointOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Delete", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Point Delete", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -826,7 +849,7 @@ public async Task StreamPointOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Write", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Point Write", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -844,7 +867,7 @@ public async Task StreamPointOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Read", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Point Read", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -870,7 +893,7 @@ public async Task StreamPointOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Replace", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Point Replace", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -915,7 +938,7 @@ public async Task StreamPointOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)itemResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Delete", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Point Delete", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -964,7 +987,7 @@ public async Task PointOperationsExceptionsAsync() } endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Operation with Request Timeout", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Point Operation with Request Timeout", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -1016,7 +1039,7 @@ public async Task PointOperationsExceptionsAsync() } endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Operation With Throttle", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Point Operation With Throttle", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -1096,7 +1119,7 @@ void interceptor(Uri uri, Documents.ResourceOperation operation, Documents.Docum } endLineNumber = GetLineNumber(); - inputs.Add(new Input($"Point Operation With Forbidden + Max Count = {maxCount}", trace, startLineNumber, endLineNumber, testListener.GetRecordedAttributes())); + inputs.Add(new Input($"Point Operation With Forbidden + Max Count = {maxCount}", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -1147,7 +1170,7 @@ void interceptor(Uri uri, Documents.ResourceOperation operation, Documents.Docum } endLineNumber = GetLineNumber(); - inputs.Add(new Input("Point Operation with Service Unavailable", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Point Operation with Service Unavailable", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -1198,7 +1221,7 @@ public async Task BatchOperationsAsync() ITrace trace = ((CosmosTraceDiagnostics)response.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Batch Operation", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Batch Operation", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -1248,7 +1271,7 @@ public async Task BulkOperationsAsync() foreach (ITrace trace in traces) { - inputs.Add(new Input("Bulk Operation", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Bulk Operation", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); } EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); @@ -1302,7 +1325,7 @@ public async Task BulkOperationsAsync() endLineNumber = GetLineNumber(); - inputs.Add(new Input("Bulk Operation With Throttle", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Bulk Operation With Throttle", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -1334,7 +1357,7 @@ public async Task MiscellanousAsync() await databaseResponse.Database.DeleteAsync(); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Custom Handler", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Custom Handler", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -1353,7 +1376,7 @@ public async Task MiscellanousAsync() await databaseResponse.Database.DeleteAsync(); endLineNumber = GetLineNumber(); - inputs.Add(new Input("Custom Handler", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Custom Handler", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -1394,7 +1417,7 @@ public async Task ReadManyAsync() } endLineNumber = GetLineNumber(); - inputs.Add(new Input("Read Many Stream Api", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Read Many Stream Api", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } @@ -1409,7 +1432,7 @@ public async Task ReadManyAsync() ITrace trace = ((CosmosTraceDiagnostics)feedResponse.Diagnostics).Value; endLineNumber = GetLineNumber(); - inputs.Add(new Input("Read Many Typed Api", trace, startLineNumber, endLineNumber, testListener?.GetRecordedAttributes())); + inputs.Add(new Input("Read Many Typed Api", trace, startLineNumber, endLineNumber, EndToEndTraceWriterBaselineTests.testListener?.GetRecordedAttributes())); EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs index 8c71a6b168..96254aca79 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs @@ -22,7 +22,8 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenTelemetry; using OpenTelemetry.Trace; - + using AzureCore = global::Azure.Core.Pipeline; + internal enum DocumentClientType { Gateway, @@ -542,6 +543,8 @@ internal static CustomListener ConfigureOpenTelemetryAndCustomListeners() { AppContext.SetSwitch("Azure.Experimental.EnableActivitySource", true); + AzureCore.ActivityExtensions.ResetFeatureSwitch(); + // Open Telemetry Listener Util.OTelTracerProvider = Sdk.CreateTracerProviderBuilder() .AddCustomOtelExporter() // use any exporter here @@ -567,6 +570,8 @@ internal static void DisposeOpenTelemetryAndCustomListeners() Util.TestListener = null; AppContext.SetSwitch("Azure.Experimental.EnableActivitySource", false); + + AzureCore.ActivityExtensions.ResetFeatureSwitch(); } /// From 67dc262090fc66b5b8d80c6012baa926f3fa19ca Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Thu, 30 Mar 2023 11:19:27 -0700 Subject: [PATCH 081/240] Release: Adds SDK version and changelog for 3.32.3 (#3788) * Adding contract and version bump * Adding changelog --- Directory.Build.props | 4 +- .../contracts/API_3.32.3-preview.txt | 1531 +++++++++++++++++ .../contracts/API_3.32.3.txt | 1478 ++++++++++++++++ changelog.md | 7 + 4 files changed, 3018 insertions(+), 2 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.32.3-preview.txt create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.32.3.txt diff --git a/Directory.Build.props b/Directory.Build.props index 39004a08ab..e51eae5f3f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 3.32.2 - 3.32.2 + 3.32.3 + 3.32.3 preview 3.30.4 2.0.1 diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.32.3-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.32.3-preview.txt new file mode 100644 index 0000000000..69b7a4b83e --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.32.3-preview.txt @@ -0,0 +1,1531 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool IsDistributedTracingEnabled { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithDistributedTracing(bool isEnabled=true); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsPrimitive(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.32.3.txt b/Microsoft.Azure.Cosmos/contracts/API_3.32.3.txt new file mode 100644 index 0000000000..5218206b0e --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.32.3.txt @@ -0,0 +1,1478 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsPrimitive(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/changelog.md b/changelog.md index a8a156b922..a41dc7f438 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,13 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [3.32.3](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.32.3) - 2023-03-30 +### [3.32.3-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.32.3-preview) - 2023-03-30 + +#### Fixed + +- [#3787](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3787) Connectivity: Fixes ConnectionBroken and adds support for Burst Capacity + ### [3.32.2](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.32.2) - 2023-03-10 ### [3.32.2-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.32.2-preview) - 2023-03-10 From a6972422d51ea5d430238bac9f285ff1c7f2dc8a Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Mon, 3 Apr 2023 11:42:22 -0700 Subject: [PATCH 082/240] SummaryDiagnostics: Refactors Code to Remove Dependency of HttpResponseHeadersWrapper to fetch Sub Status Codes (#3792) * Code changes to fetch sub status code from http response/ content headers. * Code changes to address review comments. * Code changes to return the first element from the sub status list. * Code changes to update first or default. --- .../Tracing/TraceData/SummaryDiagnostics.cs | 25 +++++++++++--- .../SummaryDiagnosticsTests.cs | 33 +++++++++++++++++++ 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Tracing/TraceData/SummaryDiagnostics.cs b/Microsoft.Azure.Cosmos/src/Tracing/TraceData/SummaryDiagnostics.cs index 1838cb72c5..3a50b96841 100644 --- a/Microsoft.Azure.Cosmos/src/Tracing/TraceData/SummaryDiagnostics.cs +++ b/Microsoft.Azure.Cosmos/src/Tracing/TraceData/SummaryDiagnostics.cs @@ -7,6 +7,7 @@ namespace Microsoft.Azure.Cosmos.Tracing.TraceData using System; using System.Collections.Generic; using System.Globalization; + using System.Linq; using Microsoft.Azure.Cosmos.Json; using static Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum; @@ -73,10 +74,7 @@ private void AggregateGatewayStatistics(IReadOnlyList + /// Gets the sub status code as a comma separated value from the http response message headers. + /// If the sub status code header is not found, then returns null. + /// + /// An instance of . + /// A string containing the sub status code. + private static string GetSubStatusCodes( + HttpResponseStatistics httpResponseStatistics) + { + return httpResponseStatistics + .HttpResponseMessage + .Headers + .TryGetValues( + name: Documents.WFConstants.BackendHeaders.SubStatus, + values: out IEnumerable httpResponseHeaderValues) ? + httpResponseHeaderValues.FirstOrDefault() : + null; + } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SummaryDiagnosticsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SummaryDiagnosticsTests.cs index ae94a7220d..1948411400 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SummaryDiagnosticsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SummaryDiagnosticsTests.cs @@ -128,5 +128,38 @@ public async Task DirectPointOperationsWithTransportErrors() Assert.AreEqual(summaryDiagnostics.DirectRequestsSummary.Value[(410, (int)SubStatusCodes.TransportGenerated410)], 3); Assert.AreEqual(summaryDiagnostics.DirectRequestsSummary.Value[(201, 0)], 1); } + + /// + /// Test to validate that when a read operation is done on a database and a container that + /// does not exists, then the should capture the sub status + /// codes successfully. + /// + [TestMethod] + [Owner("dkunda")] + public async Task SummaryDiagnostics_WhenContainerDoesNotExists_ShouldRecordSubStatusCode() + { + string partitionKey = "/pk"; + int notFoundStatusCode = 404, notFoundSubStatusCode = 1003; + using CosmosClient cosmosClient = TestCommon.CreateCosmosClient(useGateway: false); + + try + { + Container container = cosmosClient.GetContainer( + databaseId: Guid.NewGuid().ToString(), + containerId: Guid.NewGuid().ToString()); + + ItemResponse readResponse = await container.ReadItemAsync( + partitionKey, + new Cosmos.PartitionKey(partitionKey)); + } + catch (CosmosException ex) + { + ITrace trace = ((CosmosTraceDiagnostics)ex.Diagnostics).Value; + SummaryDiagnostics summaryDiagnostics = new(trace); + + Assert.IsNotNull(value: summaryDiagnostics); + Assert.IsTrue(condition: summaryDiagnostics.GatewayRequestsSummary.Value.ContainsKey((notFoundStatusCode, notFoundSubStatusCode))); + } + } } } \ No newline at end of file From e41eea5ad6db54e51e953552bfccf751c0de291f Mon Sep 17 00:00:00 2001 From: Justine Cocchi Date: Tue, 4 Apr 2023 07:50:11 -0700 Subject: [PATCH 083/240] [Internal] Documentation: Fixes API name to NoSQL (#3795) --- .../src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj | 2 +- .../src/Microsoft.Azure.Cosmos.Encryption.csproj | 2 +- Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj | 2 +- README.md | 4 ++-- changelog.md | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj b/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj index d368f399bd..54755c89ef 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj @@ -10,7 +10,7 @@ $(CustomEncryptionVersion) Microsoft Corporation Microsoft - This is an internal library that provides an implementation for client-side encryption for Azure Cosmos DB's SQL API for multi-tenant use case. For more information, refer to https://aka.ms/CosmosCustomClientEncryption + This is an internal library that provides an implementation for client-side encryption for Azure Cosmos DB for NoSQL for multi-tenant use case. For more information, refer to https://aka.ms/CosmosCustomClientEncryption © Microsoft Corporation. All rights reserved. Microsoft Azure Cosmos DB client-side encryption library for multi-tenant Microsoft.Azure.Cosmos.Encryption.Custom diff --git a/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj b/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj index 9fe41b765f..f58b171cd5 100644 --- a/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj +++ b/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj @@ -12,7 +12,7 @@ $([System.DateTime]::Now.ToString(yyyyMMdd)) Microsoft Corporation Microsoft - This library provides an implementation for client-side encryption for Azure Cosmos's SQL API. For more information, refer to https://aka.ms/CosmosClientEncryption + This library provides an implementation for client-side encryption for Azure Cosmos DB for NoSQL. For more information, refer to https://aka.ms/CosmosClientEncryption © Microsoft Corporation. All rights reserved. Microsoft Azure Cosmos DB client-side encryption library Microsoft.Azure.Cosmos.Encryption diff --git a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj index 0b21867bf7..a33142b79b 100644 --- a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj +++ b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj @@ -3,7 +3,7 @@ Microsoft Corporation Microsoft(R) Azure Cosmos - This client library enables client applications to connect to Azure Cosmos via the SQL API. Azure Cosmos is a globally distributed, multi-model database service. For more information, refer to http://azure.microsoft.com/services/cosmos-db/. + This client library enables client applications to connect to Azure Cosmos DB for NoSQL. Azure Cosmos DB is a globally distributed, multi-model database service. For more information, refer to http://azure.microsoft.com/services/cosmos-db/. © Microsoft Corporation. All rights reserved. en-US $([System.DateTime]::Now.ToString(yyyyMMdd)) diff --git a/README.md b/README.md index 1d39e6e204..f1dcffa7b9 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # Microsoft Azure Cosmos DB .NET SDK Version 3 -This client library enables client applications to connect to Azure Cosmos via the SQL API. Azure Cosmos is a globally distributed, multi-model database service. For more information, refer to https://azure.microsoft.com/services/cosmos-db/. +This client library enables client applications to connect to Azure Cosmos DB for NoSQL. Azure Cosmos DB is a globally distributed, multi-model database service. For more information, refer to https://azure.microsoft.com/services/cosmos-db/. ```csharp CosmosClient client = new CosmosClient("https://mycosmosaccount.documents.azure.com:443/", "mysupersecretkey"); @@ -45,7 +45,7 @@ using (FeedIterator feedIterator = container.GetItemQueryIterator Date: Tue, 4 Apr 2023 13:37:19 -0700 Subject: [PATCH 084/240] [Internal] CTL: Fixes docker image pipeline (#3794) --- azure-pipelines-ctl-publishing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines-ctl-publishing.yml b/azure-pipelines-ctl-publishing.yml index b3b9e10fb9..862d125aa1 100644 --- a/azure-pipelines-ctl-publishing.yml +++ b/azure-pipelines-ctl-publishing.yml @@ -1,5 +1,5 @@ variables: - VmImage: 'ubuntu-18.04' + VmImage: 'ubuntu-latest' jobs: - job: BuildDockerImage From ae6bcf313b83ff58c3bb703c1dee6a4b9b1e8820 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Wed, 5 Apr 2023 03:51:25 +0530 Subject: [PATCH 085/240] [Internal] AI Integration : Refactors useragent attribute name as per Otel conventions (#3784) Co-authored-by: Fabian Meiswinkel --- .../OpenTelemetryAttributeKeys.cs | 2 +- ...iterBaselineTests.BatchOperationsAsync.xml | 2 +- ...riterBaselineTests.BulkOperationsAsync.xml | 202 +++++++++--------- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 44 ++-- ...eWriterBaselineTests.MiscellanousAsync.xml | 8 +- ...neTests.PointOperationsExceptionsAsync.xml | 12 +- ...EndTraceWriterBaselineTests.QueryAsync.xml | 56 ++--- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 32 +-- ...TraceWriterBaselineTests.ReadManyAsync.xml | 14 +- ...selineTests.StreamPointOperationsAsync.xml | 8 +- ...aselineTests.TypedPointOperationsAsync.xml | 8 +- .../Tracing/AssertActivity.cs | 2 +- 12 files changed, 195 insertions(+), 195 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs index e7c4d96cc2..755e1e3a66 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs @@ -20,7 +20,7 @@ internal sealed class OpenTelemetryAttributeKeys // Cosmos Db Specific public const string ClientId = "db.cosmosdb.client_id"; public const string MachineId = "db.cosmosdb.machine_id"; - public const string UserAgent = "db.cosmosdb.user_agent"; + public const string UserAgent = "user_agent.original"; // Compliant with open telemetry conventions public const string ConnectionMode = "db.cosmosdb.connection_mode"; public const string OperationType = "db.cosmosdb.operation_type"; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index d468fe87f5..ad1a3f1288 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -129,7 +129,7 @@ } ] }]]> - Operation.ExecuteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationExecuteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeBatchdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.ExecuteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationExecuteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeBatchdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index 041523ff8a..09d8c3ce63 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -153,16 +153,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -311,16 +311,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -469,16 +469,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -627,16 +627,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -785,16 +785,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -943,16 +943,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1101,16 +1101,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1259,16 +1259,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1417,16 +1417,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1575,16 +1575,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2324,7 +2324,7 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.messagedb.cosmosdb.operation_typeCreate + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.messagedb.cosmosdb.operation_typeCreate ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml index dccb7fe5d0..2e20bceb1c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml @@ -952,11 +952,11 @@ } ] }]]> - Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1569,11 +1569,11 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2167,11 +2167,11 @@ } ] }]]> - Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2785,11 +2785,11 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3066,8 +3066,8 @@ } ] }]]> - Operation.Change Feed Estimator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Estimator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Change Feed Estimator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Estimator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml index 832dfee446..348925a1f6 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml @@ -107,8 +107,8 @@ } ] }]]> - Operation.DeleteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateDatabaseAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateDatabaseAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.DeleteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateDatabaseAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateDatabaseAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -207,8 +207,8 @@ } ] }]]> - Operation.DeleteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateDatabaseAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateDatabaseAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.DeleteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateDatabaseAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateDatabaseAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml index 200ad02660..a8b686d679 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml @@ -148,7 +148,7 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -390,7 +390,7 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -615,7 +615,7 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -872,7 +872,7 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1193,7 +1193,7 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1347,7 +1347,7 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml index 876d37dc63..18aa6d67d8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml @@ -574,10 +574,10 @@ } ] }]]> - Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1180,10 +1180,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1767,10 +1767,10 @@ } ] }]]> - Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2374,10 +2374,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3048,10 +3048,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3644,10 +3644,10 @@ } ] }]]> - Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -4260,10 +4260,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml index 44a8a04a51..1ceef081c6 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml @@ -536,10 +536,10 @@ } ] }]]> - Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1104,10 +1104,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1653,10 +1653,10 @@ } ] }]]> - Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2222,10 +2222,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml index 9a96ef9751..7229f78197 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml @@ -542,12 +542,12 @@ } ] }]]> - Operation.ReadManyItemsStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadManyItemsStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.ReadManyItemsStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadManyItemsStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1112,7 +1112,7 @@ } ] }]]> - Operation.ReadManyItemsAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadManyItemsAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.ReadManyItemsAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadManyItemsAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml index 25a01f6b94..f0dec5b7bd 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml @@ -89,7 +89,7 @@ } ] }]]> - Operation.CreateItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.CreateItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -178,7 +178,7 @@ } ] }]]> - Operation.ReadItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.ReadItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -275,7 +275,7 @@ } ] }]]> - Operation.ReplaceItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReplaceItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.ReplaceItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReplaceItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -367,7 +367,7 @@ } ] }]]> - Operation.DeleteItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.DeleteItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml index 4dfceee978..6b57caad95 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml @@ -109,7 +109,7 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -203,7 +203,7 @@ } ] }]]> - Operation.ReadItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.ReadItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -310,7 +310,7 @@ } ] }]]> - Operation.ReplaceItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReplaceItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.ReplaceItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReplaceItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -406,7 +406,7 @@ } ] }]]> - Operation.DeleteItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.DeleteItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs index d19b330d98..c46d8b035a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs @@ -39,7 +39,7 @@ public static void IsValid(Activity activity) "net.peer.name", "db.cosmosdb.client_id", "db.cosmosdb.machine_id", - "db.cosmosdb.user_agent", + "user_agent.original", "db.cosmosdb.connection_mode", "db.cosmosdb.operation_type", "db.cosmosdb.container", From 2b693948a02a2206984a6c423c3d9a3e560026d8 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Thu, 6 Apr 2023 15:05:15 -0700 Subject: [PATCH 086/240] HttpClient: Adds Properties to the Http messages if available (#3803) * Passing properties * test --- .../src/GatewayStoreClient.cs | 8 +++ .../GatewayStoreModelTest.cs | 61 +++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/Microsoft.Azure.Cosmos/src/GatewayStoreClient.cs b/Microsoft.Azure.Cosmos/src/GatewayStoreClient.cs index c779dc7855..e151ffcd94 100644 --- a/Microsoft.Azure.Cosmos/src/GatewayStoreClient.cs +++ b/Microsoft.Azure.Cosmos/src/GatewayStoreClient.cs @@ -320,6 +320,14 @@ private async ValueTask PrepareRequestMessageAsync( } } + if (request.Properties != null) + { + foreach (KeyValuePair property in request.Properties) + { + requestMessage.Properties.Add(property); + } + } + // add activityId Guid activityId = System.Diagnostics.Trace.CorrelationManager.ActivityId; Debug.Assert(activityId != Guid.Empty); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs index 43078d1866..36b350a751 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs @@ -161,6 +161,67 @@ public async Task TestRetries() } + /// + /// Verifies that if the DCE has Properties set, the HttpRequestMessage has them too. Used on ThinClient. + /// + [TestMethod] + public async Task PassesPropertiesFromDocumentServiceRequest() + { + IDictionary properties = new Dictionary() + { + {"property1", Guid.NewGuid() }, + {"property2", Guid.NewGuid().ToString() } + }; + + Func> sendFunc = request => + { + Assert.AreEqual(properties.Count, request.Properties.Count); + foreach (KeyValuePair item in properties) + { + Assert.AreEqual(item.Value, request.Properties[item.Key]); + } + + return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK) ); + }; + + Mock mockDocumentClient = new Mock(); + mockDocumentClient.Setup(client => client.ServiceEndpoint).Returns(new Uri("https://foo")); + + using GlobalEndpointManager endpointManager = new GlobalEndpointManager(mockDocumentClient.Object, new ConnectionPolicy()); + ISessionContainer sessionContainer = new SessionContainer(string.Empty); + DocumentClientEventSource eventSource = DocumentClientEventSource.Instance; + HttpMessageHandler messageHandler = new MockMessageHandler(sendFunc); + using GatewayStoreModel storeModel = new GatewayStoreModel( + endpointManager, + sessionContainer, + ConsistencyLevel.Eventual, + eventSource, + null, + MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(messageHandler))); + + using (new ActivityScope(Guid.NewGuid())) + { + using (DocumentServiceRequest request = + DocumentServiceRequest.Create( + Documents.OperationType.Query, + Documents.ResourceType.Document, + new Uri("https://foo.com/dbs/db1/colls/coll1", UriKind.Absolute), + new MemoryStream(Encoding.UTF8.GetBytes("content1")), + AuthorizationTokenType.PrimaryMasterKey, + null)) + { + // Add properties to the DCE + request.Properties = new Dictionary(); + foreach (KeyValuePair property in properties) + { + request.Properties.Add(property.Key, property.Value); + } + + await storeModel.ProcessMessageAsync(request); + } + } + } + [TestMethod] public async Task TestApplySessionForMasterOperation() { From 4222cefad2df3c06d13fb629ae0c1f4b3937d08c Mon Sep 17 00:00:00 2001 From: Scott Addie <10702007+scottaddie@users.noreply.github.com> Date: Thu, 6 Apr 2023 17:31:29 -0500 Subject: [PATCH 087/240] Documentation: Refactors SQL API reference to NoSQL API (#3793) Co-authored-by: Kiran Kumar Kolli --- Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj index a33142b79b..7ba4e9213d 100644 --- a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj +++ b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj @@ -3,7 +3,7 @@ Microsoft Corporation Microsoft(R) Azure Cosmos - This client library enables client applications to connect to Azure Cosmos DB for NoSQL. Azure Cosmos DB is a globally distributed, multi-model database service. For more information, refer to http://azure.microsoft.com/services/cosmos-db/. + This client library enables client applications to connect to Azure Cosmos DB via the NoSQL API. Azure Cosmos DB is a globally distributed, multi-model database service. For more information, refer to http://azure.microsoft.com/services/cosmos-db/. © Microsoft Corporation. All rights reserved. en-US $([System.DateTime]::Now.ToString(yyyyMMdd)) From fce970237f1f1b5c5b7d88488761b61dd3e766d4 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Fri, 7 Apr 2023 05:45:12 +0530 Subject: [PATCH 088/240] [Internal] Perf test: Refactors code to re-enable performance tests (#3785) * enable perf tests * updated json * upgrade benchmark * update results * updated benchmark results --- .../Contracts/BenchmarkResults.json | 144 +++++++++--------- .../Contracts/PerformanceValidation.cs | 2 +- ...soft.Azure.Cosmos.Performance.Tests.csproj | 2 +- 3 files changed, 74 insertions(+), 74 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json index b54d4f0624..c97e0b5b2c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json @@ -1,79 +1,79 @@ { - "MasterKeyAuthorizationBenchmark.CreateSignatureGeneration;": 534.0, - "MasterKeyAuthorizationBenchmark.ReadSignatureGeneration;": 532.0, - "MockedItemBenchmark.CreateItem;[Type=OfT]": 45302.0, - "MockedItemBenchmark.CreateItem;[Type=OfTCustom]": 45320.0, - "MockedItemBenchmark.CreateItem;[Type=OfTWithClientTelemetryEnabled]": 48140.0, - "MockedItemBenchmark.CreateItem;[Type=OfTWithDiagnosticsToString]": 83798.0, - "MockedItemBenchmark.CreateItem;[Type=Stream]": 29766.0, - "MockedItemBenchmark.DeleteItemExists;[Type=OfT]": 37154.0, - "MockedItemBenchmark.DeleteItemExists;[Type=OfTCustom]": 37154.0, - "MockedItemBenchmark.DeleteItemExists;[Type=OfTWithClientTelemetryEnabled]": 39840.0, - "MockedItemBenchmark.DeleteItemExists;[Type=OfTWithDiagnosticsToString]": 74758.0, - "MockedItemBenchmark.DeleteItemExists;[Type=Stream]": 29872.0, - "MockedItemBenchmark.DeleteItemNotExists;[Type=OfT]": 42786.0, - "MockedItemBenchmark.DeleteItemNotExists;[Type=OfTCustom]": 43144.0, - "MockedItemBenchmark.DeleteItemNotExists;[Type=OfTWithClientTelemetryEnabled]": 44694.0, - "MockedItemBenchmark.DeleteItemNotExists;[Type=OfTWithDiagnosticsToString]": 80098.0, - "MockedItemBenchmark.DeleteItemNotExists;[Type=Stream]": 37610.0, + "MasterKeyAuthorizationBenchmark.CreateSignatureGeneration;": 534, + "MasterKeyAuthorizationBenchmark.ReadSignatureGeneration;": 544, + "MockedItemBenchmark.CreateItem;[Type=OfT]": 36356, + "MockedItemBenchmark.CreateItem;[Type=OfTCustom]": 36362, + "MockedItemBenchmark.CreateItem;[Type=OfTWithClientTelemetryEnabled]": 36359.5, + "MockedItemBenchmark.CreateItem;[Type=OfTWithDiagnosticsToString]": 57472.25, + "MockedItemBenchmark.CreateItem;[Type=Stream]": 24673.25, + "MockedItemBenchmark.DeleteItemExists;[Type=OfT]": 32308.5, + "MockedItemBenchmark.DeleteItemExists;[Type=OfTCustom]": 32328, + "MockedItemBenchmark.DeleteItemExists;[Type=OfTWithClientTelemetryEnabled]": 32321.25, + "MockedItemBenchmark.DeleteItemExists;[Type=OfTWithDiagnosticsToString]": 53231.25, + "MockedItemBenchmark.DeleteItemExists;[Type=Stream]": 24696, + "MockedItemBenchmark.DeleteItemNotExists;[Type=OfT]": 42172.5, + "MockedItemBenchmark.DeleteItemNotExists;[Type=OfTCustom]": 42174.75, + "MockedItemBenchmark.DeleteItemNotExists;[Type=OfTWithClientTelemetryEnabled]": 42166.5, + "MockedItemBenchmark.DeleteItemNotExists;[Type=OfTWithDiagnosticsToString]": 56695.5, + "MockedItemBenchmark.DeleteItemNotExists;[Type=Stream]": 37610, "MockedItemBenchmark.QuerySinglePartitionMultiplePages;[Type=OfT]": 13342232, "MockedItemBenchmark.QuerySinglePartitionMultiplePages;[Type=OfTCustom]": 13341058, "MockedItemBenchmark.QuerySinglePartitionMultiplePages;[Type=OfTWithClientTelemetryEnabled]": 13355160, "MockedItemBenchmark.QuerySinglePartitionMultiplePages;[Type=OfTWithDiagnosticsToString]": 13612338, "MockedItemBenchmark.QuerySinglePartitionMultiplePages;[Type=Stream]": 5920952, - "MockedItemBenchmark.QuerySinglePartitionOnePage;[Type=OfT]": 2241814.0, - "MockedItemBenchmark.QuerySinglePartitionOnePage;[Type=OfTCustom]": 2241810.0, - "MockedItemBenchmark.QuerySinglePartitionOnePage;[Type=OfTWithClientTelemetryEnabled]": 2244658.0, - "MockedItemBenchmark.QuerySinglePartitionOnePage;[Type=OfTWithDiagnosticsToString]": 2310842.0, - "MockedItemBenchmark.QuerySinglePartitionOnePage;[Type=Stream]": 1005038.0, - "MockedItemBenchmark.ReadFeed;[Type=OfT]": 560692.0, - "MockedItemBenchmark.ReadFeed;[Type=OfTCustom]": 571334.0, - "MockedItemBenchmark.ReadFeed;[Type=OfTWithClientTelemetryEnabled]": 565196.0, - "MockedItemBenchmark.ReadFeed;[Type=OfTWithDiagnosticsToString]": 609704.0, - "MockedItemBenchmark.ReadFeed;[Type=Stream]": 39140.0, - "MockedItemBenchmark.ReadItemExists;[Type=OfT]": 38622.0, - "MockedItemBenchmark.ReadItemExists;[Type=OfTCustom]": 37992.0, - "MockedItemBenchmark.ReadItemExists;[Type=OfTWithClientTelemetryEnabled]": 39918.0, - "MockedItemBenchmark.ReadItemExists;[Type=OfTWithDiagnosticsToString]": 74370.0, - "MockedItemBenchmark.ReadItemExists;[Type=Stream]": 31018.0, - "MockedItemBenchmark.ReadItemNotExists;[Type=OfT]": 43438.0, - "MockedItemBenchmark.ReadItemNotExists;[Type=OfTCustom]": 43860.0, - "MockedItemBenchmark.ReadItemNotExists;[Type=OfTWithClientTelemetryEnabled]": 45502.0, - "MockedItemBenchmark.ReadItemNotExists;[Type=OfTWithDiagnosticsToString]": 83760.0, - "MockedItemBenchmark.ReadItemNotExists;[Type=Stream]": 38266.0, - "MockedItemBenchmark.UpdateItem;[Type=OfT]": 46690.0, - "MockedItemBenchmark.UpdateItem;[Type=OfTCustom]": 45532.0, - "MockedItemBenchmark.UpdateItem;[Type=OfTWithClientTelemetryEnabled]": 48372.0, - "MockedItemBenchmark.UpdateItem;[Type=OfTWithDiagnosticsToString]": 84694.0, - "MockedItemBenchmark.UpdateItem;[Type=Stream]": 30026.0, - "MockedItemBenchmark.UpsertItem;[Type=OfT]": 45448.0, - "MockedItemBenchmark.UpsertItem;[Type=OfTCustom]": 45458.0, - "MockedItemBenchmark.UpsertItem;[Type=OfTWithClientTelemetryEnabled]": 48298.0, - "MockedItemBenchmark.UpsertItem;[Type=OfTWithDiagnosticsToString]": 83938.0, - "MockedItemBenchmark.UpsertItem;[Type=Stream]": 29934.0, - "MockedItemBulkBenchmark.CreateItem;[Type=OfT]": 1196168.0, - "MockedItemBulkBenchmark.CreateItem;[Type=OfTCustom]": 1195808.0, - "MockedItemBulkBenchmark.CreateItem;[Type=OfTWithClientTelemetryEnabled]": 1235418.0, - "MockedItemBulkBenchmark.CreateItem;[Type=OfTWithDiagnosticsToString]": 1231120.0, - "MockedItemBulkBenchmark.CreateItem;[Type=Stream]": 772810.0, - "MockedItemBulkBenchmark.DeleteItem;[Type=OfT]": 1187168.0, - "MockedItemBulkBenchmark.DeleteItem;[Type=OfTCustom]": 1187224.0, - "MockedItemBulkBenchmark.DeleteItem;[Type=OfTWithClientTelemetryEnabled]": 1226488.0, - "MockedItemBulkBenchmark.DeleteItem;[Type=OfTWithDiagnosticsToString]": 1222124.0, - "MockedItemBulkBenchmark.DeleteItem;[Type=Stream]": 771414.0, - "MockedItemBulkBenchmark.ReadItem;[Type=OfT]": 1186594.0, - "MockedItemBulkBenchmark.ReadItem;[Type=OfTCustom]": 1187192.0, - "MockedItemBulkBenchmark.ReadItem;[Type=OfTWithClientTelemetryEnabled]": 1226502.0, - "MockedItemBulkBenchmark.ReadItem;[Type=OfTWithDiagnosticsToString]": 1222342.0, - "MockedItemBulkBenchmark.ReadItem;[Type=Stream]": 770894.0, - "MockedItemBulkBenchmark.UpdateItem;[Type=OfT]": 1196464.0, - "MockedItemBulkBenchmark.UpdateItem;[Type=OfTCustom]": 1195778.0, - "MockedItemBulkBenchmark.UpdateItem;[Type=OfTWithClientTelemetryEnabled]": 1235738.0, - "MockedItemBulkBenchmark.UpdateItem;[Type=OfTWithDiagnosticsToString]": 1231486.0, - "MockedItemBulkBenchmark.UpdateItem;[Type=Stream]": 773284.0, - "MockedItemBulkBenchmark.UpsertItem;[Type=OfT]": 1196210.0, - "MockedItemBulkBenchmark.UpsertItem;[Type=OfTCustom]": 1195590.0, - "MockedItemBulkBenchmark.UpsertItem;[Type=OfTWithClientTelemetryEnabled]": 1235596.0, - "MockedItemBulkBenchmark.UpsertItem;[Type=OfTWithDiagnosticsToString]": 1231380.0, - "MockedItemBulkBenchmark.UpsertItem;[Type=Stream]": 773312.0 + "MockedItemBenchmark.QuerySinglePartitionOnePage;[Type=OfT]": 2241814, + "MockedItemBenchmark.QuerySinglePartitionOnePage;[Type=OfTCustom]": 2241810, + "MockedItemBenchmark.QuerySinglePartitionOnePage;[Type=OfTWithClientTelemetryEnabled]": 2244658, + "MockedItemBenchmark.QuerySinglePartitionOnePage;[Type=OfTWithDiagnosticsToString]": 2310842, + "MockedItemBenchmark.QuerySinglePartitionOnePage;[Type=Stream]": 1005038, + "MockedItemBenchmark.ReadFeed;[Type=OfT]": 560692, + "MockedItemBenchmark.ReadFeed;[Type=OfTCustom]": 555716, + "MockedItemBenchmark.ReadFeed;[Type=OfTWithClientTelemetryEnabled]": 550898.25, + "MockedItemBenchmark.ReadFeed;[Type=OfTWithDiagnosticsToString]": 573734.5, + "MockedItemBenchmark.ReadFeed;[Type=Stream]": 33434, + "MockedItemBenchmark.ReadItemExists;[Type=OfT]": 33630.5, + "MockedItemBenchmark.ReadItemExists;[Type=OfTCustom]": 33636.25, + "MockedItemBenchmark.ReadItemExists;[Type=OfTWithClientTelemetryEnabled]": 33627.75, + "MockedItemBenchmark.ReadItemExists;[Type=OfTWithDiagnosticsToString]": 47961.25, + "MockedItemBenchmark.ReadItemExists;[Type=Stream]": 26018.25, + "MockedItemBenchmark.ReadItemNotExists;[Type=OfT]": 43489.25, + "MockedItemBenchmark.ReadItemNotExists;[Type=OfTCustom]": 43490, + "MockedItemBenchmark.ReadItemNotExists;[Type=OfTWithClientTelemetryEnabled]": 43489.25, + "MockedItemBenchmark.ReadItemNotExists;[Type=OfTWithDiagnosticsToString]": 57420.25, + "MockedItemBenchmark.ReadItemNotExists;[Type=Stream]": 39044, + "MockedItemBenchmark.UpdateItem;[Type=OfT]": 36591, + "MockedItemBenchmark.UpdateItem;[Type=OfTCustom]": 36594.25, + "MockedItemBenchmark.UpdateItem;[Type=OfTWithClientTelemetryEnabled]": 36587.25, + "MockedItemBenchmark.UpdateItem;[Type=OfTWithDiagnosticsToString]": 57649, + "MockedItemBenchmark.UpdateItem;[Type=Stream]": 24894.75, + "MockedItemBenchmark.UpsertItem;[Type=OfT]": 36577.25, + "MockedItemBenchmark.UpsertItem;[Type=OfTCustom]": 36583.75, + "MockedItemBenchmark.UpsertItem;[Type=OfTWithClientTelemetryEnabled]": 36578.5, + "MockedItemBenchmark.UpsertItem;[Type=OfTWithDiagnosticsToString]": 57732.5, + "MockedItemBenchmark.UpsertItem;[Type=Stream]": 24878.5, + "MockedItemBulkBenchmark.CreateItem;[Type=OfT]": 1196168, + "MockedItemBulkBenchmark.CreateItem;[Type=OfTCustom]": 1195808, + "MockedItemBulkBenchmark.CreateItem;[Type=OfTWithClientTelemetryEnabled]": 1235418, + "MockedItemBulkBenchmark.CreateItem;[Type=OfTWithDiagnosticsToString]": 1231120, + "MockedItemBulkBenchmark.CreateItem;[Type=Stream]": 772810, + "MockedItemBulkBenchmark.DeleteItem;[Type=OfT]": 1187168, + "MockedItemBulkBenchmark.DeleteItem;[Type=OfTCustom]": 1187224, + "MockedItemBulkBenchmark.DeleteItem;[Type=OfTWithClientTelemetryEnabled]": 1226488, + "MockedItemBulkBenchmark.DeleteItem;[Type=OfTWithDiagnosticsToString]": 1222124, + "MockedItemBulkBenchmark.DeleteItem;[Type=Stream]": 771414, + "MockedItemBulkBenchmark.ReadItem;[Type=OfT]": 1186594, + "MockedItemBulkBenchmark.ReadItem;[Type=OfTCustom]": 1187192, + "MockedItemBulkBenchmark.ReadItem;[Type=OfTWithClientTelemetryEnabled]": 1226502, + "MockedItemBulkBenchmark.ReadItem;[Type=OfTWithDiagnosticsToString]": 1222342, + "MockedItemBulkBenchmark.ReadItem;[Type=Stream]": 770894, + "MockedItemBulkBenchmark.UpdateItem;[Type=OfT]": 1196464, + "MockedItemBulkBenchmark.UpdateItem;[Type=OfTCustom]": 1195778, + "MockedItemBulkBenchmark.UpdateItem;[Type=OfTWithClientTelemetryEnabled]": 1235738, + "MockedItemBulkBenchmark.UpdateItem;[Type=OfTWithDiagnosticsToString]": 1231486, + "MockedItemBulkBenchmark.UpdateItem;[Type=Stream]": 773284, + "MockedItemBulkBenchmark.UpsertItem;[Type=OfT]": 1196210, + "MockedItemBulkBenchmark.UpsertItem;[Type=OfTCustom]": 1195590, + "MockedItemBulkBenchmark.UpsertItem;[Type=OfTWithClientTelemetryEnabled]": 1235596, + "MockedItemBulkBenchmark.UpsertItem;[Type=OfTWithDiagnosticsToString]": 1231380, + "MockedItemBulkBenchmark.UpsertItem;[Type=Stream]": 773312 } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/PerformanceValidation.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/PerformanceValidation.cs index af3d77e5a4..ad7e43ab4a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/PerformanceValidation.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/PerformanceValidation.cs @@ -125,7 +125,7 @@ public static int ValidateSummaryResultsAgainstBaseline(SortedDictionary - + From 2f2e8fbd32fb672253413c1f237a03801810619a Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Fri, 7 Apr 2023 14:18:20 -0700 Subject: [PATCH 089/240] HttpClient: Adds detection of DNS changes through use of SocketsHttpHandler for .NET 6 and above (#3762) * initial commit * removed unneeded usings * added validation callback, still needs tests * nits + fixes * added additional test * test change * removed unneeded Dispose calls * removed unnneed dispose calls * requested changes * added pooledConnectionLifetime as client option * nit Co-authored-by: Kevin Pilch * Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs Co-authored-by: Matias Quaranta * Update Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs Co-authored-by: Matias Quaranta * suggested changes * remove test, reorder usings * updated contracts * removed all non XXXAPI.json changes from UpdateContracts run * removed public surface, added random timespan * removed change from unrelated file * Update Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs Co-authored-by: Matias Quaranta * added thread safe random method * nit * fixed merge mistake * added reflection failsafe/error tracing * nits * added back removed if * fixed formatting * changed random method, fixed serverCertificateCustomValidation --------- Co-authored-by: Kevin Pilch Co-authored-by: Matias Quaranta --- .../src/HttpClient/CosmosHttpClientCore.cs | 97 +++++++++++++++++-- .../ClientTests.cs | 19 +++- .../CosmosClientOptionsUnitTests.cs | 2 +- .../CosmosHttpClientCoreTests.cs | 65 +++++++++++-- 4 files changed, 164 insertions(+), 19 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs b/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs index a48666f16d..0fde01afb5 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs @@ -5,17 +5,17 @@ namespace Microsoft.Azure.Cosmos { using System; using System.Collections.Generic; - using System.Diagnostics; using System.Linq; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Net.Security; + using System.Reflection; using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Core.Trace; using Microsoft.Azure.Cosmos.Resource.CosmosExceptions; - using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; using Microsoft.Azure.Documents; using Microsoft.Azure.Documents.Collections; @@ -99,7 +99,87 @@ public static CosmosHttpClient CreateWithConnectionPolicy( eventSource: eventSource); } - public static HttpMessageHandler CreateHttpClientHandler(int gatewayModeMaxConnectionLimit, IWebProxy webProxy, Func serverCertificateCustomValidationCallback) + public static HttpMessageHandler CreateHttpClientHandler( + int gatewayModeMaxConnectionLimit, + IWebProxy webProxy, + Func serverCertificateCustomValidationCallback) + { + // TODO: Remove type check and use #if NET6_0_OR_GREATER when multitargetting is possible + Type socketHandlerType = Type.GetType("System.Net.Http.SocketsHttpHandler, System.Net.Http"); + + if (socketHandlerType != null) + { + try + { + return CosmosHttpClientCore.CreateSocketsHttpHandlerHelper(gatewayModeMaxConnectionLimit, webProxy, serverCertificateCustomValidationCallback); + } + catch (Exception e) + { + DefaultTrace.TraceError("Failed to create SocketsHttpHandler: {0}", e); + } + } + + return CosmosHttpClientCore.CreateHttpClientHandlerHelper(gatewayModeMaxConnectionLimit, webProxy, serverCertificateCustomValidationCallback); + } + + public static HttpMessageHandler CreateSocketsHttpHandlerHelper( + int gatewayModeMaxConnectionLimit, + IWebProxy webProxy, + Func serverCertificateCustomValidationCallback) + { + // TODO: Remove Reflection when multitargetting is possible + Type socketHandlerType = Type.GetType("System.Net.Http.SocketsHttpHandler, System.Net.Http"); + + object socketHttpHandler = Activator.CreateInstance(socketHandlerType); + + PropertyInfo pooledConnectionLifetimeInfo = socketHandlerType.GetProperty("PooledConnectionLifetime"); + + //Sets the timeout for unused connections to a random time between 5 minutes and 5 minutes and 30 seconds. + //This is to avoid the issue where a large number of connections are closed at the same time. + TimeSpan connectionTimeSpan = TimeSpan.FromMinutes(5) + TimeSpan.FromSeconds(30 * CustomTypeExtensions.GetRandomNumber().NextDouble()); + pooledConnectionLifetimeInfo.SetValue(socketHttpHandler, connectionTimeSpan); + + // Proxy is only set by users and can cause not supported exception on some platforms + if (webProxy != null) + { + PropertyInfo webProxyInfo = socketHandlerType.GetProperty("Proxy"); + webProxyInfo.SetValue(socketHttpHandler, webProxy); + } + + // https://docs.microsoft.com/en-us/archive/blogs/timomta/controlling-the-number-of-outgoing-connections-from-httpclient-net-core-or-full-framework + try + { + PropertyInfo maxConnectionsPerServerInfo = socketHandlerType.GetProperty("MaxConnectionsPerServer"); + maxConnectionsPerServerInfo.SetValue(socketHttpHandler, gatewayModeMaxConnectionLimit); + } + // MaxConnectionsPerServer is not supported on some platforms. + catch (PlatformNotSupportedException) + { + } + + if (serverCertificateCustomValidationCallback != null) + { + //Get SslOptions Property + PropertyInfo sslOptionsInfo = socketHandlerType.GetProperty("SslOptions"); + object sslOptions = sslOptionsInfo.GetValue(socketHttpHandler); + + //Set SslOptions Property with custom certificate validation + PropertyInfo remoteCertificateValidationCallbackInfo = sslOptions.GetType().GetProperty("RemoteCertificateValidationCallback"); + remoteCertificateValidationCallbackInfo.SetValue( + sslOptions, + new RemoteCertificateValidationCallback((object _, X509Certificate certificate, X509Chain x509Chain, SslPolicyErrors sslPolicyErrors) => serverCertificateCustomValidationCallback( + certificate is { } ? new X509Certificate2(certificate) : null, + x509Chain, + sslPolicyErrors))); + } + + return (HttpMessageHandler)socketHttpHandler; + } + + public static HttpMessageHandler CreateHttpClientHandlerHelper( + int gatewayModeMaxConnectionLimit, + IWebProxy webProxy, + Func serverCertificateCustomValidationCallback) { HttpClientHandler httpClientHandler = new HttpClientHandler(); @@ -112,17 +192,18 @@ public static HttpMessageHandler CreateHttpClientHandler(int gatewayModeMaxConne // https://docs.microsoft.com/en-us/archive/blogs/timomta/controlling-the-number-of-outgoing-connections-from-httpclient-net-core-or-full-framework try { - httpClientHandler.MaxConnectionsPerServer = gatewayModeMaxConnectionLimit; - if (serverCertificateCustomValidationCallback != null) - { - httpClientHandler.ServerCertificateCustomValidationCallback = (_, certificate2, x509Chain, sslPolicyErrors) => serverCertificateCustomValidationCallback(certificate2, x509Chain, sslPolicyErrors); - } + httpClientHandler.MaxConnectionsPerServer = gatewayModeMaxConnectionLimit; } // MaxConnectionsPerServer is not supported on some platforms. catch (PlatformNotSupportedException) { } + if (serverCertificateCustomValidationCallback != null) + { + httpClientHandler.ServerCertificateCustomValidationCallback = (_, certificate2, x509Chain, sslPolicyErrors) => serverCertificateCustomValidationCallback(certificate2, x509Chain, sslPolicyErrors); + } + return httpClientHandler; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs index 1f419c4eb8..c8a9a0aff7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs @@ -486,7 +486,6 @@ public async Task Verify_CertificateCallBackGetsCalled_ForTCP_HTTP() { await database?.DeleteStreamAsync(); } - } [TestMethod] @@ -878,7 +877,7 @@ public async Task HttpClientConnectionLimitTest() )) { CosmosHttpClient cosmosHttpClient = cosmosClient.DocumentClient.httpClient; - HttpClientHandler httpClientHandler = (HttpClientHandler)cosmosHttpClient.HttpMessageHandler; + SocketsHttpHandler httpClientHandler = (SocketsHttpHandler)cosmosHttpClient.HttpMessageHandler; Assert.AreEqual(gatewayConnectionLimit, httpClientHandler.MaxConnectionsPerServer); Cosmos.Database database = await cosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString()); @@ -895,7 +894,7 @@ public async Task HttpClientConnectionLimitTest() await Task.WhenAll(creates); - // Clean up the database and container + // Clean up the database await database.DeleteAsync(); } @@ -907,6 +906,20 @@ public async Task HttpClientConnectionLimitTest() $"Before connections: {JsonConvert.SerializeObject(excludeConnections)}; After connections: {JsonConvert.SerializeObject(afterConnections)}"); } + [TestMethod] + public void PooledConnectionLifetimeTest() + { + //Create Cosmos Client + using CosmosClient cosmosClient = new CosmosClient( + accountEndpoint: "https://localhost:8081", + authKeyOrResourceToken: Convert.ToBase64String(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString()))); + + //Assert type of message handler + Type socketHandlerType = Type.GetType("System.Net.Http.SocketsHttpHandler, System.Net.Http"); + Type clientMessageHandlerType = cosmosClient.ClientContext.DocumentClient.httpClient.HttpMessageHandler.GetType(); + Assert.AreEqual(socketHandlerType, clientMessageHandlerType); + } + public static IReadOnlyList GetActiveConnections() { string testPid = Process.GetCurrentProcess().Id.ToString(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs index 986b9cc997..efb06d7cc5 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs @@ -398,7 +398,7 @@ public void VerifyHttpClientHandlerIsSet() CosmosClient cosmosClient = cosmosClientBuilder.Build(); CosmosHttpClient cosmosHttpClient = cosmosClient.DocumentClient.httpClient; - HttpClientHandler handler = (HttpClientHandler)cosmosHttpClient.HttpMessageHandler; + SocketsHttpHandler handler = (SocketsHttpHandler)cosmosHttpClient.HttpMessageHandler; Assert.IsTrue(object.ReferenceEquals(webProxy, handler.Proxy)); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs index 3ac919bf83..0d475ca370 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs @@ -4,18 +4,20 @@ namespace Microsoft.Azure.Cosmos.Tests { - using System.Threading.Tasks; - using Microsoft.VisualStudio.TestTools.UnitTesting; - using Microsoft.Azure.Documents; using System; - using System.Net.Http; + using System.Collections.Generic; + using System.IO; using System.Net; + using System.Net.Http; + using System.Net.Security; + using System.Security.Cryptography; + using System.Security.Cryptography.X509Certificates; using System.Threading; - using System.IO; - using System.Net.Sockets; - using System.Collections.Generic; + using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; + using Microsoft.Azure.Documents; + using Microsoft.VisualStudio.TestTools.UnitTesting; [TestClass] public class CosmosHttpClientCoreTests @@ -410,6 +412,55 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio Assert.AreEqual(HttpStatusCode.OK, responseMessage.StatusCode); } + [TestMethod] + public void CreateSocketsHttpHandlerCreatesCorrectValueType() + { + int gatewayLimit = 10; + IWebProxy webProxy = null; + Func serverCertificateCustomValidationCallback = (certificate2, x509Chain, sslPolicyErrors) => false; + + HttpMessageHandler handler = CosmosHttpClientCore.CreateSocketsHttpHandlerHelper( + gatewayLimit, + webProxy, + serverCertificateCustomValidationCallback); + + Assert.AreEqual(Type.GetType("System.Net.Http.SocketsHttpHandler, System.Net.Http"), handler.GetType()); + SocketsHttpHandler socketsHandler = (SocketsHttpHandler)handler; + + Assert.IsTrue(TimeSpan.FromMinutes(5.5) >= socketsHandler.PooledConnectionLifetime); + Assert.IsTrue(TimeSpan.FromMinutes(5) <= socketsHandler.PooledConnectionLifetime); + Assert.AreEqual(webProxy, socketsHandler.Proxy); + Assert.AreEqual(gatewayLimit, socketsHandler.MaxConnectionsPerServer); + + //Create cert for test + X509Certificate2 x509Certificate2 = new CertificateRequest("cn=www.test", ECDsa.Create(), HashAlgorithmName.SHA256).CreateSelfSigned(DateTime.Now, DateTime.Now.AddYears(1)); + X509Chain x509Chain = new X509Chain(); + SslPolicyErrors sslPolicyErrors = new SslPolicyErrors(); + Assert.IsFalse(socketsHandler.SslOptions.RemoteCertificateValidationCallback.Invoke(new object(), x509Certificate2, x509Chain, sslPolicyErrors)); + } + + [TestMethod] + public void CreateHttpClientHandlerCreatesCorrectValueType() + { + int gatewayLimit = 10; + IWebProxy webProxy = null; + Func serverCertificateCustomValidationCallback = (certificate2, x509Chain, sslPolicyErrors) => false; + + HttpMessageHandler handler = CosmosHttpClientCore.CreateHttpClientHandlerHelper(gatewayLimit, webProxy, serverCertificateCustomValidationCallback); + + Assert.AreEqual(Type.GetType("System.Net.Http.HttpClientHandler, System.Net.Http"), handler.GetType()); + HttpClientHandler clientHandler = (HttpClientHandler)handler; + + Assert.AreEqual(webProxy, clientHandler.Proxy); + Assert.AreEqual(gatewayLimit, clientHandler.MaxConnectionsPerServer); + + //Create cert for test + X509Certificate2 x509Certificate2 = new CertificateRequest("cn=www.test", ECDsa.Create(), HashAlgorithmName.SHA256).CreateSelfSigned(DateTime.Now, DateTime.Now.AddYears(1)); + X509Chain x509Chain = new X509Chain(); + SslPolicyErrors sslPolicyErrors = new SslPolicyErrors(); + Assert.IsFalse(clientHandler.ServerCertificateCustomValidationCallback.Invoke(new HttpRequestMessage(), x509Certificate2, x509Chain, sslPolicyErrors)); + } + private class MockMessageHandler : HttpMessageHandler { private readonly Func> sendFunc; From 789f70183a2323259d6518eb7d463aca38f4ae08 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Sat, 8 Apr 2023 11:05:59 -0700 Subject: [PATCH 090/240] [Internal] Tests: Fixes Open Telemetry attributes for ReadMany test (#3805) * Fixing test * New baseline * Undo some changes --- .../EndToEndTraceWriterBaselineTests.ReadManyAsync.xml | 10 ---------- .../Tracing/EndToEndTraceWriterBaselineTests.cs | 4 +++- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml index 7229f78197..a7cc47631a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml @@ -543,16 +543,6 @@ ] }]]> Operation.ReadManyItemsStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadManyItemsStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs index c32c756121..e14188d92a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs @@ -92,7 +92,7 @@ public static async Task ClassInitAsync(TestContext context) EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); } - + [TestCleanup] public async Task CleanUp() { @@ -1405,6 +1405,8 @@ public async Task ReadManyAsync() itemList.Add(("id" + i, new PartitionKey(i.ToString()))); } + EndToEndTraceWriterBaselineTests.AssertAndResetActivityInformation(); + //---------------------------------------------------------------- // Read Many Stream //---------------------------------------------------------------- From 2b6fdb7d818115b88a992d0370e77d1a8aaf0e19 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 11 Apr 2023 00:42:35 +0530 Subject: [PATCH 091/240] [Internal] Client Telemetry: Refactors code to run client telemetry data processing task in background. (#3783) * first draft * remove failure count test * refactporing * code refactor * create task with timeout * fix test * code refactoring * fix timeout code * space fix * not failing if processor is taking time * fix procrsser test * code refactor * refactor and test fix --- .../src/Telemetry/ClientTelemetry.cs | 78 ++++++++----- .../src/Telemetry/ClientTelemetryOptions.cs | 6 +- .../ClientTelemetryTests.cs | 27 ----- .../Telemetry/ClientTelemetryTests.cs | 108 +++++++++++++++++- 4 files changed, 155 insertions(+), 64 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs index 8a83778fdb..dde7d5a7c5 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs @@ -19,7 +19,6 @@ namespace Microsoft.Azure.Cosmos.Telemetry using Microsoft.Azure.Cosmos.Tracing.TraceData; using Microsoft.Azure.Documents; using Util; - using static Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum; /// /// This class collects and send all the telemetry information. @@ -29,8 +28,6 @@ namespace Microsoft.Azure.Cosmos.Telemetry /// internal class ClientTelemetry : IDisposable { - private const int allowedNumberOfFailures = 3; - private static readonly TimeSpan observingWindow = ClientTelemetryOptions.GetScheduledTimeSpan(); private readonly ClientTelemetryProperties clientTelemetryInfo; @@ -39,7 +36,6 @@ internal class ClientTelemetry : IDisposable private readonly NetworkDataRecorder networkDataRecorder; private readonly CancellationTokenSource cancellationTokenSource; - private readonly GlobalEndpointManager globalEndpointManager; private Task telemetryTask; @@ -50,8 +46,6 @@ internal class ClientTelemetry : IDisposable private ConcurrentDictionary cacheRefreshInfoMap = new ConcurrentDictionary(); - private int numberOfFailures = 0; - /// /// Only for Mocking in tests /// @@ -123,7 +117,6 @@ internal ClientTelemetry( aggregationIntervalInSec: (int)observingWindow.TotalSeconds); this.networkDataRecorder = new NetworkDataRecorder(); - this.cancellationTokenSource = new CancellationTokenSource(); } @@ -137,9 +130,9 @@ private void StartObserverTask() /// /// Task which does below operations , periodically - /// 1. Set Account information (one time at the time of initialization) - /// 2. Load VM metedata information (one time at the time of initialization) - /// 3. Calculate and Send telemetry Information to juno service (never ending task)/// + /// 1. Set Account information (one time during initialization) + /// 2. Load VM metedata information (one time during initialization) + /// 3. Calculate and Send telemetry Information to Client Telemetry Service (never ending task)/// /// Async Task private async Task EnrichAndSendAsync() { @@ -149,18 +142,12 @@ private async Task EnrichAndSendAsync() { while (!this.cancellationTokenSource.IsCancellationRequested) { - if (this.numberOfFailures == allowedNumberOfFailures) - { - this.Dispose(); - break; - } - if (string.IsNullOrEmpty(this.clientTelemetryInfo.GlobalDatabaseAccountName)) { AccountProperties accountProperties = await ClientTelemetryHelper.SetAccountNameAsync(this.globalEndpointManager); this.clientTelemetryInfo.GlobalDatabaseAccountName = accountProperties.Id; } - + await Task.Delay(observingWindow, this.cancellationTokenSource.Token); this.clientTelemetryInfo.DateTimeUtc = DateTime.UtcNow.ToString(ClientTelemetryOptions.DateFormat); @@ -180,24 +167,28 @@ private async Task EnrichAndSendAsync() ConcurrentDictionary cacheRefreshInfoSnapshot = Interlocked.Exchange(ref this.cacheRefreshInfoMap, new ConcurrentDictionary()); - + + List requestInfoSnapshot = this.networkDataRecorder.GetRequests(); + try { - await this.processor - .ProcessAndSendAsync( - clientTelemetryInfo: this.clientTelemetryInfo, - operationInfoSnapshot: operationInfoSnapshot, - cacheRefreshInfoSnapshot: cacheRefreshInfoSnapshot, - requestInfoSnapshot: this.networkDataRecorder.GetRequests(), - cancellationToken: this.cancellationTokenSource.Token); - - this.numberOfFailures = 0; + CancellationTokenSource cancellationToken = new CancellationTokenSource(ClientTelemetryOptions.ClientTelemetryProcessorTimeOut); + Task processorTask = Task.Run(() => this.processor + .ProcessAndSendAsync( + clientTelemetryInfo: this.clientTelemetryInfo, + operationInfoSnapshot: operationInfoSnapshot, + cacheRefreshInfoSnapshot: cacheRefreshInfoSnapshot, + requestInfoSnapshot: requestInfoSnapshot, + cancellationToken: cancellationToken.Token), cancellationToken.Token); + + // Initiating Telemetry Data Processor task which will serialize and send telemetry information to Client Telemetry Service + // Not disposing this task. If we dispose a client then, telemetry job(telemetryTask) should stop but processor task(processorTask) should make best effort to finish the job in background. + _ = ClientTelemetry.RunProcessorTaskAsync(this.clientTelemetryInfo.DateTimeUtc, processorTask, ClientTelemetryOptions.ClientTelemetryProcessorTimeOut); + } catch (Exception ex) { - this.numberOfFailures++; - - DefaultTrace.TraceError("Telemetry Job Processor failed with error : {0}", ex); + DefaultTrace.TraceError("Exception while initiating processing task : {0} with telemetry date as {1}", ex.Message, this.clientTelemetryInfo.DateTimeUtc); } } } @@ -209,6 +200,33 @@ await this.processor DefaultTrace.TraceInformation("Telemetry Job Stopped."); } + /// + /// This Task makes sure, processing task is timing out after 5 minute of timeout + /// + /// + /// + /// + internal static async Task RunProcessorTaskAsync(string telemetryDate, Task processingTask, TimeSpan timeout) + { + using (CancellationTokenSource tokenForDelayTask = new CancellationTokenSource()) + { + Task delayTask = Task.Delay(timeout, tokenForDelayTask.Token); + + Task resultTask = await Task.WhenAny(processingTask, delayTask); + if (resultTask == delayTask) + { + DefaultTrace.TraceVerbose($"Processor task with date as {telemetryDate} is canceled as it did not finish in {timeout}"); + // Operation cancelled + throw new OperationCanceledException($"Processor task with date as {telemetryDate} is canceled as it did not finish in {timeout}"); + } + else + { + // Cancel the timer task so that it does not fire + tokenForDelayTask.Cancel(); + } + } + } + /// /// Collects Cache Telemetry Information. /// diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs index 47232a187e..2aeaadca63 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs @@ -79,13 +79,12 @@ internal static class ClientTelemetryOptions internal const double Percentile99 = 99.0; internal const double Percentile999 = 99.9; internal const string DateFormat = "yyyy-MM-ddTHH:mm:ssZ"; - internal const string EnvPropsClientTelemetrySchedulingInSeconds = "COSMOS.CLIENT_TELEMETRY_SCHEDULING_IN_SECONDS"; internal const string EnvPropsClientTelemetryEnabled = "COSMOS.CLIENT_TELEMETRY_ENABLED"; internal const string EnvPropsClientTelemetryVmMetadataUrl = "COSMOS.VM_METADATA_URL"; internal const string EnvPropsClientTelemetryEndpoint = "COSMOS.CLIENT_TELEMETRY_ENDPOINT"; internal const string EnvPropsClientTelemetryEnvironmentName = "COSMOS.ENVIRONMENT_NAME"; - + internal static readonly ResourceType AllowedResourceTypes = ResourceType.Document; // Why 5 sec? As of now, if any network request is taking more than 5 millisecond sec, we will consider it slow request this value can be revisited in future internal static readonly TimeSpan NetworkLatencyThreshold = TimeSpan.FromMilliseconds(5); @@ -101,7 +100,8 @@ internal static class ClientTelemetryOptions internal static readonly int NetworkTelemetrySampleSize = 200; internal static int PayloadSizeThreshold = 1024 * 1024 * 2; // 2MB - + internal static TimeSpan ClientTelemetryProcessorTimeOut = TimeSpan.FromMinutes(5); + private static Uri clientTelemetryEndpoint; private static string environmentName; private static TimeSpan scheduledTimeSpan = TimeSpan.Zero; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs index 7e924ffd53..30edc7ebf7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs @@ -1075,33 +1075,6 @@ private static void AssertCacheRefreshInfoInformation( } } - [TestMethod] - public async Task CheckMisconfiguredTelemetryEndpoint_should_stop_the_job() - { - int retryCounter = 0; - HttpClientHandlerHelper customHttpHandler = new HttpClientHandlerHelper - { - RequestCallBack = (request, cancellation) => - { - if (request.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) - { - retryCounter++; - throw new Exception("Exception while sending telemetry"); - } - - return null; - } - }; - - Container container = await this.CreateClientAndContainer( - mode: ConnectionMode.Direct, - customHttpHandler: customHttpHandler); - - await Task.Delay(TimeSpan.FromMilliseconds(5000)); // wait for 5 sec, ideally telemetry would be sent 5 times but client telemetry endpoint is not functional (in this test), it should try 3 times maximum and after that client telemetry job should be stopped. - - Assert.AreEqual(3, retryCounter); - } - private static ItemBatchOperation CreateItem(string itemId) { var testItem = new { id = itemId, Status = itemId }; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryTests.cs index 4a6b077baa..9308d22806 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryTests.cs @@ -30,6 +30,7 @@ public class ClientTelemetryTests public void Cleanup() { Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, null); + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, null); } [TestMethod] @@ -147,7 +148,6 @@ public async Task CheckIfPayloadIsDividedCorrectlyAsync(int expectedOperationInf string payloadJson = request.Content.ReadAsStringAsync().Result; Assert.IsTrue(payloadJson.Length <= ClientTelemetryOptions.PayloadSizeThreshold, "Payload Size is " + payloadJson.Length); - Console.WriteLine(payloadJson); ClientTelemetryProperties propertiesToSend = JsonConvert.DeserializeObject(payloadJson); Assert.AreEqual(7, propertiesToSend.SystemInfo.Count, "System Info is not correct"); @@ -245,14 +245,114 @@ await processor.ProcessAndSendAsync( clientTelemetryProperties, operationInfoSnapshot, cacheRefreshInfoSnapshot, - requestInfoList, - new CancellationToken()); + requestInfoList, + new CancellationTokenSource(ClientTelemetryOptions.ClientTelemetryProcessorTimeOut).Token); Assert.AreEqual(expectedOperationInfoSize, actualOperationInfoSize, "Operation Info is not correct"); Assert.AreEqual(expectedCacheRefreshInfoSize, actualCacheRefreshInfoSize, "Cache Refresh Info is not correct"); Assert.AreEqual(expectedRequestInfoSize, actualRequestInfoSize, "Request Info is not correct"); } - + + [TestMethod] + public async Task ClientTelmetryProcessor_should_timeout() + { + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, "http://dummy.telemetry.endpoint/"); + + string data = File.ReadAllText("Telemetry/ClientTelemetryPayloadWithoutMetrics.json", Encoding.UTF8); + ClientTelemetryProperties clientTelemetryProperties = JsonConvert.DeserializeObject(data); + + int actualOperationInfoSize = 0; + int actualCacheRefreshInfoSize = 0; + + Mock mockHttpHandler = new Mock(); + _ = mockHttpHandler.Setup(x => x.SendAsync( + It.IsAny(), + It.IsAny())) + .Callback( + (request, cancellationToken) => + { + string payloadJson = request.Content.ReadAsStringAsync().Result; + Assert.IsTrue(payloadJson.Length <= ClientTelemetryOptions.PayloadSizeThreshold, "Payload Size is " + payloadJson.Length); + + ClientTelemetryProperties propertiesToSend = JsonConvert.DeserializeObject(payloadJson); + + actualOperationInfoSize += propertiesToSend.OperationInfo?.Count ?? 0; + actualCacheRefreshInfoSize += propertiesToSend.CacheRefreshInfo?.Count ?? 0; + }) + .Returns(Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK))); + + ClientTelemetryProcessor processor = new ClientTelemetryProcessor( + MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(new HttpHandlerHelper(mockHttpHandler.Object))), + Mock.Of()); + + ConcurrentDictionary operationInfoSnapshot + = new ConcurrentDictionary(); + + for (int i = 0; i < 20; i++) + { + OperationInfo opeInfo = new OperationInfo(Regions.WestUS, + 0, + Documents.ConsistencyLevel.Session.ToString(), + "databaseName" + i, + "containerName", + Documents.OperationType.Read, + Documents.ResourceType.Document, + 200, + 0); + + LongConcurrentHistogram latency = new LongConcurrentHistogram(ClientTelemetryOptions.RequestLatencyMin, + ClientTelemetryOptions.RequestLatencyMax, + ClientTelemetryOptions.RequestLatencyPrecision); + latency.RecordValue(10); + + LongConcurrentHistogram requestcharge = new LongConcurrentHistogram(ClientTelemetryOptions.RequestChargeMin, + ClientTelemetryOptions.RequestChargeMax, + ClientTelemetryOptions.RequestChargePrecision); + requestcharge.RecordValue(11); + + operationInfoSnapshot.TryAdd(opeInfo, (latency, requestcharge)); + } + + ConcurrentDictionary cacheRefreshInfoSnapshot + = new ConcurrentDictionary(); + for (int i = 0; i < 10; i++) + { + CacheRefreshInfo crInfo = new CacheRefreshInfo(Regions.WestUS, + 10, + Documents.ConsistencyLevel.Session.ToString(), + "databaseName" + i, + "containerName", + Documents.OperationType.Read, + Documents.ResourceType.Document, + 200, + 1002, + "dummycache"); + + LongConcurrentHistogram latency = new LongConcurrentHistogram(ClientTelemetryOptions.RequestLatencyMin, + ClientTelemetryOptions.RequestLatencyMax, + ClientTelemetryOptions.RequestLatencyPrecision); + latency.RecordValue(10); + + cacheRefreshInfoSnapshot.TryAdd(crInfo, latency); + } + + Task processorTask = Task.Run(async () => + { + CancellationTokenSource cts = new CancellationTokenSource(TimeSpan.FromMilliseconds(1)); + await Task.Delay(1000, cts.Token); // Making this task wait to ensure that processir is taking more time. + await processor.ProcessAndSendAsync(clientTelemetryProperties, + operationInfoSnapshot, + cacheRefreshInfoSnapshot, + default, + cts.Token); + }); + + await Assert.ThrowsExceptionAsync(() => ClientTelemetry.RunProcessorTaskAsync( + telemetryDate: DateTime.Now.ToString(), + processingTask: processorTask, + timeout: TimeSpan.FromTicks(1))); + } + [TestMethod] [ExpectedException(typeof(FormatException))] public void CheckMisconfiguredTelemetry_should_fail() From 33dea8a333239a63be8700da1d982bde99d17da8 Mon Sep 17 00:00:00 2001 From: Amaan-Haque <54414760+Amaan-Haque@users.noreply.github.com> Date: Tue, 11 Apr 2023 21:09:22 +0530 Subject: [PATCH 092/240] Patch: Adds Move Operation (#3389) * Basic changes to introduce move operator * Added "from" object in patch spec operation. Added testcase block. * Fixed testcase. * Changes made to address comments' * Added comment regarding enum mutations * Formatted comment Co-authored-by: Matias Quaranta * Moved summary location. * Ran UpdateContracts.ps1 --------- Co-authored-by: Amaan Haque Co-authored-by: Amaan Haque Co-authored-by: Matias Quaranta --- .../src/Patch/PatchConstants.cs | 4 ++ .../src/Patch/PatchOperation.cs | 22 ++++++++++ .../src/Patch/PatchOperationCore{T}.cs | 43 +++++++++++++------ .../src/Patch/PatchOperationType.cs | 8 +++- .../src/Patch/PatchOperationsJsonConverter.cs | 7 ++- .../Batch/BatchSinglePartitionKeyTests.cs | 6 ++- .../CosmosItemTests.cs | 17 +++++++- .../Contracts/DotNetSDKAPI.json | 33 ++++++++++++++ 8 files changed, 122 insertions(+), 18 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Patch/PatchConstants.cs b/Microsoft.Azure.Cosmos/src/Patch/PatchConstants.cs index fd0cd79215..b06ad841b4 100644 --- a/Microsoft.Azure.Cosmos/src/Patch/PatchConstants.cs +++ b/Microsoft.Azure.Cosmos/src/Patch/PatchConstants.cs @@ -13,6 +13,7 @@ public static class PropertyNames public const string OperationType = "op"; public const string Path = "path"; public const string Value = "value"; + public const string From = "from"; } public static class PatchSpecAttributes @@ -28,6 +29,7 @@ public static class OperationTypeNames public const string Replace = "replace"; public const string Set = "set"; public const string Increment = "incr"; + public const string Move = "move"; } public static string ToEnumMemberString(this PatchOperationType patchOperationType) @@ -44,6 +46,8 @@ public static string ToEnumMemberString(this PatchOperationType patchOperationTy return PatchConstants.OperationTypeNames.Set; case PatchOperationType.Increment: return PatchConstants.OperationTypeNames.Increment; + case PatchOperationType.Move: + return PatchConstants.OperationTypeNames.Move; default: throw new ArgumentException($"Unknown Patch operation type '{patchOperationType}'."); } diff --git a/Microsoft.Azure.Cosmos/src/Patch/PatchOperation.cs b/Microsoft.Azure.Cosmos/src/Patch/PatchOperation.cs index 16448c7f9f..412dec2334 100644 --- a/Microsoft.Azure.Cosmos/src/Patch/PatchOperation.cs +++ b/Microsoft.Azure.Cosmos/src/Patch/PatchOperation.cs @@ -25,6 +25,12 @@ public abstract class PatchOperation [JsonProperty(PropertyName = PatchConstants.PropertyNames.Path)] public abstract string Path { get; } + /// + /// Source location reference (used in case of move) + /// + [JsonProperty(PropertyName = PatchConstants.PropertyNames.From)] + public virtual string From { get; set; } = null; + /// /// Serializes the value parameter, if specified for the PatchOperation. /// @@ -134,5 +140,21 @@ public static PatchOperation Increment( path, value); } + + /// + /// Create to move an object/value. + /// + /// The source location of the object/value. + /// Target location reference. + /// PatchOperation instance for specified input. + public static PatchOperation Move( + string from, + string path) + { + return new PatchOperationCore( + PatchOperationType.Move, + path, + from); + } } } diff --git a/Microsoft.Azure.Cosmos/src/Patch/PatchOperationCore{T}.cs b/Microsoft.Azure.Cosmos/src/Patch/PatchOperationCore{T}.cs index bb87570242..c560cbae7b 100644 --- a/Microsoft.Azure.Cosmos/src/Patch/PatchOperationCore{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Patch/PatchOperationCore{T}.cs @@ -10,23 +10,40 @@ namespace Microsoft.Azure.Cosmos internal sealed class PatchOperationCore : PatchOperation { /// - /// Initializes a new instance of the class. - /// - /// Specifies the type of Patch operation. - /// Specifies the path to target location. - /// Specifies the value to be used. +        /// Initializes a new instance of the class. +        /// +        /// Specifies the type of Patch operation. +        /// Specifies the path to target location. +        /// Specifies the value to be used. In case of move operations it will be a string specifying the source +        /// location. public PatchOperationCore( - PatchOperationType operationType, - string path, - T value) + PatchOperationType operationType, + string path, + T value) { this.OperationType = operationType; - this.Path = string.IsNullOrWhiteSpace(path) - ? throw new ArgumentNullException(nameof(path)) - : path; - this.Value = value; + if (operationType == PatchOperationType.Move) + { + this.Path = string.IsNullOrWhiteSpace(path) + ? throw new ArgumentNullException(nameof(path)) + : path; + if (!(value is String valueAsString)) + { + throw new ArgumentException( + $"Parameter {nameof(value)} must be of type String for patch operation type {nameof(PatchOperationType.Move)}"); + } + this.From = string.IsNullOrWhiteSpace(valueAsString) + ? throw new ArgumentNullException(nameof(value)) + : valueAsString; + } + else + { + this.Path = string.IsNullOrWhiteSpace(path) + ? throw new ArgumentNullException(nameof(path)) + : path; + this.Value = value; + } } - public override T Value { get; } public override PatchOperationType OperationType { get; } diff --git a/Microsoft.Azure.Cosmos/src/Patch/PatchOperationType.cs b/Microsoft.Azure.Cosmos/src/Patch/PatchOperationType.cs index 7504492126..d98d35f832 100644 --- a/Microsoft.Azure.Cosmos/src/Patch/PatchOperationType.cs +++ b/Microsoft.Azure.Cosmos/src/Patch/PatchOperationType.cs @@ -9,7 +9,7 @@ namespace Microsoft.Azure.Cosmos using Newtonsoft.Json.Converters; /// - /// Type of Patch operation. + /// Describes the list of Patch supported operation types. /// /// /// For more information, see Partial document update in Azure Cosmos DB: Supported operations @@ -47,5 +47,11 @@ public enum PatchOperationType /// [EnumMember(Value = PatchConstants.OperationTypeNames.Increment)] Increment, + + /// + /// Operation to move a object/value. + /// + [EnumMember(Value = PatchConstants.OperationTypeNames.Move)] + Move, } } diff --git a/Microsoft.Azure.Cosmos/src/Patch/PatchOperationsJsonConverter.cs b/Microsoft.Azure.Cosmos/src/Patch/PatchOperationsJsonConverter.cs index 6cb9c8fa45..04419a5765 100644 --- a/Microsoft.Azure.Cosmos/src/Patch/PatchOperationsJsonConverter.cs +++ b/Microsoft.Azure.Cosmos/src/Patch/PatchOperationsJsonConverter.cs @@ -88,7 +88,12 @@ public override void WriteJson( writer.WritePropertyName(PatchConstants.PropertyNames.Path); writer.WriteValue(operation.Path); - if (operation.TrySerializeValueParameter(this.userSerializer, out Stream valueStream)) + if (operation.OperationType == PatchOperationType.Move) + { + writer.WritePropertyName(PatchConstants.PropertyNames.From); + writer.WriteValue(operation.From); + } + else if (operation.TrySerializeValueParameter(this.userSerializer, out Stream valueStream)) { string valueParam; using (valueStream) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchSinglePartitionKeyTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchSinglePartitionKeyTests.cs index 675ed6b20e..b2b1ffb217 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchSinglePartitionKeyTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Batch/BatchSinglePartitionKeyTests.cs @@ -693,7 +693,8 @@ public async Task BatchCustomSerializerUsedForPatchAsync() DateTime patchDate = new DateTime(2020, 07, 01, 01, 02, 03); List patchOperations = new List() { - PatchOperation.Add("/date", patchDate) + PatchOperation.Add("/date", patchDate), + PatchOperation.Move("/date", "/TodayDate") }; BatchCore batch = (BatchCore)new BatchCore((ContainerInlineCore)customSerializationContainer, BatchTestBase.GetPartitionKey(this.PartitionKey1)) @@ -719,7 +720,8 @@ public async Task BatchCustomSerializerUsedForPatchAsync() Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); Assert.IsNotNull(response.Resource); - Assert.IsTrue(dateJson.Contains(response.Resource["date"].ToString())); + Assert.IsNull(response.Resource["date"]); + Assert.IsTrue(dateJson.Contains(response.Resource["TodayDate"].ToString())); } private async Task RunCrudAsync(bool isStream, bool isSchematized, bool useEpk, Container container) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs index c5d6347dd1..b237c68c2a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs @@ -1984,7 +1984,6 @@ public async Task ItemPatchSuccessTest() patchOperations.Clear(); patchOperations.Add(PatchOperation.Add("/children/0/cost", 1)); - //patchOperations.Add(PatchOperation.Set("/random", value)); // with content response response = await containerInternal.PatchItemAsync( id: testItem.id, @@ -2006,6 +2005,22 @@ public async Task ItemPatchSuccessTest() Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); Assert.IsNotNull(response.Resource); Assert.AreEqual(null, response.Resource.children[0].id); + + patchOperations.Clear(); + patchOperations.Add(PatchOperation.Add("/children/1/description","Child#1")); + patchOperations.Add(PatchOperation.Move("/children/0/description", "/description")); + patchOperations.Add(PatchOperation.Move("/children/1/description", "/children/0/description")); + // with content response + response = await containerInternal.PatchItemAsync( + id: testItem.id, + partitionKey: new Cosmos.PartitionKey(testItem.pk), + patchOperations: patchOperations); + + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.IsNotNull(response.Resource); + Assert.AreEqual("testSet", response.Resource.description); + Assert.AreEqual("Child#1", response.Resource.children[0].description); + Assert.IsNull(response.Resource.children[1].description); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 3cf5c017c2..3eee7f406b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -5745,6 +5745,11 @@ "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.PatchOperation Increment(System.String, Int64);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Microsoft.Azure.Cosmos.PatchOperation Move(System.String, System.String)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.PatchOperation Move(System.String, System.String);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Microsoft.Azure.Cosmos.PatchOperation Remove(System.String)": { "Type": "Method", "Attributes": [], @@ -5772,6 +5777,20 @@ ], "MethodInfo": "Microsoft.Azure.Cosmos.PatchOperationType OperationType;CanRead:True;CanWrite:False;Microsoft.Azure.Cosmos.PatchOperationType get_OperationType();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "System.String From[Newtonsoft.Json.JsonPropertyAttribute(PropertyName = \"from\")]": { + "Type": "Property", + "Attributes": [ + "JsonPropertyAttribute" + ], + "MethodInfo": "System.String From;CanRead:True;CanWrite:True;System.String get_From();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_From(System.String);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String get_From()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.String get_From();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "System.String get_Path()": { "Type": "Method", "Attributes": [], @@ -5783,6 +5802,13 @@ "JsonPropertyAttribute" ], "MethodInfo": "System.String Path;CanRead:True;CanWrite:False;System.String get_Path();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_From(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_From(System.String);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {} @@ -5827,6 +5853,13 @@ ], "MethodInfo": "Microsoft.Azure.Cosmos.PatchOperationType Increment;IsInitOnly:False;IsStatic:True;" }, + "Microsoft.Azure.Cosmos.PatchOperationType Move[System.Runtime.Serialization.EnumMemberAttribute(Value = \"move\")]": { + "Type": "Field", + "Attributes": [ + "EnumMemberAttribute" + ], + "MethodInfo": "Microsoft.Azure.Cosmos.PatchOperationType Move;IsInitOnly:False;IsStatic:True;" + }, "Microsoft.Azure.Cosmos.PatchOperationType Remove[System.Runtime.Serialization.EnumMemberAttribute(Value = \"remove\")]": { "Type": "Field", "Attributes": [ From 31b1ff330a4b0983f8e29a1156faaa0c702584d5 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Tue, 11 Apr 2023 11:48:29 -0700 Subject: [PATCH 093/240] [Internal] Pipelines: Adds nightly build to produce packages (#3802) * Support cleaning * wire previous content delete * as text * with variable * another test * param with types * as string * no delete * no quotes * undoing * re-adding quotes * testing empty * trying another test * readding version * fixing publishing artifacts * fixing parameter * Fixing official pipeline * version 5 * fixing main pipeline * test with true * using start time * nightly preview * passing parameters to pack * Fixing nuget version * arguments on the nuget pack * folder structure * testing v5 * Using only content * Removing currentDate --- .../src/Microsoft.Azure.Cosmos.csproj | 3 +- azure-pipelines-nightly.yml | 72 ++++++------------- azure-pipelines-official.yml | 3 +- azure-pipelines.yml | 1 - templates/nuget-pack.yml | 67 ++++++++++------- 5 files changed, 63 insertions(+), 83 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj index 7ba4e9213d..6a5be8ccbb 100644 --- a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj +++ b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj @@ -9,8 +9,9 @@ $([System.DateTime]::Now.ToString(yyyyMMdd)) $(ClientOfficialVersion) $(ClientPreviewVersion) - nightly-$(CurrentDate) $(ClientPreviewSuffixVersion) + nightly-$(CurrentDate) + $(VersionSuffix)-nightly-$(CurrentDate) $(ClientVersion) $(ClientVersion)-$(VersionSuffix) $(ClientVersion) diff --git a/azure-pipelines-nightly.yml b/azure-pipelines-nightly.yml index 8db3ff01e6..04a53968aa 100644 --- a/azure-pipelines-nightly.yml +++ b/azure-pipelines-nightly.yml @@ -13,64 +13,32 @@ schedules: variables: - ReleaseArguments: ' --filter "TestCategory!=Quarantine" --verbosity normal ' VmImage: windows-latest # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops - BuildConfiguration: Release - IsNightly: true - + BuildConfiguration: Release + Packaging.EnableSBOMSigning: true stages: - stage: - displayName: Gate + displayName: Generate nightly GA jobs: - - template: templates/static-tools.yml - parameters: - BuildConfiguration: $(BuildConfiguration) - VmImage: $(VmImage) - - - - template: templates/build-test.yml + - template: templates/nuget-pack.yml parameters: - BuildConfiguration: $(BuildConfiguration) - Arguments: $(ReleaseArguments) /p:IsNightly=true /p:GeneratePackageOnBuild=true + BuildConfiguration: Release + Arguments: /p:IsNightly=true VmImage: $(VmImage) - - + ReleasePackage: true + OutputPath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/$(BuildConfiguration)/Microsoft.Azure.Cosmos' + BlobVersion: 'nightly' + CleanupFolder: true - stage: - displayName: Publish + displayName: Generate nightly preview jobs: - - job: - pool: - vmImage: $(VmImage) - - steps: - - task: DotNetCoreCLI@2 - displayName: Build Microsoft.Azure.Cosmos - inputs: - command: build - configuration: $(BuildConfiguration) - nugetConfigPath: NuGet.config - projects: Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj - arguments: --configuration $(BuildConfiguration) - versioningScheme: OFF - - - task: DotNetCoreCLI@2 - displayName: Pack Microsoft.Azure.Cosmos - inputs: - command: pack - configuration: $(BuildConfiguration) - searchPatternPack: Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj - arguments: --configuration $(BuildConfiguration) - versioningScheme: OFF - - - task: DotNetCoreCLI@2 - displayName: Push Microsoft.Azure.Cosmos - inputs: - command: push - configuration: $(BuildConfiguration) - searchPatternPack: Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj - arguments: --configuration $(BuildConfiguration) - packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg' - nuGetFeedType: 'internal' - publishVstsFeed: '4000bd49-81c3-47f2-94d8-d1392b95c228/04efb628-f46d-4b48-ac4d-5af5b1c75043' #azure-cosmos-dotnet - versioningScheme: OFF + - template: templates/nuget-pack.yml + parameters: + BuildConfiguration: Release + Arguments: /p:IsNightly=true /p:IsPreview=true + VmImage: $(VmImage) + ReleasePackage: true + OutputPath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/$(BuildConfiguration)/Microsoft.Azure.Cosmos' + BlobVersion: 'nightly-preview' + CleanupFolder: true \ No newline at end of file diff --git a/azure-pipelines-official.yml b/azure-pipelines-official.yml index 1aff6dbfd2..510bf5f6f8 100644 --- a/azure-pipelines-official.yml +++ b/azure-pipelines-official.yml @@ -29,8 +29,7 @@ stages: - template: templates/nuget-pack.yml parameters: BuildConfiguration: Release - Arguments: $(ReleaseArguments) VmImage: $(VmImage) ReleasePackage: true OutputPath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/$(BuildConfiguration)/Microsoft.Azure.Cosmos' - BlobVersion: variables['BlobVersion'] + BlobVersion: $(BlobVersion) \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 98490f0a62..aae5115a5e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,7 +29,6 @@ jobs: - template: templates/nuget-pack.yml parameters: BuildConfiguration: Release - Arguments: $(ReleaseArguments) VmImage: $(VmImage) ReleasePackage: false OutputPath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/Release/Microsoft.Azure.Cosmos' diff --git a/templates/nuget-pack.yml b/templates/nuget-pack.yml index 874676d3e1..095b1b52ff 100644 --- a/templates/nuget-pack.yml +++ b/templates/nuget-pack.yml @@ -1,13 +1,27 @@ # File: templates/nuget-pack.yml parameters: - BuildConfiguration: '' - Arguments: '' - VmImage: '' # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops - OS: 'Windows' - OutputPath: '' - ReleasePackage: false - BlobVersion: '' + - name: BuildConfiguration + type: string + default: '' + - name: Arguments + type: string + default: '' + - name: VmImage + type: string + default: '' + - name: OutputPath + type: string + default: '' + - name: BlobVersion + type: string + default: '' + - name: ReleasePackage + type: boolean + default: false + - name: CleanupFolder + type: boolean + default: false jobs: - job: GenerateNugetPackages @@ -23,7 +37,7 @@ jobs: configuration: $(BuildConfiguration) nugetConfigPath: NuGet.config projects: Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj - arguments: --configuration ${{ parameters.BuildConfiguration }} -p:Optimize=true + arguments: --configuration ${{ parameters.BuildConfiguration }} -p:Optimize=true ${{ parameters.Arguments }} versioningScheme: OFF - task: DotNetCoreCLI@2 @@ -32,7 +46,7 @@ jobs: command: custom projects: 'Microsoft.Azure.Cosmos\src\Microsoft.Azure.Cosmos.csproj' custom: pack - arguments: '-v detailed -c ${{ parameters.BuildConfiguration }} --no-build --no-restore -o "${{ parameters.OutputPath }}"' + arguments: '-v detailed -c ${{ parameters.BuildConfiguration }} --no-build ${{ parameters.Arguments }} --no-restore -o "${{ parameters.OutputPath }}"' - ${{ if eq(parameters.ReleasePackage, true) }}: - task: DotNetCoreCLI@2 @@ -41,26 +55,25 @@ jobs: command: custom projects: 'Microsoft.Azure.Cosmos\src\Microsoft.Azure.Cosmos.csproj' custom: pack - arguments: '-v detailed -c ${{ parameters.BuildConfiguration }} --no-build --include-symbols /p:SymbolPackageFormat=snupkg --no-restore -o "${{ parameters.OutputPath }}"' + arguments: '-v detailed -c ${{ parameters.BuildConfiguration }} --no-build --include-symbols /p:SymbolPackageFormat=snupkg ${{ parameters.Arguments }} --no-restore -o "${{ parameters.OutputPath }}"' - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 inputs: BuildDropPath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/$(BuildConfiguration)/Microsoft.Azure.Cosmos' - - task: AzureFileCopy@2 - displayName: ' Copy Artifacts to Azure SDK Release blob storage' - condition: and(succeeded(),ne(${{ parameters.BlobVersion }}, '')) - inputs: - SourcePath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/$(BuildConfiguration)/Microsoft.Azure.Cosmos' - azureSubscription: azuresdkpartnerdrops - Destination: AzureBlob - storage: azuresdkpartnerdrops - ContainerName: 'drops' - BlobPrefix: 'cosmosdb/csharp/$(BlobVersion)' - - - task: PublishBuildArtifacts@1 - displayName: 'Publish Artifacts: Microsoft.Azure.Cosmos' - inputs: - artifactName: Microsoft.Azure.Cosmos + - ${{ if ne(parameters.BlobVersion, '') }}: + - task: AzureFileCopy@5 + displayName: 'Copy Artifacts to Azure SDK Release blob storage' + condition: succeeded() + inputs: + SourcePath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/$(BuildConfiguration)/Microsoft.Azure.Cosmos/**' + azureSubscription: azuresdkpartnerdrops + Destination: AzureBlob + storage: azuresdkpartnerdrops + ContainerName: 'drops' + BlobPrefix: 'cosmosdb/csharp/${{ parameters.BlobVersion }}' + CleanTargetBeforeCopy: ${{ parameters.CleanupFolder }} - - task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0 - displayName: 'Component Detection' + - task: PublishBuildArtifacts@1 + displayName: 'Publish Artifacts: Microsoft.Azure.Cosmos' + inputs: + artifactName: Microsoft.Azure.Cosmos From bfbb43e6b835f921cb17fec0c1f25a84b0430065 Mon Sep 17 00:00:00 2001 From: aavasthy <113193425+aavasthy@users.noreply.github.com> Date: Tue, 18 Apr 2023 07:33:59 -0700 Subject: [PATCH 094/240] [Internal] OpenTelemetry: Direct Package update and replacing diagnostic files (#3797) * Direct Package update and replacing dagnostic files * Resolve merge conflicts * Running updateCOnstracts script * Removed LinqTranslationWithCustomSerializerBaseline file * Adding isDistributedTracingEnabled flag * Running update contracts * Running update contracts * Running update contracts * fix test * Code cleanup for test fix * Code cleanup for test fix * Making regex expression readable * Adding comment for regex expression --------- Co-authored-by: Sourabh Jain --- Directory.Build.props | 2 +- .../ChangeFeedProcessorUserException.cs | 2 +- Microsoft.Azure.Cosmos/src/DocumentClient.cs | 17 +- .../OSS/Azure.Core/AppContextSwitchHelper.cs | 44 -- .../src/OSS/Azure.Core/DiagnosticScope.cs | 664 ------------------ .../OSS/Azure.Core/DiagnosticScopeFactory.cs | 61 -- .../src/Resource/ClientContextCore.cs | 3 +- .../CosmosExceptions/CosmosException.cs | 2 +- .../CosmosNullReferenceException.cs | 2 +- .../CosmosObjectDisposedException.cs | 2 +- .../CosmosOperationCanceledException.cs | 2 +- .../OpenTelemetryCoreRecorder.cs | 2 +- .../OpenTelemetryRecorderFactory.cs | 5 +- ...iterBaselineTests.BatchOperationsAsync.xml | 2 +- ...riterBaselineTests.BulkOperationsAsync.xml | 202 +++--- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 44 +- ...eWriterBaselineTests.MiscellanousAsync.xml | 8 +- ...neTests.PointOperationsExceptionsAsync.xml | 12 +- ...EndTraceWriterBaselineTests.QueryAsync.xml | 56 +- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 32 +- ...TraceWriterBaselineTests.ReadManyAsync.xml | 4 +- ...selineTests.StreamPointOperationsAsync.xml | 8 +- ...aselineTests.TypedPointOperationsAsync.xml | 8 +- .../Tracing/AssertActivity.cs | 1 + .../Tracing/CustomListener.cs | 24 +- .../EndToEndTraceWriterBaselineTests.cs | 1 - .../Utils/Util.cs | 6 +- 27 files changed, 235 insertions(+), 981 deletions(-) delete mode 100644 Microsoft.Azure.Cosmos/src/OSS/Azure.Core/AppContextSwitchHelper.cs delete mode 100644 Microsoft.Azure.Cosmos/src/OSS/Azure.Core/DiagnosticScope.cs delete mode 100644 Microsoft.Azure.Cosmos/src/OSS/Azure.Core/DiagnosticScopeFactory.cs diff --git a/Directory.Build.props b/Directory.Build.props index e51eae5f3f..40b25a6e73 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,7 +3,7 @@ 3.32.3 3.32.3 preview - 3.30.4 + 3.30.6 2.0.1 2.0.1 preview diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/Exceptions/ChangeFeedProcessorUserException.cs b/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/Exceptions/ChangeFeedProcessorUserException.cs index b62eba6ec7..b3b4f51932 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/Exceptions/ChangeFeedProcessorUserException.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeedProcessor/Exceptions/ChangeFeedProcessorUserException.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.Cosmos { using System; using System.Runtime.Serialization; - using global::Azure.Core.Pipeline; + using global::Azure.Core; using Microsoft.Azure.Cosmos.Telemetry; using Microsoft.Azure.Cosmos.Telemetry.Diagnostics; diff --git a/Microsoft.Azure.Cosmos/src/DocumentClient.cs b/Microsoft.Azure.Cosmos/src/DocumentClient.cs index cbd4e06674..451166618d 100644 --- a/Microsoft.Azure.Cosmos/src/DocumentClient.cs +++ b/Microsoft.Azure.Cosmos/src/DocumentClient.cs @@ -167,6 +167,9 @@ internal partial class DocumentClient : IDisposable, IAuthorizationTokenProvider //RemoteCertificateValidationCallback internal RemoteCertificateValidationCallback remoteCertificateValidationCallback; + //Distributed Tracing Flag + internal bool isDistributedTracingEnabled; + //SessionContainer. internal ISessionContainer sessionContainer; @@ -426,6 +429,7 @@ internal DocumentClient(Uri serviceEndpoint, /// Flag to allow Quorum Read with Eventual Consistency Account /// /// This delegate responsible for validating the third party certificate. + /// This is distributed tracing flag /// /// The service endpoint can be obtained from the Azure Management Portal. /// If you are connecting using one of the Master Keys, these can be obtained along with the endpoint from the Azure Management Portal @@ -452,7 +456,8 @@ internal DocumentClient(Uri serviceEndpoint, IStoreClientFactory storeClientFactory = null, bool isLocalQuorumConsistency = false, string cosmosClientId = null, - RemoteCertificateValidationCallback remoteCertificateValidationCallback = null) + RemoteCertificateValidationCallback remoteCertificateValidationCallback = null, + bool isDistributedTracingEnabled = false) { if (sendingRequestEventArgs != null) { @@ -485,7 +490,8 @@ internal DocumentClient(Uri serviceEndpoint, enableCpuMonitor: enableCpuMonitor, storeClientFactory: storeClientFactory, cosmosClientId: cosmosClientId, - remoteCertificateValidationCallback: remoteCertificateValidationCallback); + remoteCertificateValidationCallback: remoteCertificateValidationCallback, + isDistributedTracingEnabled: isDistributedTracingEnabled); } /// @@ -668,7 +674,8 @@ internal virtual void Initialize(Uri serviceEndpoint, IStoreClientFactory storeClientFactory = null, TokenCredential tokenCredential = null, string cosmosClientId = null, - RemoteCertificateValidationCallback remoteCertificateValidationCallback = null) + RemoteCertificateValidationCallback remoteCertificateValidationCallback = null, + bool isDistributedTracingEnabled = false) { if (serviceEndpoint == null) { @@ -677,6 +684,7 @@ internal virtual void Initialize(Uri serviceEndpoint, this.clientId = cosmosClientId; this.remoteCertificateValidationCallback = remoteCertificateValidationCallback; + this.isDistributedTracingEnabled = isDistributedTracingEnabled; this.queryPartitionProvider = new AsyncLazy(async () => { @@ -6658,7 +6666,8 @@ private void InitializeDirectConnectivity(IStoreClientFactory storeClientFactory enableTcpConnectionEndpointRediscovery: this.ConnectionPolicy.EnableTcpConnectionEndpointRediscovery, addressResolver: this.AddressResolver, rntbdMaxConcurrentOpeningConnectionCount: this.rntbdMaxConcurrentOpeningConnectionCount, - remoteCertificateValidationCallback: this.remoteCertificateValidationCallback ); + remoteCertificateValidationCallback: this.remoteCertificateValidationCallback, + isDistributedTracingEnabled: this.isDistributedTracingEnabled); if (this.transportClientHandlerFactory != null) { diff --git a/Microsoft.Azure.Cosmos/src/OSS/Azure.Core/AppContextSwitchHelper.cs b/Microsoft.Azure.Cosmos/src/OSS/Azure.Core/AppContextSwitchHelper.cs deleted file mode 100644 index d7e25b35c3..0000000000 --- a/Microsoft.Azure.Cosmos/src/OSS/Azure.Core/AppContextSwitchHelper.cs +++ /dev/null @@ -1,44 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ - -// This File is copied from Azure.Core repo i.e. https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/src/Shared/AppContextSwitchHelper.cs - -#nullable enable - -namespace Azure.Core -{ - using System; - /// - /// Helper for interacting with AppConfig settings and their related Environment variable settings. - /// - internal static class AppContextSwitchHelper - { - /// - /// Determines if either an AppContext switch or its corresponding Environment Variable is set - /// - /// Name of the AppContext switch. - /// Name of the Environment variable. - /// If the AppContext switch has been set, returns the value of the switch. - /// If the AppContext switch has not been set, returns the value of the environment variable. - /// False if neither is set. - /// - public static bool GetConfigValue(string appContexSwitchName, string environmentVariableName) - { - // First check for the AppContext switch, giving it priority over the environment variable. - if (AppContext.TryGetSwitch(appContexSwitchName, out bool value)) - { - return value; - } - // AppContext switch wasn't used. Check the environment variable. - string? envVar = Environment.GetEnvironmentVariable(environmentVariableName); - if (envVar != null && (envVar.Equals("true", StringComparison.OrdinalIgnoreCase) || envVar.Equals("1"))) - { - return true; - } - - // Default to false. - return false; - } - } -} diff --git a/Microsoft.Azure.Cosmos/src/OSS/Azure.Core/DiagnosticScope.cs b/Microsoft.Azure.Cosmos/src/OSS/Azure.Core/DiagnosticScope.cs deleted file mode 100644 index ca05f6cabb..0000000000 --- a/Microsoft.Azure.Cosmos/src/OSS/Azure.Core/DiagnosticScope.cs +++ /dev/null @@ -1,664 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ - -// This File is copied from Azure.Core repo. i.e. https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/src/Shared/DiagnosticScope.cs - -#nullable enable - -namespace Azure.Core.Pipeline -{ - using System; - using System.Collections; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Diagnostics; - using System.Globalization; - using System.Linq.Expressions; - using System.Reflection; - - internal readonly struct DiagnosticScope : IDisposable - { - private static readonly ConcurrentDictionary ActivitySources = new (); - - private readonly ActivityAdapter? activityAdapter; - - internal DiagnosticScope(string ns, string scopeName, DiagnosticListener source, ActivityKind kind) - { - object? activitySource = GetActivitySource(ns, scopeName); - - this.IsEnabled = source.IsEnabled() || ActivityExtensions.ActivitySourceHasListeners(activitySource); - - this.activityAdapter = this.IsEnabled ? new ActivityAdapter(activitySource, source, scopeName, kind, null) : null; - } - - internal DiagnosticScope(string scopeName, DiagnosticListener source, object? diagnosticSourceArgs, object? activitySource, ActivityKind kind) - { - this.IsEnabled = source.IsEnabled() || ActivityExtensions.ActivitySourceHasListeners(activitySource); - - this.activityAdapter = this.IsEnabled ? new ActivityAdapter(activitySource, source, scopeName, kind, diagnosticSourceArgs) : null; - } - - public bool IsEnabled { get; } - - /// - /// This method combines client namespace and operation name into an ActivitySource name and creates the activity source. - /// For example: - /// ns: Azure.Storage.Blobs - /// name: BlobClient.DownloadTo - /// result Azure.Storage.Blobs.BlobClient - /// - private static object? GetActivitySource(string ns, string name) - { - if (!ActivityExtensions.SupportsActivitySource()) - { - return null; - } - - int indexOfDot = name.IndexOf(".", StringComparison.OrdinalIgnoreCase); - if (indexOfDot == -1) - { - return null; - } - - string clientName = ns + "." + name.Substring(0, indexOfDot); - - return ActivitySources.GetOrAdd(clientName, static n => ActivityExtensions.CreateActivitySource(n)); - } - - public void AddAttribute(string name, string? value) - { - this.activityAdapter?.AddTag(name, value); - } - - public void AddAttribute(string name, -#if AZURE_NULLABLE - [AllowNull] -#endif - T value) - { - this.AddAttribute(name, value, static v => Convert.ToString(v, CultureInfo.InvariantCulture) ?? string.Empty); - } - - public void AddAttribute(string name, T value, Func format) - { - if (this.activityAdapter != null) - { - var formattedValue = format(value); - this.activityAdapter.AddTag(name, formattedValue); - } - } - - public void AddLink(string traceparent, string tracestate, IDictionary? attributes = null) - { - this.activityAdapter?.AddLink(traceparent, tracestate, attributes); - } - - public void Start() - { - this.activityAdapter?.Start(); - } - - public void SetStartTime(DateTime dateTime) - { - this.activityAdapter?.SetStartTime(dateTime); - } - - public void Dispose() - { - // Reverse the Start order - this.activityAdapter?.Dispose(); - } - - public void Failed(Exception e) - { - this.activityAdapter?.MarkFailed(e); - } - - /// - /// Kind describes the relationship between the Activity, its parents, and its children in a Trace. - /// - public enum ActivityKind - { - /// - /// Default value. - /// Indicates that the Activity represents an internal operation within an application, as opposed to an operations with remote parents or children. - /// - Internal = 0, - - /// - /// Server activity represents request incoming from external component. - /// - Server = 1, - - /// - /// Client activity represents outgoing request to the external component. - /// - Client = 2, - - /// - /// Producer activity represents output provided to external components. - /// - Producer = 3, - - /// - /// Consumer activity represents output received from an external component. - /// - Consumer = 4, - } - - private class DiagnosticActivity : Activity - { -#pragma warning disable 109 // extra new modifier - public new IEnumerable Links { get; set; } = Array.Empty(); -#pragma warning restore 109 - - public DiagnosticActivity(string operationName) - : base(operationName) - { - } - } - - private class ActivityAdapter : IDisposable - { - private readonly DiagnosticSource diagnosticSource; - private readonly object? activitySource; - private readonly string activityName; - private readonly ActivityKind kind; - private object? diagnosticSourceArgs; - - private Activity? currentActivity; - private ICollection>? tagCollection; - private DateTimeOffset startTime; - private List? links; - - public ActivityAdapter(object? activitySource, DiagnosticSource diagnosticSource, string activityName, ActivityKind kind, object? diagnosticSourceArgs) - { - this.activitySource = activitySource; - this.diagnosticSource = diagnosticSource; - this.activityName = activityName; - this.kind = kind; - this.diagnosticSourceArgs = diagnosticSourceArgs; - - switch (this.kind) - { - case ActivityKind.Internal: - this.AddTag("kind", "internal"); - break; - case ActivityKind.Server: - this.AddTag("kind", "server"); - break; - case ActivityKind.Client: - this.AddTag("kind", "client"); - break; - case ActivityKind.Producer: - this.AddTag("kind", "producer"); - break; - case ActivityKind.Consumer: - this.AddTag("kind", "consumer"); - break; - } - } - - public void AddTag(string name, string? value) - { - if (this.currentActivity == null) - { - // Activity is not started yet, add the value to the collection - // that is going to be passed to StartActivity - this.tagCollection ??= ActivityExtensions.CreateTagsCollection() ?? new List>(); - this.tagCollection?.Add(new KeyValuePair(name, value!)); - } - else - { - this.currentActivity?.AddTag(name, value!); - } - } - - private IList? GetActivitySourceLinkCollection() - { - if (this.links == null) - { - return null; - } - - var linkCollection = ActivityExtensions.CreateLinkCollection(); - if (linkCollection == null) - { - return null; - } - - foreach (var activity in this.links) - { - ICollection>? linkTagsCollection = ActivityExtensions.CreateTagsCollection(); - if (linkTagsCollection != null) - { - foreach (var tag in activity.Tags) - { - linkTagsCollection.Add(new KeyValuePair(tag.Key, tag.Value!)); - } - } - - var link = ActivityExtensions.CreateActivityLink(activity.ParentId!, activity.TraceStateString, linkTagsCollection); - if (link != null) - { - linkCollection.Add(link); - } - } - - return linkCollection; - } - - public void AddLink(string traceparent, string tracestate, IDictionary? attributes) - { - var linkedActivity = new Activity("LinkedActivity"); - linkedActivity.SetW3CFormat(); - linkedActivity.SetParentId(traceparent); - linkedActivity.TraceStateString = tracestate; - - if (attributes != null) - { - foreach (var kvp in attributes) - { - linkedActivity.AddTag(kvp.Key, kvp.Value); - } - } - - this.links ??= new List(); - this.links.Add(linkedActivity); - } - - public void Start() - { - this.currentActivity = this.StartActivitySourceActivity(); - - if (this.currentActivity == null) - { - if (!this.diagnosticSource.IsEnabled(this.activityName, this.diagnosticSourceArgs)) - { - return; - } - - this.currentActivity = new DiagnosticActivity(this.activityName) - { - Links = (IEnumerable?)this.links ?? Array.Empty(), - }; - this.currentActivity.SetW3CFormat(); - - if (this.startTime != default) - { - this.currentActivity.SetStartTime(this.startTime.DateTime); - } - - if (this.tagCollection != null) - { - foreach (var tag in this.tagCollection) - { - this.currentActivity.AddTag(tag.Key, (string)tag.Value); - } - } - - this.currentActivity.Start(); - } - - this.diagnosticSource.Write(this.activityName + ".Start", this.diagnosticSourceArgs ?? this.currentActivity); - } - - private Activity? StartActivitySourceActivity() - { - return ActivityExtensions.ActivitySourceStartActivity( - this.activitySource, - this.activityName, - (int)this.kind, - startTime: this.startTime, - tags: this.tagCollection, - links: this.GetActivitySourceLinkCollection()); - } - - public void SetStartTime(DateTime startTime) - { - this.startTime = startTime; - this.currentActivity?.SetStartTime(startTime); - } - - public void MarkFailed(Exception exception) - { - this.diagnosticSource?.Write(this.activityName + ".Exception", exception); - } - - public void Dispose() - { - if (this.currentActivity == null) - { - return; - } - - if (this.currentActivity.Duration == TimeSpan.Zero) - this.currentActivity.SetEndTime(DateTime.UtcNow); - - this.diagnosticSource.Write(this.activityName + ".Stop", this.diagnosticSourceArgs); - - if (!this.currentActivity.TryDispose()) - { - this.currentActivity.Stop(); - } - } - } - } - -#pragma warning disable SA1507 // File can not contain multiple types - /// - /// Until we can reference the 5.0 of System.Diagnostics.DiagnosticSource - /// - internal static class ActivityExtensions - { - static ActivityExtensions() - { - ResetFeatureSwitch(); - } - - private static readonly Type? ActivitySourceType = Type.GetType("System.Diagnostics.ActivitySource, System.Diagnostics.DiagnosticSource"); - private static readonly Type? ActivityKindType = Type.GetType("System.Diagnostics.ActivityKind, System.Diagnostics.DiagnosticSource"); - private static readonly Type? ActivityTagsCollectionType = Type.GetType("System.Diagnostics.ActivityTagsCollection, System.Diagnostics.DiagnosticSource"); - private static readonly Type? ActivityLinkType = Type.GetType("System.Diagnostics.ActivityLink, System.Diagnostics.DiagnosticSource"); - private static readonly Type? ActivityContextType = Type.GetType("System.Diagnostics.ActivityContext, System.Diagnostics.DiagnosticSource"); - - private static readonly ParameterExpression ActivityParameter = Expression.Parameter(typeof(Activity)); - - private static bool SupportsActivitySourceSwitch; - - private static Action? SetIdFormatMethod; - private static Func? GetTraceStateStringMethod; - private static Func? GetIdFormatMethod; - private static Action? ActivityAddTagMethod; - private static Func>?, IList?, DateTimeOffset, Activity?>? ActivitySourceStartActivityMethod; - private static Func? ActivitySourceHasListenersMethod; - private static Func>?, object?>? CreateActivityLinkMethod; - private static Func>?>? CreateTagsCollectionMethod; - - public static void SetW3CFormat(this Activity activity) - { - if (SetIdFormatMethod == null) - { - var method = typeof(Activity).GetMethod("SetIdFormat"); - if (method == null) - { - SetIdFormatMethod = (_, _) => { }; - } - else - { - var idParameter = Expression.Parameter(typeof(int)); - var convertedId = Expression.Convert(idParameter, method.GetParameters()[0].ParameterType); - - SetIdFormatMethod = Expression.Lambda>( - Expression.Call(ActivityParameter, method, convertedId), - ActivityParameter, idParameter).Compile(); - } - } - - SetIdFormatMethod(activity, 2 /* ActivityIdFormat.W3C */); - } - - public static bool IsW3CFormat(this Activity activity) - { - if (GetIdFormatMethod == null) - { - var method = typeof(Activity).GetProperty("IdFormat")?.GetMethod; - if (method == null) - { - GetIdFormatMethod = _ => -1; - } - else - { - GetIdFormatMethod = Expression.Lambda>( - Expression.Convert(Expression.Call(ActivityParameter, method), typeof(int)), - ActivityParameter).Compile(); - } - } - - - int result = GetIdFormatMethod(activity); - - return result == 2 /* ActivityIdFormat.W3C */; - } - - public static string? GetTraceState(this Activity activity) - { - if (GetTraceStateStringMethod == null) - { - var method = typeof(Activity).GetProperty("TraceStateString")?.GetMethod; - if (method == null) - { - GetTraceStateStringMethod = _ => null; - } - else - { - GetTraceStateStringMethod = Expression.Lambda>( - Expression.Call(ActivityParameter, method), - ActivityParameter).Compile(); - } - } - - return GetTraceStateStringMethod(activity); - } - - public static void AddObjectTag(this Activity activity, string name, object value) - { - if (ActivityAddTagMethod == null) - { - var method = typeof(Activity).GetMethod("AddTag", BindingFlags.Instance | BindingFlags.Public, null, new Type[] - { - typeof(string), - typeof(object) - }, null); - - if (method == null) - { - ActivityAddTagMethod = (_, _, _) => { }; - } - else - { - var nameParameter = Expression.Parameter(typeof(string)); - var valueParameter = Expression.Parameter(typeof(object)); - - ActivityAddTagMethod = Expression.Lambda>( - Expression.Call(ActivityParameter, method, nameParameter, valueParameter), - ActivityParameter, nameParameter, valueParameter).Compile(); - } - } - - ActivityAddTagMethod(activity, name, value); - } - - public static bool SupportsActivitySource() - { - return SupportsActivitySourceSwitch && ActivitySourceType != null; - } - - public static ICollection>? CreateTagsCollection() - { - if (CreateTagsCollectionMethod == null) - { - var ctor = ActivityTagsCollectionType?.GetConstructor(Array.Empty()); - if (ctor == null) - { - CreateTagsCollectionMethod = () => null; - } - else - { - CreateTagsCollectionMethod = Expression.Lambda>?>>( - Expression.New(ctor)).Compile(); - } - } - - return CreateTagsCollectionMethod(); - } - - public static object? CreateActivityLink(string traceparent, string? tracestate, ICollection>? tags) - { - if (ActivityLinkType == null) - { - return null; - } - - if (CreateActivityLinkMethod == null) - { - var parseMethod = ActivityContextType?.GetMethod("Parse", BindingFlags.Static | BindingFlags.Public); - var ctor = ActivityLinkType?.GetConstructor(new[] { ActivityContextType!, ActivityTagsCollectionType! }); - - if (parseMethod == null || - ctor == null || - ActivityTagsCollectionType == null || - ActivityContextType == null) - { - CreateActivityLinkMethod = (_, _, _) => null; - } - else - { - var traceparentParameter = Expression.Parameter(typeof(string)); - var tracestateParameter = Expression.Parameter(typeof(string)); - var tagsParameter = Expression.Parameter(typeof(ICollection>)); - - CreateActivityLinkMethod = Expression.Lambda>?, object?>>( - Expression.TryCatch( - Expression.Convert(Expression.New(ctor, - Expression.Call(parseMethod, traceparentParameter, tracestateParameter), - Expression.Convert(tagsParameter, ActivityTagsCollectionType)), typeof(object)), - Expression.Catch(typeof(Exception), Expression.Default(typeof(object)))), - traceparentParameter, tracestateParameter, tagsParameter).Compile(); - } - } - - return CreateActivityLinkMethod(traceparent, tracestate, tags); - } - - public static bool ActivitySourceHasListeners(object? activitySource) - { - if (!SupportsActivitySource()) - { - return false; - } - - if (activitySource == null) - { - return false; - } - - if (ActivitySourceHasListenersMethod == null) - { - var method = ActivitySourceType?.GetMethod("HasListeners", BindingFlags.Instance | BindingFlags.Public); - if (method == null || - ActivitySourceType == null) - { - ActivitySourceHasListenersMethod = _ => false; - } - else - { - var sourceParameter = Expression.Parameter(typeof(object)); - ActivitySourceHasListenersMethod = Expression.Lambda>( - Expression.Call(Expression.Convert(sourceParameter, ActivitySourceType), method), - sourceParameter).Compile(); - } - } - - return ActivitySourceHasListenersMethod.Invoke(activitySource); - } - - public static Activity? ActivitySourceStartActivity(object? activitySource, string activityName, int kind, DateTimeOffset startTime, ICollection>? tags, IList? links) - { - if (activitySource == null) - { - return null; - } - - if (ActivitySourceStartActivityMethod == null) - { - if (ActivityLinkType == null || - ActivitySourceType == null || - ActivityContextType == null || - ActivityKindType == null) - { - ActivitySourceStartActivityMethod = (_, _, _, _, _, _) => null; - } - else - { - var method = ActivitySourceType?.GetMethod("StartActivity", BindingFlags.Instance | BindingFlags.Public, null, new[] - { - typeof(string), - ActivityKindType, - ActivityContextType, - typeof(IEnumerable>), - typeof(IEnumerable<>).MakeGenericType(ActivityLinkType), - typeof(DateTimeOffset) - }, null); - - if (method == null) - { - ActivitySourceStartActivityMethod = (_, _, _, _, _, _) => null; - } - else - { - var sourceParameter = Expression.Parameter(typeof(object)); - var nameParameter = Expression.Parameter(typeof(string)); - var kindParameter = Expression.Parameter(typeof(int)); - var startTimeParameter = Expression.Parameter(typeof(DateTimeOffset)); - var tagsParameter = Expression.Parameter(typeof(ICollection>)); - var linksParameter = Expression.Parameter(typeof(IList)); - var methodParameter = method.GetParameters(); - ActivitySourceStartActivityMethod = Expression.Lambda>?, IList?, DateTimeOffset, Activity?>>( - Expression.Call( - Expression.Convert(sourceParameter, method.DeclaringType!), - method, - nameParameter, - Expression.Convert(kindParameter, methodParameter[1].ParameterType), - Expression.Default(ActivityContextType), - Expression.Convert(tagsParameter, methodParameter[3].ParameterType), - Expression.Convert(linksParameter, methodParameter[4].ParameterType), - Expression.Convert(startTimeParameter, methodParameter[5].ParameterType)), - sourceParameter, nameParameter, kindParameter, tagsParameter, linksParameter, startTimeParameter).Compile(); - } - } - } - - return ActivitySourceStartActivityMethod.Invoke(activitySource, activityName, kind, tags, links, startTime); - } - - public static object? CreateActivitySource(string name) - { - if (ActivitySourceType == null) - { - return null; - } - return Activator.CreateInstance(ActivitySourceType, - name, // name - null); // version - } - - public static IList? CreateLinkCollection() - { - if (ActivityLinkType == null) - { - return null; - } - return Activator.CreateInstance(typeof(List<>).MakeGenericType(ActivityLinkType)) as IList; - } - - public static bool TryDispose(this Activity activity) - { - if (activity is IDisposable disposable) - { - disposable.Dispose(); - return true; - } - - return false; - } - - public static void ResetFeatureSwitch() - { - SupportsActivitySourceSwitch = AppContextSwitchHelper.GetConfigValue( - "Azure.Experimental.EnableActivitySource", - "AZURE_EXPERIMENTAL_ENABLE_ACTIVITY_SOURCE"); - } - } -} diff --git a/Microsoft.Azure.Cosmos/src/OSS/Azure.Core/DiagnosticScopeFactory.cs b/Microsoft.Azure.Cosmos/src/OSS/Azure.Core/DiagnosticScopeFactory.cs deleted file mode 100644 index 2cddf70d21..0000000000 --- a/Microsoft.Azure.Cosmos/src/OSS/Azure.Core/DiagnosticScopeFactory.cs +++ /dev/null @@ -1,61 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ - -// This File is copied from Azure.Core repo. i.e. https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/src/Shared/DiagnosticScopeFactory.cs - -#nullable enable - -namespace Azure.Core.Pipeline -{ - using System.Collections.Generic; - using System.Diagnostics; - using System.Threading; - -#pragma warning disable CA1001 // Types that own disposable fields should be disposable - internal class DiagnosticScopeFactory -#pragma warning restore CA1001 // Types that own disposable fields should be disposable - { - private static Dictionary? listeners; - private readonly string? resourceProviderNamespace; - private readonly DiagnosticListener? source; - - public DiagnosticScopeFactory(string clientNamespace, string? resourceProviderNamespace, bool isActivityEnabled) - { - this.resourceProviderNamespace = resourceProviderNamespace; - this.IsActivityEnabled = isActivityEnabled; - if (this.IsActivityEnabled) - { -#pragma warning disable CS8601 // Possible null reference assignment. - var listeners = LazyInitializer.EnsureInitialized>(ref DiagnosticScopeFactory.listeners); -#pragma warning restore CS8601 // Possible null reference assignment. - - lock (listeners!) - { - if (!listeners.TryGetValue(clientNamespace, out this.source)) - { - this.source = new DiagnosticListener(clientNamespace); - listeners[clientNamespace] = this.source; - } - } - } - } - - public bool IsActivityEnabled { get; } - - public DiagnosticScope CreateScope(string name, DiagnosticScope.ActivityKind kind = DiagnosticScope.ActivityKind.Client) - { - if (this.source == null) - { - return default; - } - var scope = new DiagnosticScope(this.source.Name, name, this.source, kind); - - if (this.resourceProviderNamespace != null) - { - scope.AddAttribute("az.namespace", this.resourceProviderNamespace); - } - return scope; - } - } -} diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index a9c475615a..d16d1c8bcc 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -83,7 +83,8 @@ internal static CosmosClientContext Create( handler: httpMessageHandler, sessionContainer: clientOptions.SessionContainer, cosmosClientId: cosmosClient.Id, - remoteCertificateValidationCallback: ClientContextCore.SslCustomValidationCallBack(clientOptions.ServerCertificateCustomValidationCallback)); + remoteCertificateValidationCallback: ClientContextCore.SslCustomValidationCallBack(clientOptions.ServerCertificateCustomValidationCallback), + isDistributedTracingEnabled: clientOptions.IsDistributedTracingEnabled); return ClientContextCore.Create( cosmosClient, diff --git a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosException.cs b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosException.cs index 12db379f0c..9d0856507e 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosException.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosException.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Cosmos using System; using System.Net; using System.Text; - using global::Azure.Core.Pipeline; + using global::Azure.Core; using Microsoft.Azure.Cosmos.Diagnostics; using Microsoft.Azure.Cosmos.Telemetry; using Microsoft.Azure.Cosmos.Tracing; diff --git a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosNullReferenceException.cs b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosNullReferenceException.cs index 4e7aa73f54..cbee4c59ec 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosNullReferenceException.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosNullReferenceException.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.Cosmos { using System; using System.Collections; - using global::Azure.Core.Pipeline; + using global::Azure.Core; using Microsoft.Azure.Cosmos.Diagnostics; using Microsoft.Azure.Cosmos.Telemetry; using Microsoft.Azure.Cosmos.Tracing; diff --git a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosObjectDisposedException.cs b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosObjectDisposedException.cs index 64d5018f60..c6f097355d 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosObjectDisposedException.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosObjectDisposedException.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Cosmos using System; using System.Collections; using System.Globalization; - using global::Azure.Core.Pipeline; + using global::Azure.Core; using Microsoft.Azure.Cosmos.Diagnostics; using Microsoft.Azure.Cosmos.Telemetry; using Microsoft.Azure.Cosmos.Tracing; diff --git a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosOperationCanceledException.cs b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosOperationCanceledException.cs index e21843656a..010d968bd0 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosOperationCanceledException.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosOperationCanceledException.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Cosmos using System; using System.Collections; using System.Runtime.Serialization; - using global::Azure.Core.Pipeline; + using global::Azure.Core; using Microsoft.Azure.Cosmos.Diagnostics; using Microsoft.Azure.Cosmos.Telemetry; using Microsoft.Azure.Cosmos.Tracing; diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs index 51aa1ee794..c199c0727c 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.Cosmos.Telemetry { using System; using System.Collections.Generic; - using global::Azure.Core.Pipeline; + using global::Azure.Core; /// /// This class is used to add information in an Activity tags ref. https://github.com/Azure/azure-cosmos-dotnet-v3/issues/3058 diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs index 6c88b3d5db..51b4666b6f 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.Cosmos.Telemetry { using System; - using global::Azure.Core.Pipeline; + using global::Azure.Core; /// /// This class is used to generate Activities with Azure.Cosmos.Operation Source Name @@ -28,7 +28,8 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, { OpenTelemetryRecorderFactory.ScopeFactory ??= new DiagnosticScopeFactory(clientNamespace: OpenTelemetryAttributeKeys.DiagnosticNamespace, resourceProviderNamespace: OpenTelemetryAttributeKeys.ResourceProviderNamespace, - isActivityEnabled: true); + isActivityEnabled: true, + suppressNestedClientActivities: true); // If there is no source then it will return default otherwise a valid diagnostic scope DiagnosticScope scope = OpenTelemetryRecorderFactory diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index ad1a3f1288..90f32b89c9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -129,7 +129,7 @@ } ] }]]> - Operation.ExecuteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationExecuteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeBatchdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.ExecuteAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationExecuteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeBatchdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index 09d8c3ce63..b776a8eaae 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -153,16 +153,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -311,16 +311,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -469,16 +469,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -627,16 +627,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -785,16 +785,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -943,16 +943,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1101,16 +1101,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1259,16 +1259,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1417,16 +1417,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1575,16 +1575,16 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2324,7 +2324,7 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.messagedb.cosmosdb.operation_typeCreate + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.messagedb.cosmosdb.operation_typeCreate ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml index 2e20bceb1c..4189b4bab8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml @@ -952,11 +952,11 @@ } ] }]]> - Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1569,11 +1569,11 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2167,11 +2167,11 @@ } ] }]]> - Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2785,11 +2785,11 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3066,9 +3066,7 @@ } ] }]]> - Operation.Change Feed Estimator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationChange Feed Estimator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. + Operation.Change Feed Estimator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Estimator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml index 348925a1f6..591a6af4ac 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml @@ -107,8 +107,8 @@ } ] }]]> - Operation.DeleteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateDatabaseAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateDatabaseAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.DeleteAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationDeleteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateDatabaseAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateDatabaseAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -207,8 +207,8 @@ } ] }]]> - Operation.DeleteAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateDatabaseAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateDatabaseAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted + Operation.DeleteAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationDeleteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted +Operation.CreateDatabaseAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateDatabaseAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml index a8b686d679..64e7e0c3ed 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml @@ -148,7 +148,7 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -390,7 +390,7 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -615,7 +615,7 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -872,7 +872,7 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1193,7 +1193,7 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1347,7 +1347,7 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml index 18aa6d67d8..d2abebc194 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml @@ -574,10 +574,10 @@ } ] }]]> - Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1180,10 +1180,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1767,10 +1767,10 @@ } ] }]]> - Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2374,10 +2374,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3048,10 +3048,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -3644,10 +3644,10 @@ } ] }]]> - Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -4260,10 +4260,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml index 1ceef081c6..dc6df3eacf 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml @@ -536,10 +536,10 @@ } ] }]]> - Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1104,10 +1104,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1653,10 +1653,10 @@ } ] }]]> - Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -2222,10 +2222,10 @@ } ] }]]> - Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml index a7cc47631a..29b36304ec 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml @@ -542,7 +542,7 @@ } ] }]]> - Operation.ReadManyItemsStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadManyItemsStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.ReadManyItemsStreamAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReadManyItemsStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -1102,7 +1102,7 @@ } ] }]]> - Operation.ReadManyItemsAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadManyItemsAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.ReadManyItemsAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReadManyItemsAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml index f0dec5b7bd..18f11acd62 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml @@ -89,7 +89,7 @@ } ] }]]> - Operation.CreateItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.CreateItemStreamAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -178,7 +178,7 @@ } ] }]]> - Operation.ReadItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.ReadItemStreamAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReadItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -275,7 +275,7 @@ } ] }]]> - Operation.ReplaceItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReplaceItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.ReplaceItemStreamAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReplaceItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -367,7 +367,7 @@ } ] }]]> - Operation.DeleteItemStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.DeleteItemStreamAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationDeleteItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml index 6b57caad95..abeaa41de8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml @@ -109,7 +109,7 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -203,7 +203,7 @@ } ] }]]> - Operation.ReadItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.ReadItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReadItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -310,7 +310,7 @@ } ] }]]> - Operation.ReplaceItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReplaceItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.ReplaceItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReplaceItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. @@ -406,7 +406,7 @@ } ] }]]> - Operation.DeleteItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationDeleteItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.DeleteItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationDeleteItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs index c46d8b035a..f4983c10a7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs @@ -32,6 +32,7 @@ public static void IsValid(Activity activity) IList expectedTags = new List { "az.namespace", + "az.schema_url", "kind", "db.system", "db.name", diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs index 1f192bb086..5f98a6191a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs @@ -33,15 +33,27 @@ internal class CustomListener : public static ConcurrentBag CollectedActivities { private set; get; } = new(); private static ConcurrentBag CollectedEvents { set; get; } = new(); + private string SourceType { set; get; } + + // Regex is used to match string 'n' against diagnosticNameSpace string + // which is constructed by combining first two parts of name. + // Eg: Azure.Cosmos.Operation where diagnosticNameSpace is Azure.Cosmos and Operation is the sourceType public CustomListener(string name, string eventName) - : this(n => Regex.Match(n, name).Success, eventName) + : this(n => + { + string[] nameParts = name.Split("."); + string diagnosticNameSpace = $"{nameParts[0]}.{nameParts[1]}"; + return Regex.Match(n, diagnosticNameSpace).Success; + }, name.Split(".")[2], eventName) + { } - public CustomListener(Func filter, string eventName) + public CustomListener(Func filter, string sourceType, string eventName) { this.sourceNameFilter = filter; this.eventName = eventName; + this.SourceType = sourceType; DiagnosticListener.AllListeners.Subscribe(this); } @@ -76,6 +88,11 @@ public void OnNext(KeyValuePair value) string stopSuffix = ".Stop"; string exceptionSuffix = ".Exception"; + if(!this.SourceType.Contains("*") && !Activity.Current.OperationName.Contains(this.SourceType)) + { + return; + } + if (value.Key.EndsWith(startSuffix)) { string name = value.Key[..^startSuffix.Length]; @@ -89,7 +106,6 @@ public void OnNext(KeyValuePair value) Links = links.Select(a => new ProducedLink(a.ParentId, a.TraceStateString)).ToList(), LinkedActivities = links.ToList() }; - this.Scopes.Add(scope); } else if (value.Key.EndsWith(stopSuffix)) @@ -100,7 +116,6 @@ public void OnNext(KeyValuePair value) if (producedDiagnosticScope.Activity.Id == Activity.Current.Id) { AssertActivity.IsValid(producedDiagnosticScope.Activity); - CustomListener.CollectedActivities.Add(producedDiagnosticScope.Activity); producedDiagnosticScope.IsCompleted = true; @@ -120,7 +135,6 @@ public void OnNext(KeyValuePair value) { throw new InvalidOperationException("Scope should not be stopped when calling Failed"); } - producedDiagnosticScope.Exception = (Exception)value.Value; } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs index e14188d92a..ba7e828edf 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs @@ -24,7 +24,6 @@ namespace Microsoft.Azure.Cosmos.EmulatorTests.Tracing using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json.Linq; using static Microsoft.Azure.Cosmos.SDK.EmulatorTests.TransportClientHelper; - using AzureCore = global::Azure.Core.Pipeline; [VisualStudio.TestTools.UnitTesting.TestClass] [TestCategory("UpdateContract")] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs index 96254aca79..59172beb33 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenTelemetry; using OpenTelemetry.Trace; - using AzureCore = global::Azure.Core.Pipeline; + using AzureCore = global::Azure.Core; internal enum DocumentClientType { @@ -548,11 +548,11 @@ internal static CustomListener ConfigureOpenTelemetryAndCustomListeners() // Open Telemetry Listener Util.OTelTracerProvider = Sdk.CreateTracerProviderBuilder() .AddCustomOtelExporter() // use any exporter here - .AddSource($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.*") // Right now, it will capture only "Azure.Cosmos.Operation" + .AddSource($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation") // Right now, it will capture only "Azure.Cosmos.Operation" .Build(); // Custom Listener - Util.TestListener = new CustomListener($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.*", "Azure-Cosmos-Operation-Request-Diagnostics"); + Util.TestListener = new CustomListener($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", "Azure-Cosmos-Operation-Request-Diagnostics"); return Util.TestListener; From f94869a83016dac97adb315d3ec23bca874e60bc Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Tue, 18 Apr 2023 11:29:19 -0700 Subject: [PATCH 095/240] [Internal] MerlinBot: Adds auto-merge and cleanup automation (#3813) * Add config changes * Polishing automerge config --- .github/fabricbot.json | 75 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/.github/fabricbot.json b/.github/fabricbot.json index 90924da0c3..67aa59fa46 100644 --- a/.github/fabricbot.json +++ b/.github/fabricbot.json @@ -102,6 +102,81 @@ } ] } + }, + { + "taskType": "trigger", + "capabilityId": "AutoMerge", + "subCapability": "AutoMerge", + "version": "1.0", + "config": { + "taskName": "PR Automerge", + "allowAutoMergeInstructionsWithoutLabel": false, + "mergeType": "squash", + "deleteBranches": true, + "removeLabelOnPush": true, + "label": "auto-merge", + "requireAllStatuses": false, + "requireSpecificCheckRuns": false, + "usePrDescriptionAsCommitMessage": false, + "minMinutesOpen": "60", + "enforceDMPAsStatus": true + } + }, + { + "taskType": "scheduled", + "capabilityId": "ScheduledSearch", + "subCapability": "ScheduledSearch", + "version": "1.1", + "config": { + "frequency": [ + { + "weekDay": 1, + "hours": [ + 9 + ], + "timezoneOffset": -7 + } + ], + "searchTerms": [ + { + "name": "isOpen", + "parameters": {} + }, + { + "name": "isIssue", + "parameters": {} + }, + { + "name": "hasLabel", + "parameters": { + "label": "needs-more-information" + } + }, + { + "name": "noActivitySince", + "parameters": { + "days": 14 + } + }, + { + "name": "noAssignees", + "parameters": {} + } + ], + "taskName": "Close inactive needs-information", + "actions": [ + { + "name": "addReply", + "parameters": { + "comment": "${issueAuthor} this issue requires more information for the team to be able to help. In case this information is available, please add it and re-open the Issue." + } + }, + { + "name": "closeIssue", + "parameters": {} + } + ] + } } ], "userGroups": [] From afd5904eef28e9d9c3d8d2615192b3a43a4ee5da Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Mon, 24 Apr 2023 13:54:19 -0700 Subject: [PATCH 096/240] Update fabricbot.json (#3824) --- .github/fabricbot.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/fabricbot.json b/.github/fabricbot.json index 67aa59fa46..e400139553 100644 --- a/.github/fabricbot.json +++ b/.github/fabricbot.json @@ -168,7 +168,7 @@ { "name": "addReply", "parameters": { - "comment": "${issueAuthor} this issue requires more information for the team to be able to help. In case this information is available, please add it and re-open the Issue." + "comment": "@${issueAuthor} this issue requires more information for the team to be able to help. In case this information is available, please add it and re-open the Issue." } }, { @@ -180,4 +180,4 @@ } ], "userGroups": [] -} \ No newline at end of file +} From fb80ba8eb2a219fb6c8ce14b601d4153d0f71457 Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Tue, 25 Apr 2023 04:42:16 +0530 Subject: [PATCH 097/240] [Internal] Upgrade Resiliency: Adds Logic to Validate `Unknown` Replicas along with `Unhealthy`. (#3820) * Code changes to add aggressive validation logic. * Code changes to enable aggressive validation for all regions. * Code changes to pull in msdata cosmos.direct changes related to aggresive validation logic. * Code changes to make minor cosmetic changes. * Code changes to address review comments. --- Directory.Build.props | 2 +- .../src/Routing/GatewayAddressCache.cs | 37 +++- .../GatewayAddressCacheTests.cs | 200 ++++++++++-------- 3 files changed, 134 insertions(+), 105 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 40b25a6e73..695ad7c92c 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,7 +3,7 @@ 3.32.3 3.32.3 preview - 3.30.6 + 3.30.8 2.0.1 2.0.1 preview diff --git a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs index eba425fb0d..d99be609ea 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs @@ -549,7 +549,7 @@ await this.GetServerAddressesViaGatewayAsync(request, collectionRid, new[] { par } } - this.ValidateUnhealthyPendingReplicas(transportAddressUris); + this.ValidateReplicaAddresses(transportAddressUris); return mergedAddresses; } @@ -840,12 +840,12 @@ await this.GetServerAddressesViaGatewayAsync( } /// - /// Validates the unhealthy pending replicas by attempting to open the Rntbd connection. This operation - /// will eventually marks the unhealthy pending replicas to healthy, if the rntbd connection attempt made was + /// Validates the unknown or unhealthy-pending replicas by attempting to open the Rntbd connection. This operation + /// will eventually marks the unknown or unhealthy-pending replicas to healthy, if the rntbd connection attempt made was /// successful or unhealthy otherwise. /// /// A read-only list of needs to be validated. - private void ValidateUnhealthyPendingReplicas( + private void ValidateReplicaAddresses( IReadOnlyList addresses) { if (addresses == null) @@ -853,15 +853,13 @@ private void ValidateUnhealthyPendingReplicas( throw new ArgumentNullException(nameof(addresses)); } - IEnumerable addressesNeedToValidation = addresses - .Where(address => address - .GetCurrentHealthState() - .GetHealthStatus() == TransportAddressHealthState.HealthStatus.UnhealthyPending); + IEnumerable addressesNeedToValidateStatus = this.GetAddressesNeededToValidateStatus( + transportAddresses: addresses); - if (addressesNeedToValidation.Any()) + if (addressesNeedToValidateStatus.Any()) { Task openConnectionsInBackgroundTask = Task.Run(async () => await this.openConnectionsHandler.TryOpenRntbdChannelsAsync( - addresses: addressesNeedToValidation.ToList())); + addresses: addressesNeedToValidateStatus)); } } @@ -919,6 +917,25 @@ private static PartitionAddressInformation MergeAddresses( return newAddresses; } + /// + /// Returns a list of needed to validate their health status. Validating + /// a uri is done by opening Rntbd connection to the backend replica, which is a costly operation by nature. Therefore + /// vaidating both Unhealthy and Unknown replicas at the same time could impose a high CPU utilization. To avoid this + /// situation, the RntbdOpenConnectionHandler has good concurrency control mechanism to open the connections gracefully/>. + /// + /// A read only list of s. + /// A list of that needs to validate their status. + private IEnumerable GetAddressesNeededToValidateStatus( + IReadOnlyList transportAddresses) + { + return transportAddresses + .Where(address => address + .GetCurrentHealthState() + .GetHealthStatus() is + TransportAddressHealthState.HealthStatus.Unknown or + TransportAddressHealthState.HealthStatus.UnhealthyPending); + } + protected virtual void Dispose(bool disposing) { if (this.disposedValue) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs index 809814aef1..2d0d0a5c6a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs @@ -379,10 +379,10 @@ await cache.OpenConnectionsAsync( // Assert. GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, - expectedExceptionCount: 0, - expectedMethodInvocationCount: 1, - expectedReceivedAddressesCount: 3, - expectedSuccessCount: 3); + expectedTotalFailedAddressesToOpenCount: 0, + expectedTotalHandlerInvocationCount: 1, + expectedTotalReceivedAddressesCount: 3, + expectedTotalSuccessAddressesToOpenCount: 3); } /// @@ -425,10 +425,10 @@ await cache.OpenConnectionsAsync( // Assert. GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, - expectedExceptionCount: 3, - expectedMethodInvocationCount: 1, - expectedReceivedAddressesCount: 3, - expectedSuccessCount: 0); + expectedTotalFailedAddressesToOpenCount: 3, + expectedTotalHandlerInvocationCount: 1, + expectedTotalReceivedAddressesCount: 3, + expectedTotalSuccessAddressesToOpenCount: 0); } /// @@ -474,10 +474,10 @@ await cache.OpenConnectionsAsync( // Assert. GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, - expectedExceptionCount: 0, - expectedMethodInvocationCount: 0, - expectedReceivedAddressesCount: 0, - expectedSuccessCount: 0); + expectedTotalFailedAddressesToOpenCount: 0, + expectedTotalHandlerInvocationCount: 0, + expectedTotalReceivedAddressesCount: 0, + expectedTotalSuccessAddressesToOpenCount: 0); } /// @@ -552,10 +552,10 @@ await globalAddressResolver.OpenConnectionsToAllReplicasAsync( // Assert. GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, - expectedExceptionCount: 0, - expectedMethodInvocationCount: 1, - expectedReceivedAddressesCount: 3, - expectedSuccessCount: 3); + expectedTotalFailedAddressesToOpenCount: 0, + expectedTotalHandlerInvocationCount: 1, + expectedTotalReceivedAddressesCount: 3, + expectedTotalSuccessAddressesToOpenCount: 3); } /// @@ -630,10 +630,10 @@ await globalAddressResolver.OpenConnectionsToAllReplicasAsync( // Assert. GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, - expectedExceptionCount: 2, - expectedMethodInvocationCount: 1, - expectedReceivedAddressesCount: 3, - expectedSuccessCount: 1); + expectedTotalFailedAddressesToOpenCount: 2, + expectedTotalHandlerInvocationCount: 1, + expectedTotalReceivedAddressesCount: 3, + expectedTotalSuccessAddressesToOpenCount: 1); } /// @@ -721,10 +721,10 @@ public async Task GlobalAddressResolver_OpenConnectionsToAllReplicasAsync_WhenIn Assert.AreEqual(exceptionMessage, ex.Message); GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, - expectedExceptionCount: 0, - expectedMethodInvocationCount: 0, - expectedReceivedAddressesCount: 0, - expectedSuccessCount: 0); + expectedTotalFailedAddressesToOpenCount: 0, + expectedTotalHandlerInvocationCount: 0, + expectedTotalReceivedAddressesCount: 0, + expectedTotalSuccessAddressesToOpenCount: 0); } /// @@ -797,10 +797,10 @@ public async Task GlobalAddressResolver_OpenConnectionsToAllReplicasAsync_WhenNu Assert.IsTrue(ce.Message.Contains("Could not resolve the collection")); GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, - expectedExceptionCount: 0, - expectedMethodInvocationCount: 0, - expectedReceivedAddressesCount: 0, - expectedSuccessCount: 0); + expectedTotalFailedAddressesToOpenCount: 0, + expectedTotalHandlerInvocationCount: 0, + expectedTotalReceivedAddressesCount: 0, + expectedTotalSuccessAddressesToOpenCount: 0); } /// @@ -879,10 +879,10 @@ await cache.OpenConnectionsAsync( // Assert. GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, - expectedExceptionCount: 0, - expectedMethodInvocationCount: 1, - expectedReceivedAddressesCount: addresses.Count, - expectedSuccessCount: addresses.Count); + expectedTotalFailedAddressesToOpenCount: 0, + expectedTotalHandlerInvocationCount: 1, + expectedTotalReceivedAddressesCount: addresses.Count, + expectedTotalSuccessAddressesToOpenCount: addresses.Count); } /// @@ -960,9 +960,15 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabled_ShouldValidat .ReplicaTransportAddressUris .Single(x => x.ToString().Equals(addressTobeMarkedUnhealthy)); + // Waits until a completion signal from the background task is received. + GatewayAddressCacheTests.WaitForManualResetEventSignal( + manualResetEvent: manualResetEvent, + shouldReset: true); + + // Because the Unknown Replicas are now validated aggresively, the health status should be marked as connected. Assert.IsNotNull(refreshedUri); Assert.AreEqual( - expected: TransportAddressHealthState.HealthStatus.Unknown, + expected: TransportAddressHealthState.HealthStatus.Connected, actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); Assert.AreEqual(4, addressInfo.AllAddresses.Count); @@ -1004,10 +1010,10 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabled_ShouldValidat mockHttpHandler.VerifyAll(); GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, - expectedExceptionCount: 0, - expectedMethodInvocationCount: 1, - expectedReceivedAddressesCount: 1, - expectedSuccessCount: 1); + expectedTotalFailedAddressesToOpenCount: 0, + expectedTotalHandlerInvocationCount: 2, + expectedTotalReceivedAddressesCount: 6, + expectedTotalSuccessAddressesToOpenCount: 6); } /// @@ -1053,7 +1059,7 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr FakeOpenConnectionHandler fakeOpenConnectionHandler = new ( failIndexesByAttempts: new Dictionary>() { - { 0, new HashSet() { 0 } } + { 0, new HashSet() { 1 } } }, manualResetEvent: manualResetEvent); @@ -1095,9 +1101,22 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr .ReplicaTransportAddressUris .Single(x => x.ToString().Equals(addressTobeMarkedUnhealthy)); + // Waits until a completion signal from the background task is received. + GatewayAddressCacheTests.WaitForManualResetEventSignal( + manualResetEvent: manualResetEvent, + shouldReset: true); + + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedTotalFailedAddressesToOpenCount: 0, + expectedTotalHandlerInvocationCount: 1, + expectedTotalReceivedAddressesCount: 4, + expectedTotalSuccessAddressesToOpenCount: 4); + + // Because the Unknown Replicas are now validated aggresively, the health status should be marked as connected. Assert.IsNotNull(refreshedUri); Assert.AreEqual( - expected: TransportAddressHealthState.HealthStatus.Unknown, + expected: TransportAddressHealthState.HealthStatus.Connected, actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); Assert.AreEqual(4, addressInfo.AllAddresses.Count); @@ -1140,10 +1159,10 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, - expectedExceptionCount: 1, - expectedMethodInvocationCount: 1, - expectedReceivedAddressesCount: 1, - expectedSuccessCount: 0); + expectedTotalFailedAddressesToOpenCount: 1, + expectedTotalHandlerInvocationCount: 2, + expectedTotalReceivedAddressesCount: 6, + expectedTotalSuccessAddressesToOpenCount: 5); // A delay of 2 minute was added to make the replica unhealthy for more than one minute. This // will make sure the unhealthy replica gets a chance to re-validate it's health status. @@ -1167,10 +1186,10 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr Assert.AreEqual(4, addressInfo.AllAddresses.Count); GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, - expectedExceptionCount: 1, - expectedMethodInvocationCount: 2, - expectedReceivedAddressesCount: 1, - expectedSuccessCount: 1); + expectedTotalFailedAddressesToOpenCount: 1, + expectedTotalHandlerInvocationCount: 3, + expectedTotalReceivedAddressesCount: 7, + expectedTotalSuccessAddressesToOpenCount: 6); addressInfo = await cache.TryGetAddressesAsync( request: request, @@ -1194,13 +1213,13 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); // This assertion makes sure that no additional calls were made to the open connection handler after - // since the last address refresh, because all the replicas are now either Unknown or Connected. + // since the last address refresh, because all the replicas at this point should be Connected. GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, - expectedExceptionCount: 1, - expectedMethodInvocationCount: 2, - expectedReceivedAddressesCount: 1, - expectedSuccessCount: 1); + expectedTotalFailedAddressesToOpenCount: 1, + expectedTotalHandlerInvocationCount: 3, + expectedTotalReceivedAddressesCount: 7, + expectedTotalSuccessAddressesToOpenCount: 6); } /// @@ -1290,10 +1309,10 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationDisabled_ShouldNotVal mockHttpHandler.VerifyAll(); GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, - expectedExceptionCount: 0, - expectedMethodInvocationCount: 0, - expectedReceivedAddressesCount: 0, - expectedSuccessCount: 0); + expectedTotalFailedAddressesToOpenCount: 0, + expectedTotalHandlerInvocationCount: 0, + expectedTotalReceivedAddressesCount: 0, + expectedTotalSuccessAddressesToOpenCount: 0); } /// @@ -1320,21 +1339,21 @@ private static void WaitForManualResetEventSignal( /// to match with that of the expected ones. /// /// An instance of the . - /// The expected exception count for the test. - /// The expected method invocation count for the test. - /// The expected received addresses count for the test. - /// The expected successful messages count for the test. + /// The expected total addresses count that are supposed to fail while opening connection for the scenario. + /// The expected total open connection handler method invocation count for the scenario. + /// The expected total received addresses count for the scenario. + /// The expected total addresses count that are supposed to succeed while opening connection for the scenario. private static void AssertOpenConnectionHandlerAttributes( FakeOpenConnectionHandler fakeOpenConnectionHandler, - int expectedExceptionCount, - int expectedMethodInvocationCount, - int expectedReceivedAddressesCount, - int expectedSuccessCount) + int expectedTotalFailedAddressesToOpenCount, + int expectedTotalHandlerInvocationCount, + int expectedTotalReceivedAddressesCount, + int expectedTotalSuccessAddressesToOpenCount) { - Assert.AreEqual(expectedExceptionCount, fakeOpenConnectionHandler.GetExceptionCount()); - Assert.AreEqual(expectedMethodInvocationCount, fakeOpenConnectionHandler.GetMethodInvocationCount()); - Assert.AreEqual(expectedReceivedAddressesCount, fakeOpenConnectionHandler.GetReceivedAddressesCount()); - Assert.AreEqual(expectedSuccessCount, fakeOpenConnectionHandler.GetSuccessfulInvocationCount()); + Assert.AreEqual(expectedTotalFailedAddressesToOpenCount, fakeOpenConnectionHandler.GetTotalExceptionCount()); + Assert.AreEqual(expectedTotalHandlerInvocationCount, fakeOpenConnectionHandler.GetTotalMethodInvocationCount()); + Assert.AreEqual(expectedTotalReceivedAddressesCount, fakeOpenConnectionHandler.GetTotalReceivedAddressesCount()); + Assert.AreEqual(expectedTotalSuccessAddressesToOpenCount, fakeOpenConnectionHandler.GetTotalSuccessfulInvocationCount()); } private class FakeMessageHandler : HttpMessageHandler @@ -1451,22 +1470,22 @@ public FakeOpenConnectionHandler( this.manualResetEvent = manualResetEvent; } - public int GetSuccessfulInvocationCount() + public int GetTotalSuccessfulInvocationCount() { return this.successInvocationCounter; } - public int GetExceptionCount() + public int GetTotalExceptionCount() { return this.exceptionCounter; } - public int GetReceivedAddressesCount() + public int GetTotalReceivedAddressesCount() { return this.totalReceivedAddressesCounter; } - public int GetMethodInvocationCount() + public int GetTotalMethodInvocationCount() { return this.methodInvocationCounter; } @@ -1474,39 +1493,34 @@ public int GetMethodInvocationCount() Task IOpenConnectionsHandler.TryOpenRntbdChannelsAsync( IEnumerable addresses) { - this.totalReceivedAddressesCounter = addresses.Count(); - for (int i = 0; i < addresses.Count(); i++) + int idx = 0; + this.totalReceivedAddressesCounter += addresses.Count(); + foreach (TransportAddressUri transportAddress in addresses) { if (this.useAttemptBasedFailingIndexs) { - if (this.failIndexesByAttempts.ContainsKey(i) && this.failIndexesByAttempts[i].Contains(this.methodInvocationCounter)) + if (this.failIndexesByAttempts.ContainsKey(idx) && this.failIndexesByAttempts[idx].Contains(this.methodInvocationCounter)) { - this.ExecuteFailureCondition( - addresses: addresses.ToList(), - index: i); + this.ExecuteFailureCondition(transportAddress); } else { - this.ExecuteSuccessCondition( - addresses: addresses.ToList(), - index: i); + this.ExecuteSuccessCondition(transportAddress); } } else { - if (this.failingIndexes.Contains(i)) + if (this.failingIndexes.Contains(idx)) { - this.ExecuteFailureCondition( - addresses: addresses.ToList(), - index: i); + this.ExecuteFailureCondition(transportAddress); } else { - this.ExecuteSuccessCondition( - addresses: addresses.ToList(), - index: i); + this.ExecuteSuccessCondition(transportAddress); } } + + idx++; } this.methodInvocationCounter++; @@ -1515,18 +1529,16 @@ Task IOpenConnectionsHandler.TryOpenRntbdChannelsAsync( } private void ExecuteSuccessCondition( - IReadOnlyList addresses, - int index) + TransportAddressUri address) { - addresses[index].SetConnected(); + address.SetConnected(); this.successInvocationCounter++; } private void ExecuteFailureCondition( - IReadOnlyList addresses, - int index) + TransportAddressUri address) { - addresses[index].SetUnhealthy(); + address.SetUnhealthy(); this.exceptionCounter++; } } From 5d4f7c152edcc5671ca5da71818eeb73c84f6ca3 Mon Sep 17 00:00:00 2001 From: Baltima <130716409+Baltima@users.noreply.github.com> Date: Tue, 25 Apr 2023 21:19:33 +0300 Subject: [PATCH 098/240] Serialization: Fixes call to CosmosSerializer.FromStream on Gateway mode when EnableContentResponseOnWrite is false (#3814) * Do not call serializer if ResponseMessage.Content is empty. * Add unit test * Update unit tests * Remove unused usings --------- Co-authored-by: Matias Quaranta --- .../src/Resource/CosmosResponseFactoryCore.cs | 6 ++ ...ts.cs => CosmosJsonSerializerUnitTests.cs} | 90 ++++++++++++------- 2 files changed, 66 insertions(+), 30 deletions(-) rename Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/{CosmosJsonSeriliazerUnitTests.cs => CosmosJsonSerializerUnitTests.cs} (84%) diff --git a/Microsoft.Azure.Cosmos/src/Resource/CosmosResponseFactoryCore.cs b/Microsoft.Azure.Cosmos/src/Resource/CosmosResponseFactoryCore.cs index 7d9e609ba3..14d405ffc6 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/CosmosResponseFactoryCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/CosmosResponseFactoryCore.cs @@ -276,6 +276,12 @@ public T ToObjectpublic(ResponseMessage responseMessage) return default; } + if (responseMessage.Content.Length == 0) + { + responseMessage.Content.Dispose(); + return default; + } + return this.serializerCore.FromStream(responseMessage.Content); } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosJsonSeriliazerUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosJsonSerializerUnitTests.cs similarity index 84% rename from Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosJsonSeriliazerUnitTests.cs rename to Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosJsonSerializerUnitTests.cs index 3ff401269b..8b318ad09e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosJsonSeriliazerUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosJsonSerializerUnitTests.cs @@ -7,7 +7,6 @@ namespace Microsoft.Azure.Cosmos.Core.Tests using System; using System.Collections.Generic; using System.IO; - using System.Linq; using System.Net; using System.Text; using Microsoft.Azure.Cosmos.CosmosElements; @@ -19,15 +18,15 @@ namespace Microsoft.Azure.Cosmos.Core.Tests using Newtonsoft.Json; [TestClass] - public class CosmosJsonSeriliazerUnitTests + public class CosmosJsonSerializerUnitTests { private readonly ToDoActivity toDoActivity = new ToDoActivity() { - id = "c1d433c1-369d-430e-91e5-14e3ce588f71", - taskNum = 42, - cost = double.MaxValue, - description = "cosmos json serializer", - status = "TBD" + Id = "c1d433c1-369d-430e-91e5-14e3ce588f71", + TaskNum = 42, + Cost = double.MaxValue, + Description = "cosmos json serializer", + Status = "TBD" }; private readonly string toDoActivityJson = @"{""id"":""c1d433c1-369d-430e-91e5-14e3ce588f71"",""taskNum"":42,""cost"":1.7976931348623157E+308,""description"":""cosmos json serializer"",""status"":""TBD""}"; @@ -41,11 +40,11 @@ public void ValidateSerializer() Assert.IsNotNull(stream); ToDoActivity result = cosmosDefaultJsonSerializer.FromStream(stream); Assert.IsNotNull(result); - Assert.AreEqual(this.toDoActivity.id, result.id); - Assert.AreEqual(this.toDoActivity.taskNum, result.taskNum); - Assert.AreEqual(this.toDoActivity.cost, result.cost); - Assert.AreEqual(this.toDoActivity.description, result.description); - Assert.AreEqual(this.toDoActivity.status, result.status); + Assert.AreEqual(this.toDoActivity.Id, result.Id); + Assert.AreEqual(this.toDoActivity.TaskNum, result.TaskNum); + Assert.AreEqual(this.toDoActivity.Cost, result.Cost); + Assert.AreEqual(this.toDoActivity.Description, result.Description); + Assert.AreEqual(this.toDoActivity.Status, result.Status); } } @@ -143,11 +142,11 @@ public void ValidateCustomSerializerSettings() ToDoActivity toDoActivityNoDescription = new ToDoActivity() { - id = "c1d433c1-369d-430e-91e5-14e3ce588f71", - taskNum = 42, - cost = double.MaxValue, - description = null, - status = "TBD" + Id = "c1d433c1-369d-430e-91e5-14e3ce588f71", + TaskNum = 42, + Cost = double.MaxValue, + Description = null, + Status = "TBD" }; string toDoActivityJson = @"{""id"":""c1d433c1-369d-430e-91e5-14e3ce588f71"",""taskNum"":42,""cost"":1.7976931348623157E+308,""status"":""TBD""}"; @@ -175,19 +174,15 @@ public void ValidateResponseFactoryJsonSerializer() ResponseMessage udfResponse = this.CreateResponse(); ResponseMessage itemResponse = this.CreateResponse(); - Mock mockUserJsonSerializer = new Mock(); CosmosSerializerCore serializerCore = new CosmosSerializerCore(mockUserJsonSerializer.Object); - CosmosResponseFactoryInternal cosmosResponseFactory = new CosmosResponseFactoryCore( - serializerCore); - - // Test the user specified response - mockUserJsonSerializer.Setup(x => x.FromStream(itemResponse.Content)).Callback(input => input.Dispose()).Returns(new ToDoActivity()); - mockUserJsonSerializer.Setup(x => x.FromStream(storedProcedureExecuteResponse.Content)).Callback(input => input.Dispose()).Returns(new ToDoActivity()); + CosmosResponseFactoryInternal cosmosResponseFactory = new CosmosResponseFactoryCore(serializerCore); // Verify all the user types use the user specified version ItemResponse itemResponseFromFactory = cosmosResponseFactory.CreateItemResponse(itemResponse); Assert.IsNotNull(itemResponseFromFactory.Diagnostics); + // Verify that FromStream is not called as the stream is empty + mockUserJsonSerializer.Verify(x => x.FromStream(itemResponse.Content), Times.Never); cosmosResponseFactory.CreateStoredProcedureExecuteResponse(storedProcedureExecuteResponse); // Throw if the setups were not called @@ -253,6 +248,27 @@ public void ValidateResponseFactoryJsonSerializer() cosmosResponseFactory.CreateUserDefinedFunctionResponse(udfResponse); } + [TestMethod] + public void ValidateResponseFactoryJsonSerializerWithContent() + { + ResponseMessage itemResponse = this.CreateResponseWithContent(); + + Mock mockUserJsonSerializer = new Mock(); + CosmosSerializerCore serializerCore = new CosmosSerializerCore(mockUserJsonSerializer.Object); + CosmosResponseFactoryInternal cosmosResponseFactory = new CosmosResponseFactoryCore(serializerCore); + + mockUserJsonSerializer.Setup(x => x.FromStream(itemResponse.Content)).Callback(input => input.Dispose()).Returns(new ToDoActivity()); + + // Verify all the user types use the user specified version + ItemResponse itemResponseFromFactory = cosmosResponseFactory.CreateItemResponse(itemResponse); + Assert.IsNotNull(itemResponseFromFactory.Diagnostics); + Assert.IsNotNull(itemResponseFromFactory.Resource); + Assert.AreEqual(HttpStatusCode.OK, itemResponseFromFactory.StatusCode); + + // Throw if the setups were not called + mockUserJsonSerializer.VerifyAll(); + } + [TestMethod] public void ValidateSqlQuerySpecSerializer() { @@ -339,6 +355,15 @@ private ResponseMessage CreateResponse() return cosmosResponse; } + private ResponseMessage CreateResponseWithContent() + { + ResponseMessage cosmosResponse = new ResponseMessage(statusCode: HttpStatusCode.OK) + { + Content = new MemoryStream(Encoding.UTF8.GetBytes(this.toDoActivityJson)) + }; + return cosmosResponse; + } + private ResponseMessage CreateQueryResponse() { List cosmosElements = new List(); @@ -387,13 +412,18 @@ private string GetSerializedToDoActivity() return @"{""id"":""c1d433c1-369d-430e-91e5-14e3ce588f71"",""taskNum"":42,""cost"":1.7976931348623157E+308,""status"":""TBD""}"; } - public class ToDoActivity + private class ToDoActivity { - public string id { get; set; } - public int taskNum { get; set; } - public double cost { get; set; } - public string description { get; set; } - public string status { get; set; } + [JsonProperty("id")] + public string Id { get; set; } + [JsonProperty("taskNum")] + public int TaskNum { get; set; } + [JsonProperty("cost")] + public double Cost { get; set; } + [JsonProperty("description")] + public string Description { get; set; } + [JsonProperty("status")] + public string Status { get; set; } } } } From 0d0ffe07919094d4304443540653fb6aa7c1141b Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Wed, 26 Apr 2023 17:28:58 -0700 Subject: [PATCH 099/240] [Internal] Documentation: Adds documentation covering build pipelines (#3822) * Add doc * Move benchmark * Fixing texts --- docs/builds-and-pipelines.md | 73 +++++++++++++++++++++++++++++++++++ templates/build-benchmark.yml | 25 ++++++++++++ templates/build-preview.yml | 28 +------------- 3 files changed, 99 insertions(+), 27 deletions(-) create mode 100644 docs/builds-and-pipelines.md diff --git a/docs/builds-and-pipelines.md b/docs/builds-and-pipelines.md new file mode 100644 index 0000000000..0747982783 --- /dev/null +++ b/docs/builds-and-pipelines.md @@ -0,0 +1,73 @@ +# Build pipelines for the Azure Cosmos DB .NET SDK + +This repository contains 6 pipelines that are used on different scenarios. + +## PR Validation + +[azure-pipelines.yml](../azure-pipelines.yml) defines the checks that are performed during a PR validation, it covers: + +* [Static analysis](../templates/static-tools.yml) +* [Verifying if the state of the SDK package is valid / can we generate a Nuget package](../templates/nuget-pack.yml) +* [Verify if the CTL runner builds](../templates/build-ctl.yml) -> [CTL Runner source](../Microsoft.Azure.Cosmos.Samples/Tools/CTL). +* [Verify if the Samples build](../templates/build-samples.yml) -> [Samples folder source](../Microsoft.Azure.Cosmos.Samples/Usage). +* [Run the Unit and Emulator tests](../templates/build-test.yml) -> For more information about tests, see the [CONTRIBUTING guide](../CONTRIBUTING.md#tests). +* [Verify the project builds with INTERNAL flag](../templates/build-internal.yml) -> INTERNAL is used for service dogfooding and for friends assembly access. +* [Verify the project builds with the PREVIEW flag, Unit tests for PREVIEW pass, Encryption and Benchmark projects for PREVIEW build](../templates/build-preview.yml) -> PREVIEW is used to ship the `-preview` SDK package. +* [Verify the Benchmark project builds, including PREVIEW flag build](../templates/build-benchmark.yml) -> [Benchmark project](../Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/README.md) enables users to execute benchmark runs on their accounts. + +This pipeline executes on Azure Pipelines as [dotnet-v3-ci](https://cosmos-db-sdk-public.visualstudio.com/cosmos-db-sdk-public/_build?definitionId=63). + +## SDK release + +[azure-pipelines-official.yml](../azure-pipelines-official.yml) is used during the release process of a new version: + +* [Static analysis](../templates/static-tools.yml) +* [Run the Unit and Emulator tests](../templates/build-test.yml) -> For more information about tests, see the [CONTRIBUTING guide](../CONTRIBUTING.md#tests). +* [Generate a Nuget package, and a Symbols package, and publish it on the `cosmosdb/csharp/` storage container](../templates/nuget-pack.yml) the Nuget version will be what is defined on [Directory.Build.Props](../Directory.Build.props). Template parameters: ReleasePackage = true, CleanupFolder = false, BlobVersion = `` + +This pipeline executes on Azure Pipelines as [dotnet-v3-release](https://cosmos-db-sdk-public.visualstudio.com/cosmos-db-sdk-public/_build?definitionId=65). + +## Nightly release + +[azure-pipelines-nightly.yml](../azure-pipelines-nightly.yml) is a scheduled run that executes every day at 0:00 UTC and produces two Nuget packages with the content on the `master` branch: + +* A non-preview package with versioning `Microsoft.Azure.Cosmos.X.Y.Z-nightly-DATE` where `X.Y.Z` is the current version from [Directory.Build.Props](../Directory.Build.props) and `DATE` is the current date in `MMDDYYYY` format. +* A preview package with versioning `Microsoft.Azure.Cosmos.X.Y.Z-preview-nightly-DATE` where `X.Y.Z` is the current version from [Directory.Build.Props](../Directory.Build.props) and `DATE` is the current date in `MMDDYYYY` format. + +The pipeline will: + +* [Generate a nightly Nuget package and publish it on the `cosmosdb/csharp/nightly` storage container and delete previous contents](../templates/nuget-pack.yml). Template parameters: ReleasePackage = true, CleanupFolder = true, BlobVersion = nightly. +* [Generate a preview nightly Nuget package and publish it on the `cosmosdb/csharp/nightly-preview` storage container and delete previous contents](../templates/nuget-pack.yml). Template parameters: ReleasePackage = true, CleanupFolder = true, BlobVersion = nightly-preview. + +This pipeline executes on Azure Pipelines as [dotnet-v3-nightly](https://cosmos-db-sdk-public.visualstudio.com/cosmos-db-sdk-public/_build?definitionId=75). + +## Docker image for CTL workloads + +[azure-pipelines-ctl-publishing.yml](../azure-pipelines-ctl-publishing.yml) executes every time a change is merged into `master` and it will: + +* Generate [docker config files](../Microsoft.Azure.Cosmos.Samples/Tools/CTL/Dockerfile). +* Copy the [executable shell file](../Microsoft.Azure.Cosmos.Samples/Tools/CTL/run_ctl.sh). +* Build and publish as a binary [the CTL project](../Microsoft.Azure.Cosmos.Samples/Tools/CTL/CosmosCTL.csproj). +* Execute docker build and publish the image to the team's Azure Container Instances container. + +This pipeline executes on Azure Pipelines as [dotnet-v3-ctl-image-publish](https://cosmos-db-sdk-public.visualstudio.com/cosmos-db-sdk-public/_build?definitionId=64). + +## Encryption packages release + +This repository also includes the [Microsoft.Azure.Cosmos.Encryption](../Microsoft.Azure.Cosmos.Encryption/) and [Microsoft.Azure.Cosmos.Encryption.Custom](../Microsoft.Azure.Cosmos.Encryption.Custom/) projects as satellite packages for client side encryption. + +[azure-pipelines-encryption](../azure-pipelines-encryption.yml) is used during the release process for a new `Microsoft.Azure.Cosmos.Encryption` release: + +* Builds the [Microsoft.Azure.Cosmos.Encryption](../Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj) +* Generate a Nuget package and a Symbols package +* Publish the package on the `cosmosdb/csharp/encryption/` storage container. + +This pipeline executes on Azure Pipelines as [dotnet-v3-encryption-release](https://cosmos-db-sdk-public.visualstudio.com/cosmos-db-sdk-public/_build?definitionId=66). + +[azure-pipelines-encryption-custom](../azure-pipelines-encryption-custom.yml) is used during the release process for a new `Microsoft.Azure.Cosmos.Encryption.Custom` release: + +* Builds the [Microsoft.Azure.Cosmos.Encryption.Custom](../Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj) +* Generate a Nuget package and a Symbols package +* Publish the package on the `cosmosdb/csharp/encryption.custom/` storage container. + +This pipeline executes on Azure Pipelines as [dotnet-v3-encryption-custom-release](https://cosmos-db-sdk-public.visualstudio.com/cosmos-db-sdk-public/_build?definitionId=67). diff --git a/templates/build-benchmark.yml b/templates/build-benchmark.yml index 7e73842ee1..b542231b8c 100644 --- a/templates/build-benchmark.yml +++ b/templates/build-benchmark.yml @@ -31,4 +31,29 @@ jobs: nugetConfigPath: NuGet.config projects: 'Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmark.sln' arguments: -p:Optimize=true -p:OSSProjectRef=true + versioningScheme: OFF +- job: + displayName: Preview CosmosBenchmark ${{ parameters.BuildConfiguration }} + pool: + vmImage: ${{ parameters.VmImage }} + + steps: + - checkout: self # self represents the repo where the initial Pipelines YAML file was found + clean: true # if true, execute `execute git clean -ffdx && git reset --hard HEAD` before fetching + + # Add this Command to Include the .NET 6 SDK + - task: UseDotNet@2 + displayName: Use .NET 6.0 + inputs: + packageType: 'sdk' + version: '6.x' + + - task: DotNetCoreCLI@2 + displayName: Build Microsoft.Azure.CosmosBenchmark + inputs: + command: build + configuration: $(parameters.BuildConfiguration) + nugetConfigPath: NuGet.config + projects: 'Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmark.sln' + arguments: -p:Optimize=true -p:IsPreview=true -p:OSSProjectRef=true versioningScheme: OFF \ No newline at end of file diff --git a/templates/build-preview.yml b/templates/build-preview.yml index e9919878ff..5ce991a148 100644 --- a/templates/build-preview.yml +++ b/templates/build-preview.yml @@ -142,30 +142,4 @@ jobs: arguments: ${{ parameters.Arguments }} --configuration ${{ parameters.BuildConfiguration }} /p:IsPreview=true /p:OS=${{ parameters.OS }} publishTestResults: true nugetConfigPath: NuGet.config - testRunTitle: Microsoft.Azure.Cosmos.Tests - -- job: - displayName: Preview CosmosBenchmark ${{ parameters.BuildConfiguration }} - pool: - vmImage: ${{ parameters.VmImage }} - - steps: - - checkout: self # self represents the repo where the initial Pipelines YAML file was found - clean: true # if true, execute `execute git clean -ffdx && git reset --hard HEAD` before fetching - - # Add this Command to Include the .NET 6 SDK - - task: UseDotNet@2 - displayName: Use .NET 6.0 - inputs: - packageType: 'sdk' - version: '6.x' - - - task: DotNetCoreCLI@2 - displayName: Build Microsoft.Azure.CosmosBenchmark - inputs: - command: build - configuration: $(parameters.BuildConfiguration) - nugetConfigPath: NuGet.config - projects: 'Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmark.sln' - arguments: -p:Optimize=true -p:IsPreview=true -p:OSSProjectRef=true - versioningScheme: OFF \ No newline at end of file + testRunTitle: Microsoft.Azure.Cosmos.Tests \ No newline at end of file From e872f936caf2f653f7e8fd01e71f3e0ad85691ef Mon Sep 17 00:00:00 2001 From: vipulvishal-ms <110802706+vipulvishal-ms@users.noreply.github.com> Date: Thu, 27 Apr 2023 16:32:17 +0530 Subject: [PATCH 100/240] Client Encryption: Adds release version of Microsoft.Azure.Cosmos to Microsoft.Azure.Cosmos.Encryption.Custom (#3799) * cosmos version change * changing preview to release * resolving code review comments --------- Co-authored-by: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com> --- .../src/EncryptionContainer.cs | 16 +++++++++------- ...crosoft.Azure.Cosmos.Encryption.Custom.csproj | 10 ++++++---- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/src/EncryptionContainer.cs b/Microsoft.Azure.Cosmos.Encryption.Custom/src/EncryptionContainer.cs index ae0ec2aead..eebf5900cf 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/src/EncryptionContainer.cs +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/src/EncryptionContainer.cs @@ -791,13 +791,6 @@ public override Task> GetFeedRangesAsync( return this.container.GetFeedRangesAsync(cancellationToken); } - public override Task> GetPartitionKeyRangesAsync( - FeedRange feedRange, - CancellationToken cancellationToken = default) - { - return this.container.GetPartitionKeyRangesAsync(feedRange, cancellationToken); - } - public override FeedIterator GetItemQueryStreamIterator( FeedRange feedRange, QueryDefinition queryDefinition, @@ -1010,6 +1003,14 @@ public override async Task> ReadManyItemsAsync( return this.ResponseFactory.CreateItemFeedResponse(responseMessage); } +#if ENCRYPTIONPREVIEW + public override Task> GetPartitionKeyRangesAsync( + FeedRange feedRange, + CancellationToken cancellationToken = default) + { + return this.container.GetPartitionKeyRangesAsync(feedRange, cancellationToken); + } + public override Task DeleteAllItemsByPartitionKeyStreamAsync( Cosmos.PartitionKey partitionKey, RequestOptions requestOptions = null, @@ -1020,6 +1021,7 @@ public override Task DeleteAllItemsByPartitionKeyStreamAsync( requestOptions, cancellationToken); } +#endif private async Task ReadManyItemsHelperAsync( IReadOnlyList<(string id, PartitionKey partitionKey)> items, diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj b/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj index 54755c89ef..09b92aa37e 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj @@ -4,8 +4,6 @@ Microsoft.Azure.Cosmos.Encryption.Custom Microsoft.Azure.Cosmos.Encryption.Custom $(LangVersion) - true - $([System.DateTime]::Now.ToString(yyyyMMdd)) $(CustomEncryptionVersion) Microsoft Corporation @@ -24,8 +22,12 @@ - - + + + + + + From e5972ac0ffd53595b2f1f0f10a3faf913ff882e1 Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Thu, 27 Apr 2023 10:16:32 -0700 Subject: [PATCH 101/240] SDK 3.33.0 : Adds version bump and changelog (#3823) * release 3.30.0 * added changelog * updated changelog * updated changelog * suggested change to changelog * updated changelog --------- Co-authored-by: Matias Quaranta --- Directory.Build.props | 4 +- .../contracts/API_3.33.0-preview.txt | 1540 +++++++++++++++++ .../contracts/API_3.33.0.txt | 1493 ++++++++++++++++ changelog.md | 25 +- 4 files changed, 3059 insertions(+), 3 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.33.0-preview.txt create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.33.0.txt diff --git a/Directory.Build.props b/Directory.Build.props index 695ad7c92c..0a0d59a5b4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 3.32.3 - 3.32.3 + 3.33.0 + 3.33.0 preview 3.30.8 2.0.1 diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.33.0-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.33.0-preview.txt new file mode 100644 index 0000000000..4b3c5c951e --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.33.0-preview.txt @@ -0,0 +1,1540 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool IsDistributedTracingEnabled { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public enum PriorityLevel + { + High = 1, + Low = 2, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public Nullable PriorityLevel { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithDistributedTracing(bool isEnabled=true); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsPrimitive(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.33.0.txt b/Microsoft.Azure.Cosmos/contracts/API_3.33.0.txt new file mode 100644 index 0000000000..af7ab6eef4 --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.33.0.txt @@ -0,0 +1,1493 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsPrimitive(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/changelog.md b/changelog.md index 7188399b52..709a4bfccf 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,6 @@ ## Recommended version -The **minimum recommended version is [3.31.0](#3.31.0)**. +The **minimum recommended version is [3.33.0](#3.33.0)**. Make sure that your applications, when using the .NET V3 SDK, are using at least the version described here to have all the critical fixes. @@ -13,6 +13,29 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [3.33.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.33.0-preview) - 2023-04-21 + +### Added + +- [3672](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3672) PriorityBasedExecution: Added PriorityLevel as a RequestOption + +### [3.33.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.33.0) - 2023-04-21 + +#### Fixed +- [3762](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3762) HttpClient: Adds detection of DNS changes through use of SocketsHttpHandler for .NET 6 and above +- [3707](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3707) Diagnostics: Adds startDate in Summary +- [3457](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3457) Documentation: Update Database.ReadAsync description +- [3730](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3730) Query: Fixes System.ArgumentException when using PartitionKey.None on x86, Linux or in Optimistic Direct Execution +- [3775](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3775) Change Feed Processor: Fixes LeaseLostException leaks on notification APIs for Renew scenarios +- [3792](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3792) Diagnostics: Refactors Code to Remove Dependency of HttpResponseHeadersWrapper to fetch Sub Status Codes +- [3793](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3793) Documentation: Refactors SQL API reference to NoSQL API +- [3814](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3814) Serialization: Fixes call to CosmosSerializer.FromStream on Gateway mode when EnableContentResponseOnWrite is false. (Thanks @Baltima) + +#### Added +- [3109](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3109), [3763](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3763) Subpartitioning: Adds support for Prefix Partition Key searches for sub partitioned containers, and APIs for public release and increase REST API version +- [3803](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3803) HttpClient: Adds Properties to the Http messages if available +- [3389](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3389) Patch: Adds Move Operation + ### [3.32.3](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.32.3) - 2023-03-30 ### [3.32.3-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.32.3-preview) - 2023-03-30 From 7465da2dcf92dc14769149ae7492c3db77024405 Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Mon, 1 May 2023 23:59:38 +0530 Subject: [PATCH 102/240] [Internal] Documentation: Adds msdata/direct Sync-up Guide. (#3828) * Code changes to add msdata/direct sync-up documentation. * Code changes to address review comments. * Code changes to address further review comments. * Code changes to address minor review comments. * Removed internal links. --- docs/sync_up_msdata_direct.md | 93 +++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 docs/sync_up_msdata_direct.md diff --git a/docs/sync_up_msdata_direct.md b/docs/sync_up_msdata_direct.md new file mode 100644 index 0000000000..9c416aa65b --- /dev/null +++ b/docs/sync_up_msdata_direct.md @@ -0,0 +1,93 @@ +# Update msdata/direct Repo with Cosmos v3 and Direct Codebase + +## Table of Contents + +* [Background.](#background) +* [Prerequisites.](#prerequisites) +* [Steps Required to Update msdata direct Repo.](#steps-required-to-update-msdata-direct-repo) +* [Validating the sync-up.](#validating-the-sync-up) +* [Submit Pull Request to msdata direct.](#submit-pull-request-to-msdata-direct) +* [Sample Pull Requests to Sync-up msdata direct.](#sample-pull-requests-to-sync-up-msdata-direct) + +## Background + +As a developer on the Cosmos SDK team, we often engage in a task, that requires code changes in both cosmos dotnet sdk v3 repository, as well as in the `msdata` cosmosdb direct codebase (aka `Microsoft.Azure.Cosmos.Direct` namespace). Therefore, sometimes it's utterly challenging to visualize the code changes as a whole, and analyze the impacts. To overcome this, we have created a branch called `msdata/direct` within our cosmos dotnet sdk v3 codebase, that basically mimics the code present in `msdata` repository mentioned above. This simplifies the code changes required to be done in both, provides much better understanding on the overall impacts of the code changes and gives transparency to users in terms of what is the source code for the `Microsoft.Azure.Cosmos.Direct` package. + +## Prerequisites + +Before covering the sync-up process in detail, please follow the below steps to make sure all the required pre-requisites are met. + +### Clone the Azure Cosmos DB .NET SDK Version 3 Repo + +- Clone the azure `cosmos-db dotnet sdk` repo in the local environment, using the below git command: + - git clone https://github.com/Azure/azure-cosmos-dotnet-v3.git + +- Navigate to the directory `azure-cosmos-dotnet-v3` and check out the following branch, `msdata/direct` using the below git commands: + - git pull && git checkout msdata/direct + +### Clone the `CosmosDB` Repo hosted in msdata + +- Clone the CosmosDB repository in the local environment, using the CosmosDB onboarding guide. Please note, building the entire repository is not required for the sync-up process. + +- Navigate to the cloned `CosmosDB` directory and check out the following branch, `master` using the below git commands: + - git pull && git checkout master + +## Steps Required to Update msdata direct Repo + +### Create a Feature Branch for Local Changes. + +The first step to sync up the `msdata/direct` repo is to create a feature branch out of it, where all the required changes could be made. Later on, we will use the feature branch to submit pull request to `msdata/direct`. Please use the following git command to create the feature branch: + +- Stay on the `msdata/direct` branch and run `git checkout -b users//update_msdata_direct_` to create the feature branch. + +### Merging the cosmos db v3 Code into Feature Branch. + +The next step is to port the latest `master` branch code into the newly created feature branch. Please see the below git commands to perform this action: + +- Make sure the `master` branch is up-to-date. +- Stay on the newly created feature branch `users//update_msdata_direct_` and run `git merge master`. +- There are likely to be conflicts during the merge. If that happens, we will need to resolve the conflicts gracefully by accepting the incoming `master` branch changes. + +### Pick the Required Microsoft Azure Cosmos.Direct files into `msdata/direct` repo. + +This is the last part for the sync-up process. Please follow the below steps to copy the required `Microsoft.Cosmos.Direct` files from msdata CosmosDB repo. + +- Open command prompt/windows terminal and navigate to the following directory `Microsoft.Azure.Cosmos\src\direct` inside the cloned cosmos v3 repo. +- Locate and edit the following line in the `msdata_sync.ps1` script with the respective location of the msdata repo: `$baseDir = "\CosmosDB"` +- Run the powershell script using: `.\msdata_sync.ps1`. You will notice the script started copying the required files from the msdata repo, and generating the console logs, like the below: + + ``` + Copying Files: rntbd2 + Copying Files: AccessCondition.cs + Copying Files: AccessConditionType.cs + Copying Files: Address.cs + Copying Files: AddressCacheToken.cs + Copying Files: AddressEnumerator.cs + Copying Files: AddressInformation.cs + Copying Files: AddressSelector.cs + Copying Files: ApiType.cs + Copying Files: Attachment.cs + Copying Files: AuthorizationTokenType.cs + Copying Files: BackoffRetryUtility.cs + Copying Files: BadRequestException.cs + Copying Files: BarrierRequestHelper.cs + ``` + +- Note: There may be instances where some of the files could be missing in the v3 `msdata/direct` repo and the copy may fail with the following error: `Write-Error: SystemSynchronizationScope.cs False`. If that happens, please copy the file manually from the `msdata/CosmosDB` repo and continue running the script all over again. + +## Validating the sync-up + +One of the most important part in the whole `msdata/direct` sync up process is to validate whether the code merges, conflict resolutions and file updates went successfully. To comply with this, please make sure to follow the below steps: + +- Open command prompt/ windows terminal and navigate to the directory where the cosmos v3 code is located, for instance `C:\stash\azure-cosmos-dotnet-v3`. +- Make sure to stay on the newly created feature branch. +- Stay on the same directory mentioned above, and run the following command for a clean build: `dotnet build`. Make sure, the build passes successfully. + +## Submit Pull Request to msdata direct + +Once the feature branch builds successfully, it's time to submit the PR to `msdata/direct` to complete the sync-up process. To do this, please follow `git add`, `git commit` and `git push` commands to push the newly created branch upstream. Once the branch is pushed, please submit the pull request to the `msdata/direct` branch and seek for approvals. + +## Sample Pull Requests to Sync-up msdata direct + +- [[Internal] Msdata/Direct: Refactors msdata branch with latest v3 and direct release](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3726) +- [[Internal] Msdata/Direct: Refactors msdata/direct branch with latest v3 master and Cosmos.Direct v3.30.4](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3776) \ No newline at end of file From 20121c85a1c49f46e5194007de055e5ff79ca297 Mon Sep 17 00:00:00 2001 From: leminh98 Date: Tue, 2 May 2023 08:48:44 -0700 Subject: [PATCH 103/240] Query: Adds TRIM string system function support in LINQ (#3833) * add trim support * Added some test coverage * address reviews --------- Co-authored-by: Minh Le --- .../StringBuiltinFunctions.cs | 43 ++++++ ...ationBaselineTests.TestStringFunctions.xml | 128 ++++++++++++++++-- .../LinqTranslationBaselineTests.cs | 19 ++- 3 files changed, 177 insertions(+), 13 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/StringBuiltinFunctions.cs b/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/StringBuiltinFunctions.cs index 781eb8d20a..b04bd58c3c 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/StringBuiltinFunctions.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/StringBuiltinFunctions.cs @@ -348,6 +348,45 @@ protected override SqlScalarExpression VisitImplicit(MethodCallExpression method } } + private class StringVisitTrim : SqlBuiltinFunctionVisitor + { + public StringVisitTrim() + : base("TRIM", + false, + null) + { + } + + protected override SqlScalarExpression VisitImplicit(MethodCallExpression methodCallExpression, TranslationContext context) + { + bool validInNet = false; + bool validInNetCore = false; + + if (methodCallExpression.Arguments.Count == 1 && + methodCallExpression.Arguments[0].NodeType == ExpressionType.Constant && + methodCallExpression.Arguments[0].Type == typeof(char[])) + { + char[] argumentsExpressions = (char[])((ConstantExpression)methodCallExpression.Arguments[0]).Value; + if (argumentsExpressions.Length == 0) + { + validInNet = true; + } + } + else if (methodCallExpression.Arguments.Count == 0) + { + validInNetCore = true; + } + + if (validInNet || validInNetCore) + { + SqlScalarExpression str = ExpressionToSql.VisitScalarExpression(methodCallExpression.Object, context); + return SqlFunctionCallScalarExpression.CreateBuiltin(SqlFunctionCallScalarExpression.Names.Trim, str); + } + + return null; + } + } + static StringBuiltinFunctions() { StringBuiltinFunctionDefinitions = new Dictionary @@ -415,6 +454,10 @@ static StringBuiltinFunctions() "TrimEnd", new StringVisitTrimEnd() }, + { + "Trim", + new StringVisitTrim() + }, { "StartsWith", new SqlStringWithComparisonVisitor(SqlFunctionCallScalarExpression.Names.Startswith) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringFunctions.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringFunctions.xml index a9fc581461..4ccc9d34ca 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringFunctions.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringFunctions.xml @@ -363,6 +363,28 @@ FROM root]]> + + + + + + doc.StringField.Replace(c, a))]]> + + + + + + + + + doc.StringField.Replace("str", "str2"))]]> + + + @@ -379,34 +401,45 @@ FROM root]]> - - doc.StringField.TrimStart())]]> + + doc.StringField.Trim())]]> - - doc.StringField.Replace(c, a))]]> + + " abc ".Trim())]]> - - doc.StringField.Replace("str", "str2"))]]> + + doc.StringField.Trim(new [] {}))]]> + + + + + + " abc ".Trim(new [] {}))]]> + + + @@ -418,6 +451,83 @@ FROM root]]> + + + + + + " abc ".TrimEnd())]]> + + + + + + + + + doc.StringField.TrimEnd(new [] {}))]]> + + + + + + + + + " abc ".TrimEnd(new [] {}))]]> + + + + + + + + + doc.StringField.TrimStart())]]> + + + + + + + + + " abc ".TrimStart())]]> + + + + + + + + + doc.StringField.TrimStart(new [] {}))]]> + + + + + + + + + " abc ".TrimStart(new [] {}))]]> + + + diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs index 14aadd354f..76bd0ffc81 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs @@ -744,15 +744,26 @@ public void TestStringFunctions() new LinqTestInput("IndexOf string w/ startIndex", b => getQuery(b).Select(doc => doc.StringField.IndexOf("str", 0))), // Count new LinqTestInput("Count", b => getQuery(b).Select(doc => doc.StringField.Count())), - // ToLower - new LinqTestInput("ToLower", b => getQuery(b).Select(doc => doc.StringField.ToLower())), - // TrimStart - new LinqTestInput("TrimStart", b => getQuery(b).Select(doc => doc.StringField.TrimStart())), // Replace new LinqTestInput("Replace char", b => getQuery(b).Select(doc => doc.StringField.Replace('c', 'a'))), new LinqTestInput("Replace string", b => getQuery(b).Select(doc => doc.StringField.Replace("str", "str2"))), + // ToLower + new LinqTestInput("ToLower", b => getQuery(b).Select(doc => doc.StringField.ToLower())), + // Trim + new LinqTestInput("Trim", b => getQuery(b).Select(doc => doc.StringField.Trim())), + new LinqTestInput("Trim with Literal", b => getQuery(b).Select(doc => " abc ".Trim())), + new LinqTestInput("Trim with EmptyCharArray", b => getQuery(b).Select(doc => doc.StringField.Trim(new char[]{ }))), + new LinqTestInput("Trim with Literal and EmptyCharArray", b => getQuery(b).Select(doc => " abc ".Trim(new char[]{ }))), // TrimEnd new LinqTestInput("TrimEnd", b => getQuery(b).Select(doc => doc.StringField.TrimEnd())), + new LinqTestInput("TrimEnd with Literal", b => getQuery(b).Select(doc => " abc ".TrimEnd())), + new LinqTestInput("TrimEnd with EmptyCharArray", b => getQuery(b).Select(doc => doc.StringField.TrimEnd(new char[]{ }))), + new LinqTestInput("TrimEnd with Literal and EmptyCharArray", b => getQuery(b).Select(doc => " abc ".TrimEnd(new char[]{ }))), + // TrimStart + new LinqTestInput("TrimStart", b => getQuery(b).Select(doc => doc.StringField.TrimStart())), + new LinqTestInput("TrimStart with Literal", b => getQuery(b).Select(doc => " abc ".TrimStart())), + new LinqTestInput("TrimStart with EmptyCharArray", b => getQuery(b).Select(doc => doc.StringField.TrimStart(new char[]{ }))), + new LinqTestInput("TrimStart with Literal and EmptyCharArray", b => getQuery(b).Select(doc => " abc ".TrimStart(new char[]{ }))), //StartsWith new LinqTestInput("StartsWith", b => getQuery(b).Select(doc => doc.StringField.StartsWith("str"))), new LinqTestInput("String constant StartsWith", b => getQuery(b).Select(doc => "str".StartsWith(doc.StringField))), From 15616d38a619de70a35c99b6de7f6b30b504d17a Mon Sep 17 00:00:00 2001 From: leminh98 Date: Tue, 2 May 2023 10:34:44 -0700 Subject: [PATCH 104/240] Query: Fixes Parsing Error in SQL DOM when CultureInfo is available (#3832) * add fix * Add cultural info to test to verify correct behavior * address pr review to restore to restore culture * fix comment --------- Co-authored-by: Minh Le --- .../src/Query/Core/Parser/CstToAstVisitor.cs | 3 ++- .../Query/Parser/SqlParserBaselineTests.cs | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/CstToAstVisitor.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/CstToAstVisitor.cs index 8ba6c4fc45..7ca3a60a71 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/CstToAstVisitor.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/CstToAstVisitor.cs @@ -8,6 +8,7 @@ namespace Microsoft.Azure.Cosmos.Query.Core.Parser using System.Collections.Generic; using System.Collections.Immutable; using System.Diagnostics.Contracts; + using System.Globalization; using Antlr4.Runtime.Misc; using Antlr4.Runtime.Tree; using Microsoft.Azure.Cosmos.SqlObjects; @@ -963,7 +964,7 @@ private static Number64 GetNumber64ValueFromNode(IParseTree parseTree) } else { - number64 = double.Parse(text); + number64 = double.Parse(text, CultureInfo.InvariantCulture); } return number64; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/SqlParserBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/SqlParserBaselineTests.cs index fbbca5abbc..11f23fab83 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/SqlParserBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/SqlParserBaselineTests.cs @@ -5,6 +5,9 @@ namespace Microsoft.Azure.Cosmos.Tests.Query.Parser { using System; + using System.Collections.Generic; + using System.Globalization; + using System.Threading; using System.Xml; using Microsoft.Azure.Cosmos.Query.Core.Monads; using Microsoft.Azure.Cosmos.Query.Core.Parser; @@ -17,6 +20,8 @@ public abstract class SqlParserBaselineTests : BaselineTests parseQueryMonad = SqlQueryParser.Monadic.Parse(input.Query); if (parseQueryMonad.Succeeded) { @@ -26,6 +31,22 @@ public override SqlParserBaselineTestOutput ExecuteTest(SqlParserBaselineTestInp Assert.AreEqual(parseQueryMonad.Result, parseQueryMonad2.Result); } + // Set culture to non-standard (US) to catch any parsing error + foreach (string culture in new List { "en-US", "fr-FR", "jp-JP" }) + { + Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(culture); + TryCatch parseQueryMonadCulture = SqlQueryParser.Monadic.Parse(input.Query); + if (parseQueryMonadCulture.Succeeded) + { + // Addtional round trip for extra validation + TryCatch parseQueryMonadCulture2 = SqlQueryParser.Monadic.Parse(parseQueryMonad.Result.ToString()); + Assert.IsTrue(parseQueryMonadCulture2.Succeeded); + Assert.AreEqual(parseQueryMonadCulture2.Result, parseQueryMonadCulture2.Result); + } + } + + // return thread to default culture + Thread.CurrentThread.CurrentCulture = defaultCulture; return new SqlParserBaselineTestOutput(parseQueryMonad); } } From 1dcba536ecaed62b559ed6f5cf0bec62d4b63374 Mon Sep 17 00:00:00 2001 From: vipulvishal-ms <110802706+vipulvishal-ms@users.noreply.github.com> Date: Wed, 3 May 2023 19:10:54 +0530 Subject: [PATCH 105/240] Client Encryption: Adds api FetchDataEncryptionKeyWithoutRawKeyAsync and FetchDataEncryptionKeyAsync to get DEK without and with raw key respectively. (#3809) * added raw key to MdeEncryption * adding ray key to Mde Algo * test case changes * resolving code review comments * code optimization to reduce keyvault calls * removed Microsoft.Data.Encryption.Cryptography nuget package * added api for dek with raw key * resolved code review comments * adding change log * code review changes --- Directory.Build.props | 2 +- .../changelog.md | 5 ++ .../src/CosmosDataEncryptionKeyProvider.cs | 17 +++++- .../src/CosmosEncryptor.cs | 8 +-- .../src/DataEncryptionKeyContainerCore.cs | 11 ++-- .../src/DataEncryptionKeyProvider.cs | 14 ++++- .../src/MdeServices/MdeEncryptionAlgorithm.cs | 54 +++++++++++-------- .../EmulatorTests/LegacyEncryptionTests.cs | 6 +-- .../EmulatorTests/MdeCustomEncryptionTests.cs | 48 +++++++++++++++-- .../CosmosEncryptorTests.cs | 4 +- 10 files changed, 127 insertions(+), 42 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 0a0d59a5b4..a24f0ab2ac 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,7 +7,7 @@ 2.0.1 2.0.1 preview - 1.0.0-preview04 + 1.0.0-preview05 1.1.0-preview3 10.0 $([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../')) diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/changelog.md b/Microsoft.Azure.Cosmos.Encryption.Custom/changelog.md index a17680a9f8..58fcf1d790 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/changelog.md +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/changelog.md @@ -3,6 +3,11 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [1.0.0-preview05](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption.Custom/1.0.0-preview05) - 2023-04-27 + +#### Fixes +- [#3809](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3809) Adds api FetchDataEncryptionKeyWithoutRawKeyAsync and FetchDataEncryptionKey to get DEK without and with raw key respectively. + ### [1.0.0-preview04](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption.Custom/1.0.0-preview04) - 2022-08-16 #### Fixes diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/src/CosmosDataEncryptionKeyProvider.cs b/Microsoft.Azure.Cosmos.Encryption.Custom/src/CosmosDataEncryptionKeyProvider.cs index 1c8cffce8e..773845aa9e 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/src/CosmosDataEncryptionKeyProvider.cs +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/src/CosmosDataEncryptionKeyProvider.cs @@ -166,11 +166,25 @@ public async Task InitializeAsync( this.container = containerResponse.Container; } + /// + public override async Task FetchDataEncryptionKeyWithoutRawKeyAsync( + string id, + string encryptionAlgorithm, + CancellationToken cancellationToken) + { + return await this.FetchDekAsync(id, encryptionAlgorithm, cancellationToken); + } + /// public override async Task FetchDataEncryptionKeyAsync( string id, string encryptionAlgorithm, CancellationToken cancellationToken) + { + return await this.FetchDekAsync(id, encryptionAlgorithm, cancellationToken, true); + } + + private async Task FetchDekAsync(string id, string encryptionAlgorithm, CancellationToken cancellationToken, bool withRawKey = false) { DataEncryptionKeyProperties dataEncryptionKeyProperties = await this.dataEncryptionKeyContainerCore.FetchDataEncryptionKeyPropertiesAsync( id, @@ -200,7 +214,8 @@ public override async Task FetchDataEncryptionKeyAsync( InMemoryRawDek inMemoryRawDek = await this.dataEncryptionKeyContainerCore.FetchUnwrappedAsync( dataEncryptionKeyProperties, diagnosticsContext: CosmosDiagnosticsContext.Create(null), - cancellationToken: cancellationToken); + cancellationToken: cancellationToken, + withRawKey); return inMemoryRawDek.DataEncryptionKey; } diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/src/CosmosEncryptor.cs b/Microsoft.Azure.Cosmos.Encryption.Custom/src/CosmosEncryptor.cs index 3a325e77b2..462bd56a1f 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/src/CosmosEncryptor.cs +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/src/CosmosEncryptor.cs @@ -35,14 +35,14 @@ public override async Task DecryptAsync( string encryptionAlgorithm, CancellationToken cancellationToken = default) { - DataEncryptionKey dek = await this.DataEncryptionKeyProvider.FetchDataEncryptionKeyAsync( + DataEncryptionKey dek = await this.DataEncryptionKeyProvider.FetchDataEncryptionKeyWithoutRawKeyAsync( dataEncryptionKeyId, encryptionAlgorithm, cancellationToken); if (dek == null) { - throw new InvalidOperationException($"Null {nameof(DataEncryptionKey)} returned from {nameof(this.DataEncryptionKeyProvider.FetchDataEncryptionKeyAsync)}."); + throw new InvalidOperationException($"Null {nameof(DataEncryptionKey)} returned from {nameof(this.DataEncryptionKeyProvider.FetchDataEncryptionKeyWithoutRawKeyAsync)}."); } return dek.DecryptData(cipherText); @@ -55,14 +55,14 @@ public override async Task EncryptAsync( string encryptionAlgorithm, CancellationToken cancellationToken = default) { - DataEncryptionKey dek = await this.DataEncryptionKeyProvider.FetchDataEncryptionKeyAsync( + DataEncryptionKey dek = await this.DataEncryptionKeyProvider.FetchDataEncryptionKeyWithoutRawKeyAsync( dataEncryptionKeyId, encryptionAlgorithm, cancellationToken); if (dek == null) { - throw new InvalidOperationException($"Null {nameof(DataEncryptionKey)} returned from {nameof(this.DataEncryptionKeyProvider.FetchDataEncryptionKeyAsync)}."); + throw new InvalidOperationException($"Null {nameof(DataEncryptionKey)} returned from {nameof(this.DataEncryptionKeyProvider.FetchDataEncryptionKeyWithoutRawKeyAsync)}."); } return dek.EncryptData(plainText); diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/src/DataEncryptionKeyContainerCore.cs b/Microsoft.Azure.Cosmos.Encryption.Custom/src/DataEncryptionKeyContainerCore.cs index b5f5d340c9..68e5414275 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/src/DataEncryptionKeyContainerCore.cs +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/src/DataEncryptionKeyContainerCore.cs @@ -335,6 +335,7 @@ internal async Task FetchUnWrappedMdeSupportedLegacyDekAsync( unwrapResult.DataEncryptionKey); return new MdeEncryptionAlgorithm( + unwrapResult.DataEncryptionKey, plaintextDataEncryptionKey, Data.Encryption.Cryptography.EncryptionType.Randomized); } @@ -378,13 +379,14 @@ internal async Task FetchUnWrappedLegacySupportedMdeDekAsync( internal async Task FetchUnwrappedAsync( DataEncryptionKeyProperties dekProperties, CosmosDiagnosticsContext diagnosticsContext, - CancellationToken cancellationToken) + CancellationToken cancellationToken, + bool withRawKey = false) { try { if (string.Equals(dekProperties.EncryptionAlgorithm, CosmosEncryptionAlgorithm.MdeAeadAes256CbcHmac256Randomized)) { - DataEncryptionKey dek = this.InitMdeEncryptionAlgorithm(dekProperties); + DataEncryptionKey dek = this.InitMdeEncryptionAlgorithm(dekProperties, withRawKey); // TTL is not used since DEK is not cached. return new InMemoryRawDek(dek, TimeSpan.FromMilliseconds(0)); @@ -564,7 +566,7 @@ private async Task UnWrapDekMdeEncAlgoAsync( return unwrapResult; } - internal DataEncryptionKey InitMdeEncryptionAlgorithm(DataEncryptionKeyProperties dekProperties) + internal DataEncryptionKey InitMdeEncryptionAlgorithm(DataEncryptionKeyProperties dekProperties, bool withRawKey = false) { if (this.DekProvider.MdeKeyWrapProvider == null) { @@ -576,7 +578,8 @@ internal DataEncryptionKey InitMdeEncryptionAlgorithm(DataEncryptionKeyPropertie dekProperties, Data.Encryption.Cryptography.EncryptionType.Randomized, this.DekProvider.MdeKeyWrapProvider.EncryptionKeyStoreProvider, - this.DekProvider.PdekCacheTimeToLive); + this.DekProvider.PdekCacheTimeToLive, + withRawKey); } private async Task ReadResourceAsync( diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/src/DataEncryptionKeyProvider.cs b/Microsoft.Azure.Cosmos.Encryption.Custom/src/DataEncryptionKeyProvider.cs index 502e14897b..c92df3fa60 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/src/DataEncryptionKeyProvider.cs +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/src/DataEncryptionKeyProvider.cs @@ -14,7 +14,19 @@ namespace Microsoft.Azure.Cosmos.Encryption.Custom public abstract class DataEncryptionKeyProvider { /// - /// Retrieves the data encryption key for the given id. + /// Retrieves the data encryption key for the given id without rawkey. RawKey will be set to null. + /// + /// Identifier of the data encryption key. + /// Encryption algorithm that the retrieved key will be used with. + /// Token for request cancellation. + /// Data encryption key bytes. + public abstract Task FetchDataEncryptionKeyWithoutRawKeyAsync( + string id, + string encryptionAlgorithm, + CancellationToken cancellationToken); + + /// + /// Retrieves the data encryption key for the given id with RawKey value. /// /// Identifier of the data encryption key. /// Encryption algorithm that the retrieved key will be used with. diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/src/MdeServices/MdeEncryptionAlgorithm.cs b/Microsoft.Azure.Cosmos.Encryption.Custom/src/MdeServices/MdeEncryptionAlgorithm.cs index d9144a5c4f..68d863114e 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/src/MdeServices/MdeEncryptionAlgorithm.cs +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/src/MdeServices/MdeEncryptionAlgorithm.cs @@ -14,8 +14,10 @@ internal sealed class MdeEncryptionAlgorithm : DataEncryptionKey { private readonly AeadAes256CbcHmac256EncryptionAlgorithm mdeAeadAes256CbcHmac256EncryptionAlgorithm; + private readonly byte[] unwrapKey; + // unused for MDE Algorithm. - public override byte[] RawKey => null; + public override byte[] RawKey { get; } public override string EncryptionAlgorithm => CosmosEncryptionAlgorithm.MdeAeadAes256CbcHmac256Randomized; @@ -32,7 +34,8 @@ public MdeEncryptionAlgorithm( DataEncryptionKeyProperties dekProperties, Data.Encryption.Cryptography.EncryptionType encryptionType, EncryptionKeyStoreProvider encryptionKeyStoreProvider, - TimeSpan? cacheTimeToLive) + TimeSpan? cacheTimeToLive, + bool withRawKey=false) { if (dekProperties == null) { @@ -49,36 +52,39 @@ public MdeEncryptionAlgorithm( dekProperties.EncryptionKeyWrapMetadata.Value, encryptionKeyStoreProvider); - ProtectedDataEncryptionKey protectedDataEncryptionKey; - if (cacheTimeToLive.HasValue) + if (!withRawKey) { - // no caching - if (cacheTimeToLive.Value == TimeSpan.Zero) - { - protectedDataEncryptionKey = new ProtectedDataEncryptionKey( + ProtectedDataEncryptionKey protectedDataEncryptionKey = cacheTimeToLive.HasValue && cacheTimeToLive.Value == TimeSpan.Zero + ? new ProtectedDataEncryptionKey( + dekProperties.Id, + keyEncryptionKey, + dekProperties.WrappedDataEncryptionKey) + : ProtectedDataEncryptionKey.GetOrCreate( dekProperties.Id, keyEncryptionKey, dekProperties.WrappedDataEncryptionKey); - } - else - { - protectedDataEncryptionKey = ProtectedDataEncryptionKey.GetOrCreate( - dekProperties.Id, - keyEncryptionKey, - dekProperties.WrappedDataEncryptionKey); - } + this.mdeAeadAes256CbcHmac256EncryptionAlgorithm = AeadAes256CbcHmac256EncryptionAlgorithm.GetOrCreate( + protectedDataEncryptionKey, + encryptionType); } else { - protectedDataEncryptionKey = ProtectedDataEncryptionKey.GetOrCreate( - dekProperties.Id, - keyEncryptionKey, - dekProperties.WrappedDataEncryptionKey); + byte[] rawKey = keyEncryptionKey.DecryptEncryptionKey(dekProperties.WrappedDataEncryptionKey); + PlaintextDataEncryptionKey plaintextDataEncryptionKey = cacheTimeToLive.HasValue && (cacheTimeToLive.Value == TimeSpan.Zero) + ? new PlaintextDataEncryptionKey( + dekProperties.Id, + rawKey) + : PlaintextDataEncryptionKey.GetOrCreate( + dekProperties.Id, + rawKey); + this.RawKey = rawKey; + this.mdeAeadAes256CbcHmac256EncryptionAlgorithm = AeadAes256CbcHmac256EncryptionAlgorithm.GetOrCreate( + plaintextDataEncryptionKey, + encryptionType); + } - this.mdeAeadAes256CbcHmac256EncryptionAlgorithm = AeadAes256CbcHmac256EncryptionAlgorithm.GetOrCreate( - protectedDataEncryptionKey, - encryptionType); + } /// @@ -90,9 +96,11 @@ public MdeEncryptionAlgorithm( /// Data Encryption Key /// Encryption type public MdeEncryptionAlgorithm( + byte[] rawkey, Data.Encryption.Cryptography.DataEncryptionKey dataEncryptionKey, Data.Encryption.Cryptography.EncryptionType encryptionType) { + this.RawKey = rawkey; this.mdeAeadAes256CbcHmac256EncryptionAlgorithm = AeadAes256CbcHmac256EncryptionAlgorithm.GetOrCreate( dataEncryptionKey, encryptionType); diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/tests/EmulatorTests/LegacyEncryptionTests.cs b/Microsoft.Azure.Cosmos.Encryption.Custom/tests/EmulatorTests/LegacyEncryptionTests.cs index 27f4567732..2785f04815 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/tests/EmulatorTests/LegacyEncryptionTests.cs +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/tests/EmulatorTests/LegacyEncryptionTests.cs @@ -1747,14 +1747,14 @@ public override async Task DecryptAsync( throw new InvalidOperationException($"Null {nameof(DataEncryptionKey)} returned."); } - DataEncryptionKey dek = await this.DataEncryptionKeyProvider.FetchDataEncryptionKeyAsync( + DataEncryptionKey dek = await this.DataEncryptionKeyProvider.FetchDataEncryptionKeyWithoutRawKeyAsync( dataEncryptionKeyId, encryptionAlgorithm, cancellationToken); if (dek == null) { - throw new InvalidOperationException($"Null {nameof(DataEncryptionKey)} returned from {nameof(this.DataEncryptionKeyProvider.FetchDataEncryptionKeyAsync)}."); + throw new InvalidOperationException($"Null {nameof(DataEncryptionKey)} returned from {nameof(this.DataEncryptionKeyProvider.FetchDataEncryptionKeyWithoutRawKeyAsync)}."); } return dek.DecryptData(cipherText); @@ -1766,7 +1766,7 @@ public override async Task EncryptAsync( string encryptionAlgorithm, CancellationToken cancellationToken = default) { - DataEncryptionKey dek = await this.DataEncryptionKeyProvider.FetchDataEncryptionKeyAsync( + DataEncryptionKey dek = await this.DataEncryptionKeyProvider.FetchDataEncryptionKeyWithoutRawKeyAsync( dataEncryptionKeyId, encryptionAlgorithm, cancellationToken); diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/tests/EmulatorTests/MdeCustomEncryptionTests.cs b/Microsoft.Azure.Cosmos.Encryption.Custom/tests/EmulatorTests/MdeCustomEncryptionTests.cs index 3b2b8f8d97..e100268ea0 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/tests/EmulatorTests/MdeCustomEncryptionTests.cs +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/tests/EmulatorTests/MdeCustomEncryptionTests.cs @@ -20,6 +20,7 @@ namespace Microsoft.Azure.Cosmos.Encryption.EmulatorTests using EncryptionKeyWrapMetadata = Custom.EncryptionKeyWrapMetadata; using DataEncryptionKey = Custom.DataEncryptionKey; using Newtonsoft.Json.Linq; + using System.Buffers.Text; [TestClass] public class MdeCustomEncryptionTests @@ -103,6 +104,47 @@ public async Task EncryptionCreateDek() Assert.AreEqual(dekProperties, readProperties); } + [TestMethod] + public async Task FetchDataEncryptionKeyWithRawKey() + { + CosmosDataEncryptionKeyProvider dekProvider = new CosmosDataEncryptionKeyProvider(new TestEncryptionKeyStoreProvider()); + await dekProvider.InitializeAsync(MdeCustomEncryptionTests.database, MdeCustomEncryptionTests.keyContainer.Id); + DataEncryptionKey k = await dekProvider.FetchDataEncryptionKeyAsync(dekProperties.Id, dekProperties.EncryptionAlgorithm, CancellationToken.None); + Assert.IsNotNull(k.RawKey); + } + + [TestMethod] + public async Task FetchDataEncryptionKeyWithoutRawKey() + { + CosmosDataEncryptionKeyProvider dekProvider = new CosmosDataEncryptionKeyProvider(new TestEncryptionKeyStoreProvider()); + await dekProvider.InitializeAsync(MdeCustomEncryptionTests.database, MdeCustomEncryptionTests.keyContainer.Id); + DataEncryptionKey k = await dekProvider.FetchDataEncryptionKeyWithoutRawKeyAsync(dekProperties.Id, dekProperties.EncryptionAlgorithm, CancellationToken.None); + Assert.IsNull(k.RawKey); + } + + [TestMethod] + [Obsolete] + public async Task FetchDataEncryptionKeyMdeDEKAndLegacyBasedAlgorithm() + { + CosmosDataEncryptionKeyProvider dekProvider = new CosmosDataEncryptionKeyProvider(new TestEncryptionKeyStoreProvider()); + await dekProvider.InitializeAsync(MdeCustomEncryptionTests.database, MdeCustomEncryptionTests.keyContainer.Id); + DataEncryptionKey k = await dekProvider.FetchDataEncryptionKeyAsync(dekProperties.Id, CosmosEncryptionAlgorithm.AEAes256CbcHmacSha256Randomized, CancellationToken.None); + Assert.IsNotNull(k.RawKey); + } + + [TestMethod] + [Obsolete] + public async Task FetchDataEncryptionKeyLegacyDEKAndMdeBasedAlgorithm() + { + string dekId = "legacyDEK"; + DataEncryptionKeyProperties dekProperties = await MdeCustomEncryptionTests.CreateDekAsync(MdeCustomEncryptionTests.dekProvider, dekId, CosmosEncryptionAlgorithm.AEAes256CbcHmacSha256Randomized); + // Use different DEK provider to avoid (unintentional) cache impact + CosmosDataEncryptionKeyProvider dekProvider = new CosmosDataEncryptionKeyProvider(new TestKeyWrapProvider(), new TestEncryptionKeyStoreProvider()); + await dekProvider.InitializeAsync(MdeCustomEncryptionTests.database, MdeCustomEncryptionTests.keyContainer.Id); + DataEncryptionKey k = await dekProvider.FetchDataEncryptionKeyAsync(dekProperties.Id, CosmosEncryptionAlgorithm.MdeAeadAes256CbcHmac256Randomized, CancellationToken.None); + Assert.IsNotNull(k.RawKey); + } + [TestMethod] public async Task EncryptionRewrapDek() { @@ -2190,14 +2232,14 @@ public override async Task DecryptAsync( throw new InvalidOperationException($"Null {nameof(DataEncryptionKey)} returned."); } - DataEncryptionKey dek = await this.DataEncryptionKeyProvider.FetchDataEncryptionKeyAsync( + DataEncryptionKey dek = await this.DataEncryptionKeyProvider.FetchDataEncryptionKeyWithoutRawKeyAsync( dataEncryptionKeyId, encryptionAlgorithm, cancellationToken); if (dek == null) { - throw new InvalidOperationException($"Null {nameof(DataEncryptionKey)} returned from {nameof(this.DataEncryptionKeyProvider.FetchDataEncryptionKeyAsync)}."); + throw new InvalidOperationException($"Null {nameof(DataEncryptionKey)} returned from {nameof(this.DataEncryptionKeyProvider.FetchDataEncryptionKeyWithoutRawKeyAsync)}."); } return dek.DecryptData(cipherText); @@ -2209,7 +2251,7 @@ public override async Task EncryptAsync( string encryptionAlgorithm, CancellationToken cancellationToken = default) { - DataEncryptionKey dek = await this.DataEncryptionKeyProvider.FetchDataEncryptionKeyAsync( + DataEncryptionKey dek = await this.DataEncryptionKeyProvider.FetchDataEncryptionKeyWithoutRawKeyAsync( dataEncryptionKeyId, encryptionAlgorithm, cancellationToken); diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/tests/Microsoft.Azure.Cosmos.Encryption.Custom.Tests/CosmosEncryptorTests.cs b/Microsoft.Azure.Cosmos.Encryption.Custom/tests/Microsoft.Azure.Cosmos.Encryption.Custom.Tests/CosmosEncryptorTests.cs index 747bf3e295..63c5b370d1 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/tests/Microsoft.Azure.Cosmos.Encryption.Custom.Tests/CosmosEncryptorTests.cs +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/tests/Microsoft.Azure.Cosmos.Encryption.Custom.Tests/CosmosEncryptorTests.cs @@ -34,7 +34,7 @@ public static void ClassInitialize(TestContext testContext) CosmosEncryptorTests.mockDataEncryptionKeyProvider = new Mock(); CosmosEncryptorTests.mockDataEncryptionKeyProvider - .Setup(m => m.FetchDataEncryptionKeyAsync(It.IsAny(), It.IsAny(), It.IsAny())) + .Setup(m => m.FetchDataEncryptionKeyWithoutRawKeyAsync(It.IsAny(), It.IsAny(), It.IsAny())) .ReturnsAsync((string dekId, string algo, CancellationToken cancellationToken) => dekId == CosmosEncryptorTests.dekId ? CosmosEncryptorTests.mockDataEncryptionKey.Object : null); @@ -82,7 +82,7 @@ public async Task ValidateEncryptDecrypt() Times.Once); CosmosEncryptorTests.mockDataEncryptionKeyProvider.Verify( - m => m.FetchDataEncryptionKeyAsync( + m => m.FetchDataEncryptionKeyWithoutRawKeyAsync( CosmosEncryptorTests.dekId, CosmosEncryptionAlgorithm.MdeAeadAes256CbcHmac256Randomized, It.IsAny()), Times.Exactly(2)); From 9ba3f7539ee0b4dadb937dd47069f7c9a935ea4c Mon Sep 17 00:00:00 2001 From: Aditya Date: Wed, 3 May 2023 23:00:55 +0000 Subject: [PATCH 106/240] Initial commit (#3826) --- .../src/Linq/TranslationContext.cs | 6 +++ .../BaselineTest/BaselineTests.cs | 4 +- ...nqGeneralBaselineTests.TestLambdaReuse.xml | 38 +++++++++++++++++++ .../LinqGeneralBaselineTests.cs | 21 +++++++++- ...icrosoft.Azure.Cosmos.EmulatorTests.csproj | 6 +++ 5 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqGeneralBaselineTests.TestLambdaReuse.xml diff --git a/Microsoft.Azure.Cosmos/src/Linq/TranslationContext.cs b/Microsoft.Azure.Cosmos/src/Linq/TranslationContext.cs index 9205052604..8fc95d8701 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/TranslationContext.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/TranslationContext.cs @@ -119,6 +119,7 @@ public void PopParameter() { ParameterExpression last = this.lambdaParametersStack[this.lambdaParametersStack.Count - 1]; this.lambdaParametersStack.RemoveAt(this.lambdaParametersStack.Count - 1); + this.substitutions.Remove(last); } /// @@ -337,6 +338,11 @@ public Expression Lookup(ParameterExpression parameter) return null; } + internal void Remove(ParameterExpression parameter) + { + this.substitutionTable.Remove(parameter); + } + public const string InputParameterName = "root"; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/BaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/BaselineTests.cs index e9fbc54267..62f20f1fe4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/BaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/BaselineTests.cs @@ -153,8 +153,8 @@ public void ExecuteTestSuite(IEnumerable inputs, [CallerMemberName] stri Please run the ..\azure-cosmos-dotnet-v3\UpdateContracts.ps1 script to update the baselines. Expected: {baselineTextSuffix}, Actual: {outputTextSuffix}, - OutputPath: {outputPath}, - BaselinePath: {baselinePath}"); + OutputPath: {Path.GetFullPath(outputPath)}, + BaselinePath: {Path.GetFullPath(baselinePath)}"); } /// diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqGeneralBaselineTests.TestLambdaReuse.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqGeneralBaselineTests.TestLambdaReuse.xml new file mode 100644 index 0000000000..bd2e168e76 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqGeneralBaselineTests.TestLambdaReuse.xml @@ -0,0 +1,38 @@ + + + + Where with same predicate instance]]> + + + + + + + + + Select with same predicate instance]]> + + + + + + + + + Select -> Where with same predicate instance]]> + new AnonymousType(Int = 10, Result = c)).Where(DisplayClass.predicate2)]]> + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqGeneralBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqGeneralBaselineTests.cs index a9782bb26b..3fc3aff900 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqGeneralBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqGeneralBaselineTests.cs @@ -1272,6 +1272,25 @@ orderby f.FamilyId descending this.ExecuteTestSuite(inputs); } + [TestMethod] + public void TestLambdaReuse() + { + List inputs = new List(); + + System.Linq.Expressions.Expression> predicate = f => f.Int == 5; + inputs.Add(new LinqTestInput("Where -> Where with same predicate instance", b => getQuery(b).Where(predicate).Where(predicate))); + inputs.Add(new LinqTestInput("Where -> Select with same predicate instance", b => getQuery(b).Where(predicate).Select(predicate))); + + System.Linq.Expressions.Expression> predicate2 = f => f.ToString() == "a"; + inputs.Add(new LinqTestInput("Where -> Select -> Where with same predicate instance", + b => getQuery(b) + .Where(predicate2) + .Select(c => new { Int = 10, Result = c }) + .Where(predicate2))); + + this.ExecuteTestSuite(inputs); + } + [TestMethod] public void TestThenByTranslation() { @@ -1922,7 +1941,7 @@ public async Task ValidateLinqQueries() Gender = "female", Grade = 1, Pets = new List() { pet, new Pet() { GivenName = "koko" } }, - Things = new Dictionary() { { "A", "B" }, { "C", "D" } }, + Things = new Dictionary() { { "A", "B" }, { "C", "D" } } }; Address address = new Address { State = "NY", County = "Manhattan", City = "NY" }; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj index a504adc855..51891d7e3f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj @@ -35,6 +35,7 @@ + @@ -283,6 +284,11 @@ + + + PreserveNewest + + PreserveNewest From 17203a5966e906e0d66d52a95cf4d482add3c51e Mon Sep 17 00:00:00 2001 From: Aditya Date: Thu, 4 May 2023 03:54:27 +0000 Subject: [PATCH 107/240] Query: Adds Computed Property SDK Support (#3761) * Initial commit * Restored settings.json changes. * Update * Addressed comments; still need to be tested using Emulator. * Fixes after test run. * Ignored the computed property tests based on the sync this morning (to allow for preview release). * Suite0 fixes. * Test update. * Suite0 fixes --- .../Settings/ComputedPropertiesDefinition.cs | 60 ++ .../Fluent/Settings/ContainerDefinition.cs | 35 ++ .../src/Resource/Settings/ComputedProperty.cs | 53 ++ .../Resource/Settings/ContainerProperties.cs | 45 ++ .../ComputedPropertyComparer.cs | 45 ++ .../ComputedPropertyTests.cs | 549 ++++++++++++++++++ .../Fluent/ContainerSettingsTests.cs | 188 ++++++ .../Contracts/DotNetPreviewSDKAPI.json | 97 ++++ .../CosmosContainerSettingsTests.cs | 3 + .../ContainerDefinitionForCreateTests.cs | 50 ++ .../SettingsContractTests.cs | 63 +- 11 files changed, 1162 insertions(+), 26 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/src/Fluent/Settings/ComputedPropertiesDefinition.cs create mode 100644 Microsoft.Azure.Cosmos/src/Resource/Settings/ComputedProperty.cs create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputedPropertyComparer.cs create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputedPropertyTests.cs diff --git a/Microsoft.Azure.Cosmos/src/Fluent/Settings/ComputedPropertiesDefinition.cs b/Microsoft.Azure.Cosmos/src/Fluent/Settings/ComputedPropertiesDefinition.cs new file mode 100644 index 0000000000..41a6db5168 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Fluent/Settings/ComputedPropertiesDefinition.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace Microsoft.Azure.Cosmos.Fluent +{ + using System; + using System.Collections.ObjectModel; + + /// + /// Computed Properties fluent definition. + /// + /// +#if PREVIEW + public +#else + internal +#endif + class ComputedPropertiesDefinition + { + private readonly Collection computedProperties = new Collection(); + private readonly T parent; + private readonly Action> attachCallback; + + internal ComputedPropertiesDefinition( + T parent, + Action> attachCallback) + { + this.parent = parent; + this.attachCallback = attachCallback; + } + + /// + /// Adds a computed property to the current + /// + /// Name of the computed property + /// Query for the computed property values + /// An instance of the current + public ComputedPropertiesDefinition WithComputedProperty(string name, string query) + { + this.computedProperties.Add( + new ComputedProperty + { + Name = name, + Query = query + }); + + return this; + } + + /// + /// Applies the current definition to the parent. + /// + /// An instance of the parent. + public T Attach() + { + this.attachCallback(this.computedProperties); + return this.parent; + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Fluent/Settings/ContainerDefinition.cs b/Microsoft.Azure.Cosmos/src/Fluent/Settings/ContainerDefinition.cs index a1141fc3f0..1678688c41 100644 --- a/Microsoft.Azure.Cosmos/src/Fluent/Settings/ContainerDefinition.cs +++ b/Microsoft.Azure.Cosmos/src/Fluent/Settings/ContainerDefinition.cs @@ -4,6 +4,8 @@ namespace Microsoft.Azure.Cosmos.Fluent { using System; + using System.Collections.Generic; + using System.Collections.ObjectModel; /// /// Azure Cosmos container fluent definition. @@ -18,6 +20,7 @@ public abstract class ContainerDefinition private IndexingPolicy indexingPolicy; private string timeToLivePropertyPath; private PartitionKeyDefinitionVersion? partitionKeyDefinitionVersion = null; + private Collection computedProperties; /// /// Creates an instance for unit-testing @@ -123,6 +126,28 @@ public IndexingPolicyDefinition WithIndexingPolicy() (indexingPolicy) => this.WithIndexingPolicy(indexingPolicy)); } + /// + /// definition for Azure Cosmos container. + /// + /// An instance of . +#if PREVIEW + public +#else + internal +#endif + ComputedPropertiesDefinition WithComputedProperties() + { + if (this.computedProperties != null) + { + // Overwrite + throw new NotSupportedException(); + } + + return new ComputedPropertiesDefinition( + (T)this, + (computedProperties) => this.WithComputedProperties(computedProperties)); + } + /// /// Applies the current Fluent definition and creates a container configuration. /// @@ -152,6 +177,11 @@ public ContainerProperties Build() containerProperties.PartitionKeyDefinitionVersion = this.partitionKeyDefinitionVersion.Value; } + if (this.computedProperties != null) + { + containerProperties.ComputedProperties = this.computedProperties; + } + containerProperties.ValidateRequiredProperties(); return containerProperties; @@ -161,5 +191,10 @@ private void WithIndexingPolicy(IndexingPolicy indexingPolicy) { this.indexingPolicy = indexingPolicy; } + + private void WithComputedProperties(Collection computedProperties) + { + this.computedProperties = computedProperties; + } } } diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/ComputedProperty.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/ComputedProperty.cs new file mode 100644 index 0000000000..9eaf5f806b --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/ComputedProperty.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos +{ + using System.Collections.Generic; + using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + + /// + /// Represents a computed property definition in a Cosmos DB collection. + /// +#if PREVIEW + public +#else + internal +#endif + sealed class ComputedProperty + { + /// + /// Gets or sets the name of the computed property. + /// + /// + /// The name of the computed property. + /// + /// + /// Name of the computed property should be chosen such that it does not collide with any existing or future document properties. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the query for the computed property. + /// + /// + /// The query used to evaluate the value for the computed property. + /// + /// + /// For example: + /// SELECT VALUE LOWER(c.firstName) FROM c + /// + [JsonProperty(PropertyName = "query")] + public string Query { get; set; } + + /// + /// This contains additional values for scenarios where the SDK is not aware of new fields. + /// This ensures that if resource is read and updated none of the fields will be lost in the process. + /// + [JsonExtensionData] + internal IDictionary AdditionalProperties { get; private set; } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs index 94cb93cff5..534f4f033d 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs @@ -78,6 +78,9 @@ public class ContainerProperties [JsonProperty(PropertyName = "clientEncryptionPolicy", NullValueHandling = NullValueHandling.Ignore)] private ClientEncryptionPolicy clientEncryptionPolicyInternal; + [JsonProperty(PropertyName = "computedProperties", NullValueHandling = NullValueHandling.Ignore)] + private Collection computedProperties; + /// /// This contains additional values for scenarios where the SDK is not aware of new fields. /// This ensures that if resource is read and updated none of the fields will be lost in the process. @@ -286,6 +289,48 @@ public IndexingPolicy IndexingPolicy } } + /// + /// Gets or sets the collection containing objects in the container. + /// + /// + /// The collection containing objects associated with the container. + /// + + /// + /// Gets or sets the collection containing objects in the container. + /// + /// + /// The collection containing objects associated with the container. + /// + [JsonIgnore] +#if PREVIEW + public +#else + internal +#endif + Collection ComputedProperties + { + get + { + if (this.computedProperties == null) + { + this.computedProperties = new Collection(); + } + + return this.computedProperties; + } + + set + { + if (value == null) + { + throw new ArgumentException($"{nameof(value)}"); + } + + this.computedProperties = value; + } + } + /// /// Gets the associated with the container from the Azure Cosmos DB service. /// diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputedPropertyComparer.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputedPropertyComparer.cs new file mode 100644 index 0000000000..486e785978 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputedPropertyComparer.cs @@ -0,0 +1,45 @@ +namespace Microsoft.Azure.Cosmos +{ + using System; + using System.Collections.Generic; + using System.Collections.ObjectModel; + using System.Diagnostics.CodeAnalysis; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + class ComputedPropertyComparer : IEqualityComparer + { + public static void AssertAreEqual(Collection expected, Collection actual) + { + int expectedCount = expected?.Count ?? 0; + int actualCount = actual?.Count ?? 0; + Assert.AreEqual(expectedCount, actualCount); + + for (int i = 0; i < expectedCount; i++) + { + AssertAreEqual(expected[i], actual[i]); + } + } + + public static void AssertAreEqual(ComputedProperty expected, ComputedProperty actual) + { + ComputedPropertyComparer comparer = new ComputedPropertyComparer(); + Assert.IsTrue(comparer.Equals(expected, actual), $"Expected: {ToString(expected)}{Environment.NewLine}Actual:{ToString(actual)}"); + } + + private static string ToString(ComputedProperty computedProperty) => $@"""Name"":""{computedProperty.Name}"", ""Query"":""{computedProperty.Query}"""; + + public bool Equals(ComputedProperty x, ComputedProperty y) + { + if (x == null) return y == null; + if (y == null) return false; + + return (x.Name?.Equals(y.Name) == true) && + (x.Query?.Equals(y.Query) == true); + } + + public int GetHashCode([DisallowNull] ComputedProperty obj) + { + return obj.GetHashCode(); + } + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputedPropertyTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputedPropertyTests.cs new file mode 100644 index 0000000000..a2c7f552ee --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ComputedPropertyTests.cs @@ -0,0 +1,549 @@ +namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests +{ + using System; + using System.Collections.Generic; + using System.Collections.ObjectModel; + using System.Diagnostics; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using global::Azure; + using Microsoft.Azure.Cosmos.CosmosElements; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + [TestClass] + public class ComputedPropertyTests + { + private static readonly CosmosClient cosmosClient; + private static readonly Database database; + + private static readonly ComputedProperty LowerName; + private static readonly ComputedProperty ParentsFullName; + private static readonly Collection AllComputedProperties; + + private static readonly IndexingPolicy IndexAllComputedProperties_IncludeAll; + private static readonly IndexingPolicy IndexAllComputedProperties_ExcludeAll; + private static readonly IndexingPolicy IndexDefault_IncludeAll; + private static readonly IndexingPolicy IndexDefault_ExcludeAll; + + private static readonly string SelectAllComputedPropertiesQuery; + private static readonly List AllComputedPropertiesResult; + private static readonly List EmptyResult; + + static ComputedPropertyTests() + { + cosmosClient = TestCommon.CreateCosmosClient(); + database = cosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString()).Result; + + LowerName = new ComputedProperty + { + Name = "lowerLastName", + Query = "SELECT VALUE LOWER(IS_DEFINED(c.lastName) ? c.lastName : c.parents[0].familyName) FROM c" + }; + ParentsFullName = new ComputedProperty + { + Name = "parentsFullName", + Query = "SELECT VALUE CONCAT(CONCAT(c.parents[0].firstName, ' ', c.lastName), ' & ', CONCAT(c.parents[1].firstName, ' ', c.lastName)) FROM c" + }; + AllComputedProperties = new Collection { { LowerName }, { ParentsFullName } }; + + IndexAllComputedProperties_IncludeAll = new IndexingPolicy + { + IncludedPaths = new Collection + { + { new IncludedPath { Path = $"/{LowerName.Name}/*" } }, + { new IncludedPath { Path = $"/{ParentsFullName.Name}/*" } }, + { new IncludedPath { Path = $"/*" } }, + } + }; + IndexAllComputedProperties_ExcludeAll = new IndexingPolicy + { + IncludedPaths = new Collection + { + { new IncludedPath { Path = $"/{LowerName.Name}/*" } }, + { new IncludedPath { Path = $"/{ParentsFullName.Name}/*" } }, + }, + ExcludedPaths = new Collection + { + { new ExcludedPath { Path = $"/*" } } + } + }; + IndexDefault_IncludeAll = new IndexingPolicy + { + IncludedPaths = new Collection + { + { new IncludedPath { Path = $"/*" } }, + } + }; + IndexDefault_ExcludeAll = new IndexingPolicy + { + ExcludedPaths = new Collection + { + { new ExcludedPath { Path = $"/*" } } + } + }; + + SelectAllComputedPropertiesQuery = @"SELECT c.lowerLastName, c.parentsFullName FROM c"; + AllComputedPropertiesResult = new List + { + $@"{{{Environment.NewLine} ""lowerLastName"": ""andersen"",{Environment.NewLine} ""parentsFullName"": ""Thomas Andersen & Mary Kay Andersen""{Environment.NewLine}}}", + $@"{{{Environment.NewLine} ""lowerLastName"": ""wakefield""{Environment.NewLine}}}" + }; + EmptyResult = new List + { + @"{}", + @"{}" + }; + } + + [ClassCleanup] + public static async Task Cleanup() + { + await database?.DeleteAsync(); + } + + [Ignore] + [TestMethod] + public async Task TestComputedProperties() + { + TestVariation[] variations = new TestVariation[] + { + ///////////////// + // Create tests + ///////////////// + new TestVariation + { + Description = "V1: null; V2: Empty", + V1 = new ContainerState + { + ComputedProperties = null, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = EmptyResult + }, + V2 = new ContainerState + { + ComputedProperties = new Collection(), + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = EmptyResult + } + }, + new TestVariation + { + Description = "V1: default; V2: All computed properties, no indexing", + V1 = new ContainerState(), + V2 = new ContainerState + { + ComputedProperties = AllComputedProperties, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + } + }, + new TestVariation + { + Description = "V1: default; V2: All computed properties, indexed, exclude /*", + V1 = new ContainerState(), + V2 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexAllComputedProperties_ExcludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + } + }, + new TestVariation + { + Description = "V1: default; V2: All computed properties, indexed, include /*", + V1 = new ContainerState(), + V2 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexAllComputedProperties_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + }, + }, + new TestVariation + { + Description = "V1: default; V2: All computed properties, not indexed, exclude /*", + V1 = new ContainerState(), + V2 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexDefault_ExcludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + }, + }, + new TestVariation + { + Description = "V1: default; V2: All computed properties, not indexed, include /*", + V1 = new ContainerState(), + V2 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexDefault_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + } + }, + new TestVariation + { + Description = "V1: one computed property; V2: All computed properties, not indexed, include /*", + V1 = new ContainerState() + { + ComputedProperties = new Collection{ LowerName }, + IndexingPolicy = IndexDefault_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = new List + { + $@"{{{Environment.NewLine} ""lowerLastName"": ""andersen""{Environment.NewLine}}}", + $@"{{{Environment.NewLine} ""lowerLastName"": ""wakefield""{Environment.NewLine}}}" + } + }, + V2 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexDefault_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + } + }, + + ///////////////// + // Replace tests + ///////////////// + new TestVariation + { + Description = "V1: one computed property; V2: other computed property, not indexed, include /*", + V1 = new ContainerState() + { + ComputedProperties = new Collection{ LowerName }, + IndexingPolicy = IndexDefault_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = new List + { + $@"{{{Environment.NewLine} ""lowerLastName"": ""andersen""{Environment.NewLine}}}", + $@"{{{Environment.NewLine} ""lowerLastName"": ""wakefield""{Environment.NewLine}}}" + } + }, + V2 = new ContainerState + { + ComputedProperties = new Collection{ ParentsFullName }, + IndexingPolicy = IndexDefault_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = new List + { + $@"{{{Environment.NewLine} ""parentsFullName"": ""Thomas Andersen & Mary Kay Andersen""{Environment.NewLine}}}", + @"{}" + } + } + }, + new TestVariation + { + Description = "V1: one computed property; V2: updated computed property definition, not indexed, include /*", + V1 = new ContainerState() + { + ComputedProperties = new Collection{ LowerName }, + IndexingPolicy = IndexDefault_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = new List + { + $@"{{{Environment.NewLine} ""lowerLastName"": ""andersen""{Environment.NewLine}}}", + $@"{{{Environment.NewLine} ""lowerLastName"": ""wakefield""{Environment.NewLine}}}" + } + }, + V2 = new ContainerState + { + ComputedProperties = new Collection + { + new ComputedProperty + { + Name = "lowerLastName", + Query = "SELECT VALUE LOWER(c.lastName) FROM c" + } + }, + IndexingPolicy = IndexDefault_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = new List + { + $@"{{{Environment.NewLine} ""lowerLastName"": ""andersen""{Environment.NewLine}}}", + @"{}" + } + } + }, + + ///////////////// + // Drop tests + ///////////////// + new TestVariation + { + Description = "V1: All computed properties; V2: null", + V1 = new ContainerState + { + ComputedProperties = AllComputedProperties, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + }, + V2 = new ContainerState + { + ComputedProperties = null, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = EmptyResult + } + }, + new TestVariation + { + Description = "V1: All computed properties; V2: only 1 computed property", + V1 = new ContainerState + { + ComputedProperties = AllComputedProperties, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + }, + V2 = new ContainerState + { + ComputedProperties = new Collection{ LowerName }, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = new List + { + $@"{{{Environment.NewLine} ""lowerLastName"": ""andersen""{Environment.NewLine}}}", + $@"{{{Environment.NewLine} ""lowerLastName"": ""wakefield""{Environment.NewLine}}}" + } + } + }, + new TestVariation + { + Description = "V1: All computed properties, indexed, exclude /*; V2: null", + V1 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexAllComputedProperties_ExcludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + }, + V2 = new ContainerState + { + ComputedProperties = null, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = EmptyResult + } + }, + new TestVariation + { + Description = "V1: All computed properties, indexed, include /*; V2: null", + V1 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexAllComputedProperties_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + }, + V2 = new ContainerState + { + ComputedProperties = null, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = EmptyResult + } + }, + new TestVariation + { + Description = "V1: All computed properties, not indexed, exclude /*; V2: null", + V1 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexDefault_ExcludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + }, + V2 = new ContainerState + { + ComputedProperties = null, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = EmptyResult + } + }, + new TestVariation + { + Description = "V1: All computed properties, not indexed, include /*; V2: null", + V1 = new ContainerState + { + ComputedProperties = AllComputedProperties, + IndexingPolicy = IndexDefault_IncludeAll, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = AllComputedPropertiesResult + }, + V2 = new ContainerState + { + ComputedProperties = null, + Query = SelectAllComputedPropertiesQuery, + ExpectedDocuments = EmptyResult + } + } + }; + + int i = 0; + foreach (TestVariation variation in variations) + { + Console.WriteLine($"Variation {i++} : {variation.Description}"); + await this.RunTest(variation); + } + } + + private async Task RunTest(TestVariation variation) + { + Container container = await this.CreateOrReplace(container: null, containerState: variation.V1); + return await this.CreateOrReplace(container, containerState: variation.V2); + } + + private async Task CreateOrReplace(Container container, ContainerState containerState) + { + ContainerProperties containerProperties = new ContainerProperties(container?.Id ?? Guid.NewGuid().ToString(), "/id") + { + IndexingPolicy = containerState.IndexingPolicy ?? new IndexingPolicy(), + ComputedProperties = containerState.ComputedProperties ?? new Collection(), + }; + + ContainerResponse response = container == null ? + await database.CreateContainerAsync(containerProperties) : + await container.ReplaceContainerAsync(containerProperties); + + this.ValidateComputedProperties(containerState.ComputedProperties, response.Resource.ComputedProperties); + + if (container == null) + { + await this.InsertDocuments(response.Container); + } + else + { + // Sometimes the container changes are not immediately reflected in the query. + // We force a insert-delete after container replacement, which seems to help with this problem. + // If this still doesn't help with the flakiness, we need to find other ways of running the query scenario. + // One alternative is to wait for V2 for all test variations to take effect + // and then run queries separately on each container. + await this.DeleteReinsertDocuments(response.Container); + } + + if (!string.IsNullOrEmpty(containerState.Query)) + { + List results = await this.QueryItems(response.Container, containerState.Query); + + Assert.AreEqual(containerState.ExpectedDocuments.Count, results.Count); + for (int i = 0; i < containerState.ExpectedDocuments.Count; i++) + { + Assert.AreEqual(containerState.ExpectedDocuments[i], results[i]); + } + } + + return response.Container; + } + + private async Task DeleteReinsertDocuments(Container container) + { + foreach (CosmosObject document in Documents) + { + string id = ((CosmosString)document["id"]).Value; + await container.DeleteItemAsync(id, new PartitionKey(id)); + } + + await this.InsertDocuments(container); + } + + private async Task InsertDocuments(Container container) + { + foreach(CosmosObject document in Documents) + { + await container.CreateItemAsync(document); + } + } + + private async Task> QueryItems(Container container, string query) + { + List results = new List(); + FeedIterator iterator = container.GetItemQueryIterator(query); + do + { + FeedResponse page = await iterator.ReadNextAsync(); + results.AddRange(page.Select(item => item.ToString())); + } while (iterator.HasMoreResults); + + return results; + } + + private void ValidateComputedProperties(Collection expected, Collection actual) + { + ComputedPropertyComparer.AssertAreEqual(expected, actual); + } + + private class TestVariation + { + public string Description { get; set; } + public ContainerState V1 { get; set; } + public ContainerState V2 { get; set; } + } + + private class ContainerState + { + public Collection ComputedProperties { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public List ExpectedDocuments { get; set; } + public string Query { get; set; } + } + + private static readonly CosmosObject AndersenFamily = CosmosObject.Parse(@" + { + ""id"": ""AndersenFamily"", + ""lastName"": ""Andersen"", + ""parents"": [ + { ""firstName"": ""Thomas"" }, + { ""firstName"": ""Mary Kay""} + ], + ""children"": [ + { + ""firstName"": ""Henriette Thaulow"", + ""gender"": ""female"", + ""grade"": 5, + ""pets"": [{ ""givenName"": ""Fluffy"" }] + } + ], + ""address"": { ""state"": ""WA"", ""county"": ""King"", ""city"": ""seattle"" }, + ""creationDate"": 1431620472, + ""isRegistered"": true, + ""_rid"": ""0fomAIxnukU1AQAAAAAAAA=="" + }"); + + private static readonly CosmosObject WakefieldFamily = CosmosObject.Parse(@" + { + ""id"": ""WakefieldFamily"", + ""parents"": [ + { ""familyName"": ""Wakefield"", ""givenName"": ""Robin"" }, + { ""familyName"": ""Miller"", ""givenName"": ""Ben"" } + ], + ""children"": [ + { + ""familyName"": ""Merriam"", + ""givenName"": ""Jesse"", + ""gender"": ""female"", ""grade"": 1, + ""pets"": [ + { ""givenName"": ""Goofy"" }, + { ""givenName"": ""Shadow"" } + ] + }, + { + ""familyName"": ""Miller"", + ""givenName"": ""Lisa"", + ""gender"": ""female"", + ""grade"": 8 } + ], + ""address"": { ""state"": ""NY"", ""county"": ""Manhattan"", ""city"": ""NY"" }, + ""creationDate"": 1431620462, + ""isRegistered"": false, + ""_rid"": ""0fomAIxnukU1AQAAAAAAAB=="" + }"); + + private static readonly CosmosElement[] Documents = new CosmosElement[] + { + AndersenFamily, + WakefieldFamily, + }; + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Fluent/ContainerSettingsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Fluent/ContainerSettingsTests.cs index 9de85f9f7e..8eb72cac25 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Fluent/ContainerSettingsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Fluent/ContainerSettingsTests.cs @@ -7,6 +7,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json.Linq; using System; + using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; using System.Linq; @@ -98,6 +99,11 @@ public async Task ContainerContractTest() } } }, + // ComputedProperties = new Collection + // { + // { new ComputedProperty{ Name = "lowerName", Query = "SELECT VALUE LOWER(c.Name) FROM c" } }, + // { new ComputedProperty{ Name = "fullName", Query = "SELECT VALUE CONCAT(c.Name, ' ', c.LastName) FROM c" } } + // }, ClientEncryptionPolicy = new ClientEncryptionPolicy(paths) }; @@ -140,6 +146,129 @@ public async Task ContainerContractTest() Assert.IsTrue(responseProperties.ClientEncryptionPolicy.PolicyFormatVersion <= 2); ClientEncryptionIncludedPath clientEncryptionIncludedPath = responseProperties.ClientEncryptionPolicy.IncludedPaths.First(); Assert.IsTrue(this.VerifyClientEncryptionIncludedPath(clientEncryptionIncludedPath1, clientEncryptionIncludedPath)); + + ComputedPropertyComparer.AssertAreEqual(containerProperties.ComputedProperties, responseProperties.ComputedProperties); + ComputedPropertyComparer.AssertAreEqual(containerProperties.ComputedProperties, deserialziedTest.ComputedProperties); + } + + [Ignore] + [TestMethod] + public async Task ContainerNegativeComputedPropertyTest() + { + string query = "SELECT VALUE LOWER(c.name) FROM c"; + var variations = new[] + { + new + { + ComputedProperties = new Collection + { + new ComputedProperty {Name = "lowerName", Query = @"SELECT VALUE LOWER(c.name) FROM c"}, + new ComputedProperty {Name = "lowerName", Query = @"SELECT VALUE LOWER(c.lastName) FROM c"} + }, + Error = @"""Errors"":[""Computed property name 'lowerName' cannot be used in multiple definitions.""]" + }, + new + { + ComputedProperties = new Collection{ new ComputedProperty { Query = query } }, + Error = @"""Errors"":[""One of the specified inputs is invalid""]" + }, + new + { + ComputedProperties = new Collection{ new ComputedProperty { Name = "", Query = query } }, + Error = @"""Errors"":[""Computed property 'name' is either empty or unspecified.""]" + }, + new + { + ComputedProperties = new Collection{ new ComputedProperty { Name = "lowerName" } }, + Error = @"""Errors"":[""One of the specified inputs is invalid""]" + }, + new + { + ComputedProperties = new Collection{ new ComputedProperty { Name = "lowerName", Query = "" } }, + Error = @"""Errors"":[""Computed property 'query' is either empty or unspecified.""]" + }, + new + { + ComputedProperties = new Collection{ new ComputedProperty { Name = "id", Query = query } }, + Error = @"""Errors"":[""The system property name 'id' cannot be used as a computed property name.""]" + }, + new + { + ComputedProperties = new Collection{ new ComputedProperty { Name = "spatial", Query = query } }, + Error = @"""Errors"":[""Computed property 'spatial' at index (0) has a spatial index. Remove the spatial index on this path.""]" + }, + new + { + ComputedProperties = new Collection{ new ComputedProperty {Name = "lowerName", Query = @"SELECT LOWER(c.name) FROM c"} }, + Error = @"""Errors"":[""Required VALUE expression missing from computed property query 'SELECT LOWER(c.name) FROM c' at index (0).""]" + }, + new + { + ComputedProperties = new Collection{ new ComputedProperty {Name = "lowerName", Query = @"SELECT LOWER(c.name) FROM r"} }, + Error = @"""Errors"":[""Computed property at index (0) has a malformed query: 'SELECT LOWER(c.name) FROM r' Error details: '{\""errors\"":[{\""severity\"":\""Error\"",\""code\"":2001,\""message\"":\""Identifier 'c' could not be resolved.\""}]}'""]" + }, + }; + + IndexingPolicy indexingPolicy = new IndexingPolicy + { + SpatialIndexes = new Collection + { + new SpatialPath + { + Path = "/spatial/*", + SpatialTypes = new Collection() + { + Cosmos.SpatialType.LineString, + Cosmos.SpatialType.MultiPolygon, + Cosmos.SpatialType.Point, + Cosmos.SpatialType.Polygon, + } + } + } + }; + + // Create + foreach (var variation in variations) + { + ContainerProperties containerProperties = new ContainerProperties(Guid.NewGuid().ToString(), "/users") + { + IndexingPolicy = indexingPolicy, + GeospatialConfig = new GeospatialConfig(GeospatialType.Geography), + ComputedProperties = variation.ComputedProperties + }; + + try + { + ContainerResponse response = await this.database.CreateContainerAsync(containerProperties); + Assert.Fail($@"Computed Property '{variation.ComputedProperties.Last().Name}' Query '{variation.ComputedProperties.Last().Query}' was expected to fail with error '{variation.Error}'."); + } + catch (CosmosException ce) when (ce.StatusCode == HttpStatusCode.BadRequest) + { + Assert.IsTrue(ce.Message.Contains(variation.Error), $"Message expected to contain:'{variation.Error}'{Environment.NewLine}Actual Message: '{ce.Message}'"); + } + } + + // Replace + Container containerToReplace = await this.database.CreateContainerAsync(new ContainerProperties(Guid.NewGuid().ToString(), "/users")); + foreach (var variation in variations) + { + ContainerProperties containerProperties = new ContainerProperties(Guid.NewGuid().ToString(), "/users") + { + IndexingPolicy = indexingPolicy, + GeospatialConfig = new GeospatialConfig(GeospatialType.Geography), + ComputedProperties = variation.ComputedProperties + }; + + try + { + ContainerResponse response = await containerToReplace.ReplaceContainerAsync(containerProperties); + Assert.Fail($@"Computed Property '{variation.ComputedProperties.Last().Name}' Query '{variation.ComputedProperties.Last().Query}' was expected to fail with error '{variation.Error}'."); + } + catch (CosmosException ce) when (ce.StatusCode == HttpStatusCode.BadRequest) + { + Assert.IsTrue(ce.Message.Contains(variation.Error), $"Message expected to contain:'{variation.Error}'{Environment.NewLine}Actual Message: '{ce.Message}'"); + } + } } [TestMethod] @@ -230,6 +359,17 @@ public async Task ContainerMigrationTest() SpatialTypes = new Collection() { SpatialType.Point } }); + // List computedProperties = new List + // { + // new ComputedProperty() { Name = "lowerName", Query = "SELECT VALUE LOWER(c.name) FROM c" }, + // new ComputedProperty() { Name = "estimatedTax", Query = "SELECT VALUE c.salary * 0.2 FROM c" } + // }; + + // foreach (ComputedProperty computedProperty in computedProperties) + // { + // containerProperties.ComputedProperties.Add(computedProperty); + // } + ContainerProperties propertiesAfterReplace = await container.ReplaceContainerAsync(containerProperties); Assert.AreEqual(0, propertiesAfterReplace.IndexingPolicy.IncludedPaths.First().Indexes.Count); Assert.AreEqual(1, propertiesAfterReplace.IndexingPolicy.CompositeIndexes.Count); @@ -242,6 +382,8 @@ public async Task ContainerMigrationTest() Assert.AreEqual(1, propertiesAfterReplace.IndexingPolicy.SpatialIndexes.Count); Assert.AreEqual("/address/test/*", propertiesAfterReplace.IndexingPolicy.SpatialIndexes.First().Path); + + ComputedPropertyComparer.AssertAreEqual(containerProperties.ComputedProperties, propertiesAfterReplace.ComputedProperties); } [TestMethod] @@ -449,6 +591,52 @@ await this.database.DefineContainer(containerName, partitionKeyPath) Assert.AreEqual(HttpStatusCode.NoContent, containerResponse.StatusCode); } + [Ignore] + [TestMethod] + public async Task WithComputedProperties() + { + string containerName = Guid.NewGuid().ToString(); + string partitionKeyPath = "/users"; + + var definitions = new[] + { + new { Name = "lowerName", Query = "SELECT VALUE LOWER(c.name) FROM c" }, + new { Name = "estimatedTax", Query = "SELECT VALUE c.salary * 0.2 FROM c" } + }; + ContainerResponse containerResponse = + await this.database.DefineContainer(containerName, partitionKeyPath) + .WithComputedProperties() + .WithComputedProperty(definitions[0].Name, definitions[0].Query) + .WithComputedProperty(definitions[1].Name, definitions[1].Query) + .Attach() + .CreateAsync(); + + Assert.AreEqual(HttpStatusCode.Created, containerResponse.StatusCode); + Assert.AreEqual(containerName, containerResponse.Resource.Id); + Assert.AreEqual(partitionKeyPath, containerResponse.Resource.PartitionKey.Paths.First()); + + Assert.AreEqual(2, containerResponse.Resource.ComputedProperties.Count); + Assert.AreEqual(definitions[0].Name, containerResponse.Resource.ComputedProperties[0].Name); + Assert.AreEqual(definitions[0].Query, containerResponse.Resource.ComputedProperties[0].Query); + Assert.AreEqual(definitions[1].Name, containerResponse.Resource.ComputedProperties[1].Name); + Assert.AreEqual(definitions[1].Query, containerResponse.Resource.ComputedProperties[1].Query); + + Container container = containerResponse; + containerResponse = await container.ReadContainerAsync(); + Assert.AreEqual(HttpStatusCode.OK, containerResponse.StatusCode); + Assert.AreEqual(containerName, containerResponse.Resource.Id); + Assert.AreEqual(partitionKeyPath, containerResponse.Resource.PartitionKey.Paths.First()); + + Assert.AreEqual(2, containerResponse.Resource.ComputedProperties.Count); + Assert.AreEqual(definitions[0].Name, containerResponse.Resource.ComputedProperties[0].Name); + Assert.AreEqual(definitions[0].Query, containerResponse.Resource.ComputedProperties[0].Query); + Assert.AreEqual(definitions[1].Name, containerResponse.Resource.ComputedProperties[1].Name); + Assert.AreEqual(definitions[1].Query, containerResponse.Resource.ComputedProperties[1].Query); + + containerResponse = await containerResponse.Container.DeleteContainerAsync(); + Assert.AreEqual(HttpStatusCode.NoContent, containerResponse.StatusCode); + } + [TestMethod] public async Task ThroughputTest() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index 8a3d326d50..ab29c95bf0 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -253,6 +253,59 @@ }, "NestedTypes": {} }, + "Microsoft.Azure.Cosmos.ComputedProperty;System.Object;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "System.String get_Name()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.String get_Name();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String get_Query()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.String get_Query();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String Name[Newtonsoft.Json.JsonPropertyAttribute(PropertyName = \"name\")]": { + "Type": "Property", + "Attributes": [ + "JsonPropertyAttribute" + ], + "MethodInfo": "System.String Name;CanRead:True;CanWrite:True;System.String get_Name();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_Name(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String Query[Newtonsoft.Json.JsonPropertyAttribute(PropertyName = \"query\")]": { + "Type": "Property", + "Attributes": [ + "JsonPropertyAttribute" + ], + "MethodInfo": "System.String Query;CanRead:True;CanWrite:True;System.String get_Query();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_Query(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void .ctor()": { + "Type": "Constructor", + "Attributes": [], + "MethodInfo": "[Void .ctor(), Void .ctor()]" + }, + "Void set_Name(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_Name(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_Query(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_Query(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.Container;System.Object;IsAbstract:True;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { @@ -284,10 +337,27 @@ "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedPolicy get_ChangeFeedPolicy();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "System.Collections.ObjectModel.Collection`1[Microsoft.Azure.Cosmos.ComputedProperty] ComputedProperties[Newtonsoft.Json.JsonIgnoreAttribute()]": { + "Type": "Property", + "Attributes": [ + "JsonIgnoreAttribute" + ], + "MethodInfo": "System.Collections.ObjectModel.Collection`1[Microsoft.Azure.Cosmos.ComputedProperty] ComputedProperties;CanRead:True;CanWrite:True;System.Collections.ObjectModel.Collection`1[Microsoft.Azure.Cosmos.ComputedProperty] get_ComputedProperties();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_ComputedProperties(System.Collections.ObjectModel.Collection`1[Microsoft.Azure.Cosmos.ComputedProperty]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Collections.ObjectModel.Collection`1[Microsoft.Azure.Cosmos.ComputedProperty] get_ComputedProperties()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.Collections.ObjectModel.Collection`1[Microsoft.Azure.Cosmos.ComputedProperty] get_ComputedProperties();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Void set_ChangeFeedPolicy(Microsoft.Azure.Cosmos.ChangeFeedPolicy)": { "Type": "Method", "Attributes": [], "MethodInfo": "Void set_ChangeFeedPolicy(Microsoft.Azure.Cosmos.ChangeFeedPolicy);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_ComputedProperties(System.Collections.ObjectModel.Collection`1[Microsoft.Azure.Cosmos.ComputedProperty])": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Void set_ComputedProperties(System.Collections.ObjectModel.Collection`1[Microsoft.Azure.Cosmos.ComputedProperty]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {} @@ -328,6 +398,22 @@ }, "NestedTypes": {} }, + "Microsoft.Azure.Cosmos.Fluent.ComputedPropertiesDefinition`1;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:True;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "Microsoft.Azure.Cosmos.Fluent.ComputedPropertiesDefinition`1[T] WithComputedProperty(System.String, System.String)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.Fluent.ComputedPropertiesDefinition`1[T] WithComputedProperty(System.String, System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "T Attach()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "T Attach();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.Fluent.ContainerBuilder;Microsoft.Azure.Cosmos.Fluent.ContainerDefinition`1[[Microsoft.Azure.Cosmos.Fluent.ContainerBuilder, ]];IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { @@ -339,6 +425,17 @@ }, "NestedTypes": {} }, + "Microsoft.Azure.Cosmos.Fluent.ContainerDefinition`1;System.Object;IsAbstract:True;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:True;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "Microsoft.Azure.Cosmos.Fluent.ComputedPropertiesDefinition`1[T] WithComputedProperties()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.Fluent.ComputedPropertiesDefinition`1[T] WithComputedProperties();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosContainerSettingsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosContainerSettingsTests.cs index 865bb71d18..bda132d6a3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosContainerSettingsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosContainerSettingsTests.cs @@ -33,6 +33,9 @@ public void DefaultIncludesPopulated() Cosmos.IncludedPath defaultEntry = containerSettings.IndexingPolicy.IncludedPaths[0]; Assert.AreEqual(Cosmos.IndexingPolicy.DefaultPath, defaultEntry.Path); Assert.AreEqual(0, defaultEntry.Indexes.Count); + + Assert.IsNotNull(containerSettings.ComputedProperties); + Assert.AreEqual(0, containerSettings.ComputedProperties.Count); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Fluent/ContainerDefinitionForCreateTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Fluent/ContainerDefinitionForCreateTests.cs index 58361f89bb..d94aed92a4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Fluent/ContainerDefinitionForCreateTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Fluent/ContainerDefinitionForCreateTests.cs @@ -251,6 +251,56 @@ await containerFluentDefinitionForCreate It.IsAny()), Times.Once); } + [Ignore] + [TestMethod] + public async Task WithComputedProperties() + { + Mock mockContainerResponse = new Mock(MockBehavior.Strict); + Mock mockDatabase = new Mock(MockBehavior.Strict); + Mock mockClient = new Mock(MockBehavior.Strict); + mockDatabase.Setup(m => m.Client).Returns(mockClient.Object); + mockDatabase + .Setup(c => c.CreateContainerAsync( + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny())) + .ReturnsAsync(mockContainerResponse.Object); + mockDatabase + .Setup(c => c.Id) + .Returns(Guid.NewGuid().ToString()); + + ContainerBuilder containerFluentDefinitionForCreate = new ContainerBuilder( + mockDatabase.Object, + containerName, + partitionKey); + + var definitions = new[] + { + new { Name = "lowerName", Query = "SELECT VALUE LOWER(c.name) FROM c" }, + new { Name = "estimatedTax", Query = "SELECT VALUE c.salary * 0.2 FROM c" } + }; + await containerFluentDefinitionForCreate + .WithComputedProperties() + .WithComputedProperty(definitions[0].Name, definitions[0].Query) + .WithComputedProperty(definitions[1].Name, definitions[1].Query) + .Attach() + .CreateAsync(); + + mockDatabase.Verify(c => c.CreateContainerAsync( + It.Is((settings) => + settings.ComputedProperties.Count == 2 && + definitions[0].Name.Equals(settings.ComputedProperties[0].Name) && + definitions[0].Query.Equals(settings.ComputedProperties[0].Query) && + definitions[1].Name.Equals(settings.ComputedProperties[1].Name) && + definitions[1].Query.Equals(settings.ComputedProperties[1].Query) + ), + It.IsAny(), + It.IsAny(), + It.IsAny()), + Times.Once); + } + [TestMethod] public async Task WithUniqueKey() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/SettingsContractTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/SettingsContractTests.cs index 239de170de..2e8df92318 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/SettingsContractTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/SettingsContractTests.cs @@ -339,7 +339,7 @@ public void AccountPropertiesDeserializeWithAdditionalDataTest() [TestMethod] public void ContainerPropertiesDeserializeWithAdditionalDataTest() { - string cosmosSerialized = "{\"indexingPolicy\":{\"automatic\":true,\"indexingMode\":\"Consistent\",\"additionalIndexPolicy\":\"indexpolicyvalue\",\"includedPaths\":[{\"path\":\"/included/path\",\"additionalIncludedPath\":\"includedPathValue\",\"indexes\":[]}],\"excludedPaths\":[{\"path\":\"/excluded/path\",\"additionalExcludedPath\":\"excludedPathValue\"}],\"compositeIndexes\":[[{\"path\":\"/composite/path\",\"additionalCompositeIndex\":\"compositeIndexValue\",\"order\":\"ascending\"}]],\"spatialIndexes\":[{\"path\":\"/spatial/path\",\"additionalSpatialIndexes\":\"spatialIndexValue\",\"types\":[]}]},\"geospatialConfig\":{\"type\":\"Geography\",\"additionalGeospatialConfig\":\"geospatialConfigValue\"},\"uniqueKeyPolicy\":{\"additionalUniqueKeyPolicy\":\"uniqueKeyPolicyValue\",\"uniqueKeys\":[{\"paths\":[\"/unique/key/path/1\",\"/unique/key/path/2\"]}]},\"conflictResolutionPolicy\":{\"mode\":\"LastWriterWins\",\"additionalConflictResolutionPolicy\":\"conflictResolutionValue\"},\"clientEncryptionPolicy\":{\"includedPaths\":[{\"path\":\"/path\",\"clientEncryptionKeyId\":\"clientEncryptionKeyId\",\"encryptionType\":\"Randomized\",\"additionalIncludedPath\":\"includedPathValue\",\"encryptionAlgorithm\":\"AEAD_AES_256_CBC_HMAC_SHA256\"}],\"policyFormatVersion\":1,\"additionalEncryptionPolicy\":\"clientEncryptionpolicyValue\"},\"id\":\"2a9f501b-6948-4795-8fd1-797defb5c466\",\"partitionKey\":{\"paths\":[],\"kind\":\"Hash\"}}"; + string cosmosSerialized = "{\"indexingPolicy\":{\"automatic\":true,\"indexingMode\":\"Consistent\",\"additionalIndexPolicy\":\"indexpolicyvalue\",\"includedPaths\":[{\"path\":\"/included/path\",\"additionalIncludedPath\":\"includedPathValue\",\"indexes\":[]}],\"excludedPaths\":[{\"path\":\"/excluded/path\",\"additionalExcludedPath\":\"excludedPathValue\"}],\"compositeIndexes\":[[{\"path\":\"/composite/path\",\"additionalCompositeIndex\":\"compositeIndexValue\",\"order\":\"ascending\"}]],\"spatialIndexes\":[{\"path\":\"/spatial/path\",\"additionalSpatialIndexes\":\"spatialIndexValue\",\"types\":[]}]},\"computedProperties\":[{\"name\":\"lowerName\",\"query\":\"SELECT VALUE LOWER(c.name) FROM c\"},{\"name\":\"estimatedTax\",\"query\":\"SELECT VALUE c.salary * 0.2 FROM c\"}],\"geospatialConfig\":{\"type\":\"Geography\",\"additionalGeospatialConfig\":\"geospatialConfigValue\"},\"uniqueKeyPolicy\":{\"additionalUniqueKeyPolicy\":\"uniqueKeyPolicyValue\",\"uniqueKeys\":[{\"paths\":[\"/unique/key/path/1\",\"/unique/key/path/2\"]}]},\"conflictResolutionPolicy\":{\"mode\":\"LastWriterWins\",\"additionalConflictResolutionPolicy\":\"conflictResolutionValue\"},\"clientEncryptionPolicy\":{\"includedPaths\":[{\"path\":\"/path\",\"clientEncryptionKeyId\":\"clientEncryptionKeyId\",\"encryptionType\":\"Randomized\",\"additionalIncludedPath\":\"includedPathValue\",\"encryptionAlgorithm\":\"AEAD_AES_256_CBC_HMAC_SHA256\"}],\"policyFormatVersion\":1,\"additionalEncryptionPolicy\":\"clientEncryptionpolicyValue\"},\"id\":\"2a9f501b-6948-4795-8fd1-797defb5c466\",\"partitionKey\":{\"paths\":[],\"kind\":\"Hash\"}}"; JObject complexObject = JObject.FromObject(new { id = 1, name = new { fname = "fname", lname = "lname" } }); @@ -351,43 +351,49 @@ public void ContainerPropertiesDeserializeWithAdditionalDataTest() // Serialized string cosmosSerialized = SettingsContractTests.CosmosSerialize(jobject); - ContainerProperties containerDeserSettings = SettingsContractTests.CosmosDeserialize(cosmosSerialized); + ContainerProperties containerProperties = SettingsContractTests.CosmosDeserialize(cosmosSerialized); - Assert.AreEqual("2a9f501b-6948-4795-8fd1-797defb5c466", containerDeserSettings.Id); + Assert.AreEqual("2a9f501b-6948-4795-8fd1-797defb5c466", containerProperties.Id); - Assert.AreEqual(2, containerDeserSettings.AdditionalProperties.Count); - Assert.AreEqual("policy value", (string)containerDeserSettings.AdditionalProperties["simple string"]); - Assert.AreEqual(complexObject.ToString(), JObject.FromObject(containerDeserSettings.AdditionalProperties["complex object"]).ToString()); + Assert.AreEqual(2, containerProperties.AdditionalProperties.Count); + Assert.AreEqual("policy value", (string)containerProperties.AdditionalProperties["simple string"]); + Assert.AreEqual(complexObject.ToString(), JObject.FromObject(containerProperties.AdditionalProperties["complex object"]).ToString()); + + Assert.AreEqual(1, containerProperties.IndexingPolicy.AdditionalProperties.Count); + Assert.AreEqual("indexpolicyvalue", containerProperties.IndexingPolicy.AdditionalProperties["additionalIndexPolicy"]); - Assert.AreEqual(1, containerDeserSettings.IndexingPolicy.AdditionalProperties.Count); - Assert.AreEqual("indexpolicyvalue", containerDeserSettings.IndexingPolicy.AdditionalProperties["additionalIndexPolicy"]); + Assert.AreEqual(1, containerProperties.IndexingPolicy.SpatialIndexes[0].AdditionalProperties.Count); + Assert.AreEqual("spatialIndexValue", containerProperties.IndexingPolicy.SpatialIndexes[0].AdditionalProperties["additionalSpatialIndexes"]); - Assert.AreEqual(1, containerDeserSettings.IndexingPolicy.SpatialIndexes[0].AdditionalProperties.Count); - Assert.AreEqual("spatialIndexValue", containerDeserSettings.IndexingPolicy.SpatialIndexes[0].AdditionalProperties["additionalSpatialIndexes"]); + Assert.AreEqual(1, containerProperties.IndexingPolicy.CompositeIndexes[0][0].AdditionalProperties.Count); + Assert.AreEqual("compositeIndexValue", containerProperties.IndexingPolicy.CompositeIndexes[0][0].AdditionalProperties["additionalCompositeIndex"]); - Assert.AreEqual(1, containerDeserSettings.IndexingPolicy.CompositeIndexes[0][0].AdditionalProperties.Count); - Assert.AreEqual("compositeIndexValue", containerDeserSettings.IndexingPolicy.CompositeIndexes[0][0].AdditionalProperties["additionalCompositeIndex"]); + Assert.AreEqual(1, containerProperties.IndexingPolicy.IncludedPaths[0].AdditionalProperties.Count); + Assert.AreEqual("includedPathValue", containerProperties.IndexingPolicy.IncludedPaths[0].AdditionalProperties["additionalIncludedPath"]); - Assert.AreEqual(1, containerDeserSettings.IndexingPolicy.IncludedPaths[0].AdditionalProperties.Count); - Assert.AreEqual("includedPathValue", containerDeserSettings.IndexingPolicy.IncludedPaths[0].AdditionalProperties["additionalIncludedPath"]); + Assert.AreEqual(1, containerProperties.IndexingPolicy.ExcludedPaths[0].AdditionalProperties.Count); + Assert.AreEqual("excludedPathValue", containerProperties.IndexingPolicy.ExcludedPaths[0].AdditionalProperties["additionalExcludedPath"]); - Assert.AreEqual(1, containerDeserSettings.IndexingPolicy.ExcludedPaths[0].AdditionalProperties.Count); - Assert.AreEqual("excludedPathValue", containerDeserSettings.IndexingPolicy.ExcludedPaths[0].AdditionalProperties["additionalExcludedPath"]); + Assert.AreEqual(1, containerProperties.GeospatialConfig.AdditionalProperties.Count); + Assert.AreEqual("geospatialConfigValue", containerProperties.GeospatialConfig.AdditionalProperties["additionalGeospatialConfig"]); - Assert.AreEqual(1, containerDeserSettings.GeospatialConfig.AdditionalProperties.Count); - Assert.AreEqual("geospatialConfigValue", containerDeserSettings.GeospatialConfig.AdditionalProperties["additionalGeospatialConfig"]); + Assert.AreEqual(1, containerProperties.UniqueKeyPolicy.AdditionalProperties.Count); + Assert.AreEqual("uniqueKeyPolicyValue", containerProperties.UniqueKeyPolicy.AdditionalProperties["additionalUniqueKeyPolicy"]); - Assert.AreEqual(1, containerDeserSettings.UniqueKeyPolicy.AdditionalProperties.Count); - Assert.AreEqual("uniqueKeyPolicyValue", containerDeserSettings.UniqueKeyPolicy.AdditionalProperties["additionalUniqueKeyPolicy"]); + Assert.AreEqual(1, containerProperties.ConflictResolutionPolicy.AdditionalProperties.Count); + Assert.AreEqual("conflictResolutionValue", containerProperties.ConflictResolutionPolicy.AdditionalProperties["additionalConflictResolutionPolicy"]); - Assert.AreEqual(1, containerDeserSettings.ConflictResolutionPolicy.AdditionalProperties.Count); - Assert.AreEqual("conflictResolutionValue", containerDeserSettings.ConflictResolutionPolicy.AdditionalProperties["additionalConflictResolutionPolicy"]); + Assert.AreEqual(1, containerProperties.ClientEncryptionPolicy.AdditionalProperties.Count); + Assert.AreEqual("clientEncryptionpolicyValue", containerProperties.ClientEncryptionPolicy.AdditionalProperties["additionalEncryptionPolicy"]); - Assert.AreEqual(1, containerDeserSettings.ClientEncryptionPolicy.AdditionalProperties.Count); - Assert.AreEqual("clientEncryptionpolicyValue", containerDeserSettings.ClientEncryptionPolicy.AdditionalProperties["additionalEncryptionPolicy"]); + Assert.AreEqual(1, containerProperties.ClientEncryptionPolicy.IncludedPaths.First().AdditionalProperties.Count); + Assert.AreEqual("includedPathValue", containerProperties.ClientEncryptionPolicy.IncludedPaths.First().AdditionalProperties["additionalIncludedPath"]); - Assert.AreEqual(1, containerDeserSettings.ClientEncryptionPolicy.IncludedPaths.First().AdditionalProperties.Count); - Assert.AreEqual("includedPathValue", containerDeserSettings.ClientEncryptionPolicy.IncludedPaths.First().AdditionalProperties["additionalIncludedPath"]); + Assert.AreEqual(2, containerProperties.ComputedProperties.Count); + Assert.AreEqual("lowerName", containerProperties.ComputedProperties[0].Name); + Assert.AreEqual("SELECT VALUE LOWER(c.name) FROM c", containerProperties.ComputedProperties[0].Query); + Assert.AreEqual("estimatedTax", containerProperties.ComputedProperties[1].Name); + Assert.AreEqual("SELECT VALUE c.salary * 0.2 FROM c", containerProperties.ComputedProperties[1].Query); } [TestMethod] @@ -724,6 +730,7 @@ public void ContainerSettingsDefaults() "TimeToLivePropertyPath", "PartitionKeyPath", "PartitionKeyDefinitionVersion", + "ComputedProperties", "ConflictResolutionPolicy", "ChangeFeedPolicy", "ClientEncryptionPolicy", @@ -762,6 +769,10 @@ public void ContainerSettingsDefaults() Assert.IsNotNull(cosmosContainerSettings.IndexingPolicy.IncludedPaths); Assert.IsTrue(object.ReferenceEquals(cosmosContainerSettings.IndexingPolicy.IncludedPaths, cosmosContainerSettings.IndexingPolicy.IncludedPaths)); + Assert.IsNotNull(cosmosContainerSettings.ComputedProperties); + Assert.AreEqual(0, cosmosContainerSettings.ComputedProperties.Count); + Assert.IsTrue(object.ReferenceEquals(cosmosContainerSettings.ComputedProperties, cosmosContainerSettings.ComputedProperties)); + Cosmos.IncludedPath ip = new Cosmos.IncludedPath(); Assert.IsNotNull(ip.Indexes); From 033e883d2f0ae6187e7227d9b86fe6539ca3ee58 Mon Sep 17 00:00:00 2001 From: Justine Cocchi Date: Fri, 5 May 2023 07:47:06 -0700 Subject: [PATCH 108/240] [Internal] Samples: Adds OpenTelemetry and Application Insights samples (#3818) * add opentelemetry and application insights samples * address pr comments --- .../ApplicationInsights/AppSettings.json | 5 + .../ApplicationInsights.csproj | 25 ++++ .../Usage/ApplicationInsights/Program.cs | 118 +++++++++++++++ .../Usage/Cosmos.Samples.Usage.sln | 12 ++ .../Usage/OpenTelemetry/AppSettings.json | 10 ++ .../Usage/OpenTelemetry/OpenTelemetry.csproj | 28 ++++ .../Usage/OpenTelemetry/Program.cs | 138 ++++++++++++++++++ 7 files changed, 336 insertions(+) create mode 100644 Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/AppSettings.json create mode 100644 Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/ApplicationInsights.csproj create mode 100644 Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/Program.cs create mode 100644 Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/AppSettings.json create mode 100644 Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/OpenTelemetry.csproj create mode 100644 Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/Program.cs diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/AppSettings.json b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/AppSettings.json new file mode 100644 index 0000000000..028030099b --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/AppSettings.json @@ -0,0 +1,5 @@ +{ + "CosmosDBEndPointUrl": "https://localhost:8081", + "CosmosDBAuthorizationKey": "Super secret key", + "ApplicationInsightsConnectionString": "Super secret connection string" +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/ApplicationInsights.csproj b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/ApplicationInsights.csproj new file mode 100644 index 0000000000..cee6d0a6e3 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/ApplicationInsights.csproj @@ -0,0 +1,25 @@ + + + + Exe + net6.0 + Cosmos.Samples.ApplicationInsights + Cosmos.Samples.ApplicationInsights + latest + + + + + + + + + + + + + PreserveNewest + + + + diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/Program.cs b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/Program.cs new file mode 100644 index 0000000000..b4f55cd65f --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/Program.cs @@ -0,0 +1,118 @@ +namespace Cosmos.Samples.ApplicationInsights +{ + using System; + using System.Threading.Tasks; + using Newtonsoft.Json; + using Microsoft.Azure.Cosmos; + using Microsoft.Extensions.Logging; + using Microsoft.Extensions.Configuration; + using Microsoft.Extensions.DependencyInjection; + using Microsoft.ApplicationInsights; + using Microsoft.ApplicationInsights.WorkerService; + using Microsoft.Extensions.Logging.ApplicationInsights; + + internal class Program + { + private static readonly string databaseName = "samples"; + private static readonly string containerName = "ai-sample"; + + private static TelemetryClient? _telemetryClient; + + static async Task Main() + { + try + { + IConfigurationRoot configuration = new ConfigurationBuilder() + .AddJsonFile("AppSettings.json") + .Build(); + + string endpoint = configuration["CosmosDBEndPointUrl"]; + if (string.IsNullOrEmpty(endpoint)) + { + throw new ArgumentNullException("Please specify a valid CosmosDBEndPointUrl in the appSettings.json"); + } + + string authKey = configuration["CosmosDBAuthorizationKey"]; + if (string.IsNullOrEmpty(authKey) || string.Equals(authKey, "Super secret key")) + { + throw new ArgumentException("Please specify a valid CosmosDBAuthorizationKey in the appSettings.json"); + } + + string aiConnectionString = configuration["ApplicationInsightsConnectionString"]; + if (string.IsNullOrEmpty(authKey) || string.Equals(authKey, "Super secret connection string")) + { + throw new ArgumentException("Please specify a valid ApplicationInsightsConnectionString in the appSettings.json"); + } + + // + IServiceCollection services = new ServiceCollection(); + services.AddApplicationInsightsTelemetryWorkerService((ApplicationInsightsServiceOptions options) => options.ConnectionString = aiConnectionString); + + IServiceProvider serviceProvider = services.BuildServiceProvider(); + _telemetryClient = serviceProvider.GetRequiredService(); + // + + CosmosClientOptions options = new CosmosClientOptions() + { + IsDistributedTracingEnabled = true // Defaults to true, set to false to disable + }; + using (CosmosClient client = new CosmosClient(endpoint, authKey, options)) + { + Console.WriteLine($"Getting container reference for {containerName}."); + + ContainerProperties properties = new ContainerProperties(containerName, partitionKeyPath: "/id"); + + await client.CreateDatabaseIfNotExistsAsync(databaseName); + Container container = await client.GetDatabase(databaseName).CreateContainerIfNotExistsAsync(properties); + + await Program.RunCrudDemo(container); + } + } + finally + { + // Explicitly calling Flush() followed by sleep is required for Application Insights logging in console apps to ensure that telemetry is sent to the back-end even if application terminates. + _telemetryClient?.Flush(); + await Task.Delay(5000); + + Console.WriteLine("End of demo."); + } + } + + public static async Task RunCrudDemo(Container container) + { + // Any operations will automatically generate telemetry + + for (int i = 1; i <= 5; i++) + { + await container.CreateItemAsync(new Item { Id = $"{i}", Status = "new" }, new PartitionKey($"{i}")); + Console.WriteLine($"Created document with id: {i}"); + } + + for (int i = 1; i <= 5; i++) + { + await container.ReadItemAsync($"{i}", new PartitionKey($"{i}")); + Console.WriteLine($"Read document with id: {i}"); + } + + for (int i = 1; i <= 5; i++) + { + await container.ReplaceItemAsync(new Item { Id = $"{i}", Status = "updated" }, $"{i}", new PartitionKey($"{i}")); + Console.WriteLine($"Updated document with id: {i}"); + } + + for (int i = 1; i <= 5; i++) + { + await container.DeleteItemAsync($"{i}", new PartitionKey($"{i}")); + Console.WriteLine($"Deleted document with id: {i}"); + } + } + } + + internal class Item + { + [JsonProperty("id")] + public string Id { get; set; } + + public string Status { get; set; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/Cosmos.Samples.Usage.sln b/Microsoft.Azure.Cosmos.Samples/Usage/Cosmos.Samples.Usage.sln index de1e1f4731..999b48d928 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/Cosmos.Samples.Usage.sln +++ b/Microsoft.Azure.Cosmos.Samples/Usage/Cosmos.Samples.Usage.sln @@ -51,6 +51,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CFPullModelAllVersionsAndDe EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CFPullModelLatestVersionMode", "CFPullModelLatestVersionMode\CFPullModelLatestVersionMode.csproj", "{985B0E0A-D480-4C3C-A1FC-589F2EC4BBF6}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry", "OpenTelemetry\OpenTelemetry.csproj", "{C6EF6948-C085-4013-A21F-99303ECBA7A9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApplicationInsights", "ApplicationInsights\ApplicationInsights.csproj", "{55149A3C-A263-4EE5-AD2D-02FE9AC4D291}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -153,6 +157,14 @@ Global {985B0E0A-D480-4C3C-A1FC-589F2EC4BBF6}.Debug|Any CPU.Build.0 = Debug|Any CPU {985B0E0A-D480-4C3C-A1FC-589F2EC4BBF6}.Release|Any CPU.ActiveCfg = Release|Any CPU {985B0E0A-D480-4C3C-A1FC-589F2EC4BBF6}.Release|Any CPU.Build.0 = Release|Any CPU + {C6EF6948-C085-4013-A21F-99303ECBA7A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C6EF6948-C085-4013-A21F-99303ECBA7A9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C6EF6948-C085-4013-A21F-99303ECBA7A9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C6EF6948-C085-4013-A21F-99303ECBA7A9}.Release|Any CPU.Build.0 = Release|Any CPU + {55149A3C-A263-4EE5-AD2D-02FE9AC4D291}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {55149A3C-A263-4EE5-AD2D-02FE9AC4D291}.Debug|Any CPU.Build.0 = Debug|Any CPU + {55149A3C-A263-4EE5-AD2D-02FE9AC4D291}.Release|Any CPU.ActiveCfg = Release|Any CPU + {55149A3C-A263-4EE5-AD2D-02FE9AC4D291}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/AppSettings.json b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/AppSettings.json new file mode 100644 index 0000000000..1ea1245434 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/AppSettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Azure-Cosmos-Operation-Request-Diagnostics": "Information" + } + }, + "CosmosDBEndPointUrl": "https://localhost:8081", + "CosmosDBAuthorizationKey": "Super secret key", + "ApplicationInsightsConnectionString": "Super secret connection string" +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/OpenTelemetry.csproj b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/OpenTelemetry.csproj new file mode 100644 index 0000000000..4dd1171328 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/OpenTelemetry.csproj @@ -0,0 +1,28 @@ + + + + Exe + net6.0 + Cosmos.Samples.OpenTelemetry + Cosmos.Samples.OpenTelemetry + latest + + + + + + + + + + + + + + + + PreserveNewest + + + + diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/Program.cs b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/Program.cs new file mode 100644 index 0000000000..d799731f1e --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/Program.cs @@ -0,0 +1,138 @@ +namespace Cosmos.Samples.OpenTelemetry +{ + using global::OpenTelemetry; + using global::OpenTelemetry.Trace; + using global::OpenTelemetry.Resources; + using System; + using System.Threading.Tasks; + using Newtonsoft.Json; + using Microsoft.Azure.Cosmos; + using Microsoft.Extensions.Azure; + using Microsoft.Extensions.Logging; + using Microsoft.Extensions.Configuration; + using Azure.Monitor.OpenTelemetry.Exporter; + + internal class Program + { + private static readonly string databaseName = "samples"; + private static readonly string containerName = "otel-sample"; + private static readonly string serviceName = "MySampleService"; + + private static TracerProvider? _traceProvider; + + static async Task Main() + { + try + { + IConfigurationRoot configuration = new ConfigurationBuilder() + .AddJsonFile("AppSettings.json") + .Build(); + + string endpoint = configuration["CosmosDBEndPointUrl"]; + if (string.IsNullOrEmpty(endpoint)) + { + throw new ArgumentNullException("Please specify a valid CosmosDBEndPointUrl in the appSettings.json"); + } + + string authKey = configuration["CosmosDBAuthorizationKey"]; + if (string.IsNullOrEmpty(authKey) || string.Equals(authKey, "Super secret key")) + { + throw new ArgumentException("Please specify a valid CosmosDBAuthorizationKey in the appSettings.json"); + } + + string aiConnectionString = configuration["ApplicationInsightsConnectionString"]; + if (string.IsNullOrEmpty(authKey) || string.Equals(authKey, "Super secret connection string")) + { + throw new ArgumentException("Please specify a valid ApplicationInsightsConnectionString in the appSettings.json"); + } + + // + ResourceBuilder resource = ResourceBuilder.CreateDefault().AddService( + serviceName: serviceName, + serviceVersion: "1.0.0"); + + // Set up logging to forward logs to chosen exporter + using ILoggerFactory loggerFactory = LoggerFactory.Create(builder => builder.AddOpenTelemetry(options => + { + options.IncludeFormattedMessage = true; + options.SetResourceBuilder(resource); + options.AddAzureMonitorLogExporter(o => o.ConnectionString = aiConnectionString); // Set up exporter of your choice + })); + + AzureEventSourceLogForwarder logforwader = new AzureEventSourceLogForwarder(loggerFactory); + logforwader.Start(); + + // Configure OpenTelemetry trace provider + AppContext.SetSwitch("Azure.Experimental.EnableActivitySource", true); + _traceProvider = Sdk.CreateTracerProviderBuilder() + .AddSource("Azure.Cosmos.Operation") // Cosmos DB source for operation level telemetry + .AddAzureMonitorTraceExporter(o => o.ConnectionString = aiConnectionString) // Set up exporter of your choice + .SetResourceBuilder(resource) + .Build(); + // + + CosmosClientOptions options = new CosmosClientOptions() + { + IsDistributedTracingEnabled = true // Defaults to true, set to false to disable + }; + using (CosmosClient client = new CosmosClient(endpoint, authKey, options)) + { + Console.WriteLine($"Getting container reference for {containerName}."); + + ContainerProperties properties = new ContainerProperties(containerName, partitionKeyPath: "/id"); + + await client.CreateDatabaseIfNotExistsAsync(databaseName); + Container container = await client.GetDatabase(databaseName).CreateContainerIfNotExistsAsync(properties); + + await Program.RunCrudDemo(container); + } + + } + finally + { + _traceProvider?.Dispose(); + // Sleep is required for logging in console apps to ensure that telemetry is sent to the back-end even if application terminates. + await Task.Delay(5000); + + Console.WriteLine("End of demo."); + } + } + + public static async Task RunCrudDemo(Container container) + { + // Any operations will automatically generate telemetry + + for(int i = 1; i <= 5; i++) + { + await container.CreateItemAsync(new Item { Id = $"{i}", Status = "new" }, new PartitionKey($"{i}")); + Console.WriteLine($"Created document with id: {i}"); + } + + for (int i = 1; i <= 5; i++) + { + await container.ReadItemAsync($"{i}", new PartitionKey($"{i}")); + Console.WriteLine($"Read document with id: {i}"); + } + + for (int i = 1; i <= 5; i++) + { + await container.ReplaceItemAsync(new Item { Id = $"{i}", Status = "updated" }, $"{i}", new PartitionKey($"{i}")); + Console.WriteLine($"Updated document with id: {i}"); + } + + for (int i = 1; i <= 5; i++) + { + await container.DeleteItemAsync($"{i}", new PartitionKey($"{i}")); + Console.WriteLine($"Deleted document with id: {i}"); + } + } + } + + internal class Item + { + [JsonProperty("id")] + public string Id { get; set; } + + public string Status { get; set; } + } +} \ No newline at end of file From 0c158656a8a9a42fafeda52757360698fbfa04ea Mon Sep 17 00:00:00 2001 From: Erik O'Leary <969938+onionhammer@users.noreply.github.com> Date: Tue, 9 May 2023 10:45:01 -0500 Subject: [PATCH 109/240] [Internal] Query: Added custom serializer coverage tests to ExpressionToSQL.cs (#3722) * Ensure enum as string is preserved for custom serializer * Failing test * Added failing tests * Updated requested names * Ignore result of test for now * Added additional comment on why the test is ignored * Replaced with sample code * Remove ignore attribute from tests, documented misbehavior for future use * Updated comment --------- Co-authored-by: leminh98 --- .../Linq/CosmosLinqJsonConverterTests.cs | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Linq/CosmosLinqJsonConverterTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Linq/CosmosLinqJsonConverterTests.cs index e4f90f1957..ca2e12c8da 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Linq/CosmosLinqJsonConverterTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Linq/CosmosLinqJsonConverterTests.cs @@ -6,7 +6,10 @@ namespace Microsoft.Azure.Cosmos.Linq { using System; using System.Globalization; + using System.IO; + using System.Linq; using System.Linq.Expressions; + using global::Azure.Core.Serialization; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -30,6 +33,104 @@ public void DateTimeKindIsPreservedTest() Assert.AreEqual("(a[\"StartDate\"] <= \"2022-05-26\")", sql); } + [TestMethod] + public void EnumIsPreservedAsINTest() + { + // Arrange + CosmosLinqSerializerOptions options = new() + { + //CustomCosmosSerializer = new TestCustomJsonSerializer() + }; + + // Act + TestEnum[] values = new[] { TestEnum.One, TestEnum.Two }; + Expression> expr = a => values.Contains(a.Value); + + string sql = SqlTranslator.TranslateExpression(expr.Body, options); + + // Assert + // Assert.AreEqual("(a[\"Value\"] IN (\"One\", \"Two\"))", sql); // <- TODO - Desired Behavior with CustomSerializer + Assert.AreEqual("(a[\"Value\"] IN (0, 1))", sql); // <- Actual behavior, with ability to set custom serializor reverted + } + + [TestMethod] + public void EnumIsPreservedAsEQUALSTest() + { + // Arrange + CosmosLinqSerializerOptions options = new() + { + // CustomCosmosSerializer = new TestCustomJsonSerializer() + }; + + // Act + TestEnum statusValue = TestEnum.One; + Expression> expr = a => a.Value == statusValue; + + string sql = SqlTranslator.TranslateExpression(expr.Body, options); + + // Assert + // Assert.AreEqual("(a[\"Value\"] = \"One\")", sql); // <- THIS is the correct value, if we are able to use the custom serializer + Assert.AreEqual("(a[\"Value\"] = 0)", sql); // <- THIS is the current mis-behavior of the SDK + } + + [TestMethod] + public void EnumIsPreservedAsEXPRESSIONTest() + { + // Arrange + CosmosLinqSerializerOptions options = new() + { + // CustomCosmosSerializer = new TestCustomJsonSerializer() + }; + + // Act + + // Get status constant + ConstantExpression status = Expression.Constant(TestEnum.One); + + // Get member access expression + ParameterExpression arg = Expression.Parameter(typeof(TestEnumNewtonsoftDocument), "a"); + + // Access the value property + MemberExpression docValueExpression = Expression.MakeMemberAccess( + arg, + typeof(TestEnumNewtonsoftDocument).GetProperty(nameof(TestEnumNewtonsoftDocument.Value))! + ); + + // Create comparison expression + BinaryExpression expression = Expression.Equal( + docValueExpression, + status + ); + + // Create lambda expression + Expression> lambda = + Expression.Lambda>(expression, arg); + + string sql = SqlTranslator.TranslateExpression(lambda.Body, options); + + // Assert + Assert.AreEqual("(a[\"Value\"] = \"One\")", sql); + } + + enum TestEnum + { + One, + Two, + Three, + } + + class TestEnumDocument + { + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] // TODO: Remove this once we have the ability to use custom serializer for LINQ queries + public TestEnum Value { get; set; } + } + + class TestEnumNewtonsoftDocument + { + [JsonConverter(typeof(StringEnumConverter))] + public TestEnum Value { get; set; } + } + class TestDocument { [JsonConverter(typeof(DateJsonConverter))] @@ -50,5 +151,54 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s } } } + + /// + // See: https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos.Samples/Usage/SystemTextJson/CosmosSystemTextJsonSerializer.cs + /// + class TestCustomJsonSerializer : CosmosSerializer + { + private readonly JsonObjectSerializer systemTextJsonSerializer; + + public static readonly System.Text.Json.JsonSerializerOptions JsonOptions = new() + { + DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, + PropertyNameCaseInsensitive = true, + Converters = { + new System.Text.Json.Serialization.JsonStringEnumConverter(), + } + }; + + public TestCustomJsonSerializer() + { + this.systemTextJsonSerializer = new JsonObjectSerializer(JsonOptions); + } + + public override T FromStream(Stream stream) + { + using (stream) + { + if (stream.CanSeek && stream.Length == 0) + { + return default; + } + + if (typeof(Stream).IsAssignableFrom(typeof(T))) + { + return (T)(object)stream; + } + + return (T)this.systemTextJsonSerializer.Deserialize(stream, typeof(T), default); + } + } + + public override Stream ToStream(T input) + { + MemoryStream stream = new (); + + this.systemTextJsonSerializer.Serialize(stream, input, typeof(T), default); + stream.Position = 0; + return stream; + } + } } } From ade7e3410c0ffb78e2af815f5fe355c2047f3436 Mon Sep 17 00:00:00 2001 From: Erik O'Leary <969938+onionhammer@users.noreply.github.com> Date: Tue, 9 May 2023 12:30:29 -0500 Subject: [PATCH 110/240] Query: Added remaining Cosmos Type checking functions to CosmosLinqExtensions (#3724) * Added the remaining Cosmos Type checking functions to the CosmosLinqExtensions * Added comments requested * Updated comment * Updated baseline * Improve readability of dictionary initialization * Aligned with code style guide * Revert change to baseline * Executed update baseline script --------- Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com> Co-authored-by: leminh98 --- .../BuiltinFunctions/TypeCheckFunctions.cs | 59 ++++++--- .../src/Linq/CosmosLinqExtensions.cs | 99 ++++++++++++++- ...onBaselineTests.TestTypeCheckFunctions.xml | 117 ++++++++++++++++++ .../LinqTranslationBaselineTests.cs | 20 ++- .../Contracts/DotNetSDKAPI.json | 35 ++++++ 5 files changed, 311 insertions(+), 19 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/TypeCheckFunctions.cs b/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/TypeCheckFunctions.cs index 93c09d65ab..db875f3ae0 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/TypeCheckFunctions.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/TypeCheckFunctions.cs @@ -18,33 +18,62 @@ static TypeCheckFunctions() { TypeCheckFunctionsDefinitions = new Dictionary { - { - "IsDefined", - new SqlBuiltinFunctionVisitor("IS_DEFINED", + [nameof(CosmosLinqExtensions.IsArray)] = new SqlBuiltinFunctionVisitor( + "IS_ARRAY", true, new List() { new Type[]{typeof(object)}, - }) - }, - { - "IsNull", - new SqlBuiltinFunctionVisitor("IS_NULL", + }), + [nameof(CosmosLinqExtensions.IsBool)] = new SqlBuiltinFunctionVisitor( + "IS_BOOL", true, new List() { new Type[]{typeof(object)}, - }) - }, - { - "IsPrimitive", - new SqlBuiltinFunctionVisitor("IS_PRIMITIVE", + }), + [nameof(CosmosLinqExtensions.IsDefined)] = new SqlBuiltinFunctionVisitor( + "IS_DEFINED", true, new List() { new Type[]{typeof(object)}, - }) - } + }), + [nameof(CosmosLinqExtensions.IsNull)] = new SqlBuiltinFunctionVisitor( + "IS_NULL", + true, + new List() + { + new Type[]{typeof(object)}, + }), + [nameof(CosmosLinqExtensions.IsNumber)] = new SqlBuiltinFunctionVisitor( + "IS_NUMBER", + true, + new List() + { + new Type[]{typeof(object)}, + }), + [nameof(CosmosLinqExtensions.IsObject)] = new SqlBuiltinFunctionVisitor( + "IS_OBJECT", + true, + new List() + { + new Type[]{typeof(object)}, + }), + [nameof(CosmosLinqExtensions.IsPrimitive)] = new SqlBuiltinFunctionVisitor( + "IS_PRIMITIVE", + true, + new List() + { + new Type[]{typeof(object)}, + }), + [nameof(CosmosLinqExtensions.IsString)] = new SqlBuiltinFunctionVisitor( + "IS_STRING", + true, + new List() + { + new Type[]{typeof(object)}, + }), }; } diff --git a/Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs b/Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs index dc86de0cb6..6663f52673 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs @@ -20,6 +20,44 @@ namespace Microsoft.Azure.Cosmos.Linq /// public static class CosmosLinqExtensions { + /// + /// Returns a Boolean value indicating if the type of the specified expression is an array. + /// This method is to be used in LINQ expressions only and will be evaluated on server. + /// There's no implementation provided in the client library. + /// + /// + /// Returns true if the type of the specified expression is an array; otherwise, false. + /// + /// + /// document.Names.IsArray()); + /// ]]> + /// + /// + public static bool IsArray(this object obj) + { + throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); + } + + /// + /// Returns a Boolean value indicating if the type of the specified expression is a boolean. + /// This method is to be used in LINQ expressions only and will be evaluated on server. + /// There's no implementation provided in the client library. + /// + /// + /// Returns true if the type of the specified expression is a boolean; otherwise, false. + /// + /// + /// document.IsRegistered.IsBool()); + /// ]]> + /// + /// + public static bool IsBool(this object obj) + { + throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); + } + /// /// Determines if a certain property is defined or not. /// This method is to be used in LINQ expressions only and will be evaluated on server. @@ -52,12 +90,50 @@ public static bool IsDefined(this object obj) /// var isNullQuery = documents.Where(document => document.Name.IsNull()); /// ]]> /// - /// s> + /// public static bool IsNull(this object obj) { throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); } + /// + /// Returns a Boolean value indicating if the type of the specified expression is a number. + /// This method is to be used in LINQ expressions only and will be evaluated on server. + /// There's no implementation provided in the client library. + /// + /// + /// Returns true if the type of the specified expression is a number; otherwise, false. + /// + /// + /// document.Age.IsNumber()); + /// ]]> + /// + /// + public static bool IsNumber(this object obj) + { + throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); + } + + /// + /// Returns a Boolean value indicating if the type of the specified expression is an object. + /// This method is to be used in LINQ expressions only and will be evaluated on server. + /// There's no implementation provided in the client library. + /// + /// + /// Returns true if the type of the specified expression is an object; otherwise, false. + /// + /// + /// document.Address.IsObject()); + /// ]]> + /// + /// + public static bool IsObject(this object obj) + { + throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); + } + /// /// Determines if a certain property is of primitive JSON type. /// This method is to be used in LINQ expressions only and will be evaluated on server. @@ -74,12 +150,31 @@ public static bool IsNull(this object obj) /// var isPrimitiveQuery = documents.Where(document => document.Name.IsPrimitive()); /// ]]> /// - /// s> + /// public static bool IsPrimitive(this object obj) { throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); } + /// + /// Returns a Boolean value indicating if the type of the specified expression is a string. + /// This method is to be used in LINQ expressions only and will be evaluated on server. + /// There's no implementation provided in the client library. + /// + /// + /// Returns true if the type of the specified expression is a string; otherwise, false. + /// + /// + /// document.Name.IsString()); + /// ]]> + /// + /// + public static bool IsString(this object obj) + { + throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); + } + /// /// This method generate query definition from LINQ query. /// diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestTypeCheckFunctions.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestTypeCheckFunctions.xml index 90a463defa..97aac9ef55 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestTypeCheckFunctions.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestTypeCheckFunctions.xml @@ -1,4 +1,52 @@  + + + + doc.ArrayField.IsArray())]]> + + + + + + + + + doc.StringField.IsArray())]]> + + + + + + + + + Convert(doc.BooleanField, Object).IsBool())]]> + + + + + + + + + doc.StringField.IsBool())]]> + + + + + @@ -45,6 +93,52 @@ FROM root WHERE IS_NULL(root["StringField"])]]> + + + + Convert(doc.NumericField, Object).IsNumber())]]> + + + + + + + + + doc.StringField.IsNumber())]]> + + + + + + + + + doc.ObjectField.IsObject())]]> + + + + + + + + + doc.StringField.IsObject())]]> + + + + + @@ -68,4 +162,27 @@ FROM root WHERE IS_PRIMITIVE(root["StringField"])]]> + + + + doc.StringField.IsString())]]> + + + + + + + + + Convert(doc.NumericField, Object).IsString())]]> + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs index 76bd0ffc81..5a46a2d118 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs @@ -116,6 +116,7 @@ internal class DataObject : LinqTestObject public int? NullableField; #pragma warning disable CS0649 // Field is never assigned to, and will always have its default value false public bool BooleanField; + public SimpleObject ObjectField = new SimpleObject(); public Guid GuidField; #pragma warning restore // Field is never assigned to, and will always have its default value false @@ -155,6 +156,11 @@ internal class DataObject : LinqTestObject public string Pk; } + internal class SimpleObject + { + public string Field { get; set; } + } + class DateJsonConverter : IsoDateTimeConverter { public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) @@ -257,7 +263,7 @@ public void TestLiteralSerialization() [TestMethod] public void TestTypeCheckFunctions() { - // IsDefined, IsNull, and IsPrimitive are not supported on the client side. + // IsArray, IsBool, IsDefined, IsNull, IsNumber, IsObject, IsPrimitive, and IsString are not supported on the client side. // Partly because IsPrimitive is not trivial to implement. // Therefore these methods are verified with baseline only. List data = new List(); @@ -266,12 +272,22 @@ public void TestTypeCheckFunctions() List inputs = new List { + new LinqTestInput("IsArray array", b => getQuery(b).Where(doc => doc.ArrayField.IsArray())), + new LinqTestInput("IsArray string", b => getQuery(b).Where(doc => doc.StringField.IsArray())), + new LinqTestInput("IsBool bool", b => getQuery(b).Where(doc => doc.BooleanField.IsBool())), + new LinqTestInput("IsBool string", b => getQuery(b).Where(doc => doc.StringField.IsBool())), new LinqTestInput("IsDefined array", b => getQuery(b).Select(doc => doc.ArrayField.IsDefined())), new LinqTestInput("IsDefined string", b => getQuery(b).Where(doc => doc.StringField.IsDefined())), new LinqTestInput("IsNull array", b => getQuery(b).Select(doc => doc.ArrayField.IsNull())), new LinqTestInput("IsNull string", b => getQuery(b).Where(doc => doc.StringField.IsNull())), + new LinqTestInput("IsNumber number", b => getQuery(b).Select(doc => doc.NumericField.IsNumber())), + new LinqTestInput("IsNumber string", b => getQuery(b).Where(doc => doc.StringField.IsNumber())), + new LinqTestInput("IsObject object", b => getQuery(b).Select(doc => doc.ObjectField.IsObject())), + new LinqTestInput("IsObject string", b => getQuery(b).Where(doc => doc.StringField.IsObject())), new LinqTestInput("IsPrimitive array", b => getQuery(b).Select(doc => doc.ArrayField.IsPrimitive())), - new LinqTestInput("IsPrimitive string", b => getQuery(b).Where(doc => doc.StringField.IsPrimitive())) + new LinqTestInput("IsPrimitive string", b => getQuery(b).Where(doc => doc.StringField.IsPrimitive())), + new LinqTestInput("IsString string", b => getQuery(b).Where(doc => doc.StringField.IsString())), + new LinqTestInput("IsString number", b => getQuery(b).Select(doc => doc.NumericField.IsString())), }; this.ExecuteTestSuite(inputs); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 3eee7f406b..5b2e38772a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -5296,6 +5296,20 @@ "Microsoft.Azure.Cosmos.Linq.CosmosLinqExtensions;System.Object;IsAbstract:True;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { + "Boolean IsArray(System.Object)[System.Runtime.CompilerServices.ExtensionAttribute()]": { + "Type": "Method", + "Attributes": [ + "ExtensionAttribute" + ], + "MethodInfo": "Boolean IsArray(System.Object);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean IsBool(System.Object)[System.Runtime.CompilerServices.ExtensionAttribute()]": { + "Type": "Method", + "Attributes": [ + "ExtensionAttribute" + ], + "MethodInfo": "Boolean IsBool(System.Object);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Boolean IsDefined(System.Object)[System.Runtime.CompilerServices.ExtensionAttribute()]": { "Type": "Method", "Attributes": [ @@ -5310,6 +5324,20 @@ ], "MethodInfo": "Boolean IsNull(System.Object);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Boolean IsNumber(System.Object)[System.Runtime.CompilerServices.ExtensionAttribute()]": { + "Type": "Method", + "Attributes": [ + "ExtensionAttribute" + ], + "MethodInfo": "Boolean IsNumber(System.Object);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean IsObject(System.Object)[System.Runtime.CompilerServices.ExtensionAttribute()]": { + "Type": "Method", + "Attributes": [ + "ExtensionAttribute" + ], + "MethodInfo": "Boolean IsObject(System.Object);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Boolean IsPrimitive(System.Object)[System.Runtime.CompilerServices.ExtensionAttribute()]": { "Type": "Method", "Attributes": [ @@ -5317,6 +5345,13 @@ ], "MethodInfo": "Boolean IsPrimitive(System.Object);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Boolean IsString(System.Object)[System.Runtime.CompilerServices.ExtensionAttribute()]": { + "Type": "Method", + "Attributes": [ + "ExtensionAttribute" + ], + "MethodInfo": "Boolean IsString(System.Object);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Microsoft.Azure.Cosmos.FeedIterator ToStreamIterator[T](System.Linq.IQueryable`1[T])[System.Runtime.CompilerServices.ExtensionAttribute()]": { "Type": "Method", "Attributes": [ From aff7349cb80da9eab40f2e792b71390268e18169 Mon Sep 17 00:00:00 2001 From: Justine Cocchi Date: Wed, 10 May 2023 08:21:05 -0700 Subject: [PATCH 111/240] update sdk version and section tags (#3841) --- .../Usage/ApplicationInsights/ApplicationInsights.csproj | 2 +- .../Usage/ApplicationInsights/Program.cs | 2 +- .../Usage/OpenTelemetry/OpenTelemetry.csproj | 2 +- .../Usage/OpenTelemetry/Program.cs | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/ApplicationInsights.csproj b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/ApplicationInsights.csproj index cee6d0a6e3..59162abaca 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/ApplicationInsights.csproj +++ b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/ApplicationInsights.csproj @@ -10,7 +10,7 @@ - + diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/Program.cs b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/Program.cs index b4f55cd65f..288ce80c64 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/Program.cs +++ b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/Program.cs @@ -50,7 +50,7 @@ static async Task Main() IServiceProvider serviceProvider = services.BuildServiceProvider(); _telemetryClient = serviceProvider.GetRequiredService(); - // + // CosmosClientOptions options = new CosmosClientOptions() { diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/OpenTelemetry.csproj b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/OpenTelemetry.csproj index 4dd1171328..46fe296b80 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/OpenTelemetry.csproj +++ b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/OpenTelemetry.csproj @@ -10,7 +10,7 @@ - + diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/Program.cs b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/Program.cs index d799731f1e..4d6431823e 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/Program.cs +++ b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/Program.cs @@ -46,7 +46,7 @@ static async Task Main() throw new ArgumentException("Please specify a valid ApplicationInsightsConnectionString in the appSettings.json"); } - // + // ResourceBuilder resource = ResourceBuilder.CreateDefault().AddService( serviceName: serviceName, serviceVersion: "1.0.0"); @@ -69,12 +69,14 @@ static async Task Main() .AddAzureMonitorTraceExporter(o => o.ConnectionString = aiConnectionString) // Set up exporter of your choice .SetResourceBuilder(resource) .Build(); - // + // + // CosmosClientOptions options = new CosmosClientOptions() { IsDistributedTracingEnabled = true // Defaults to true, set to false to disable }; + // using (CosmosClient client = new CosmosClient(endpoint, authKey, options)) { Console.WriteLine($"Getting container reference for {containerName}."); From 1a8b7f0d0bad48d7517f8871cb5174a4f929118f Mon Sep 17 00:00:00 2001 From: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com> Date: Tue, 16 May 2023 10:44:26 -0400 Subject: [PATCH 112/240] PackageLicense: Removes PackageLicenseUrl and Adds PackageLicenseFile since PackageLicenseUrl is deprecated (#3847) * proposal to add PackageLicenseFile since PackageLicenseUrl is deprecated. https://github.com/NuGet/Home/issues/4628 * adding attribute Visible=false --- Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj index 6a5be8ccbb..886a84d586 100644 --- a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj +++ b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj @@ -24,7 +24,6 @@ Microsoft.Azure.Cosmos microsoft;azure;cosmos;cosmosdb;documentdb;docdb;nosql;azureofficial;dotnetcore;netcore;netstandard The change log for this SDK is made available at https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/changelog.md at the time of release. - https://aka.ms/netcoregaeula https://github.com/Azure/azure-cosmos-dotnet-v3 true http://go.microsoft.com/fwlink/?LinkID=288890 @@ -43,8 +42,13 @@ NU5125 true $(LangVersion) + LICENSE + + + + From b06d6c3cb4bee845406ba0631228ca70e82ce70d Mon Sep 17 00:00:00 2001 From: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com> Date: Wed, 17 May 2023 13:48:21 -0400 Subject: [PATCH 113/240] making ChangeFeedMode.LatestVersion accessible to the public (#3854) --- .../src/ChangeFeed/ChangeFeedMode.cs | 7 +------ .../Contracts/DotNetPreviewSDKAPI.json | 10 ---------- .../Contracts/DotNetSDKAPI.json | 10 ++++++++++ 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedMode.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedMode.cs index 7df0871d74..50098a8057 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedMode.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/ChangeFeedMode.cs @@ -38,12 +38,7 @@ internal ChangeFeedMode() /// Latest version mode includes item creations and updates, not deletions. /// /// A to receive latest version item changes. -#if PREVIEW - public -#else - internal -#endif - static ChangeFeedMode LatestVersion => ChangeFeedModeIncremental.Instance; + public static ChangeFeedMode LatestVersion => ChangeFeedModeIncremental.Instance; /// /// Creates a to receive notifications for creations, deletes, as well as all intermediary snapshots for updates. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index ab29c95bf0..08d0d65a7e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -169,16 +169,6 @@ "Type": "Method", "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode get_AllVersionsAndDeletes();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion()": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.ChangeFeedMode LatestVersion": { - "Type": "Property", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode LatestVersion;CanRead:True;CanWrite:False;Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 5b2e38772a..074be1ee37 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -307,10 +307,20 @@ "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode get_Incremental();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Microsoft.Azure.Cosmos.ChangeFeedMode Incremental": { "Type": "Property", "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode Incremental;CanRead:True;CanWrite:False;Microsoft.Azure.Cosmos.ChangeFeedMode get_Incremental();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.ChangeFeedMode LatestVersion": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedMode LatestVersion;CanRead:True;CanWrite:False;Microsoft.Azure.Cosmos.ChangeFeedMode get_LatestVersion();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {} From c66e4884dcaf05657ef35f4452844fdc14447e4e Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Thu, 18 May 2023 02:29:57 +0530 Subject: [PATCH 114/240] AI Integration: Fixes Operation Name in the activity and end to end Tests. (#3845) * first draft * second draft * 3rd draft * remove untouched file * test fix * fix order * change order * refactor * skip network activities in test * remove network attributes --- .../OpenTelemetryRecorderFactory.cs | 4 +- ...iterBaselineTests.BatchOperationsAsync.xml | 31 +- ...riterBaselineTests.BulkOperationsAsync.xml | 2679 +++++++++++++++-- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 571 +++- ...eWriterBaselineTests.MiscellanousAsync.xml | 114 +- ...neTests.PointOperationsExceptionsAsync.xml | 174 +- ...EndTraceWriterBaselineTests.QueryAsync.xml | 763 ++++- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 436 ++- ...TraceWriterBaselineTests.ReadManyAsync.xml | 62 +- ...selineTests.StreamPointOperationsAsync.xml | 124 +- ...aselineTests.TypedPointOperationsAsync.xml | 124 +- .../Tracing/AssertActivity.cs | 14 +- .../Tracing/CustomListener.cs | 93 +- .../Tracing/CustomOtelExporter.cs | 2 +- .../EndToEndTraceWriterBaselineTests.cs | 21 +- .../Utils/Util.cs | 4 +- 16 files changed, 4639 insertions(+), 577 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs index 51b4666b6f..fe10e7b22c 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs @@ -26,7 +26,7 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, { if (clientContext is { ClientOptions.IsDistributedTracingEnabled: true }) { - OpenTelemetryRecorderFactory.ScopeFactory ??= new DiagnosticScopeFactory(clientNamespace: OpenTelemetryAttributeKeys.DiagnosticNamespace, + OpenTelemetryRecorderFactory.ScopeFactory ??= new DiagnosticScopeFactory(clientNamespace: $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.{OpenTelemetryAttributeKeys.OperationPrefix}", resourceProviderNamespace: OpenTelemetryAttributeKeys.ResourceProviderNamespace, isActivityEnabled: true, suppressNestedClientActivities: true); @@ -34,7 +34,7 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, // If there is no source then it will return default otherwise a valid diagnostic scope DiagnosticScope scope = OpenTelemetryRecorderFactory .ScopeFactory - .CreateScope(name: $"{OpenTelemetryAttributeKeys.OperationPrefix}.{operationName}", + .CreateScope(name: operationName, kind: clientContext.ClientOptions.ConnectionMode == ConnectionMode.Gateway ? DiagnosticScope.ActivityKind.Internal : DiagnosticScope.ActivityKind.Client); // Record values only when we have a valid Diagnostic Scope diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index 90f32b89c9..09579f83b7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -128,10 +128,31 @@ ] } ] -}]]> - Operation.ExecuteAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationExecuteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeBatchdb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + ExecuteAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Batch + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index b776a8eaae..be3a8c7910 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -152,29 +152,248 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + + + + + + + + + + @@ -310,29 +529,248 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + + + + + + + + + + @@ -468,29 +906,248 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + + + + + + + + + + @@ -626,29 +1283,248 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + + + + + + + + + + @@ -784,29 +1660,248 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + + + + + + + + + + @@ -942,29 +2037,248 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + + + + + + + + + + @@ -1100,29 +2414,248 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + + + + + + + + + + @@ -1258,29 +2791,248 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + + + + + + + + + + @@ -1416,29 +3168,248 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + + + + + + + + + + @@ -1574,29 +3545,248 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + + + + + + + + + + @@ -2323,10 +4513,29 @@ ] } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedexception.messagedb.cosmosdb.operation_typeCreate -ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Some Value + Some Value + Some Value + Some Value + Some Value + + Some Value + Create + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml index 4189b4bab8..43d95de95d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml @@ -951,19 +951,128 @@ ] } ] -}]]> - Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + + + + + @@ -1568,19 +1677,128 @@ ] } ] -}]]> - Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + + + + + @@ -2166,19 +2384,128 @@ ] } ] -}]]> - Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Change Feed Iterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Iterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Iterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + + + + + @@ -2784,19 +3111,128 @@ ] } ] -}]]> - Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + + + + + @@ -3065,10 +3501,31 @@ ] } ] -}]]> - Operation.Change Feed Estimator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationChange Feed Estimator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Change Feed Estimator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml index 591a6af4ac..29fc40f674 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml @@ -106,13 +106,56 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.DeleteAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationDeleteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateDatabaseAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateDatabaseAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + DeleteAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Delete + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateDatabaseAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + + @@ -206,12 +249,55 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.DeleteAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationDeleteAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -Operation.CreateDatabaseAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateDatabaseAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contacted -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + DeleteAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Delete + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateDatabaseAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml index 64e7e0c3ed..9ee0b6e650 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml @@ -147,11 +147,30 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + Some Value + Create + + + @@ -389,11 +408,30 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + Some Value + Create + + + @@ -614,11 +652,30 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + Some Value + Create + + + @@ -871,11 +928,30 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + Some Value + Create + + + @@ -1192,11 +1268,30 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + Some Value + Create + + + @@ -1346,10 +1441,29 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectexception.stacktraceexception.typedb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.regions_contactedSouth Central USexception.messagedb.cosmosdb.operation_typeCreate -ExceptionIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + Some Value + Create + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml index d2abebc194..e9b0f96a00 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml @@ -573,17 +573,104 @@ ] } ] -}]]> - Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + + + + @@ -1179,17 +1266,104 @@ ] } ] -}]]> - Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + + + + @@ -1766,17 +1940,104 @@ ] } ] -}]]> - Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + + + + @@ -2373,17 +2634,104 @@ ] } ] -}]]> - Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + + + + @@ -3047,17 +3395,104 @@ ] } ] -}]]> - Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + + + + @@ -3643,17 +4078,104 @@ ] } ] -}]]> - Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + + + + @@ -4259,16 +4781,103 @@ ] } ] -}]]> - Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeQuerydb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Query + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml index dc6df3eacf..501a8b187e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml @@ -535,17 +535,104 @@ ] } ] -}]]> - Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + + + + @@ -1103,17 +1190,104 @@ ] } ] -}]]> - Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + + + + @@ -1652,17 +1826,104 @@ ] } ] -}]]> - Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.FeedIterator Read Next Asyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationFeedIterator Read Next Asyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + FeedIterator Read Next Async + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + + + + @@ -2221,16 +2482,103 @@ ] } ] -}]]> - Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.Typed FeedIterator ReadNextAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationTyped FeedIterator ReadNextAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReadFeeddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Typed FeedIterator ReadNextAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + ReadFeed + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml index 29b36304ec..627a8ea66f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml @@ -541,11 +541,32 @@ ] } ] -}]]> - Operation.ReadManyItemsStreamAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReadManyItemsStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + ReadManyItemsStreamAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Read + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + @@ -1101,10 +1122,31 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.ReadManyItemsAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReadManyItemsAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + ReadManyItemsAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Read + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml index 18f11acd62..016a37aaaf 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml @@ -88,11 +88,32 @@ ] } ] -}]]> - Operation.CreateItemStreamAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemStreamAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + @@ -177,11 +198,32 @@ ] } ] -}]]> - Operation.ReadItemStreamAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReadItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + ReadItemStreamAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Read + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + @@ -274,11 +316,32 @@ ] } ] -}]]> - Operation.ReplaceItemStreamAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReplaceItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + ReplaceItemStreamAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Replace + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + @@ -366,10 +429,31 @@ ] } ] -}]]> - Operation.DeleteItemStreamAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationDeleteItemStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + DeleteItemStreamAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Delete + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml index abeaa41de8..add1fcc343 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml @@ -108,11 +108,32 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.CreateItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + CreateItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Create + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + @@ -202,11 +223,32 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.ReadItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReadItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + ReadItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Read + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + @@ -309,11 +351,32 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.ReplaceItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationReplaceItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReplacedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + ReplaceItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Replace + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + @@ -405,10 +468,31 @@ "duration in milliseconds": 0 } ] -}]]> - Operation.DeleteItemAsyncaz.namespaceMicrosoft.DocumentDBaz.schema_urldb.operationDeleteItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iduser_agent.originaldb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeDeletedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. - - +}]]> + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + DeleteItemAsync + Some Value + Some Value + cosmosdb + Some Value + 127.0.0.1 + Some Value + Some Value + Direct + Delete + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + Some Value + South Central US + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs index f4983c10a7..e25a46e44c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Cosmos.Tracing internal static class AssertActivity { - public static void IsValid(Activity activity) + public static void IsValidOperationActivity(Activity activity) { Assert.IsTrue(activity.OperationName == activity.DisplayName); @@ -71,7 +71,7 @@ public static void IsValid(Activity activity) public static void AreEqualAcrossListeners() { Assert.AreEqual( - JsonConvert.SerializeObject(CustomListener.CollectedActivities.OrderBy(x => x.Id)), + JsonConvert.SerializeObject(CustomListener.CollectedOperationActivities.OrderBy(x => x.Id)), JsonConvert.SerializeObject(CustomOtelExporter.CollectedActivities.OrderBy(x => x.Id))); } @@ -79,11 +79,11 @@ private static void AssertDatabaseAndContainerName(string name, KeyValuePair exceptionsForContainerAttribute = new List { - "Operation.CreateDatabaseAsync", - "Operation.CreateDatabaseIfNotExistsAsync", - "Operation.ReadAsync", - "Operation.DeleteAsync", - "Operation.DeleteStreamAsync" + "CreateDatabaseAsync", + "CreateDatabaseIfNotExistsAsync", + "ReadAsync", + "DeleteAsync", + "DeleteStreamAsync" }; if ((tag.Key == OpenTelemetryAttributeKeys.ContainerName && !exceptionsForContainerAttribute.Contains(name)) || diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs index 5f98a6191a..b0df15c3f2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs @@ -30,30 +30,19 @@ internal class CustomListener : private ConcurrentBag subscriptions = new(); private ConcurrentBag Scopes { get; } = new(); - public static ConcurrentBag CollectedActivities { private set; get; } = new(); + public static ConcurrentBag CollectedOperationActivities { private set; get; } = new(); + public static ConcurrentBag CollectedNetworkActivities { private set; get; } = new(); private static ConcurrentBag CollectedEvents { set; get; } = new(); - private string SourceType { set; get; } - - // Regex is used to match string 'n' against diagnosticNameSpace string - // which is constructed by combining first two parts of name. - // Eg: Azure.Cosmos.Operation where diagnosticNameSpace is Azure.Cosmos and Operation is the sourceType public CustomListener(string name, string eventName) - : this(n => - { - string[] nameParts = name.Split("."); - string diagnosticNameSpace = $"{nameParts[0]}.{nameParts[1]}"; - return Regex.Match(n, diagnosticNameSpace).Success; - }, name.Split(".")[2], eventName) - + : this(n => Regex.Match(n, name).Success, eventName) { } - public CustomListener(Func filter, string sourceType, string eventName) + public CustomListener(Func filter, string eventName) { this.sourceNameFilter = filter; this.eventName = eventName; - this.SourceType = sourceType; DiagnosticListener.AllListeners.Subscribe(this); } @@ -87,12 +76,7 @@ public void OnNext(KeyValuePair value) string startSuffix = ".Start"; string stopSuffix = ".Stop"; string exceptionSuffix = ".Exception"; - - if(!this.SourceType.Contains("*") && !Activity.Current.OperationName.Contains(this.SourceType)) - { - return; - } - + if (value.Key.EndsWith(startSuffix)) { string name = value.Key[..^startSuffix.Length]; @@ -115,9 +99,16 @@ public void OnNext(KeyValuePair value) { if (producedDiagnosticScope.Activity.Id == Activity.Current.Id) { - AssertActivity.IsValid(producedDiagnosticScope.Activity); - CustomListener.CollectedActivities.Add(producedDiagnosticScope.Activity); - + if (producedDiagnosticScope.Activity.Source.Name.EndsWith("Operation")) + { + AssertActivity.IsValidOperationActivity(producedDiagnosticScope.Activity); + CustomListener.CollectedOperationActivities.Add(producedDiagnosticScope.Activity); + } + else if (producedDiagnosticScope.Activity.Source.Name.EndsWith("Request")) + { + CustomListener.CollectedNetworkActivities.Add(producedDiagnosticScope.Activity); + } + producedDiagnosticScope.IsCompleted = true; return; } @@ -173,13 +164,8 @@ protected override void OnEventSourceCreated(EventSource eventSource) protected override void OnEventWritten(EventWrittenEventArgs eventData) { StringBuilder builder = new StringBuilder(); - builder.Append("") - .Append("").Append(eventData.EventName).Append("") - .Append("Ideally, this should contain request diagnostics but request diagnostics is " + - "subject to change with each request as it contains few unique id. " + - "So just putting this tag with this static text to make sure event is getting generated" + - " for each test.") - .Append(""); + builder.Append($""); + CustomListener.CollectedEvents.Add(builder.ToString()); } @@ -238,6 +224,7 @@ private string GenerateTagForBaselineTest(Activity activity) { List tagsWithStaticValue = new List { + "az.schema_url", "kind", "az.namespace", "db.operation", @@ -249,24 +236,18 @@ private string GenerateTagForBaselineTest(Activity activity) }; StringBuilder builder = new StringBuilder(); - builder.Append("") - .Append("") - .Append(activity.OperationName) - .Append(""); - + builder.Append($""); foreach (KeyValuePair tag in activity.Tags) { - builder - .Append("") - .Append(tag.Key) - .Append(""); - if (tagsWithStaticValue.Contains(tag.Key)) { builder - .Append("") - .Append(tag.Value) - .Append(""); + .Append($"{tag.Value}"); + } + else + { + builder + .Append($"Some Value"); } } @@ -278,15 +259,26 @@ private string GenerateTagForBaselineTest(Activity activity) public List GetRecordedAttributes() { List generatedActivityTagsForBaselineXmls = new(); - List collectedActivities = new List(CustomListener.CollectedActivities); - - collectedActivities.OrderBy(act => act.OperationName); - foreach (Activity activity in collectedActivities) + List collectedOperationActivities = new List(CustomListener.CollectedOperationActivities); + foreach (Activity activity in collectedOperationActivities) { generatedActivityTagsForBaselineXmls.Add(this.GenerateTagForBaselineTest(activity)); } - + + /* List collectedNetworkActivities = new List(CustomListener.CollectedNetworkActivities); + collectedNetworkActivities = collectedNetworkActivities + .OrderBy(act => + act.Source.Name + + act.OperationName + + act.GetTagItem("rntbd.status_code") + + act.GetTagItem("rntbd.sub_status_code")) + .ToList(); + foreach (Activity activity in collectedNetworkActivities) + { + generatedActivityTagsForBaselineXmls.Add(this.GenerateTagForBaselineTest(activity)); + }*/ + List outputList = new List(); if(generatedActivityTagsForBaselineXmls != null && generatedActivityTagsForBaselineXmls.Count > 0) { @@ -304,7 +296,8 @@ public List GetRecordedAttributes() public void ResetAttributes() { CustomListener.CollectedEvents = new(); - CustomListener.CollectedActivities = new(); + CustomListener.CollectedOperationActivities = new(); + CustomListener.CollectedNetworkActivities = new(); } public class ProducedDiagnosticScope diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs index 1f6c335fdd..de819ee021 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs @@ -33,7 +33,7 @@ public override ExportResult Export(in Batch batch) foreach (Activity activity in batch) { - AssertActivity.IsValid(activity); + AssertActivity.IsValidOperationActivity(activity); CollectedActivities.Add(activity); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs index ba7e828edf..63d883ef21 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.Cosmos.EmulatorTests.Tracing using System.Threading; using System.Threading.Tasks; using System.Xml; + using System.Xml.Linq; using global::Azure; using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.Diagnostics; @@ -1452,10 +1453,12 @@ public override Output ExecuteTest(Input input) StringBuilder oTelActivitiesString = new StringBuilder(); if (input.OTelActivities != null && input.OTelActivities.Count > 0) { + oTelActivitiesString.Append(""); foreach (string attributes in input.OTelActivities) { oTelActivitiesString.AppendLine(attributes); } + oTelActivitiesString.Append(""); } AssertTraceProperites(input.Trace); @@ -1464,9 +1467,23 @@ public override Output ExecuteTest(Input input) Assert.IsTrue(text.Contains("Client Configuration"), $"All diagnostics should have Client Configuration: {text}"); Assert.IsTrue(json.Contains("Client Configuration"), $"All diagnostics should have Client Configuration: {json}"); - return new Output(text, JToken.Parse(json).ToString(Newtonsoft.Json.Formatting.Indented), oTelActivitiesString.ToString()); + return new Output(text, JToken.Parse(json).ToString(Newtonsoft.Json.Formatting.Indented), this.FormatXml(oTelActivitiesString.ToString())); } + private string FormatXml(string xml) + { + try + { + XDocument doc = XDocument.Parse(xml); + return doc.ToString(); + } + catch (Exception) + { + // Handle and throw if fatal exception here; don't just ignore them + return xml; + } + } + private static TraceForBaselineTesting CreateTraceForBaslineTesting(ITrace trace, TraceForBaselineTesting parent) { TraceForBaselineTesting convertedTrace = new TraceForBaselineTesting(trace.Name, trace.Level, trace.Component, parent); @@ -1650,9 +1667,7 @@ public override void SerializeAsXml(XmlWriter xmlWriter) if (!string.IsNullOrWhiteSpace(this.OTelActivities)) { - xmlWriter.WriteStartElement(nameof(this.OTelActivities)); xmlWriter.WriteRaw(this.OTelActivities); - xmlWriter.WriteEndElement(); } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs index 59172beb33..366cc68811 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs @@ -548,11 +548,11 @@ internal static CustomListener ConfigureOpenTelemetryAndCustomListeners() // Open Telemetry Listener Util.OTelTracerProvider = Sdk.CreateTracerProviderBuilder() .AddCustomOtelExporter() // use any exporter here - .AddSource($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation") // Right now, it will capture only "Azure.Cosmos.Operation" + .AddSource($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.*") .Build(); // Custom Listener - Util.TestListener = new CustomListener($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", "Azure-Cosmos-Operation-Request-Diagnostics"); + Util.TestListener = new CustomListener($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.*", "Azure-Cosmos-Operation-Request-Diagnostics"); return Util.TestListener; From 7b32e8eb094caf9d9c2e6e905775c025e5d166f1 Mon Sep 17 00:00:00 2001 From: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com> Date: Thu, 18 May 2023 10:47:27 -0400 Subject: [PATCH 115/240] SDK 3.34.0 : Adds version bump and changelog (#3855) * SDK 3.34.0: Adds version bump and changelog * adding changelog changes * added a missing PREVIEW PR * Update changelog.md Co-authored-by: Justine Cocchi * Update changelog.md Co-authored-by: Kiran Kumar Kolli * removed 3840 as it was not committed * change text for 3832 * fix merge issue * add 3724 * Update changelog.md Co-authored-by: Matias Quaranta * Update changelog.md Co-authored-by: Matias Quaranta * including 3845 --------- Co-authored-by: Justine Cocchi Co-authored-by: Kiran Kumar Kolli Co-authored-by: Matias Quaranta --- Directory.Build.props | 4 +- .../contracts/API_3.34.0-preview.txt | 1558 +++++++++++++++++ .../contracts/API_3.34.0.txt | 1499 ++++++++++++++++ changelog.md | 17 + 4 files changed, 3076 insertions(+), 2 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.34.0-preview.txt create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.34.0.txt diff --git a/Directory.Build.props b/Directory.Build.props index a24f0ab2ac..ef1ffd2e01 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 3.33.0 - 3.33.0 + 3.34.0 + 3.34.0 preview 3.30.8 2.0.1 diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.34.0-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.34.0-preview.txt new file mode 100644 index 0000000000..4087f63f84 --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.34.0-preview.txt @@ -0,0 +1,1558 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public sealed class ComputedProperty + { + public ComputedProperty(); + public string Name { get; set; } + public string Query { get; set; } + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public Collection ComputedProperties { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool IsDistributedTracingEnabled { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public enum PriorityLevel + { + High = 1, + Low = 2, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public Nullable PriorityLevel { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ComputedPropertiesDefinition + { + public T Attach(); + public ComputedPropertiesDefinition WithComputedProperty(string name, string query); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public ComputedPropertiesDefinition WithComputedProperties(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithDistributedTracing(bool isEnabled=true); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.34.0.txt b/Microsoft.Azure.Cosmos/contracts/API_3.34.0.txt new file mode 100644 index 0000000000..a365c00c6a --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.34.0.txt @@ -0,0 +1,1499 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/changelog.md b/changelog.md index 709a4bfccf..906c0746ef 100644 --- a/changelog.md +++ b/changelog.md @@ -12,6 +12,23 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [3.34.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.34.0-preview) - 2023-05-17 + +### Added +- [3761](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3761) Query: Adds Computed Property SDK Support + +### [3.34.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.34.0) - 2023-05-17 + +#### Fixed +- [3847](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3847) PackageLicense: Replaces PackageLicenseUrl with PackageLicenseFile since PackageLicenseUrl is deprecated +- [3845](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3845) AI Integration: Fixes Operation Name in the activity and end to end Tests. +- [3832](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3832) Query: Fixes format exception when using culture and partitionKey, difference between Windows and Linux + +#### Added +- [3854](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3854) Change Feed: Adds LatestVersion to ChangeFeedMode +- [3833](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3833) Query: Adds TRIM string system function support in LINQ +- [3826](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3826) Query: Adds support for Lambda expression reuse in LINQ +- [3724](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3724) Query: Added remaining Cosmos Type checking functions to CosmosLinqExtensions. Thanks @onionhammer. ### [3.33.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.33.0-preview) - 2023-04-21 From 2b7d709b9fab04a09f373d4d64e2a1ff7c16f849 Mon Sep 17 00:00:00 2001 From: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com> Date: Thu, 18 May 2023 12:10:49 -0400 Subject: [PATCH 116/240] Release: Fixes changelog.md change for 3845 to preview (#3859) --- changelog.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 906c0746ef..b1b3139828 100644 --- a/changelog.md +++ b/changelog.md @@ -17,11 +17,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - [3761](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3761) Query: Adds Computed Property SDK Support +#### Fixed +- [3845](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3845) AI Integration: Fixes Operation Name in the activity and end to end Tests. + ### [3.34.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.34.0) - 2023-05-17 #### Fixed - [3847](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3847) PackageLicense: Replaces PackageLicenseUrl with PackageLicenseFile since PackageLicenseUrl is deprecated -- [3845](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3845) AI Integration: Fixes Operation Name in the activity and end to end Tests. - [3832](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3832) Query: Fixes format exception when using culture and partitionKey, difference between Windows and Linux #### Added From 3727d4d738cfc24aa372b578fd8ca482a5bc2f3f Mon Sep 17 00:00:00 2001 From: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com> Date: Fri, 19 May 2023 11:12:10 -0400 Subject: [PATCH 117/240] removing ThirdPartyNotice.txt from content and contentfiles folders (#3864) --- Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj index 886a84d586..f8afb4af6c 100644 --- a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj +++ b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj @@ -59,7 +59,7 @@ - + From 69cda11e4c7537cc8c864e358a4f7d47828c36d7 Mon Sep 17 00:00:00 2001 From: Rinat Minibaev <132935507+rinatmini@users.noreply.github.com> Date: Mon, 22 May 2023 06:19:42 -0700 Subject: [PATCH 118/240] Documentation: Adds see also link to Container.CreateTransactionalBatch (#3860) * Linking limit documentation to Container.CreateTransactionalBatch(PartitionKey) method * Resolved PR comments * Links update * Using learn.microsoft instead of docs.microsoft in the links --------- Co-authored-by: Matias Quaranta --- Microsoft.Azure.Cosmos/src/Batch/TransactionalBatch.cs | 6 +++++- Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatch.cs b/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatch.cs index aa8ff6af62..a479f3d8b0 100644 --- a/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatch.cs +++ b/Microsoft.Azure.Cosmos/src/Batch/TransactionalBatch.cs @@ -107,7 +107,9 @@ namespace Microsoft.Azure.Cosmos /// ]]> /// /// - /// Limits on TransactionalBatch requests + /// + /// Limits on TransactionalBatch requests + /// public abstract class TransactionalBatch { /// @@ -244,6 +246,7 @@ public abstract TransactionalBatch PatchItem( /// /// This API only throws on client side exceptions. This is to increase performance and prevent the overhead of throwing exceptions. /// Use on the response returned to ensure that the transactional batch succeeded. + /// Limits on TransactionalBatch requests /// public abstract Task ExecuteAsync( CancellationToken cancellationToken = default); @@ -275,6 +278,7 @@ public abstract Task ExecuteAsync( /// /// This API only throws on client side exceptions. This is to increase performance and prevent the overhead of throwing exceptions. /// Use on the response returned to ensure that the transactional batch succeeded. + /// Limits on TransactionalBatch requests /// public abstract Task ExecuteAsync( TransactionalBatchRequestOptions requestOptions, diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs index 1defe1f3cc..106262a13f 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs @@ -1342,6 +1342,9 @@ public abstract ChangeFeedEstimator GetChangeFeedEstimator( /// /// The partition key for all items in the batch. /// A new instance of . + /// + /// Limits on TransactionalBatch requests + /// public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); /// From d4f48f4258d2e2769a8beee69034e155f4028934 Mon Sep 17 00:00:00 2001 From: Maya-Painter <130110800+Maya-Painter@users.noreply.github.com> Date: Tue, 23 May 2023 15:33:44 -0700 Subject: [PATCH 119/240] Query: Adds type-markers with count and length for large arrays (#3852) * initial commit * cleanup * update test output * cleanup * typo * Pr comments --- .../src/Json/JsonWriter.JsonBinaryWriter.cs | 51 +-- Microsoft.Azure.Cosmos/src/Json/JsonWriter.cs | 1 - .../Json/JsonWriterTests.cs | 409 ++++++++++++------ 3 files changed, 306 insertions(+), 155 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Json/JsonWriter.JsonBinaryWriter.cs b/Microsoft.Azure.Cosmos/src/Json/JsonWriter.JsonBinaryWriter.cs index b9d6d2047a..0df6582cf6 100644 --- a/Microsoft.Azure.Cosmos/src/Json/JsonWriter.JsonBinaryWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Json/JsonWriter.JsonBinaryWriter.cs @@ -33,7 +33,7 @@ abstract partial class JsonWriter : IJsonWriter /// Blitted bytes. public static PreblittedBinaryJsonScope CapturePreblittedBinaryJsonScope(Action scopeWriter) { - JsonBinaryWriter jsonBinaryWriter = new JsonBinaryWriter(initialCapacity: 256, serializeCount: false, enableEncodedStrings: false); + JsonBinaryWriter jsonBinaryWriter = new JsonBinaryWriter(initialCapacity: 256, enableEncodedStrings: false); Contract.Requires(!jsonBinaryWriter.JsonObjectState.InArrayContext); Contract.Requires(!jsonBinaryWriter.JsonObjectState.InObjectContext); Contract.Requires(!jsonBinaryWriter.JsonObjectState.IsPropertyExpected); @@ -243,13 +243,6 @@ private enum RawValueType : byte /// private readonly Stack bufferedContexts; - /// - /// With binary encoding json elements like arrays and object are prefixed with a length in bytes and optionally a count. - /// This flag just determines whether you want to serialize the count, since it's optional and up to the user to make the - /// tradeoff between O(1) .Count() operation as the cost of additional storage. - /// - private readonly bool serializeCount; - /// /// When a user writes an open array or object we reserve this much space for the type marker + length + count /// And correct it later when they write a close array or object. @@ -269,18 +262,15 @@ private enum RawValueType : byte /// Initializes a new instance of the JsonBinaryWriter class. /// /// The initial capacity to avoid intermediary allocations. - /// Whether to serialize the count for object and array typemarkers. /// enable reference string encoding public JsonBinaryWriter( int initialCapacity, - bool serializeCount, bool enableEncodedStrings) { this.EnableEncodedStrings = enableEncodedStrings; this.binaryWriter = new JsonBinaryMemoryWriter(initialCapacity); this.bufferedContexts = new Stack(); - this.serializeCount = serializeCount; - this.reservationSize = JsonBinaryEncoding.TypeMarkerLength + JsonBinaryEncoding.OneByteLength + (this.serializeCount ? JsonBinaryEncoding.OneByteCount : 0); + this.reservationSize = JsonBinaryEncoding.TypeMarkerLength + JsonBinaryEncoding.OneByteLength; this.sharedStrings = new List(); this.sharedStringIndexes = new ReferenceStringDictionary(); this.stringReferenceOffsets = new List(); @@ -300,13 +290,13 @@ public JsonBinaryWriter( public override long CurrentLength => this.binaryWriter.Position; /// - public override void WriteObjectStart() => this.WriterArrayOrObjectStart(isArray: false); + public override void WriteObjectStart() => this.WriteArrayOrObjectStart(isArray: false); /// public override void WriteObjectEnd() => this.WriteArrayOrObjectEnd(isArray: false); /// - public override void WriteArrayStart() => this.WriterArrayOrObjectStart(isArray: true); + public override void WriteArrayStart() => this.WriteArrayOrObjectStart(isArray: true); /// public override void WriteArrayEnd() => this.WriteArrayOrObjectEnd(isArray: true); @@ -536,7 +526,7 @@ internal PreblittedBinaryJsonScope CapturePreblittedBinaryJsonScope(int startPos this.binaryWriter.BufferAsSpan.Slice(startPosition, this.binaryWriter.Position - startPosition).ToArray()); } - private void WriterArrayOrObjectStart(bool isArray) + private void WriteArrayOrObjectStart(bool isArray) { this.RegisterArrayOrObjectStart(isArray, this.binaryWriter.Position, valueCount: 0); @@ -544,10 +534,6 @@ private void WriterArrayOrObjectStart(bool isArray) // We'll adjust this as needed when writing the end of the array/object. this.binaryWriter.Write((byte)0); this.binaryWriter.Write((byte)0); - if (this.serializeCount) - { - this.binaryWriter.Write((byte)0); - } } private void RegisterArrayOrObjectStart(bool isArray, long offset, int valueCount) @@ -611,16 +597,20 @@ private void WriteArrayOrObjectEnd(bool isArray) // Need to figure out how many bytes to encode the length and the count if (payloadLength <= byte.MaxValue) { - // 1 byte length - don't need to move the buffer + bool serializeCount = isArray && (count > 16); + + // 1 byte length - move the buffer forward + Span buffer = this.binaryWriter.BufferAsSpan; int bytesToWrite = JsonBinaryEncoding.TypeMarkerLength + JsonBinaryEncoding.OneByteLength - + (this.serializeCount ? JsonBinaryEncoding.OneByteCount : 0); + + (serializeCount ? JsonBinaryEncoding.OneByteCount : 0); + this.MoveBuffer(buffer, payloadIndex, payloadLength, typeMarkerIndex, bytesToWrite, stringStartIndex, stringReferenceStartIndex); // Move the cursor back this.binaryWriter.Position = typeMarkerIndex; // Write the type marker - if (this.serializeCount) + if (serializeCount) { this.binaryWriter.Write(isArray ? JsonBinaryEncoding.TypeMarker.Array1ByteLengthAndCount : JsonBinaryEncoding.TypeMarker.Object1ByteLengthAndCount); this.binaryWriter.Write((byte)payloadLength); @@ -637,9 +627,11 @@ private void WriteArrayOrObjectEnd(bool isArray) } else if (payloadLength <= ushort.MaxValue) { + bool serializeCount = isArray && ((count > 16) || (payloadLength > 0x1000)); + // 2 byte length - make space for the extra byte length (and extra byte count) this.binaryWriter.Write((byte)0); - if (this.serializeCount) + if (serializeCount) { this.binaryWriter.Write((byte)0); } @@ -648,14 +640,14 @@ private void WriteArrayOrObjectEnd(bool isArray) Span buffer = this.binaryWriter.BufferAsSpan; int bytesToWrite = JsonBinaryEncoding.TypeMarkerLength + JsonBinaryEncoding.TwoByteLength - + (this.serializeCount ? JsonBinaryEncoding.TwoByteCount : 0); + + (serializeCount ? JsonBinaryEncoding.TwoByteCount : 0); this.MoveBuffer(buffer, payloadIndex, payloadLength, typeMarkerIndex, bytesToWrite, stringStartIndex, stringReferenceStartIndex); // Move the cursor back this.binaryWriter.Position = typeMarkerIndex; // Write the type marker - if (this.serializeCount) + if (serializeCount) { this.binaryWriter.Write(isArray ? JsonBinaryEncoding.TypeMarker.Array2ByteLengthAndCount : JsonBinaryEncoding.TypeMarker.Object2ByteLengthAndCount); this.binaryWriter.Write((ushort)payloadLength); @@ -673,11 +665,12 @@ private void WriteArrayOrObjectEnd(bool isArray) else { // (payloadLength <= uint.MaxValue) + bool serializeCount = isArray; // 4 byte length - make space for an extra 3 byte length (and 3 byte count) this.binaryWriter.Write((byte)0); this.binaryWriter.Write((ushort)0); - if (this.serializeCount) + if (serializeCount) { this.binaryWriter.Write((byte)0); this.binaryWriter.Write((ushort)0); @@ -687,14 +680,14 @@ private void WriteArrayOrObjectEnd(bool isArray) Span buffer = this.binaryWriter.BufferAsSpan; int bytesToWrite = JsonBinaryEncoding.TypeMarkerLength + JsonBinaryEncoding.FourByteLength - + (this.serializeCount ? JsonBinaryEncoding.FourByteCount : 0); + + (serializeCount ? JsonBinaryEncoding.FourByteCount : 0); this.MoveBuffer(buffer, payloadIndex, payloadLength, typeMarkerIndex, bytesToWrite, stringStartIndex, stringReferenceStartIndex); // Move the cursor back this.binaryWriter.Position = typeMarkerIndex; // Write the type marker - if (this.serializeCount) + if (serializeCount) { this.binaryWriter.Write(isArray ? JsonBinaryEncoding.TypeMarker.Array4ByteLengthAndCount : JsonBinaryEncoding.TypeMarker.Object4ByteLengthAndCount); this.binaryWriter.Write((uint)payloadLength); @@ -915,7 +908,7 @@ private bool TryRegisterStringValue(Utf8Span utf8Span) // In order to avoid having to change the typer marker later on, we need to account for the case // where the buffer might shift as a result of adjusting array/object length. - int maxOffset = (this.JsonObjectState.CurrentDepth * 3) + (int)this.CurrentLength; + int maxOffset = (this.JsonObjectState.CurrentDepth * 7) + (int)this.CurrentLength; bool shouldAddValue = (utf8Span.Length >= 5) || ((maxOffset <= byte.MaxValue) && (utf8Span.Length >= 2)) || diff --git a/Microsoft.Azure.Cosmos/src/Json/JsonWriter.cs b/Microsoft.Azure.Cosmos/src/Json/JsonWriter.cs index 8e75c0c116..9ea7b42325 100644 --- a/Microsoft.Azure.Cosmos/src/Json/JsonWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Json/JsonWriter.cs @@ -58,7 +58,6 @@ public static IJsonWriter Create( JsonSerializationFormat.Text => new JsonTextWriter(initalCapacity), JsonSerializationFormat.Binary => new JsonBinaryWriter( initialCapacity: initalCapacity, - serializeCount: false, enableEncodedStrings: enableEncodedStrings), _ => throw new ArgumentException( string.Format( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Json/JsonWriterTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Json/JsonWriterTests.cs index e60ab573e8..b44cb49b1f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Json/JsonWriterTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Json/JsonWriterTests.cs @@ -16,7 +16,7 @@ public class JsonWriterTests #region Literals [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void TrueTest() { string expectedString = "true"; @@ -37,7 +37,7 @@ public void TrueTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void FalseTest() { string expectedString = "false"; @@ -58,7 +58,7 @@ public void FalseTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NullTest() { string expectedString = "null"; @@ -80,7 +80,7 @@ public void NullTest() #endregion #region Numbers [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void IntegerTest() { string expectedString = "1337"; @@ -103,7 +103,7 @@ public void IntegerTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void DoubleTest() { string expectedString = "1337.1337"; @@ -126,7 +126,7 @@ public void DoubleTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NaNTest() { string expectedString = "\"NaN\""; @@ -149,7 +149,7 @@ public void NaNTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void PositiveInfinityTest() { string expectedString = "\"Infinity\""; @@ -172,7 +172,7 @@ public void PositiveInfinityTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NegativeInfinityTest() { string expectedString = "\"-Infinity\""; @@ -195,7 +195,7 @@ public void NegativeInfinityTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NegativeNumberTest() { string expectedString = "-1337.1337"; @@ -218,7 +218,7 @@ public void NegativeNumberTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NumberWithScientificNotationTest() { string expectedString = "6.02252E+23"; @@ -241,7 +241,7 @@ public void NumberWithScientificNotationTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NumberRegressionTest() { // regression test - the value 0.00085647800000000004 was being incorrectly rejected @@ -267,7 +267,7 @@ public void NumberRegressionTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NumberPrecisionTest() { string expectedString = "[2.7620553993338772e+018,2.7620553993338778e+018]"; @@ -303,7 +303,7 @@ public void NumberPrecisionTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void LargeNumbersTest() { string expectedString = @"[1,-1,10,-10,14997460357411200,14997460357411000,1499746035741101,1499746035741109,-14997460357411200,-14997460357411000,-1499746035741101,-1499746035741109,1499746035741128,1499752659822592,1499752939110661,1499753827614475,1499970126403840,1499970590815128,1499970842400644,1499971371510025,1499972760675685,1499972969962006,1499973086735836,1499973302072392,1499976826748983]"; @@ -343,7 +343,7 @@ public void LargeNumbersTest() #endregion #region String [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void EmptyStringTest() { string expectedString = "\"\""; @@ -364,7 +364,7 @@ public void EmptyStringTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void StringTest() { string expectedString = "\"Hello World\""; @@ -387,7 +387,7 @@ public void StringTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void SystemStringTest() { int systemStringId = 0; @@ -418,7 +418,7 @@ public void SystemStringTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void DateTimeStringsTest() { { @@ -633,7 +633,7 @@ public void DateTimeStringsTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void HexStringsTest() { { @@ -719,7 +719,7 @@ public void HexStringsTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void CompressedStringsTest() { { @@ -933,7 +933,7 @@ public void CompressedStringsTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void GuidStringsTest() { { @@ -1325,7 +1325,7 @@ public void GuidStringsTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void ReferenceStringsTest() { { @@ -1501,97 +1501,97 @@ public void ReferenceStringsTest() }; byte[] binaryPayload = new byte[] { - 0x80, 0xEB, 0xCE, 0x02, 0x89, 0x70, 0x72, 0x6F, + 0x80, 0xEB, 0xD2, 0x02, 0x89, 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x31, 0x86, 0x76, 0x61, 0x6C, 0x75, 0x65, 0x31, 0x89, 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x32, 0xC3, 0x0E, 0x89, 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x33, 0xE2, 0x64, 0x89, 0x70, 0x72, - 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x30, 0xC3, - 0x04, 0xC3, 0x15, 0xC3, 0x21, 0x89, 0x70, 0x72, - 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x34, 0x89, - 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, - 0x35, 0x89, 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, - 0x74, 0x79, 0x36, 0x89, 0x70, 0x72, 0x6F, 0x70, - 0x65, 0x72, 0x74, 0x79, 0x37, 0x89, 0x70, 0x72, - 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x38, 0x89, - 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, - 0x39, 0xC3, 0x0E, 0xC3, 0x0E, 0xC3, 0x0E, 0xC3, - 0x6F, 0xC3, 0x65, 0xC3, 0x5B, 0xC3, 0x47, 0xC3, - 0x3D, 0xC3, 0x21, 0xC3, 0x15, 0xC3, 0x04, 0xC3, - 0x2D, 0xC3, 0x21, 0xC3, 0x0E, 0xC3, 0x3D, 0xC3, - 0x0E, 0xC3, 0x47, 0xE2, 0xB8, 0x8E, 0x53, 0x74, + 0x74, 0x79, 0x33, 0xE5, 0x64, 0x16, 0x89, 0x70, + 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x30, + 0xC3, 0x04, 0xC3, 0x15, 0xC3, 0x21, 0x89, 0x70, + 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x34, + 0x89, 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, + 0x79, 0x35, 0x89, 0x70, 0x72, 0x6F, 0x70, 0x65, + 0x72, 0x74, 0x79, 0x36, 0x89, 0x70, 0x72, 0x6F, + 0x70, 0x65, 0x72, 0x74, 0x79, 0x37, 0x89, 0x70, + 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, 0x38, + 0x89, 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, + 0x79, 0x39, 0xC3, 0x0E, 0xC3, 0x0E, 0xC3, 0x0E, + 0xC3, 0x70, 0xC3, 0x66, 0xC3, 0x5C, 0xC3, 0x48, + 0xC3, 0x3E, 0xC3, 0x21, 0xC3, 0x15, 0xC3, 0x04, + 0xC3, 0x2E, 0xC3, 0x21, 0xC3, 0x0E, 0xC3, 0x3E, + 0xC3, 0x0E, 0xC3, 0x48, 0xE5, 0xB8, 0x16, 0x8E, + 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, + 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x30, 0x8E, 0x53, + 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, 0x6C, + 0x75, 0x65, 0x5F, 0x5F, 0x31, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, 0x6C, 0x75, - 0x65, 0x5F, 0x5F, 0x30, 0x8E, 0x53, 0x74, 0x72, + 0x65, 0x5F, 0x5F, 0x32, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, 0x6C, 0x75, 0x65, - 0x5F, 0x5F, 0x31, 0x8E, 0x53, 0x74, 0x72, 0x69, + 0x5F, 0x5F, 0x33, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, - 0x5F, 0x32, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, + 0x5F, 0x34, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, - 0x33, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, - 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x34, + 0x35, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, + 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x36, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, - 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x35, 0x8E, + 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x37, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, - 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x36, 0x8E, 0x53, + 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x38, 0x8E, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, 0x6C, - 0x75, 0x65, 0x5F, 0x5F, 0x37, 0x8E, 0x53, 0x74, - 0x72, 0x69, 0x6E, 0x67, 0x56, 0x61, 0x6C, 0x75, - 0x65, 0x5F, 0x5F, 0x38, 0x8E, 0x53, 0x74, 0x72, - 0x69, 0x6E, 0x67, 0x56, 0x61, 0x6C, 0x75, 0x65, - 0x5F, 0x5F, 0x39, 0x86, 0x76, 0x61, 0x6C, 0x75, - 0x65, 0x32, 0xC4, 0x33, 0x01, 0xC4, 0x33, 0x01, - 0xC4, 0x24, 0x01, 0xC4, 0x15, 0x01, 0xC4, 0x06, - 0x01, 0xC3, 0xE8, 0xC3, 0xD9, 0xC3, 0xCA, 0xC3, - 0xBB, 0xC3, 0xAC, 0xC3, 0x9D, 0xC3, 0x47, 0xC4, - 0x33, 0x01, 0xC3, 0x51, 0xC4, 0x33, 0x01, 0xC3, - 0x5B, 0xE2, 0xAA, 0x8C, 0x54, 0x65, 0x78, 0x74, - 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x30, + 0x75, 0x65, 0x5F, 0x5F, 0x39, 0x86, 0x76, 0x61, + 0x6C, 0x75, 0x65, 0x32, 0xC4, 0x35, 0x01, 0xC4, + 0x35, 0x01, 0xC4, 0x26, 0x01, 0xC4, 0x17, 0x01, + 0xC4, 0x08, 0x01, 0xC3, 0xEA, 0xC3, 0xDB, 0xC3, + 0xCC, 0xC3, 0xBD, 0xC3, 0xAE, 0xC3, 0x9F, 0xC3, + 0x48, 0xC4, 0x35, 0x01, 0xC3, 0x52, 0xC4, 0x35, + 0x01, 0xC3, 0x5C, 0xE5, 0xAA, 0x16, 0x8C, 0x54, + 0x65, 0x78, 0x74, 0x56, 0x61, 0x6C, 0x75, 0x65, + 0x5F, 0x5F, 0x30, 0x8C, 0x54, 0x65, 0x78, 0x74, + 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x31, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6C, - 0x75, 0x65, 0x5F, 0x5F, 0x31, 0x8C, 0x54, 0x65, + 0x75, 0x65, 0x5F, 0x5F, 0x32, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, - 0x5F, 0x32, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, - 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x33, 0x8C, + 0x5F, 0x33, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, + 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x34, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6C, 0x75, - 0x65, 0x5F, 0x5F, 0x34, 0x8C, 0x54, 0x65, 0x78, + 0x65, 0x5F, 0x5F, 0x35, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, - 0x35, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, 0x61, - 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x36, 0x8C, 0x54, + 0x36, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, 0x61, + 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x37, 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6C, 0x75, 0x65, - 0x5F, 0x5F, 0x37, 0x8C, 0x54, 0x65, 0x78, 0x74, - 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x38, - 0x8C, 0x54, 0x65, 0x78, 0x74, 0x56, 0x61, 0x6C, - 0x75, 0x65, 0x5F, 0x5F, 0x39, 0x86, 0x76, 0x61, - 0x6C, 0x75, 0x65, 0x33, 0xC4, 0xE5, 0x01, 0xC4, - 0xE5, 0x01, 0xC4, 0xD8, 0x01, 0xC4, 0xCB, 0x01, - 0xC4, 0xBE, 0x01, 0xC4, 0xA4, 0x01, 0xC4, 0x97, - 0x01, 0xC4, 0x8A, 0x01, 0xC4, 0x7D, 0x01, 0xC4, - 0x70, 0x01, 0xC4, 0x63, 0x01, 0xC3, 0x65, 0xC4, - 0xE5, 0x01, 0xC3, 0x6F, 0xC4, 0xE5, 0x01, 0xC3, - 0x2D, 0xE2, 0xA0, 0x8B, 0x42, 0x72, 0x6F, 0x77, - 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x30, 0x8B, + 0x5F, 0x5F, 0x38, 0x8C, 0x54, 0x65, 0x78, 0x74, + 0x56, 0x61, 0x6C, 0x75, 0x65, 0x5F, 0x5F, 0x39, + 0x86, 0x76, 0x61, 0x6C, 0x75, 0x65, 0x33, 0xC4, + 0xE8, 0x01, 0xC4, 0xE8, 0x01, 0xC4, 0xDB, 0x01, + 0xC4, 0xCE, 0x01, 0xC4, 0xC1, 0x01, 0xC4, 0xA7, + 0x01, 0xC4, 0x9A, 0x01, 0xC4, 0x8D, 0x01, 0xC4, + 0x80, 0x01, 0xC4, 0x73, 0x01, 0xC4, 0x66, 0x01, + 0xC3, 0x66, 0xC4, 0xE8, 0x01, 0xC3, 0x70, 0xC4, + 0xE8, 0x01, 0xC3, 0x2E, 0xE5, 0xA0, 0x16, 0x8B, 0x42, 0x72, 0x6F, 0x77, 0x6E, 0x44, 0x6F, 0x67, - 0x5F, 0x5F, 0x31, 0x8B, 0x42, 0x72, 0x6F, 0x77, - 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x32, 0x8B, + 0x5F, 0x5F, 0x30, 0x8B, 0x42, 0x72, 0x6F, 0x77, + 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x31, 0x8B, 0x42, 0x72, 0x6F, 0x77, 0x6E, 0x44, 0x6F, 0x67, - 0x5F, 0x5F, 0x33, 0x8B, 0x42, 0x72, 0x6F, 0x77, - 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x34, 0x8B, + 0x5F, 0x5F, 0x32, 0x8B, 0x42, 0x72, 0x6F, 0x77, + 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x33, 0x8B, 0x42, 0x72, 0x6F, 0x77, 0x6E, 0x44, 0x6F, 0x67, - 0x5F, 0x5F, 0x35, 0x8B, 0x42, 0x72, 0x6F, 0x77, - 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x36, 0x8B, + 0x5F, 0x5F, 0x34, 0x8B, 0x42, 0x72, 0x6F, 0x77, + 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x35, 0x8B, 0x42, 0x72, 0x6F, 0x77, 0x6E, 0x44, 0x6F, 0x67, - 0x5F, 0x5F, 0x37, 0x8B, 0x42, 0x72, 0x6F, 0x77, - 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x38, 0x8B, + 0x5F, 0x5F, 0x36, 0x8B, 0x42, 0x72, 0x6F, 0x77, + 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x37, 0x8B, 0x42, 0x72, 0x6F, 0x77, 0x6E, 0x44, 0x6F, 0x67, - 0x5F, 0x5F, 0x39, 0x86, 0x76, 0x61, 0x6C, 0x75, - 0x65, 0x34, 0xC4, 0x93, 0x02, 0xC4, 0x93, 0x02, - 0xC4, 0x87, 0x02, 0xC4, 0x7B, 0x02, 0xC4, 0x6F, - 0x02, 0xC4, 0x57, 0x02, 0xC4, 0x4B, 0x02, 0xC4, - 0x3F, 0x02, 0xC4, 0x33, 0x02, 0xC4, 0x27, 0x02, - 0xC4, 0x1B, 0x02, 0x89, 0x70, 0x72, 0x6F, 0x70, - 0x65, 0x72, 0x74, 0x79, 0x41, 0x86, 0x76, 0x61, - 0x6C, 0x75, 0x65, 0x41, 0xC4, 0xBB, 0x02, 0xC4, - 0xC5, 0x02 + 0x5F, 0x5F, 0x38, 0x8B, 0x42, 0x72, 0x6F, 0x77, + 0x6E, 0x44, 0x6F, 0x67, 0x5F, 0x5F, 0x39, 0x86, + 0x76, 0x61, 0x6C, 0x75, 0x65, 0x34, 0xC4, 0x97, + 0x02, 0xC4, 0x97, 0x02, 0xC4, 0x8B, 0x02, 0xC4, + 0x7F, 0x02, 0xC4, 0x73, 0x02, 0xC4, 0x5B, 0x02, + 0xC4, 0x4F, 0x02, 0xC4, 0x43, 0x02, 0xC4, 0x37, + 0x02, 0xC4, 0x2B, 0x02, 0xC4, 0x1F, 0x02, 0x89, + 0x70, 0x72, 0x6F, 0x70, 0x65, 0x72, 0x74, 0x79, + 0x41, 0x86, 0x76, 0x61, 0x6C, 0x75, 0x65, 0x41, + 0xC4, 0xBF, 0x02, 0xC4, 0xC9, 0x02 }; this.VerifyWriter(tokensToWrite, binaryPayload); @@ -1600,7 +1600,7 @@ public void ReferenceStringsTest() #endregion #region Array [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void EmptyArrayTest() { string expectedString = "[]"; @@ -1622,7 +1622,7 @@ public void EmptyArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void SingleItemArrayTest() { string expectedString = "[true]"; @@ -1646,7 +1646,7 @@ public void SingleItemArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void IntArrayTest() { string expectedString = "[-2,-1,0,1,2]"; @@ -1686,7 +1686,7 @@ public void IntArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NumberArrayTest() { string expectedString = "[15,22,0.1,-0.073,7.70001E+91]"; @@ -1726,7 +1726,7 @@ public void NumberArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void BooleanArrayTest() { string expectedString = "[true,false]"; @@ -1754,7 +1754,67 @@ public void BooleanArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] + public void BooleanLargeArrayTest() + { + string expectedString = "[true,false,true,false,true,false,false,false,true,false,true,false,true,true,true,false,true]"; + byte[] binaryOutput = + { + BinaryFormat, + JsonBinaryEncoding.TypeMarker.Array1ByteLengthAndCount, + // length + 17, + // count + 17, + JsonBinaryEncoding.TypeMarker.True, + JsonBinaryEncoding.TypeMarker.False, + JsonBinaryEncoding.TypeMarker.True, + JsonBinaryEncoding.TypeMarker.False, + JsonBinaryEncoding.TypeMarker.True, + JsonBinaryEncoding.TypeMarker.False, + JsonBinaryEncoding.TypeMarker.False, + JsonBinaryEncoding.TypeMarker.False, + JsonBinaryEncoding.TypeMarker.True, + JsonBinaryEncoding.TypeMarker.False, + JsonBinaryEncoding.TypeMarker.True, + JsonBinaryEncoding.TypeMarker.False, + JsonBinaryEncoding.TypeMarker.True, + JsonBinaryEncoding.TypeMarker.True, + JsonBinaryEncoding.TypeMarker.True, + JsonBinaryEncoding.TypeMarker.False, + JsonBinaryEncoding.TypeMarker.True, + }; + + JsonToken[] tokensToWrite = + { + JsonToken.ArrayStart(), + JsonToken.Boolean(true), + JsonToken.Boolean(false), + JsonToken.Boolean(true), + JsonToken.Boolean(false), + JsonToken.Boolean(true), + JsonToken.Boolean(false), + JsonToken.Boolean(false), + JsonToken.Boolean(false), + JsonToken.Boolean(true), + JsonToken.Boolean(false), + JsonToken.Boolean(true), + JsonToken.Boolean(false), + JsonToken.Boolean(true), + JsonToken.Boolean(true), + JsonToken.Boolean(true), + JsonToken.Boolean(false), + JsonToken.Boolean(true), + JsonToken.ArrayEnd(), + }; + + this.VerifyWriter(tokensToWrite, expectedString); + this.VerifyWriter(tokensToWrite, binaryOutput); + this.VerifyWriter(tokensToWrite, binaryOutput, null, false); + } + + [TestMethod] + [Owner("mayapainter")] public void StringArrayTest() { string expectedString = @"[""Hello"",""World"",""Bye""]"; @@ -1794,7 +1854,61 @@ public void StringArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] + public void StringLargeArrayTest() + { + int stringCount = 20; + + string expectedString = @"["; + for (int index = 0; index < stringCount; index++) + { + if (index == 0) + { + expectedString += @"""Hello0"""; + } + else + { + expectedString += @",""Hello" + index + @""""; + } + + } + expectedString += "]"; + + List binaryOutputBuilder = new List + { + new byte[] { BinaryFormat, JsonBinaryEncoding.TypeMarker.Array1ByteLengthAndCount } + }; + + List strings = new List(); + + for (int index = 0; index < stringCount; index++) + { + string value = "Hello" + index; + strings.Add(new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.EncodedStringLengthMin + value.Length) }); + strings.Add(Encoding.UTF8.GetBytes(value)); + } + byte[] stringBytes = strings.SelectMany(x => x).ToArray(); + + binaryOutputBuilder.Add(new byte[] { (byte)stringBytes.Length }); + binaryOutputBuilder.Add(new byte[] { (byte)stringCount }); + binaryOutputBuilder.Add(stringBytes); + byte[] binaryOutput = binaryOutputBuilder.SelectMany(x => x).ToArray(); + + JsonToken[] tokensToWrite = new JsonToken[stringCount + 2]; + tokensToWrite[0] = JsonToken.ArrayStart(); + for (int index = 1; index < stringCount + 1; index++) + { + tokensToWrite[index] = JsonToken.String("Hello" + (index - 1)); + } + tokensToWrite[stringCount + 1] = JsonToken.ArrayEnd(); + + this.VerifyWriter(tokensToWrite, expectedString); + this.VerifyWriter(tokensToWrite, binaryOutput); + this.VerifyWriter(tokensToWrite, binaryOutput, null, false); + } + + [TestMethod] + [Owner("mayapainter")] public void NullArrayTest() { string expectedString = "[null,null,null]"; @@ -1824,7 +1938,52 @@ public void NullArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] + public void NullLargeArrayTest() + { + int nullCount = 300; + + string expectedString = "["; + for (int index = 0; index < nullCount; index++) + { + expectedString += (index == 0) ? "null" : ",null"; + } + expectedString += "]"; + + List binaryOutputBuilder = new List + { + new byte[] { BinaryFormat, JsonBinaryEncoding.TypeMarker.Array2ByteLengthAndCount }, + // length + BitConverter.GetBytes((ushort)nullCount), + // count + BitConverter.GetBytes((ushort)nullCount), + }; + + byte[] elementsBytes = new byte[nullCount]; + + for (int index = 0; index < nullCount; index++) + { + elementsBytes[index] = JsonBinaryEncoding.TypeMarker.Null; + } + + binaryOutputBuilder.Add(elementsBytes); + byte[] binaryOutput = binaryOutputBuilder.SelectMany(x => x).ToArray(); + + JsonToken[] tokensToWrite = new JsonToken[nullCount + 2]; + tokensToWrite[0] = JsonToken.ArrayStart(); + for (int index = 1; index < nullCount + 1; index++) + { + tokensToWrite[index] = JsonToken.Null(); + } + tokensToWrite[nullCount + 1] = JsonToken.ArrayEnd(); + + this.VerifyWriter(tokensToWrite, expectedString); + this.VerifyWriter(tokensToWrite, binaryOutput); + this.VerifyWriter(tokensToWrite, binaryOutput, null, false); + } + + [TestMethod] + [Owner("mayapainter")] public void ObjectArrayTest() { string expectedString = "[{},{}]"; @@ -1854,7 +2013,7 @@ public void ObjectArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void AllPrimitiveArrayTest() { string expectedString = "[0,0,-1,-1.1,1,2,\"hello\",null,true,false]"; @@ -1905,7 +2064,7 @@ public void AllPrimitiveArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void NestedArrayTest() { string expectedString = "[[],[]]"; @@ -1935,7 +2094,7 @@ public void NestedArrayTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void StrangeNumberArrayTest() { string expectedString = @"[ @@ -1994,7 +2153,7 @@ public void StrangeNumberArrayTest() #endregion Array #region Escaping [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void EscapeCharacterTest() { /// @@ -2026,7 +2185,7 @@ public void EscapeCharacterTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void UnicodeEscapeTest() { // You don't have to escape a regular unicode character @@ -2042,7 +2201,7 @@ public void UnicodeEscapeTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void TwoAdjacentUnicodeCharactersTest() { // 2 unicode escape characters that are not surrogate pairs @@ -2059,7 +2218,7 @@ public void TwoAdjacentUnicodeCharactersTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void UnicodeTest() { // You don't have to escape a regular unicode character @@ -2083,7 +2242,7 @@ public void UnicodeTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void EmojiUTF32Test() { // You don't have to escape a regular unicode character @@ -2107,7 +2266,7 @@ public void EmojiUTF32Test() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void ControlCharacterTests() { HashSet escapeCharacters = new HashSet { '\b', '\f', '\n', '\r', '\t', '\\', '"', '/' }; @@ -2132,7 +2291,7 @@ public void ControlCharacterTests() #endregion #region Objects [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void EmptyObjectTest() { string expectedString = "{}"; @@ -2154,7 +2313,7 @@ public void EmptyObjectTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void SimpleObjectTest() { string expectedString = "{\"GlossDiv\":10,\"title\": \"example glossary\" }"; @@ -2222,7 +2381,7 @@ public void SimpleObjectTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void AllPrimitivesObjectTest() { string expectedString = @"{ @@ -2425,7 +2584,7 @@ public void AllPrimitivesObjectTest() #endregion #region Exceptions [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void ArrayNotStartedTest() { JsonToken[] tokensToWrite = @@ -2438,7 +2597,7 @@ public void ArrayNotStartedTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void ObjectNotStartedTest() { JsonToken[] tokensToWrite = @@ -2451,7 +2610,7 @@ public void ObjectNotStartedTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void PropertyArrayOrObjectNotStartedTest() { JsonToken[] tokensToWrite = @@ -2466,7 +2625,7 @@ public void PropertyArrayOrObjectNotStartedTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void MissingPropertyTest() { JsonToken[] tokensToWrite = @@ -2481,7 +2640,7 @@ public void MissingPropertyTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void PropertyAlreadyAddedTest() { string duplicateFieldName = "This property is added twice"; @@ -2501,7 +2660,7 @@ public void PropertyAlreadyAddedTest() #endregion #region ExtendedTypes [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void Int8Test() { sbyte[] values = new sbyte[] { sbyte.MinValue, sbyte.MinValue + 1, -1, 0, 1, sbyte.MaxValue, sbyte.MaxValue - 1 }; @@ -2531,7 +2690,7 @@ public void Int8Test() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void Int16Test() { short[] values = new short[] { short.MinValue, short.MinValue + 1, -1, 0, 1, short.MaxValue, short.MaxValue - 1 }; @@ -2561,7 +2720,7 @@ public void Int16Test() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void Int32Test() { int[] values = new int[] { int.MinValue, int.MinValue + 1, -1, 0, 1, int.MaxValue, int.MaxValue - 1 }; @@ -2591,7 +2750,7 @@ public void Int32Test() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void Int64Test() { long[] values = new long[] { long.MinValue, long.MinValue + 1, -1, 0, 1, long.MaxValue, long.MaxValue - 1 }; @@ -2621,7 +2780,7 @@ public void Int64Test() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void UInt32Test() { uint[] values = new uint[] { uint.MinValue, uint.MinValue + 1, 0, 1, uint.MaxValue, uint.MaxValue - 1 }; @@ -2651,7 +2810,7 @@ public void UInt32Test() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void Float32Test() { float[] values = new float[] { float.MinValue, float.MinValue + 1, 0, 1, float.MaxValue, float.MaxValue - 1 }; @@ -2681,7 +2840,7 @@ public void Float32Test() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void Float64Test() { double[] values = new double[] { double.MinValue, double.MinValue + 1, 0, 1, double.MaxValue, double.MaxValue - 1 }; @@ -2711,7 +2870,7 @@ public void Float64Test() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void GuidTest() { Guid[] values = new Guid[] { Guid.Empty, Guid.NewGuid() }; @@ -2741,7 +2900,7 @@ public void GuidTest() } [TestMethod] - [Owner("brchon")] + [Owner("mayapainter")] public void BinaryTest() { { From 459a865d323ce0009520420b4d802a1d0e3bf775 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Wed, 24 May 2023 14:23:56 +0530 Subject: [PATCH 120/240] [Internal] AI Integration or Open Telemetry: Design Document (#3858) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * first draft * redesign * ädd link * updated observability url --- docs/SdkDesign.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/SdkDesign.md b/docs/SdkDesign.md index f3f2ec1581..62d4a751f7 100644 --- a/docs/SdkDesign.md +++ b/docs/SdkDesign.md @@ -186,3 +186,32 @@ flowchart LR ConsistencyWriter --> TCPClient ``` +## Distributed Tracing (Preview) + +For detail about usage of this feature, please see the [Azure Cosmos DB SDK observability](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/sdk-observability?tabs=dotnet) + +```mermaid +flowchart TD + classDef orange fill:#f96 + classDef blue fill:#6fa8dc + subgraph ClientContextCore + OpenTelemetryRecorderFactory --> CheckFeatureFlag{isDistributedTracing Enabled?} + CheckFeatureFlag --> |Yes| CreateActivity(Start an Activity or Child activity with specific kind Using DiagnosticScope
and preloaded attributes like containerName, databaseName, operationType) + CreateActivity --> HandlerPipeline + GetResponse --> TriggerDispose(Trigger Dispose of Disagnostic Scope) + TriggerDispose --> CheckLatencyThreshold{Is high latency/errored response?} + CheckLatencyThreshold -- Yes --> GenerateTraceEvent(Generate Warning or Error Trace Event With Request Diagnostics) --> StopActivity + CheckLatencyThreshold -- No --> StopActivity + StopActivity --> SendResponse(Send Response to Caller):::blue + end + OperationRequest[Operation Request]:::blue --> ClientContextCore + subgraph Application + OperationCall(User Application):::orange + end + OperationCall(User Application):::orange --> OperationRequest + CheckFeatureFlag --> |No| HandlerPipeline + HandlerPipeline --> OtherLogic(Goes through TCP/HTTP calls
based on Connection Mode):::blue + OtherLogic --> GetResponse(Get Response for the request) + SendResponse --> OperationCall + +``` \ No newline at end of file From 09e6facad468954b9ac9d51452a39fc207b5035f Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Thu, 25 May 2023 11:55:41 -0400 Subject: [PATCH 121/240] Benchmarking: Adds use of ARM Templates for benchmarking (#3838) * initial commit DONT REVIEW * fixes and documentation * Apply suggestions from code review Co-authored-by: Matias Quaranta * requested changes * Apply suggestions from code review Co-authored-by: Matias Quaranta * name changes * readme changes * nits + changing case of parameters file --------- Co-authored-by: Matias Quaranta --- .../Tools/Benchmark/ARMTemplate/README.md | 73 +++++++++ .../Tools/Benchmark/ARMTemplate/arm1.png | Bin 0 -> 73958 bytes .../Tools/Benchmark/ARMTemplate/arm2.png | Bin 0 -> 85941 bytes .../Tools/Benchmark/ARMTemplate/arm3.png | Bin 0 -> 15913 bytes .../ARMTemplate/benchmarkTemplate.json | 154 ++++++++++++++++++ .../Benchmark/ARMTemplate/parameters.json | 39 +++++ .../Tools/Benchmark/ARMTemplate/run.sh | 2 + 7 files changed, 268 insertions(+) create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm1.png create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm2.png create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm3.png create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/benchmarkTemplate.json create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/parameters.json create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/run.sh diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md new file mode 100644 index 0000000000..f829b79bc6 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md @@ -0,0 +1,73 @@ +# Running benchmarks on ARM Tempaltes + +[ARM Templates](https://learn.microsoft.com/azure/azure-resource-manager/templates/) makes executing the Azure Cosmos DB SDK Benchmark extremely easy, with very few steps involved. Plus, it lets you test and evaluate performance quickly on multiple resource (CPU/RAM) configurations and across multiple Azure regions seamlessly. + +For the below steps, you will **need an Azure Subscription**. + +## Steps + +### Deploy with one click + +Just click in the **Deploy to Azure button** and it will guide you into automatically configuring, deploying, and running the benchmark. + +[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-cosmos-dotnet-v3%2Fmaster%2FARMBenchmarking%2FMicrosoft.Azure.Cosmos.Samples%2FTools%2FBenchmark%2FARMTemplate%2FbenchmarkTemplate.json) + +Please populate the `endpoint` and `key` for your Azure Cosmos DB account. You can [obtain these from the Azure Portal or through CLI](https://learn.microsoft.com/azure/cosmos-db/secure-access-to-data?tabs=using-primary-key#primary-keys). + +Optionally you can modify the other parameters, such as the `throughput` for the container that will get created, the amount of `documents` to insert, the degree of `parallelism`, and if you want the container to be deleted after the benchmark is run (`cleanUpOnFinish` `true/false`). + +Additionally, the template lets you customize the size of the container instance that will be deployed, which you can make as similar as possible to the instance you will be running in production to simulate results. + +### Deploy with Azure CLI + +First open the `parameters.json` file and populate the `endpoint` and `key` for your Azure Cosmos DB account. You can [obtain these from the Azure Portal or through CLI](https://learn.microsoft.com/azure/cosmos-db/secure-access-to-data?tabs=using-primary-key#primary-keys). + + Next, modify the other parameters, such as the `throughput` for the container that will get created, the amount of `documents` to insert, the degree of `parallelism`, and if you want the container to be deleted after the benchmark is run (`cleanUpOnFinish` `true/false`). + + If you're deploying the template to a resource group that does not exist you must create one first. Please note that the name of the resource group can only include alphanumeric characters, periods, underscores, hyphens, and parenthesis. It can be up to 90 characters. The name can't end in a period. To create a resource group use the following command: + ```bash + az group create --name $resourceGroupName --location $location + ``` + + To run the benchmark first navigate to the directory the `benchmarkTemplate.json` and `parameters.json` files are stored and use the Azure CLI with the following command: + ```bash + az deployment group create --resource-group $resourceGroupName --template-file benchmarkTemplate.json --parameters @parameters.json + ``` + +### The Benchmark + +Once you create the benchmark, it will do the following: + +1. It will create a Linux container named `cosmosdbsdkperf` and provision an image with NET 6 inside an instance with the configured CPU and RAM. +![Provisioned Container Instance](./arm1.png) +2. Clone the Azure Cosmos DB SDK repository with the required files +3. Execute the benchmark and provide output logs +4. Stop the instance + +While the container instance is running (or after), you can either use the Azure Portal or the Azure CLI to check the benchmark results with: + +```bash +az container logs -g $resourceGroupName -n cosmosdbsdkperf +``` + +Additionally you can check the logs in the Azure Portal by navigating to the container instance and clicking on the **Logs** tab. + +The logs will show the information, including the initial parameters: + +![Initial benchmark parameters](./arm2.png) + +And the results: + +![Benchmark results](./arm3.png) + +### Clean up + +If you want to remove the Benchmark instance, ypu can delete the container from the Azure Portal. You can also do so from the Azure CLI: + +```bash +az container delete -g $resourceGroupName -n cosmosdbsdkperf +``` + +You can also delete the Benchmark instance from the Azure Portal by navigating to the container instance and clicking on the **Delete** button. + +**Remember to delete the Database and Container** that were created for the Benchmark in your CosmosDB account if you did not use the `CLEANUPFINISH` parameter as `true`. diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm1.png b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm1.png new file mode 100644 index 0000000000000000000000000000000000000000..c740b8b3d7528c4f7232b24da55fee45cdb4f6c1 GIT binary patch literal 73958 zcmdqJhgVZw+r|mfL_}3OQlnBs=mA0qfjPe4yz|YPe_&=!)?%>^hb+xLd*9`ET{o{DnHg}O5;(=g#Kdj* z@SX(|6Gtx-(+Q80?7&ZMtxQ$|-q_vq?vx*4_@f!rR`0bTYPvB+?S!4K;s@hCPvP2 z+oOVB6`W%FCXc22W3y)S(6~?U2MblPte%J$rN)`P<%Q8#Xa2PCOgX zJ?`}^jFP@)kd*T3g5;znbLULH=O<>D7pE?zs30Bsh6*&-(wWZMeR-xAO~%XeD~7+# zR}bt)oB$U5AKe5V(acZ*m6YGa$ZH%tLYrJ-q~q4mjZ|UHkZkNRgIZ{kr((K-ueipw zh*iaj^km99lmsrBjh2VPB2F>=Biyb^{Nf)Ux&NDE6zzic9DS|{e|<4k$zGu^U8>$~ zD1QQR5UCL`|8E~!vjOHQEv|LO$Nad9$F<~1{6QU@;sLBi4^A#mdvNaNwU3ck4M$5- zzYXzFmav{6Hl~jc-(5BAPnQx8&Q&@uV{;RSdudZ0S!-`;-{_rDARYALLCd;1qFVtW zj)48L=W2GUhQ7CMHK%NCeJ=mIoqi|i?2IMU(y1G&s(*k5O7)ov?HzJzb;m8nlpM!0 zpO*{~O0$VKQ7k)_a%lE_2mE3lB-s^sHf5QI$f@R4DWK(`edEXLOYhEgCFEi2J%*G>LAlZ84NKy} zl6C`~2b#t5p4Fz|?k6_C{Q3Usnqitmqb_YU64TeyV9~nhlDl-%?o(&v@yCFLF)2%v zgHsCwIdUo5>a>DBRYLU^eKm(Dg(28f+db)i7`i=F)SVa9{~I-nFe}gyx301}lb*$% zU%S{BuR~vbk4(<53vH~lKHPpBr5myL487oWRJ%jH(+pZdB0a495Rm1NWu5VLm0fki zu9w^<;DU9v(DnQsGJ#NCA6-tLpNnI`WDj<}S%+j|(mjt#2;Q{_?ZL*XV_k24W^L(0 zzm8BH87w5cu$D>>C)SdS+&j4i@p)RNt#F=wN3mZi{8~Iro5d~g0jjDPWYq1vOvp2e zGh2D}j#7UxGsO=Rue{-dZ>SLZ)Zdc~e(xzB7 zN1AD#O3qzUm)F;T;UaAHY46PM|DMx7#V7a7_fIp7=qvXKo9ETD=QCAeTZ>pMQwZN# z4mdi5^Q)|K(L%;l2b7S#I)XPq{RCJlGAN7C1BD4Ie`B#hE~ zOQ2ItiToQUnVxT7r(s9MjZLnY#V_V4c&gA!Lh2Qtd}F1p;y{O^B+R;GVdTxi7@e_; zI_D+LZoa!_@DBLu-RGP$6#&gcna&1G&b`AakZRFKsb!`D1E^r~3APWxryIs9Eb|hY zj3{nvdx{+y1cSGiZ`;8m#y*;h!?!P<*Nu);_F55zN_9zy>57(f}Z>HRXnWWUYIDy(hLGt9$I$ zPhgJ!eWjHAe!#9d1o{2V68*I6)}J4v!~>sk2IbR|V5g z-wLUJGs#o*Yy!>NZtthxG@tgwm6>`>c5@3xzP=>&%=y5XL|h>XX$O3dw6S@)VA*Wu zqlmtu&pu@t6^RO>4V&O-L)khrCasT4qspJ?D>}JoM+8w@{O4X`8FXsYgVUnEWf?#y zTA>+V~uOX*rZK^p66};wMMqQigF=6>-7PvHc8?KkppAl(>(1L)X zwhs+t9Z+MQ+w+Dxp&PTxh2x?zhwEvI1|cz|qXTFh2r=CIP+Lvq2iZg>hW2off5tFBb1UD%`IHLA)Ty$zE z1kdva?W&rg>zh(el_j9KLt12}oYPa#u9N6Y!kHzVuTlw`cehQh{nF43A~r&1`b&-@ zmmk$*GuGoniCgVNzdfnVs}Z^Gijpy-@a6h}3>jPY2!1_IAe7cbVc~GID*F#8?0fx$ z!5!-=n*(IlI>%B@tY`Fa#|&L!gWI=*o9XwvG*9m%$M=!yg+{zG`wPcxT=Uew(F(0# z?l)irs&ZV)Ng!)*9L|{Q$#w~1aE*>g((Xj94ok=~y~46=e}K|n>W|>(q5t7h#LxrvO&4gM2Pc(M0zBRl1H8Nd2mPEI5S<^I;!XW!^fpayU)e&TIK8HaoA(; zBB=4+c^eJJZ2uk8H36AxXRC^&fMb#Nl3O5mQq~CCo-SqC-9~JOHq%6z+ThcN1{pW4 zjl9Rh2gYK9=CN7Cpa@cq?^f~svToOjx`pbGI!454)@!sxdSjX z1Js{Y`&b9q2ZXWAqa7UR`Au~ADc@OerMh=Fz-R05H)>*zrVPza`K!2{I& z|NJAQwyY^3$)xo*B>1C~P;QMF6zv0U@lxMnP>ESeBGhRkhrFHT30y7L9F#5c}qkwaI8&c~gn+*q2vQwoqrGPgT1HBeZ*o z0zcY_ErAI_x*>yY1QMLGxC`YJc+~K5rjiBXf{fI(e%@HQd%TzgtU8bv)?0}n@`4OaATGZiD)*z7Rab-gHsF< zTD93!wo{jY$5ENRJ9=0Y_A1rmV7$uK6!GJ406ekQuD=0qyx*|sGr1kUzj^L&(e^*P z=-t%^;VTO$jo_93JQ#kP+IqnPh=q#UGNkQ@omF=Pv*r#%5Y|D;S|SJJs`y;Gkw_V| zYYieGibb;aJZx*Dqw0kyZ(GAS4Kt)O4(S`{fQ%DR#TacQ>!dalE8V+8hi^y47dx3R9}1g=@=95hG&u910*2-0pH98d z4_@4XSf0gaDb8k50=obC67a%zfQfa@pCVey!y25w{lq2m2}+~Nv7)%meE|;c^!Kt= z9$K<>hW{YerL!Ap{oO5T1F6bYr$ukyEyHF*M7k?E=XwS{zPn~R%eV!UaH0W>TbK$<_mjH)4N{)|}amLv$#(_q(n4m75euWK>yww$$3(9)Mi8uXEcg|CJ>J zBX-Ebx94xqTq4I0A|0BuH}JI%p3=QgKS?K4kO%k<0*+{|t6|>)qC3@&h8QxAH!(!| zjD8-kvaXWeUBTaWRauEA6qOhkI(rjpTxX9ryDlr1xno6UOhYrj@{W26Fhj&yW;P}Z zJbs*7V5~(jd>#p$Wtsj1WJIMesp^3qbX@&8nZ+0)JiU{e8_t z(6YpYe;$^awgm0eaoBsdH^vdLFyt`A=+w0kGwi2EPO-x_yn8Xkbs z$}lEAX(Pm#jo@iPVQjMvQnl28x?blsa@Ue>0F4O8$8y%h^1&Vjy*=f_eBglu$2o)F z2s7PXF{dRbv8lLiK86qUZ$uyZ=L>21-KksZeKNC}rP|2S{z_!-YvSgIl)sPAxKO7( za(9=o-7N^q#RAPzYQ5)BHg#6ZZ1(7uMn_I_q@zpt2Og&6(V{2%Il3`%aL8j)7f&l| z09x;IZis_$|m--O7+d)At-MoZZ{`SeKgF_070t-QNrQ zAlds>jqJR#@UM{HI(KR+ZENMME3K4g+)NN!Qp0RI!IM_%Av+)24pyLbVSN@kx3*Mi z`*Wa@J8>sMUJs{ThghIbY&pQ%eKId>jyF1}QnZ==kyw-V1OS2rkAUX7L5?P@Ba*gY zJBkVxj8R{6BAxcHN$wUG@}9Tu&3$rw;Dw?ROf0YZ(wTKqt|syGA#TkdkG^6 zOyOy@JIpnImv?gXJkvJ|zk!TNBc}{Gr^$x4F|mdacuOc&MA774+zB=ebvA4fKHHB1 zj?=rjp5(m8p!_fXYZVx^3rMZ8@Wn5d?P=og2`34w5f4~ly90j zRG;Bju(GKE%kHj>t2zZH(fy~dwLauY^b~k?UQ&UKnA z|8yK9b&n{EvL?xQ$arK1zhYS)>8q@ay8epRK)}r0a6oNl43DtJ4f@`CVg}P?)EM+ zozzx^O)DX7l=j!Oti~ce@vHVnsBqkK$M<(%4ASp&@#Rjw9*Wn;6qebuDgW&XHp3bs z>YTMBdV$XWuu*y}V0qp!4HMyWg*1UIo&4;Y;L;&9-KH&usVY$T+~jx@+>j05uTq}; zTbH|ZdQIVx3Ws^HRS?tJkh|cT!A$K|{sHrz1B4cd2Pa#?-lOa#auGwx-x}~VDf9*J zsKF6BZGsF&Xu!da6jVFFNG>A(p{L_4CQqereWoMh{;v8r;L~7;YCB)cYYG+dC2}&M z>slUBL5xQC3RP6WOJ zf%{irJf#RZYCnl%SJV&V6Z9u){inGZNB`8y7SbZnZroTuL@fJ4nLOaUk7X zg{mY7zxIQ-kC)brDBiL>7?crS=$wso>Xz8+|IXUgv{T(GS+oyZg6RThG~@$w;l9W^}Vg9i|ThK6iVIqRwq0T zcg_fF(i&fn#iDe6;hae;g!*l;405qCOWtWOi?DJSO`}Psg?b~ZX%PjJusr`!=AhLPLPGr0Yb5=N+QFK0hsMOfpKn{)%S0>6DD}Al}T@)xC#R+M(X- zi6U^Mvm8)WDa*Ll<{a1*bt>mLSai8#n6_-(Gc@KezcJGe#j=In)_zkr(Z$+$n%kLG z96)>3n}4&~LmBlBr`9I7-jtE~a$TS^1lw}_B@F|?$>&pvtg_S&VoiY*Wd(-Nk-uTv zR1F_*j>ekVqoKJ=s<07@IuDG;^Ep`CQ7&3ZV<=p_>ZUU~nne+NQOe@s=chj~bfD!K zITZ1p)QO^J8MaQw2<|<`ek_Bf!FTeD7SEAJgeI%iF z@lu^z-&JB1wY}|$dy@a3@3;BK49OYN*538gqwf7brI^Kby!5O;h&m&f?!}VKIf`2Oz6%NhIx*2Wqy6jPd?`wPOyA&P?`VKK5W_HC zsu-M-?l?N;qL21$vx_eO{+8q-Gx2X}dDemQ07HpBAbG}g8F@9Yu^_c9aNZpiJUYsq zvmZP`F>qvN9%W$wCUVbr1~uMrcN~%^pqzQzHTstOGgztvxz;s{*dAeVqY$UD3y~?KSYHX9-sI3XKK!4jrUo_f#)1~=-fld_oY0nn&LL1Q0n#KP3`SSO(Cmeh5|}nkDCmr)dW-2sRD{)YK#ukO7%Kk@cLAOP+a_srT4b}?#=8qwGO`>t4rvtq!TQkpIu z?`FBUbr13f%x^wv3Ee<^f6Z$Q92N;#a8o*fkBt90d2V&=zi(q&|9|K$Z}ranU-y{& z*iOvh2?)Q z9pjk(e{_=;=+@a8XVL5&r5?CgO{+d8FNww+^hKUAM!j88_U^?a9WYB|Laj0VjPRhw z3j`N>TBd%xx=nEguS) z>*l5lQaQ7+*KWt!E+YUbNLFeMKX13ijT@$3v;+P-Cr-&S!$1RD95 zuN^J^sCzb{P_YFR(U3Wbh}ZPPy{Y38vjP;*g`bNs+V|gGQRdf){HN_;l5A1zCMD(a zzBp)Y(n-#xF24!&y&8EnLP$4&2b|Vm}7gHe*}sRt$ z8V^P9L~2*x#w{3Um3Y=Bx2ZIZ_Ses#f)&YC6#sQo;3GlHH+l2tDq~tbFamV>*iWT| zH_oczjAfcFGCVjf84}IT#B-sd@JF<0rSGg5%PAk@EZMZcr6J>SY3u7Y)!7nhg{m-w z+hDfdcE|SX0_kS}SJtfq^udZp9c|Z5bFJ2=TU<{i+0ofxAn94m1-s5jof2Q5 z*LUqc6qB*3Nh!Yn`ln@A5_<~zvWiKPsHR*?z(QR)d&ok+HNR#^^?YxRK2VTJpSybR z6PmL{(Q~L5=p8UEe-77IqBZ?~#S&qG4*`yB0sw!xsU}#KtqW4B7GHe@U2)SEP!U=rIl~ zio^aB=<_wAjE)Y-u$Hjj#p(~sMJ@j!*;uqEd***=`72JHUR+9B=%&R=+g( zu04YK(4QRWw^6>UQx;m-Q5P};u7J!)j(v2-pwM(snOUB9#?n>VR1&wKN`I2DW{LlY z2Np=MH9%6+;k@;kS+Y_NxgV; zQ3ZPzP|jr7wwEXlg;3jC!?%}5N&$>!QS;1R5&1aoM5;!xfPKf)`yWM{W994?w)-q4 z^629$_-JWx!$-%qFmsQgTwb>vCmDMl5e2L6P!3vt)B*|Drrqtg zqu&G?I(%EbA#f6&pH3nZ6NPTyU7tbA>$CHuK4;^~Mvrg^9Xula`l`S9^?R4JzF3g@ z(*2RAKjvl09$J<_czo|*Dg#rGI(SPz@8aE=`fXQP&c`%=~G z;Tf`)56-L-x}>{Ks>n8O2M`J^ee~=ABmC54k-v8A-qf! zobPBvH#Qrzmybd!s?j4wLH`NI(a3;>{#3%`8K)-um%$ss`P&Sr{=?HPwd z#DD7^?d$*fkt_*lVMU+MBVH?45qd$o$2T##DjAnBd3k~6GH5UCg&4CukEkIrdGujj zfk5Y*MMIYPpwCHsLj_aKA``slm>iF(KlqKcZ-lc5shSC)1?`(hF6{uRNI`XfB2cUC zc_*&PcSd8PBQUGs*~nds>mXlHl+xO)nM1y9jg?{QPvw2zX#q9hvkB~-` zel#xzf>E}Y>Pvt-HI)OYSL`MvWg|oDh$UunTh$m}9k9E?tL_=fERy;+?~)RmiZH3- z^$`2WwMpxUl`aT%LdK^07PAF+lV(GteQALEh3m6TKCRl;ciq(*Qf^u{+csG_O5su4Lby#cY+4knMQ&ec>qwc=rK#e`i9T7Qn4-~&-f zF7I8(Sx= zCZHd2EA1sUsS&nRz1w$fQs^qb>^`F8%S>{f@}izQH|bNe@IOZfEsdd`YBSxz9cE@hOXxuQbd! zrOIgByAFc$u>bT+KF!P}TsF)%>!<^g6*UC2rY8wAqSLgsS3>VBmG&4Ur-{frWiG)N z)chW!cj@)xK|D)ZMZ=VpC+;k~ep=dqTC7_GUNZLc%8Eh70AO2O5>%kT1}2|zNH2U&XF!5RHW6yoy%uhLsiic8ZHGqOiXve zE?jwf{nf=jRkh3D1#c{z{r-UCL4iY1XAFnS&CTP>SX%> z;%dO3c}|>z`C#_#RjDg{sqQO`(vW&2y|?}?oHTmh@|;-k%Gh4|@RnMSDekn0*1g$J z>!HEV){2%7$V4x)=bFg$J0-~Zzm~bOR%$H0D{Zf)g4#PLY4WLD%h4@Db4N$7Frfra zb4M2;^y9<(QYErJ7$ogap%Fucnx4`O^fTc+1Nc(G%Wc~5mA?W^gwdvYkCFpEf!OTL z6NU2}OqqlMLgFq9D85^%Vf57^a_f)er}6`%>>KY%_a7w~o($XIW=ito6(ex;Bc~cN z0FE*Mtwl?;>#m6VfSXm~ejl&iiPs5(5jx_n#WW-~I_OD;6ud*D+fvQUXbXkIL&S*d ztiWk}EHXqDS8oss87Xcd2^<2&hD4$(wZ>^1Acn@fE7qkmbRY5Xx62-mxMRjqLL>v@ zCuLhx9YmhIAF$XfuKQLP&^&16jI0i)Ht)wP^pOw9Z+9=Ht#|S0-kQNgQW;c_)2AhS zKe)C9ktQ*2vl|WrBf-*-#Lz;z(cdC#l`J=AKO{_Wpqx-qlWQxRzq>H;4`B`TA-#AG z<54%m5@;3=CIq1!YQui|@Fy(B>pk>WXPiRJ*As9?BLNc`tToAHbLA2AzVu8cK-v1M zC+bUsNEQ-_Ar(sSek;pf_~jX5%#r#GE2`3}<|+_9_H5q-^`(~DJn?TM^*?NGefr~6 zS%d`lSyF(o!1on=d&0d}0^_R&Q4r+Ag0i{G@X-^wBFX(3(*3DF-jskgW=DZup~AAY ziROGv@cC%}p^SD~%QW27Bv;{n$m*mNp#7&zHWF24j(LO+S`Ih6c^3YLM*t_gbq z1N}sHZhr6WlL^jzGZ8yGSwQro4{Gf(&Ds<hbFE`wx9xN;j&>qa99~uP&;mW)LDhP;>aX)NYhL!M{hw<_7G9Ehbl483Gs@ zH&mTqN1DN_o4s1|=2Nu;xX=A4Fgcn&SM};=z-r8;4CRT`F4-CgTr30YOD>S4`j;9;L1VGd&JB2`LTGUi@a@(vofvaS_v)E zFD4Ms-aLF<`6##Uw?c412mOm9$W~ul;t@mKzOH1kx$>`nFKJD4zP@K)c-Xc0zwt;! zQ@aUqqN#|$0OYT@vXR$(`Y+Gi=J^~%o7B!fsyTy~8v%q8((}4dqBHG~B7gnK^M5?r z+ZxY=`u^F`!vU2QgYA#KUAtT2vAC87!m?m3MULv$3atdmv@g@Gs{>fRpHY&p+&YcP*ja%4M>+4oax;7`zk}OdkDVLJ+h05K2^5UaPdO zl5o;ly$NxNwg)T_%LE0#m4*tB>Pdul_`^b-C=(Q5Iql^ujFAH%dnV8hI^e6FeSjLh z+1Zzfk^;1L1&9)oy)K4KOiPMD^AS~QpvE6rs$iIT(KzGsV1L#e0drg9>o~X zN?sK(5KT||w1;GWrV+e8FRxZJRUbo)=6}LFRN%Vzn?v+r!kINphr_4GafanRw(;iy z`|LZw&yyWhQhOyn;b90l8&r532SdxOC4Kbzebu7Q&CqgxRGT6{!}#yL!K_X69%S44W!TtVl0rzK>+W5m0-(hj^`WpFDiP57hggsNg)BLwgRt zrf+_Wh&JVtBz8D(_S~jM*kvDNzMK;nXm9dbR8W!o?@5`@;({%!X50Ze6?apg@-JY$ z0jqvVa0mLtJr|BLJ@UqbWEH1R@WsA^7%W2Db$sUZUU<(efRRw z2K6{+fgHYk;3eRs>jc7x9#iQXN4}4FgmrEv3Mwn~=rvn6E8g!rC(iUJl{ETxYZ{nZpsJXMu=%z`S zrW$2PJM?&^5H(H?mlXg=v_1Tpbz`;_itfUd@H8)C3*`eB2XALM z<|_F}XH`S%EtirO!{Ls(q2w+NpA00t@W^+0x9XC-)6=8Sf371{ue6vcZ{QBW6lEtH zm`v>`HFP83h?yyNQ-7mz2Vp!w11zE_mzGt-{&78wrMfmnt=$pgcX*BL?69%%Tu^OH z?9;4Fcf)$<^MK^)88PK#z0(rA46Rw;P<2cJHY zj(#2TI%UK+e+io>!!4-vshqWpthJaRYC^N$aLusU!@utgirkH9dUhL^?%T}13W)D+ zpe?fv|Hk6V!0BChZHR0wHTB@_o<9U+iGuZK$jCdPLX>ClF$W|`y;!N z7iF&|R7bs6KI8i1wbX6ow-4){Yi1Mghpeaa zaHed84gJE|qjYKeQDRHJqJf#EmyAWpzv##z{x|*nlH{En#lIeZU}|9d8f^4#fUwtO z@sHR0GwEb*S2;}=DVL6XG}LN|X0eksKh{?Sb*=@sgVzBy7A&Q+BJq%7hS3*(Ul6kb z>jGB2ZLu)?G=Lwx88c3}HCr#vp*?w*&)Nc^gu8B-+CLy){(0!#J&UFwe)L><#&adFYT3fZr?KS)njyJFeeD`E*-4=LxkAHm zpIJ*ah1Ce7gj)jWcm(gP#u{vPP~P=MMXyPZKwmARx)$fk#OxCA$)81k$>8#5~~9j@xE8t&%lv zxPR_%J5!VaM;}Kw9BxzOC5q@@^d5ndb3K*F2z`fZnqOB;aukh|MYK)Tx6F}oq6xDb zBt`c2!r?3%yTgM4dDGHBWJ*njs(zl00N%OY!+{drC4E6-N!N_|M}q` z=tZ-RC>#sM&yt?rOMWtgYgS=iO|X6$?bsT!uF%f%AnD={6p=h{8;zgaLp5$#)jGGE z)J7|MVp3<@>Aiqi(gWO!z9@^z7&;DQO|W?on$*%U*%(2zas$1)+QQE@&0nuw(h#aP zqY935i15u*Spz|ioC9%|xvEt*HK_o0?aPC8oLja(4GhINec?G?w_CjeafgDCWnHI1@2wrelDf4>z? zQ-<2akU!+RN2KXEg`=7Nl|&|fq~K`Ye1*dJFX>O9k$e5S$~4pDY_lLKnT0zXGL^5x=p_E(};##-ttkju1D zfwuxC!$r@pg;f8P@MHbQAeRHe*N6ayWxQ*~W0eK3-GA#=16%U2hq=`_xBpR=KY8Oi zAuj1$rk4FFdYXKBNLVNM&$(;&lm_rx*KY`X#}ye{B-?z`1B{Z5XdlkCLmcUh+{dU) zC5VC|`=^?~zo!Q}a0o16c$rbgD62mfp$P-=8m20JZmi*X{waLOE1HDNY+J+}GeQk~ zXWHCBTgb2Nep^>@+)fBB9xysVsgS1+=Ih5gEypVva#OMTRZ>p*-2=_D7a0Y6|C0ip zvWk*&0-ab($jUztWVNCW8iGipKddYwE+Zq)iyK+>70Sbk5>DQKb4fYFqv21SXRXv3 zAK}%&;|@}Y&W+Dcb(Y(iLCI$bpPtebaL-FTFt+a9J0t}t{w95@XGwPBjNQwCze(+D zi1yJ&sj+_OsK){>Z<7JUO>~ z`?MYOQ}}Rsp%I|@86SleZC+fi_SxxGq9b=Wgm4{o<XbgQ13{wsCzPlDb6QEu6NzE6r z<81f$EY&!aC!H2OYHXWYcA^oFqqD^E+HPJW5rdo;B#oAMbQ_ZNJ!l8y+7s5r_}_gm zx#@T7Jh4w+f^bG08YQy^qPwZ{QmMvmVg9D}I$wg08leOgtn}XM6b!`8kDRWeKZy8u zWx6Ge6Gf!9z+Ot@0&!`3?DVdm{`dpWELG>2E^@oV*~~v+DjJZlvgp+HDa#W$s7`>} zaiTbL=eZihW0HR3jgjKXLPY+hup{c!J;-=n>0gycBWTsF`&QKS-O0334hn<5o3ZgA zQNgLjJGArQ?A6Bv)sbR$^yY`>r<`S?m}+_cG^P}@>CT7(0z)R`^Ut>X#<)pL{mXe{ zy`VXfi^8tfESw2E!eocOPkS?N0uH(f4>zC$}Tngj{SyJ6F_M+CDx{^t2q=pu-Fdx6c1y$!OIF*PI#BiZ9mQ@d9Z(G(A)1eV(C{ z$CbUbN1h_2iz`18Rt788Vkd%bItg2-mEAXv#1*{N=gI^+gbbJH14E4v zFBor=O73ktef=>nbL0s#q52{4KIih}E*Y;~CF&i)K|~95LvauulTtLza(5YW|ThyDSd?x=i)J zrG9`{nVL!?&4V|G^(f8E>TLV54W;kcWdX(ZYJ9@!OnsX;sUkArI3sXLv>_?TQ7z`{ z#r^!d?FbfBqJZ1*9!W8zHf;(N1itek@=){^$?UR6o1JxNoRB0mB1rh1`8xe)~PwZ51Dj(^FG zxpg|mBvw~Dyk30gvKaCB;_Ld>pc3N0tNX%uC1KQ?RFLjli`p0b^Q}^mgNkQjEO56VJ~^yX@N z1>@W?h>5KVg6CQz6Sz9epF-u6XOCWHsQu}ABT1tyqycQx;IGUD+AU=(2Do+J3AcB5 zUtk)5d7k}<#|XgHTR$@?`$^}l={v0#C5CB}tf~!cMdiDK_`dGMyj9SV&rIF@J<&~K za8iK06i1TxHPrn+>r zO#GVA0A28yDQBo_KN4^P2}5W5%Jt)qROB3*Oio?A`S>M%^Wtcv&UJJPqT!|Qql`+C z1^;LcGkev$2$BCO3WUjyGM>wrjwSW-o&zi?hP}nd{KJDZz|Uzs+Xi2FBmYvnA(W+E z9hibCS)FY+08HENpxwssU2k>3(4dZP*M8WSuU_x=uy8hLW=(xC*0(uRv`sidOHe&< zKBW?vNm*BFR4CRTXw5|nZ(rtc!76L>J(p%lkW{bp%mTV@c9hxfL9TK{X1?JvL8;wHaa{QLw#1i#v0XxJ+H8HbL+g;)g7H8d*P{F_ zs_hj{iv&Q;lXKbwwCedbYaMy7nRsm}?j0!2C1PtZM=?QLd4Fd^((KUGDD%dZ9EF$F z&(X8x*c{ECRnZyHd%dL=H_~~^&95y~UHD2mzo>IFsHcbn!HbzvN(PMfwde@n_L|)s zV21wK5O74TRse(aCDH%!o5AOPy9%+Fxbk-=3fh*L=1IJ{B%e7I>N`-8Ch6YQov0A~ z=U!i$OcrOX*PE_b$R!81oC?jn`c<=Gjnu(5=x0*&BIz-FEMIWo9y?XOOoB&;iu zIP2r~Tt?%}955Vo9gwMyyjvl+^cBsmJ0jsYg~8836AFs3s9*dtHYPX$|D_ry1<2@i zbr0U|AVe$j+aUFWK^`3K%Dd`~uYMvDkSwaJ*TGoVRNPy?U6q0g-xbJF2(IKzTK;)w z^1!@RF;_Db!RhBEqcGD!QuOF`i8=NGr;%8~Jtu|^pl@0y>OJ#l2%RXSMF+N4fRsA} z1F1LHrrKe9RqXmGd-?;eNDT>E%}guu1mRvwC>5dPJ=WWBV(eERfK}aoe?yzTY2pHS zLlm8YMfVRtEb>0bHtsr)mKZYj-r)%;}pS_h0lLsbKiD%E?*kMn}to4rOXl0k>(unDrLRZn(MMd{LcO#S1=JpgcW0gU%#Dd;?5YAHpv2#q zO6KFbf;&d|W#fhIla_dWWwLm>Ztxa82;de>R1}pj3*p z=SsCXm3$_@KZ`H_mCl`NM|iK3K5X;r@1KbPDHv*h6x9=a#&)QkJFZyLjc#K2sr5&TZKw z-a7*kKrB`!G-h_0<*UhEkT6M)$HOZcv=-J5x7+p#4)3bFk4qZTKOIW`+7qvL>RayYoEMu%yC+^DDKqp$M~zdf98l14 zg|uk=AMCwnSd(e@_KTu87QhOE6crEw0cj!~E7C+oX`v`cZ_*)DyP^WpJE(*X0qHeX zdXEr#kPe}j!~jY5$~-g9><|0>`0n?=_mdBE96E+0xw-G_TGv|V`8)Yne|(xgOGv)? z+*BTnhZWE1BHLDjAFwIKkm6;enweP~J8SAH7rU+fkm%f+a0=KMKf;L@DvhV(ZDYP> z?roJZ(*tNs1+HUrk4gHlE_9Xjh4u4Cz03}9eKtuy7ui?onB&pDn!(i@s7kGIxkOh_ znFX%C;R65n8SKD*ZX;^K-%1!6LT!&V zDk4Kmrd?^R@AYb;s!vtQkIg#uh>V8yKy>rH&5DrW412V7{|j|QH}cSrnpdTYxT`vw zc^=j7%kK^K{qvVwmkzj+hW%$c-X*1J#5LWH{Y4yDyx-iDcdORer%0U9=|inz*`Yr) zH|8``wzVcJ)i3r16Gw^Q$k7-=dT0lHzzGJi>#iMT4T#`XgJM@C?_sPALa(pPD`j{3 zETfO8K~1<|C?ue&fM(f!5$C5$zxY-dXz-Bb3rbnB3OR#_YzI zlhL_mWuJFEi#cOrS4qyiS@Y~pn4Li9{KZgDj$BbUqS2=6R7roleqygn-lJ>2tEt0o zur$Vq>R-(^z*1wS)va1$ZMU0l-1w+Qa^l$*{)gT}mzX<$81V-pcAoG*n=Nyo3SkS{ zNBdhgjvbHS>{Ixme!|(FroigtL0Q=R^=t1JZ{M)^!G03w;IGZaryuWqy_&O>(!L|U zCm&%S@`mn#F4?*=d2beazZylPcyjl?Zc3zxzF5wughAmnsznHTAp<;3ad+>wa&}W5 zabHl{p|_)9IakRx$asd?PD+1RGF>`?{Vqe_-y)pDCob6tC* z)wY5?VZNqC17(h~J_9R9L~{LR6KCF?)NeCRf9iE(+e$~9ibsmAmjh?7=Sn~xIr)S? z(@fXIV^!JdN}cMR4Z0`|fimZz;(+ID@oY0218J;MYq2~kE*G1kMD3mO9~V)OZb|hU z%-957=CIZz1zaxe4xzjUxvDM26X)rZ!NZoiXVz-a?bt#7Yo}G9<+$4pmxrj|vSK_bwG&cHMMiws!tvWEj-Y>hleLw~`k>8V%Kzud zrb%vELlb+*?98mrw`3c@_1;G#EuoZb_+)=WZq%RvT8-UH{O~=E>}NeG({jy zryAZ4DIV>_Xvgzs$<=K`t50p=c3s{Wf+%xR007HysTV1$CS-P1}t0 zIu@9d>@UWk@E(gjt%(@#%12EDQ9PU1-ts|B<)&q-pQ;+*=8w`zX)80fGC8*KNg~E$ zD_+LYuFb1`OER;10AaYU-lcqow!7RPNo5l@Zn)j?!}P55BHY3;ha1dPXK`rf($A|T zXxok0R``*FIpozv7Hz*NrH*&0kY;-KhMi48Rw zBiaAKM(&n~0gn>0Wry(ku(VyI&C2IpNx7S6>)7m+?JZxdIx*h>XPz`qlER=T*cYkgA~t%3;?u%ap)_) z%32#y(trC|k1s;B`P9dS4<&*H$n{wzce9-yIy_4O+KiW{cn`27nHJo=;HLB7 zdnFBVmL?wOI3zOdMKi@XE$kYAh9+LJT4_wqe==9-1EChTLVEl4Im)2Wyer2#^m!={ z>+JBA=l8LxrNqOs_433@<&5h|k|e5;gef9SWXM`&>uk@yH|a_|NT-CUW;cb01>=fe zJFOogm28wVakp}M@><+vYgl(JjUu}ke0K28yPe!;tQgo6uuB&EsGA-1>DDO$v!uJc z4Er~V>l{ctN+_~#YZ`nL;%%?aVf|-*)TjHV2lQ7aNX*`h-pJyr@7K8%;({-LsJVbH zU!%X?iClQkPpqoHbOdyerVR4YzJupoc;wlJUTIZzU`=6^*mkDR?S5ItcJFxN;(#@> zvtyY5KW`0M3Z~l;#2Mx&*Xo;}ezt@V0hn7Tbse$7tsMK*&54A!ZGqLRH@4X}>O+UXL(R=9Rx~hoO`v z9sJL`{zw7F*Bt5H>?pa2sPLb^`}4oa#*Z%RocnQF^#3%%*8#sXMBjgXP*a0quzyBPx^n~qylE?Uen{%tLsQPoea_LMW~X4H6rQ7x?$D)G&;@J^KI+s9kZdQCJ(MFFQPVKGJaWd#3Q zI)t)krGG_tMj1;fa2aDN3WV8*m`t{Qgj9x3!lFmuOh5p@2ODEZM~Yb86DI;F8%@CA z)8c$CMXdwh+ISTT!2LyZ7tPmdf8D(y2tE?+!!$YB)F+Kp`w$uCNlUcZW#km!VNeZ%Sew=H4)&W!Zy^8^7WLWL}Hd5F`{+sBxb;X75oD978L}ehS zED~qzmb^WA3|x)T@2~7h!0e6<%nD2QI!_pz3vA_+LA$RYbdcPvJkkw|@m+AtuBn_n zsytiy8x`=!-gc895J4oZy_j!O`?(QRsc~%a@%dn!u$=BV0YDzx z)w10O`NIHgs=n#D*qj?DrH#}9mg!sYSTur|Wy?r|S0%uhiDg<`lTG|wO34+Em2n~d zfURGXtD539_aD_~Vbk8)^!PH52dp&KpPF`G8o8jJ*ehG^H`681SLU2TPMCVbbX?r5 z;v}6_GC;8Xy1^_tU8FMsPRdgwKKT0jxvHOEF>is0(}Ze{(JJd=WMYYgDH&YL2$UiA zlq)zHeOXwIF`n9Vz72Tx#kl1?!}EtK)pHFBTP1#^R#+1}tW`pfN(?3*OYvLDf*T8G zl(ODc>X@LqiV39EzUEOf0%41@l@hJWSHB6|2b5j=!nEQf)!$!!39#1C+%Xk{VI;wE z6TKb#>F0DOUK3O6&u_Rg-UT=k+wSZVxm}17hZBUn357a?W^Afii$P(UZ)oxgI3A2P z#Vfhw4tfuycyaR2cYdf^qh`ije#O@9;EWDMYR1Qyo!iX0v`M7a72w8jxc=vy`*9Yz z^_Bk5Sx%iF&O_)Qy1QNs##vjSPR@a+7wqzLUdl5vN0NPIdQ1HiS*ZrpE<|4ztp`QYUbg0xvT8r46=$)qaY7R)Vc6+Wx!6r8d$ zXp@PJaeP%esNf@hEL`XBro))vOPV8{tNC{DqB^p z)`r(-0Hv3jp5x;-wQ*S3;1ize9-X(jN)Dtt-#arwZV{)q)r=A<*-8lbbjOonln zUogA)WRYFBhHo$$q*xn=MQ`N1(%r{_Y|NZ)eMd^ICzp^sx zIVYGlWlSkAT@6)RFqUgwpQtcfqlBu2NZ|$x#A^#OnEXSgeUs8RhgOZbB<~l<;d{_# z);i0m&A!#jea>r&X8I0L*8>PwjEJ2ycUC# zn<`i+3fgr09(?3sepy&L&b~mKpf_pkxpE6t@A+-%=P74{Vw<;d=~JFV@+JPTNG}vQ zCDAM)37uV?K?SzT=`cq!N+9tL4Z0$UGwY6kEQ*hcyY+zF95BBp0Hl_{lGCz1lf)- zzroD;t0bh`F-68cn*VyD0i7?I+3irVGJ(4MGW?@uvkJBHqCQLjqvcBo*V3-B5)+6_ zH!_@*u-gZ1lk!C0mJn7Be%A!9=ap7zHRxgr=p^gkr`1x@HNETMZMkkgm3$_m^jmzE z&L=w3Yf7L(^x^&1szq*>7jP+htG1=6fW)%GV>24lQ&I_{%+=*9Keyy9QwxtGk3S*U>Gp#95`DMFJ^*7ll329orgYt zU#q@}4p72W-<~NH)vryI(^DvQmc`OXvjce~?Od|m-rorbK}#o%nHubWQ zk;8rZ^4AMOIH(^>beLE<>>jyoJ0fKK%}n+7W7IBIZfW2kJlJM?Rtmh=r(XE+s|Fdz zjBy0H*(@1`e(kiVozY2>7ZSXl7zWf0&5*giEp9XJ3@~sCJPgqX7QTR5NFp(#e#{|( z3F(3N7SlKD_pj0u?r^(RH6jl9=DCj{{!oFocuyujTw#Cdrnpv)-0MJ)u5t3HCP-Od zPw-Ehfnky;9k;Hl6gDXDTzv6mhNNXvys8^i7ZU@{YH?ze6n3MEOCn1PfTD+8D1zQ(cb9$8AZBNvq%l!;aUt zm1KQ(F)5=HaohiX*cg6(cf&n07Eq7>QEZ?m&z4_$xm$0fpHtBUAp8>r@_`H0yQghB zj1gxrhB?u=n2;0P{n8_(zSIjnmE#f?UiP0VuFsdDU=^n`?mV-XG#_`iQEhRxHLpR3 zQKu7o8VIBSBTaqS4nq3g6hB)LJRoB==FS%~zR_Q}79n4P+p|ahnePK5MtrpkcB`he z0ay5{rbga_`pK-|9K4$zgRqGmb1BtE)FBb+waT+Y13MmVldb7B{&IrdYTXHmW=dyKf5)plnnZY535<(zjJ ziw_E6isO`ZIs?$Qm$(?uGHy2MSjFWsTI0Bou6B+$^M)O1gm-<`*674@YpD9y22`N7 zmk_<6RHYag`JzXnYYp`3Qb%@FcOH-D;Z?f+*@e6!fE{v+Y&4cwUV+IOTviK zIjdv(Xrm)@7Wq>Z$&1Kg-!Ws>>jCUNYkoL;Ig2_i({>;KBf_^E()@q?QwAuCv|9!l z+cwVuqasei8<%S+s^B#zZBjr7246oB4o*bum7>y<_)?DqB^igoDlfeKh~{H5XU8$g z`&|;=0L7bK3J@lSH;KwuPxEW+lg_U)1cMtIL1~+c_vidb?ci;<7$&gxPlIk z!qaQB(zaWb2wo|x;+7SxVVU%+CI@enOD7d|nV_uiQFR&V0RW zt36n6*cMClU#+#riJe+p9%MoJbo~W5ophU#v}~bY_GDTzUD!l)fzvdqyo5D{DQ`Lg zwvISCi)S;tzebd@;R;Df%S|3h#b2J}Z_;(a(#{uMhkmE`Jb8AFa)!8Ry+Dsc0KQN> z4h}fmYffH%eSGKM4bPuBC)I-aVRecGF>O49HgqjesYBnUjejUi|#3{YeZ$WNsCj3q+VcRt7k%)aNQ3lvz7UxGwm60q&+n-bPhtiUgr3 z*RmtCv{Ezut2_gmu@V{9?eVsC=zOD+`0C}l1S`rH;2IksD(pnetTBqO7ucC!*u{)i ziYuYCW7>AS^}w{05o>t(9B(RHwH)P8AnwxjdFPd)9AJ{F(A={eU*Y= z(jD1H_-}XHb@Lk)+f3GEjMaxA2y!|gToR%g5k8ueU4?EGr0!mt*)!PyL< z564i)Qod?z^dKA*-fH&vbdBKD9f@H$!p;^ZxZIfx^~d4-Ry^3j!M zKr!P-*AnB49XD(773e5FPY3+HwztsZh#M>R?lk9E>&pl~iCT2QlI5q&X;jKM7>S}a z*~Q~r>S6jWtU_Ch7;j60kIuoVHXKw`&97&$mIFk`N#j^Kw{(xT z0J}ESY)?s=MXvoKyGyR06|`)6Jg?J5TFnz8ddgDsI%GicL+dGf-`1}~bY*HB?Q5IM zltN8i;+9C-jK^F6vyHfM`He{ff;&j}D_qIJeIeTznHoTpm8Q|1ZKVvprkG#LqX`~3 zi=3K^HauBAg{HKuT*}BA*MT4Z^m+EPeX$HuJe|Bv1GOzd23QV|OrUN59eD8STRV2o zIr{^%#b|xjm4vBs9sTBlJyOPWueij%Ro^TMaCjR#t9S)f^Dm$;_f!|Z@?tiy73mSa zlcNrRQSBR4Ff_VS2jvcN^^Dw`VpWc06Gdp;_vM;jIwcJY*ACG;mBqXFIN?i&c61j{ zl!wR-728V9^wd;g{O8Uf7@JM1JR>k{XU^u`Dv=2QX(D}Jzg2s2r$ULi5)Wr2_EULj zKgcL*9g4dk0puc`yV=IUtg3S6=yZoznul`#iXTk(!$p11fo858$56p!E@D7fxm6sa zrE1DJ0gkXpfQV{jv?aAl7H`@pwQ=&}@6Klc6r&jm_gpvrYf)Zd>>X6mf4mXB$lnHQ< zovFjC#?@|9Dt(ofujJa00f|LKMZlD9xDs@bl^iBd*KY%ABwDUOpM2SM^yZNw}oKD#?e*<6r9*fFrkUl6NK_ zVE%H>vC9B(>5g>{&#R!Lt!q?fCos_z6Qk_E0fAb7*EB)(q`{C2EF<56Pa{?V2TYDl z(0Kgy`hyun6i*cT^C&thl+$p|iU6m}z`x!s2%91`S{HwG5 z6PL2g(D{jgMl~vR5VGw`E7bkncVf_a#vm7DeF`XD;pa?@pubhPHZwF(4Ki+_iKeI+ zvp{Zf8M~fh-M`c)@L_bs9)*4n03r6@uTOhl{lDLAe=%ZFh*!})fSfD9S3GaGmYehX z`}0APTEW%5{|o8G#qt^R-v?s)zrOsx`q%&8RdHNiD(qd{_T*tny;D<*3GV*)pT|CK z4m!#OjwQz>pT5f97=J!K^4hUWc2=)MpX#c~Vjl(plSBsY%VFt?$r#QkJev_LeO#{gD<*OZ^TG zJhN{0(q6~E{3Xr!?Y38K>Tzol6IHl~0o|W^bo-nKAesp098o|OCH{Dx038WG1-rDv z!ndz&5DCtIlStvlc`VWJ@P_-$q>_--M!_IvkxxP1>JQHc#Q%BE8x%)$}&QI1R`Ts@~4mM(!5Z62B_iVCF(cV=IwQST>pH> zvESbae&shL?$7wl=!z9y4nF!h`CxB{eFa>4(!*0Fl!3-a zZJ@uEWc>0P`NDl@-=aL}wS%GyXy8^Q#Qo9OH3jXlH*LC8dCd1r;uyFEL{S)-(+*@D@F*mw&Cni|UoV>t2Cx;w=F-U@}!s_#E;-+Wlkav}* z%1LEnW44XaqE+(BLXqbHRc%K;?%BL_-^;+CtDLFo#qU(^h$y`7>&#}OzWT4x(PmDUxLw3Bv_N; zB;F?#zNg1E4OUJdPK@++e(1{4*AX(!oqk-Hrov-W7tgYrd2aR>jy`XL;KplYSIgEd z_ZEAU33?Y7FQWcak3>G?U|C0JHTTSuQ{AiqoBGIbSNja}u^%xY$LtNHe1iI;#jB0l zL6R3O=2rB+M$a+`+~Y6rY;x7R2o4_f6KVD8LRI)VN25P;6aTzes=X&vSrp%`$}Z3s zJGz}rfqUzd=M7u>T~go6Q;54Mn@75~6h`H&-S^8fa9K3Ws?OPWm(IAr@H7 zEYczC^h}V9r3EO_CFfp=kJq&(OfH)F&&wD>$+wSlEsh>!04T4EFnbh&VkHKe-Ws6` zLl9*lMKs%VvKTn$$Zz+<#>#A(0I8)`{i9c2&E0+nlnKr7;}^DX>P};Q2$EkCpu|t` zXigEwDE))SlQ=`Sb~va~(!M#7OJ<`g%2G^0g55hQr%OXx(Qi+j;&f1PtwNUbf{$fWFH>>t&`l3^;;5ip|&x|Dk98HbR zv`rImi?zQN%A*CEQ~c+8YsU&>#B{Ho(oP;F`2*IzMcPqjj^jl@Yb|(&2`$Pq=>&nNZ8yu`(MT-Jsmd$l(WE)o4 zlv@dTo6c_sihuNCEp2#iufPB15GfqQ^W?Eml`W&DvE><;Ymui5zrEtc|FbghFa2^S z$hbK?re@9iA639EJ)J9SW`=W$`*2UuUgdIi;P`?KS!)bi1~HzKI!$a4d!uwkC0_iYw) z^m1mMhukLG1nBm2I9SHD!$DbQo2R2kK4HECLr)dtQuezhX0oS-tq*9{vh^o&=_}9A zn`_hJaTdRyFT_P!O=;V~@sF0|#| zIJwiX*kcy(PEK{|#I%9Tf$V|Yfe>qP`%#;ZW3NdIorLia`+pXK3789k^T!ghU?X-P z1bg^(F71_IXN>vjKu>6mI?d;^nP-%adkmy}2)*#- zY`GpM8AWN-&yB6!<~tRr_U(@Y+Q%vV>-LkYaFJR|YjL@@sTvCXAHG2>41iA}PC42D ziz*2cNZP4~H{9X5T{;Ee3fHdw&`OoxyJ+&W2kgg5a~BN}sR0{($K&K3%pF#2f5mD$%cE#56kJe^0Z>2wCYTpa+D$V4lE@4dQYw%cLN2ZmeE7ZI~uZeAbk_{^(((G8zGnnK+3U}4U1Q+LU-HNMro4C6}@gY4bE zUaGxFr@G@hu&!_%lhaLap{Ewhxos3vn3o*7Ti6ikb4!jsbFGW(w^XFB<^R3^+!KI~ z#6ejnMfxmxu-XTkyz%MJV2IU;V)2AMXZjsC;JzCF_HxW~4^28u9-3?irLOKH4{ZcO z|FnzznANY!PA9(Q`jJ{&RRdp_hFFOR!$tTyhfL^S2Oj$&`G8w+nB%eX`QVt-_mG0W97mm9VP*aID(nN99U6>6GWI>vCW?!L69c0+ z>IKkH-OLbsU8dT&$u5KE=^G5-p1xMYgkPTpa7DGGtpr&8=?PFR22=6*bb$qO9ULF` zLb#QLVJrk$2*L4AF?)}kxm$S&=Y;B}i#4_aC==|feGyELIDeo8MUA9MoMAuKg+Xj# zyDn!xsfEc;nrclVkZSTVQm3j)haI2;!|~OmETa?L5|->Rs+`+3A3p3>=|re!3zFD zG(96pHH2lWYoArLOZ$Ufs6mRYZFQ&5pBu5jg-1JXl|Q)GcXytEp=~rL&uX^Qf$0eh zHjQw|E`}W_c2zGl$JBn?P`S(3G@Y>H?`)sWm&4H(K-XWWYu@>W^}1CmtoHJH6`ryx z78~y9fusE}J+ych6ALTv@A9c0Wl;~y^Jn8%MsL4FETp)M)om!KJ<=3W?uN`{j@23v z6}fiGtNne~LLL>}MoW<*;miUX`=qS3WLqwjTwJRN#HV4GLjgTBF5Bh;44D>d=4s}Q zIVreu)wj_%FWKR;_&}@@?e9y{fOIVWigm9x{IujLon(Fv$@^iI>$7q0_Il`O^6I2| zn{fp{kln1}IMX0)G8B)rRW*9t$$8qYqu^aNvEQB!O^K8D$TqHia8o1ljL^$N0^zWP z#NYLPy64E2hgwa)(X)IrYpBx4s_rJU<{*dYkV^03Fhdwe_7;HGI~0`B!L?g#$T zsxn>+ToryZ;b6Mc(uh6-A-{Su7X0=P&fNM&uRCmtD3vOZR;3O;VPPEFBqkiC5my-F zf$@hFSjqbhcZF`Grh<32cLNiYYgE&eCTdWS3L~O#rk7~%>tEdK(Z_ZAOteHHz%+WI zJ6k^nT2L@leXCV~(ai|4Y9V+5n{89HwOPCwidD{!mQN2za025((O;jl#M$46VZlmw48YPYE2W(~ zzsw<&^lxQc7xh{kidx1{g_|L7K!HXP1pjF`+`$Ms*sXYvvQttO@;Z--r?J!4CfZ@J z-~tmX4}YgAQeDh&Dy#Gpv6>AY*L(B{aofA*81crugtGhV*>_HbL8v#dN-;j!LAV!R z``F>P{T7<4eY*Z4tx!IxxlT1&^zgwvV^T5c{JlpQ$H9VoAGXd~y-qyu^QAJG2h;58 zTrBxnAH2D6=!}4v;*5oGJ$@)a1?f}1>aCSAuia>$a3W9Y<~0!-814tSSo3a3IP{){ z$a2&VG+uS~N1lEDde9?z9*uUT)4TF;A=e(X0LnmbIiOH{1&fZ+9hWv#l-210{wd0{{wSn4P z*z8Pio^i3Lj~9!6e5+E6BTm{Un0$;fKxJf#wFSDP#L!Ja?dTSx=aQ!yG9U6hXLKdJFf^fG!1w?p3$5Zgm&Wb(7Bz$t!#wOPzK#Ds$o!m5wF%3`lx6+)xMO9ZbfI zoAfh}^LozMO=2^g&4i3{V;u&IJ9kt>GQBG)@rB<1#Hx60*q_xQ3VxIKDw}#n?%Z&% zN%Z&;lV8P@E|W@yBU-C>w^}Gq6iiP{p=c1rP!_!~l%87uU1X1~9WU9%lXs8$mS$pH zCxUlB3E^7L>*MjCiCt^V^?x75pExE3!NWjR&w#8!*{(thK`FdgPbqP_uX)ELNLehp zo}%mw&FP&3)Ot#7-o~ZJZJJYAt1QgmH;ixx`yQUqe9tU)4^t%#L!CV4wk7K{XoFOn z#-mf@c;Hu}WmID4_-IUnhI40Bp|go>=&!&?AlL>F#tpN0D(YN9zN z&WA#0DY_K_X3mNy^b#T;v$;^!qZot0IXG85keD+%=Iiu$Fh~I=rL)#6M>Y$u1D>fC=`Bg zLrogBT2H(rkfFHsI}wux_7biEbZmlm9}kzu7=QyVqspfk^RSs(KNO^a%{gQ$-tUGt;g-yI$*BzsFWoSe-z1~Y7zQsqc!jCs7 zb&tbYWMN0^L!BQ@>3sD<3&zw;EnY*DYwKz1)6me7Zx^&A&gT!Anz>E2%1*uPS~Wy) ziW?XA`jt6uvgj73nST$aw(UmYxf1x4&?5Kz}mYm{e22|dndSL0>u zOF^BY-e2l(rk7{RM_$=1t?jWS$irl?$1mV0Sj64uL6J+dh|Y*Q9_f@ar5M%L?l!>H zR@*^Sg2ZS=McmiEIsh=lPt4#&O-hZKn0d~?c2=zWG@l-I5j|_>zm8IxSf2UwQ+K@g z8O(IXtSaOq&jfI*mjh0N5^JR|xRG(6E=#Ba4+HD7rh?xK!#(uc^Y0~dvaimev zYugGK=o3b4ZVdU`pDnpLb}IeY6o{C#q4|8zC~_B9krC{fefF=^xY0PNj`=rO8TY>u zU!f%)9rb5bzK${pvM>7yE5!O-pR%LGNe>t>l=y&H=tF z(%U8zWc?5h_Azyw)##faD)GO5ZZy4BN@z(|LR?Q#b}S{|Jm=7RoVGbHi+zfO5VyH3 z^SU=Zlz3po`348dQ<^54)7NV*g`zxZ^Xdq}`jA5dM);yh#g3+f`uWD^M4MK}+a{cc zJO)=_!Wbt(NQt&xOpA_EbJBo@nl}5)2~^;Rz?{_%pU?i!LXX-a-KPgKLUDeCn`^+q z_27{g|NUqvF2SQA^C?#}wFq+NbarbYvh8xdwk4^A9TL2L4SPx(R8T$XBDOl5{4Bwx zdT)66Dk+Va|A%Vd%FjfnG8wdU5@YKNgN2up?a=lG7t)Uma?PTAwZ&;I@u|mM}0%hYx`RC1w6!my^@O< zDnbO69Q$tz0r{Ek1Wlez@?0KFv(=4L_J6iE2a9HpN3NZYS}2!{$s^ycDKYU08HUGB{QR$k$Z&Pyw2yWw7Lyi>Dt`-%~Y4slJ6K#!$4?@(SPYm z_r5%VfEZz*v|kS4GBo|z(>z7>2S0Z_&I2bAn{sZR)8AnIz9e!;pi$ldGb2e^q|lnO z?7g%_T>NK1zlXO4txMn`&Y|ova)!wVFT(IplXF1KYP+8BFSrG zu+s5*v{TYmcYZg)z27RbZ*yhVux}=WD$iOPNkH~smpyJ;Y;4(A^%^Uq)@qlQO|BGfD0XXdh4 z$BT#=Jdg3GsBD=67|(~w?M6;;+~jxc{}i}+7Wo?FR~EuL4#U-b$(+i!n-4Y@@1T+A zBhzIl_0TaNc4oO&JX{6bMgpidur|=}{&X|@wk`JH76jt8_|O&n5F%ZD0zKa72r>2< zGhXpmq4WLsEyM7s3Qo(oyGu}DSk}Fsp|k2WU?!O6iVE(kydwfpb%k_Ly?VmAyd?Rv z+=NPyP_Hb1dT7OiO}`%1u1vWMx>jLG(<#s;2Okp5FLuOUh2D%~7aZFz%X`e--Cn_r zUmm{V4ZThQ>$XJ5yg4-kn{OQLmswyGY1sbM+mmXgx=N|5nMSDWL`9!3XFj;kNP^m7 zBzkh2?W+Y)>c>sIKBk}-u(hm)-J_Iib0hC+Yy8TP7hdDlR)%??~CkRPQS={Eugk8gqlSA**=~#kaQbX zJk!+(C9?q3Dz9)ojmgplx!dO86cp>TkL&!W9Ybobxi~T>JVAV!h9L2rip{naq%1$D zPhYNva;$b7_giHXO#?JAz^Ei=Kot-DVwyT&Skj<4f%837y?l^OC6zZ&g7SP|GeV+x z&hx|4Dv4YpNp5T|^5j^0J(!6l)FA!&LB0`9Z^)($*P!&^StREkQgbsSATB zbBeoL##078e|kf*wRX+VaiFq0Ess2#BS{Ah?|cGDh_Q>ObmIB%Wa~v0js^HlD+eB> zD9q2Ah9;GE;mE-9(+63wg?7#y8m034!Z476M-D~b#68eJ9F}$L>fPZ0gcExmW(A13 zie%yLPav5EQnbsD1^&x(G&oXm^zoKYnMX4lHn>t_LU>30@7@o?2*(Lkp1R_P)IlFN z?XuBrRo=g!eFg?ar5z1l8^8*4AC%53ooY4rp`+WC>2gRt{!AQ2^q)^PV#}w>bCn*K zG#0=mNLL9Fx#c0<731_zubhFwo9*N;8{UzB-o{WpV)H*ZaPfbe8S0-a_J3L=_PM>5u{$@{)+0ICoBbURX^>%z? zTD2}CrI1KgAvHBMRZ1*N<^D=ObB}BK`ugJflG^lfv%H_7g-YFYX5SS^o?s8$&G7A1 z*E5Fw;!@wf9vW4ox-q=4g&zLL`GK;5KI;@m@BtLTsA?0{U(o0YMFzQ2!t5)zG7!NbhrP*tAxF@>?$Qd{~ATzk`4X}&4Q?v(^)GJU8 z5V=_$D{5T+DNvvg7CfV;D-(m4+P58lP|xjEPTPA#_&%fp$~hragldJ@($|hNZNH{& z_44_#v56Rc zgSufBbFi;hjYmD)X~+HnNzMMVk(}nNywsrX{5#k^?3H!jt0hsIhRtkcy^!j#Rl;z* zu;n1D)X;ut6;i9TlcoDucoe6_w*^HCrHTZ#r>Njdyum~h*^M?+(dBpFc3jk4f@iXF z`egH4sSFd3?rzWZZv9P7tTUVnJlmC&97ZUlP0d@x<$B&KkHy*?#QW{Nd)>whUTygU z`1c7$dhDi--<`W9c70#gB^g7!(pa&A6|vEY80to|ReQ2yt8;B%^cmAR@i!U0xt&U& z(YKwlYF`j<_3q*%Jsf)|To318YaHLTntBlKx+*MIgJVN6`8k3H8I+DcA3YT#UVdM9 zUPSMH^|J^DszRKoW9HkY$iOOUW!*XG>Tb>zwGT?(9Mn&Cf`RbD;%ojqTP+4PQ>)B*?pL9?_b7PSq$U9Dy=he$W=aOCS-ZQyZG2CVtD`i7O)LO8NzhgbN0oW9rniY&`Vr zzf(5Rn8W9lEhoLbbNSh^;UAtYpj(s1_L$R{U!8#5!va#NL&>|Z&n(Mr&t62yEHHAI zcu#nbWas1uXNN0(sQVIeUB2GLjX*SBGxDei$PFEru6P6qnrl8*o- ze!m5jz+HEn4uR$JP^sq-a-h&HMifDPw!VPHwaKrZp>cDl8DV1?LULQ!SfxyMR!s8i z-kSpa{+xg(Zc}sHaiN{=J6D&2cwU?;paEl3h{>PfJkS2W9{f>}dJKg)z#ldC&_=jX z%I-`HB#YAq!vouIwfS+9`X} z{0X=+^qst0eXT|B$mg6YmzfaI1Eq2-JCo8oB5yeu!q&Pq7KeVoCjS0n@*r3`!8 z+m{)yz9UU{4zY0k>cU@CEcxU=x?G=kb=}U%_cJmjVC5x-Dahg-v_Be|)`GTIJ)#N3 z7>|m}QEN7uM8vLk=iVG5&JPj9-;f|G-1p@e;n3uLtnoyAk#T6rVlBbkWZiDLP_uAR zXmQKNVCcrT^CQ0w>f&92XB1(Nq+J8PD=!5HODAinl?Xxi&3BL5y9%lSOlKs5NH6vcMV@@N@QTX9)$E>yJZeL& z0FPh=uEg~Fo(abv4R7=J8*ZkO?8_BUHHZ?sxB}<*t1|b#c#B8;_%#2@6uS{|>bm=- zL?&t3kEU3~6nXv6we~F4ovcdJ3$p!z^C`qjXxpTYVYAO<9AEz?+kWBbv3L1zVod!y z0elrdZNy9cbe3IYyU_P10FTNziaps`g7zrRpRT!ZrlTY7UEztN8d7UU`ulz;3+tU0 zgMFe-d1IQ7-R!Wn`#gaXkI?;E{ybC~a%-6E-3Ib@*S}x?F`|6b>UP&5(z*|fK#Rn@ z+&!n%(KAJBaqpHzwuTSQ`7RkAJD2M<&?RBRTas+b8j5;H+T}>^oI4%6&;kdp49ux8 z#qXcSh3gr!`Sk^YCk0fJGfCbQCg#BxhnrTP#T+$AT#r$;9;bTYmj)WeD55K*i2y=L2vh{wx zwLVTGWyR~;3(pjxm_7VOlHN(*0oTS{epMBunEy@UngHFJ|ZdJIebH$7wC?K_BiR|-OBILmmwv>8(U zF}wCwt*-aU@>rf1I$2C2368h=cQe0DPCvgY*kYeX8uZ7RMorp*{sx3+Yvti!}TieI@RIoz$jwc_T`zt$F7Mrk-(#8Bcdq z+}yqqXPr`5&*S^!y8O=66K$(--ja=pX&ivw`mpJ&fmKFbL|)BS6^kO>JId*$0( zeUWPg87av>yWR%7$$M>*0`Eg>EK00Fh+?&9|Osa?F)i^CcC%V0$t3PT~s zTjHAM1D6n>FGv@;Or5Fc%`+$*UEulPwm$vAVyN2dr!>uEakyr1O2j1p;xwpk2Bte% z`+}&9b4hn{U_%&fM_+x-3C=l%=o_8GWkC-LxmfjK(`V*UY>>HJF*}=Ml5F%!rp`t4?;{r;8_(&Vx#_2_GpGW< zUuI5kObuaPpEx&FF(Y|lx0gBsgR;_Z27{;+lWHD`t!;zb@ddkp^5el9or|I-AHSI(z=Gp3@#N=wZIzw40febTcd@m{Y>x+_24f$i8G~X& z@b~|EXMl?Jp!qWzF9xDg+(VH+pRyaj-ls#dp=2b-->umyHlOLToQt>L;aAgZtHS+FzjT!`~s-Jw?soOk$Sg7r-ntFb%*-o^eKGZ|ue8Hy?9QRcneNeTjX zL2l;{XYe4GF0eO8I$B9{+pGBcN*~KD%+?YhD>~F;` z_XJ0oekspEm>s!pcO`pArcqRm%xw^iIeh+d<($)?cY-=pWvkxpaci$SPa0em z?;Wf_8&bFL%ngfS^PA|_&jUEz0tKg+V+FDmm*zF2^C(1$57DrSG)!G^MqQAZDj(Ku z^>wxj@vOY9w3F?O!N?w0*dQF;s>gn8xobv?xz#X74)dHHQC>W1RY~rWIfDnD_8ify z`O4F|L&?ad`T8O$>wZ7+p`mnb1gT%cxz7vlKb5@8T}yV*`vbyk6QAi~QMUDTD#dFv zZ|ui13pX(+N3p-g*DIXoZRcPa1Alr`!97;Rk^C5TGrvaDB&7i+7S8efW9wZv=Wd+2 zCUh#ZP|L`oKd)?fvZu51J;{!u#>0_dw{r+;s!`!LYvg9U_t)?C-=D$?*jw#`2Fpo= zF_+Iocb_MDBBn|sGs+q5zIf+*FP{ak%g)?TC1QEa(&(#mjvMa2O}?S#eXH$CQ$06* zE+R*%F9j3n=a`SOc%ysh_Jpa?)M2z+iPs_zqHN*DQ~!}Nvp|o{T>lhlpN~1lx)0Y5 zFZu+Em(Ch^w4gNW>;2Y$?L#vR0Oe7pc0r!xFU%s$V+wZH{JVY&gK}w&2e3a*ZXufzQA)pHh*}D&Lh;>exL4rj+6lkif%D=+wN5YL9 z-r9^khnqe6bj=}Sk}%=6WrewAW?8lSk8$+~(FXYqlw5-^IDyKOtZ zN`^kyysruk<$l5L;#hLmt#+Sf4Ic@mHRI-C-$kVueNEQyS#IsEPR-T5DCxFW;*^wu z($UPTo7bFcIT%hhMjjb|uQ#W0S@^~EI7OkpcZZ{v=es7Zm{#TMq zxQ*S5B(Iv3vp)_pa4`q#Kmp{otiv&L_h>nqg{PQQtyO7mnAcx2^f74k_9n}`$wXyl z>RL4HMIvtB`&tvu9T;P{uOW*c90Zf{ts$8b!yo(mD4fyplkO(rg@`-Ij z2>0QVWFjWttGz2=rt`h!UN5d&@BDo93v#|h@?Ltj9$~Y9U^tj#j0%>q_q=qmIwD*^ zqjG!WanI?JwYn#K>Mm&}n?$i_A*;;#Da#nM1yfzr?YNJYLvG(6rEXVl7|S`Rbwm{z zigaSy18jZr%7k0tMWr(AF;e&RT3f!!q4oC-;HNuQYxpSn{X3_c`O+tj?Bb?h21w=$ zK3QF;npguIcTPx!IjYI2!n}l2^hsBxXw5GkzZBseIL|B0f4KXpp3zO#pFx2ju)>yO zJjrXg5aw!??iyjw{)mcJM0cJ2h#x3T_dIM;1-b4nKFc=dn#IePR(BKP#YP=~<*q9|$?wRci`1W~hQ>>xx@Ga`0MMD8=6@ArHCe%HMokL$1dzWn1KJR*6&&-ZyA z$MZN|zO74@S}8D4;&9ea_WAs!bng>yxCMs|z6iwl`6IlAKvl|uDjF&y$yTi`SU^A$ zb-HVq`@V)oOvpCP%F>uWAa-tu+bPS{N|dneK?~+Yg!4yWX((v4(|4v0}uAqmkJf0 z(pIwZR|2TVTWvelyj@4@ODbDw{yWP)%@V&Ur_mCtG%4?AL#cPZh&j#KNRdh^rY`35 zw>2G>{|y)J@;+EO+sQ7JLb~#%P0t}~keQS9L5HZiYuaSh+9~1Sk{#VUv&{EUGqXUMMt=ExzlV*s#7jHjYy(-03&z}+XWC~r+R%9_; z>k#zYso0tJHE4>wSq0xp`ZdxmRiGRB0<<*Lw&E52k2i@HbcVIhtP-oAx%gT7rf9SbJA+Trc9PCrdl8Puu;@;=wjoFJZ~3d&|U|7k9o0b)i(wRJ#*UD+m8tDOy_ zvTw%cp?^jTadY!2qfTagf$gROQ%)wF7D;(^LGKKfkL~gttRr$7e}=iyh&;$;4n5D| z2y9><2PI|^M{E@z+H#3MLL{6!S!gsM5rpoloPDMj76Wxrt@N-G1lKX4K4ii>*tTa7?u+4)>E+K>f71i=AwmlLUXW% zh1$JQV_~;=1=qFDj~t!&q-i)(%q6ed2X=$6d;AF#Q5+caXvfG;F|qbTn*4F!cBeeV zeK#&54#Ne^%sB3SM@A$Ty$``;n9BO8yX8iop8w?!Jch~2`-gVsTVtB@wc%} zfvN1V&lP(LmwZ8u23hQa_NgNv?`%`TeLy1)kZ?53&Gct)+`sUN11K(e@zBfhcXT`Y zAYjI@s>D)qNYyuSFUQy$&JT(}p)YgJl$$b(1OeY_(@{(8_a}QvTy{_e=JW5xx{*V- z6ivfzJGq?!dnd4p>oNZg6##diE6>XW-vVrCim)NNn&0V)kjdI&&!`tyTewyzJCjJP z+E$xpMP6ONX?nJ6_b-g?<#R|))xyyhN618T^`VAl7e7K8AWKON_KRfo=;%GXNA~d# zlVyPj+zMPc}0ZSx;T9HO4k0Jz2%+|(NcdBB*Yc*;eRX=s*IOnP(5k+q`?4y~8+sRsms9rwzk05Il;v7?>kQbNSgI}LR`>{q zYlmGPrfCbAzY&7r@I}blYCGw9QHDS^mk~5JRaU(GeSve4f^N z%9N4vzwG5UVG|&ZX$tzc4tZ7Xe3y7VK7b7(L4s8}at)SJ zOrM|C6T3b{;Z;rWRD2aOOb-Fp_j<5)p8x9CF6W0*`bB`P{BZSj+ZP}#4O^pOX|Ri8 z-zA6WE`Q26ts{G@HT0^%UG<)O4H+OwQ2a}FGAnYTXlju1*s7S$J>v46Rl2CEbZAl4q1reT%LTk)x{Tk{ zZHX=wuy#f+^e_$Gh?Nfx>WLReA z5vJVMaF7Ous%yMWQGucG?m!X(f-~?3S`-;clQX(`kzrK(hkA0kkoadViT--*L^}wB z%~?m!y&Vc-;`>~ajFQ96rAslcR&{du_ktkqybG_KMen!$5`T+aM`jk?(KENe1ae`0PYp$jag`zpMZ zmo&V)csEPCqIvY2o#gfIttgB`E+*JZYM&KCpjxazfA zM5>}$Cp>)dIPJN5$;qd*HzXVV-_jX}TwtB67TY)?F-55jvpHbZA;<*KvGh!=ZU+6& z_4UaBh|06ueXH7VXAa%bUtkVBflk<~6jxtpfj7Z41tNSPTx_o-CX>F5C0#K|DoR)H zP8H|~*@Maqb$=CfqV8Qe;zERBI(4zZQ=?|;Q`L}SQ(;**3Q(RjuXcF;-8envH=x)$ z;Y7|Zr8JVK>PGCUU1s`sk969N;_{x8#ojEh)WB|db4#WVhg3PDHI}tYyIu5SZ`~5~ z!#<5*F|KkdHhDmR;@p+(B=qX}YnYk%{Wtll#BPiX7FAi`g2cMUcvQlOI$Qwk^` zAw^gV4SjIV{#!afOYGnmVM{sx)xt0##iAR1mwS;LoGg~#Is=_m1@(_z3uN0<{3$Kj zMe9xLS>?^IS1{nF&#ISWuPw03kd{Z;_2DU!;SygvCLCjmZaP{OAOSPO#FoVoZ2H2T@_m!L5-bI2eW{|6rXPy{Atf$g<~LWmItJBh*0D{ zRV}2u+CKEh-eO%NO&W3BM4uDqR!_uc-$_X-eMe6(U!?E};3V}{kE_z6;Iq1j9r61+ND7>qJTM@hfhus&Q`IK>HU$|y-rfPL zRx{cfXehYQ^oy%^*QYx*r15&ef)P@DKxw+e>4_if>rN0@IywTA67Tjn7@K9T4Q8Pl z5dJ>wd(EyaT$gW+uoSrJT(f@XOsY zpp4R=t=QNW3K**i4bQ<`yO&dUnT>V_JFKvLU&peiB=D3Q*p;>Z^UMj9R|(`8oR(M~LtErp)v))*PtZLddpv3!vvXM%dIl&W^5#auf{T&C5f^CBDr{1@uD@ST= ziZ4$F9_)B;|17>gpvVxpmw3GMLfJhVQ27(K+mIhxT#zCj7_!jqWv_RUMwtaTrgOF< zzE>Z}{yO&i8J&rIAka;Pnw_pz&)Ck+#0KOy57mGGUn(J3y z@vJg|>0i>$XBHxay7AD46A!&Vg#xcNyF(GU&%f`{zHJ29W2fzL!`6#^-^7OLR}2u| zX*MDZH{bNG_(q3fw7C!tybylUc1TF zJos4V{5q1Q}e2C z^#f`o8(3H>at|gUj-bcoThfp8{>OL|G05ad;d)gobDvzuxqdZA`fr~7KwGqRn#@sY zkuxkb>*56S$$^4(I=J+g_-i8<2~j6D{S!r%0m4*Z0+av3d_kJp=z97>j>W}Ne|L;{ z4etTRshL(?Ccbf$JY@~;w_IZi9^_yMYavq956sE)S>j7kvbkf-Mtbv$@73#^oY0F54{n(YM}KCGTRuQ5qQ`!| zKTWRs5<>k~tN!fQ(V~wF&0Pj!JS5lp8$FZUXUguO3ScLn; z%7jKugm6EESM{qWj^F0N!R(;LVrgZXTL-K2M9daAxl9CFgxn+KCYtnrlO*RVhlsoa z38No3pGKGfI{|#QUq(Qp0z81G_u5%3jrO+7O+jSu(C~tG<}k1a??C?Iboyq2zOHudph(Q`Lipt?BEnvmTc%G_D7~7WGhF-zygPbrkckR8B^t5(i_3iQ@ZBPg7D7K$8#*8 zBw}K1eSNwVK#ATfxrue#aL=RaQcOt^u@NlMyf^Uh#AnLr{ zSjge=0}p(BBg7t_$()+saqBE5C=tg&#Uln%Q&nbaGBp?U;2%56wdHKJ6&XrZT_D8M zh*CfhB#cVuRiNZLr9&4Ot8-O9f&Wo<)~KpPVV}->#Wpc_zb0gdo0E|tEL7zZgG~=e zP?g$*?!jU-XInnvL)cv^0p3wh*aA&gm26^8lgW1J4&ZUrNF;GugAThgW?}7?U}DTB ziGaiaYQoW_scg#pmU2q>@g^zX0T|*4>T{P>AKLxOtIy0IA_kbGRBnqsy0(;76#<$@ zd2_bcqx`{z3UiF_b_0HFG>Mv0&W(v=C%!ZT6`}J@f9K8xcg0k={(M&p4pAK-p7hhw z{f~X>Wc3~wjm{82H)=u7qC*Ta!~+AJq;6b6e={lFH^SeBe>5TbdW+5ry_uhxZTkeC zj}p!U-`~0kIy-Pu?dwkR-}z`ah%-VA2CkU)!0kSXBNI0_Of|%#tlA|*Ze4b^rG{HA z;cghX+cW$@VchRWW^p*UPevw+&U~y+H~)hz6)^CTnRMPr9&~=dn41dbMZ#*?MvL3= z(-obTY-yEiHn$t$pnBL15EW7-e@h{9GEh&m!dTupDtHp?U^eA~Bwz8N1QOes>+@a! z#hiK0q`H=O6|d}nVaBLwDscVp<~$<@2JlLAVD*i6lrqN*?zJFUAZnPqI<;C;fC5`f zpmm^3Ryo$sBnP>4O@Oz=RC7rz#pXhF+T_vd!JRMi86^2B(9!d!>2#V4IppTT&#xWN z@DiVFLVcgfe11i0YyI^pG`STt6HU9=PuF`L#r}HNur+u)_*@W4S%3?M=PVULajPut z`HpK|uTa%AIYuKAr+&ZfppztD4R1Q=2F2Yk^V6Y4$jda=iO}1iD}C_j?>vM5R@W^v zH7%M?Vr=j3mr|hyQ*cj=mKgW!{vH0r4l0L#$RwIsFQxgUBNL3l@K$`d0PF_{_t$#0 zd~{KE94!Lgpm(xA=fE?d0ea<6n(7Hlhk2*Q z+@1~qcPt`3j6#~B9Oe$H^vIoRXb8nkp zGhm;!B^8m_mXkJG5mec?5^-YZnh3|5^BDPkD` zU7X}x;214|dGaMNyW)OJ9sw*A+(AT3#8!9lA+K@<)PH)oB7Zu-!vn484NAt31b!8K z3Tqq<^2>0#Ef16|+V+Xh+IY-sB^AYb z2j{|D8NMy_aeCQMF$t8`Jqm0Ql>#j3mTwl&<^7_X8E^RMj%co>#jHudKX?&>YE0p# zH8AJo#dMul_4>sLDvMu-f*i)HaBLFp1Qlmk^$U3gG=kDZ8v3Sk`i%nU!4MQQsh#Cm zLS+zypC>Oq9yyH2+`h27zXOnY{c?foI~{jI_%$qo&23nSqIxMI{Ceto4I@sE%|@>U zLd`etdHR9MifNfInHV2jiHU8gX_dR17G~_*2cZ6Fi1(j(RI4dRZtIsLt%=ez<+peh zLh)7W!OQ{0-z^;OxBqH}1IsexH(;Uc+A?pn*2J;Vv-o9Mc75O1)!%g8w@pMKPp~bD zSsopFZ!{kx?Zjyw=60Q%e#H}>@AxvMRa#EpH@AIuEj#3u#ZiYlqQXf+dcHSjNxc>C zcmZ=qmye`&b2w0`HFL316pm~&vv@J}_v{!b*fLSybIv% zf7PPt^E@{%-smIXWE6}7e-m99zG88ovOWMex$$u0y2L@I%PB=k~@8wCj1yQ z_)F*o`wPJkOAP&1^Q@oS**$I}IG8m6hMY0dJ_wE+dD=}XzAN(3V9@LEcY*d<+X55i zecyPOki{Oa^HLo^Yr;@zwLMcDb$5hEc1tZhOYB=UQ?uXy(EmJ|bJ|?;9d-uPo`1S; z)0Z+jR%9FT0X66$crHh8@z^y&)^o6Uze>Er|4Zza7Vsex>2rmyz6M4^D=o0Kn_Tn=n3PRzpA^SJ% z%9Gc0aiIUTc$}qF!eQtMyXZzxVi$*~?~h%sd(FIGfKI(^QgPx@rQQ$E9zlx`xT{sF zl&yQ4y47uF@1j}Mcv-X&kaW#Tbgp%$N!Q43{klpZ+)xo&M1Wn+?wl`RY9LE6VySZ@ z^hn?pm>5}cmZ`%O%qcKe@AHO=*F=J@r*TjKId$lN@EIH=5lIIv=TIbqCoWzvuMim$9F$OpZ_k zMMgd!!%~Xzv!TiuDl@S7PXDKG!843X6x|N9+V(<^%LJJ-8AJf85-l2=`z48HM4#LG z%>~Wt>@HlfOb)5DmHjr+QB?~)3C7aGebAq@EPvroZk3V>{NzDbowdZYXB+_FVR|3Q?;*gz*0=7>cIM0&%qvAsSHD;7 z&;smfl)y6Fu*M>GX146&&NTzL44zv=eD22PhU-O!Y#^16kN9Tq3)a+L8k6$0C-4`% zSH)=YbL;tKcGK$z6_m@y^A@RV&)}Nh5)rCc45rEhK3bqX+|$|gg24~f%ANw6VLQf3 z&7CTiddo(gu;3M%PJYQ$#Dh(xJGu!ASDwB3bn0N!Bgf|lzzChvqeB8xW+ zPTUIAK>Cv~z~}kXt*YP8YN7&L;!gy)m0^iZzJ?G3TuFbDQiqlN!fhS#wjkPK1Gm z#xp{3(v#&dBuT!{gQqaUGek%DZZlHhDxv?@+t2LDxtBq3buap9q76n&3{TN zP}QA{ZT*VbT-AKfQ|q5BzBzWnERT}*<78flaymMZ_IIC74rZ-6SSJ>qOKCmlDn7L!l=2uPwbbQvjkPZ^>tT&58TLv!V3Rl!3 zxwVgBk(cPac!$JKsInK=MDlkQ=_AINvoumpO)}n&d=B=fF`c;74 z4VgZmr$(}ayE3uTlXklgb!-Pf1aL~0C)XqOTA-zXK@)!3KZFNC=t@(}-4tuvz`<{= zi|rnf5Nr5&0Wxw(i731Kl}#?7);wsR*#M!zL5Ww?bF}~jzA5O&F8+LedCK0Bs!6h) z&(|M#AheUoY3z`RZQ=i|)S)cH!x_TO$*CaonLgY<`ZEWv`{bxVE!a{5JS)H_@|2!Z z!Ina4_LgEizVPmS`)gU@a}@u5W)OC7^ncEbHL3Q-BUGSylr^#t!iSJPAYJk3?K=Z> z#78zag>3z0GPK}v{niR-Kk(E&sh%z(W<_F!~z>N&=rquCDTlXP|$9x>u;iHj--bds{~?6Xo$3)c1E} zCPKO>81!Cjj);;KbF*$~((rZ6!kKLhsR{FbRr@q&>2AwOL-YG@0(cBPjUORmF*9mY zLY`sYfL+{9Prox1A*`eyqm!vXD{N!dM-fO5Ii-6_xpnZP&Rn%?Ov{mF;qZV1XvEqU zsS7(tJK|pc=GYxPnA)~%Dxvs#beh%C!>Wv!gW00>J{!}w*eEf9c zV8#iw(N=>}gnFYii$aKQWS;114F4~x`<$z(S!0?aQ3J?>Uj291=qF*snAy9qa zp510pR?EKcpvQ;benVQXIga(iPwr~qmhhCpT9zEo3;LgmRXaB4JLLc+SnT=k5RP)%DzFj#a6?J+bHDU;2Yf3v*>U*IG6N(-a({E6U7YOiU}nkcLzgP zD>_N(SN&>i40c-NjUWy?N$#^8W-yR(Y*lVwunkacu3wtCuhS&f$ z_fH=ES?V5%h9=4-Iq#j!_bY+jy}f~WFX3#9wh(%DN0c1tGsSW1>x3a6F6O=sxF)2$ z91(Qh^olGR+p3_^tcN1t#peF}tXALI%ab?vQ{K@|H8eZ=m7XtU^k*^uilL{yyxzv7 zp{}QWl4ek6O)EM&V1H`@fNtFVb$REBAZ>)Qog4jq``cVPT_Lz1mqlvcUXv8^q@|51 z(D${U(s`QzMSmdv7?is8%{PmDgmDpy<8T#3+|uye4i$T?HM0tJGfwuTdB#8=0S-O3 z7|7A1wLw=X!__X6?HxW?IM;ypv8##M90MjOCJuZKiVful0gdkb?m zmopw9hpyZZ^)x9#?b#guN0&V)`%5!Vm<=-Zl31{cw{sz<-f2hcJc*D%lRn6{CmZG^0R;9woC~i5!cG znUvJ~xndJ7?_6p+<7nDAgK8!bYCs)@u_2*GyHUx@@I^X#YVByUYq-%sw*Q@K(uBt% zbU!}%&INh%>erGICZk#H5oW?g-{-V3I#!g~GtiEYaw7;qK~dVTbTPaB1BBz9EMQl2 zPqIyM&gxa3#%-WrHVR1S*~EcFmr0^@{gd8Xp}G@ki}grwnp*2%PpR8)7h8D3U^c_$}4B!2wo5l@W< zEJDaV%~uW^Y|kdq{&8bV-Ta(gx>ugl)ypPPU%pj-?Nf?i)W+B$=|UwNe(&EC6yor2+oA0`|rF2=6T4e9_d9Pa|ipNh^jVsyj<({moO*@7pin zlw->hN%9f-PS$O20Xpd#Sh02zIk&po8PLn%jO| zl-DP~rMz%_f4Gm%ajjz^T!ED+@UN{0u{>qELmCMv3pReQPn?W&L zs^k1svA+%@1)220zmG|vn?gtgY&L@3StgcAQ`JAl3AlKS@hl;73jPLml7i&Odr@uT zQ8|?feR-kX$_LZ_E^XV_dL_9YvQeLW*KK}P0vMq;W^t4bwGoPGf~2y08+m*{C6iL< zw;2(tJcb)0Tiw6%5=EjWPut#m|Jia`Q4l@)&KwuG*}k;*{6qI4m~`D*_4(AB*4)`{ zy`-G|{V||mAw{tc`Dw4fIW-E$o0WcbR_}NIm0jTV;uh(oQ$*)FKu3A$v??8m)f)aG#D)2t3| z3UP=61orZY2rOm3BeKRHy60&NmGt0=baTkPbJmjscgf<_RT*KA3p;b_mC6r~eWo(c#;iW{+bebN?R9l2T&R5Jtd(!e74j~roQ{~7iW3$VFkO+t&P5#nfe>yTL2a*(En}{ zRh-2K`aL1SUqwRM%AJ8wdx!6UBSk#-o?$ib11HuE3-g~n==K87(t))2na~o zSeW%LA{l4=vwSys_;{1{AkG>KI|j`;#A}WP`t+TCi^+Dzcq!!? zccu8xXmg)NL8E&!pi%bg>-PDw?{z9-5}V-7D#=c)e&O6d&$PL5@tM^oU6A|Y+N>Fibxl&1 zaz4+4cLp=9dRol`+&Cp@ALs0f#07_d59FTR+?^l__^5Az(Dw7()lr@L` zZLM$*cz@8S7@tnVLo?-y*W$d6BRLO?Ne1@4r)X%(mj31SIHCK~#y}ygKe-D1n(E3_ zB{mQJcws}991vAbSu9}Wg)V_?TcR-q8$`kTP<2$bfl{-w7T)@!1ClTm3&aC$-i?`1 z#*Ip&rGljsd0V+6s$$=&LM_SMc*B$ z40*d5>BLI;o&=%o zpwq2u^JEeviRgcZ|5RKYm`C|7#K-{t>!y`Ma38U-WtFLs@U#=o>GJkZl%&}YNbaSb zz)&s%tKGMikijuo?=m8Xy^*fDq7((-uI10K%KzjH^en+iiog7&RXp?kaa*|PG$uYn z1#jfGbBTe;CC>M1G}U3?J?I1B>cNiBe&b^>b0^Dy{f|AkRVgU6<2=hb=@~cW7O$L! zWq<7MT41Kd+SDItlt4!D4BjpyXt4#jc0T_mCYS{ojnJ6IkHd6i`=>sg z3vW!}(?JTiXHLMIR;x2>^L)u$6mkZ;)pPD!%QZza15=V7X0$$9A^TY@i9p$QVe$2I zfC%dtKYCQAUbX_9Lf1{Rh4=${oR6&E)=RXhX=8B}WfphaBI?@xskBxQJgZTSpJyM) z|0*12E>9<9B98_opt}fn#W^7jNR3bMX%hh0t539;J7-J^KN_dSzR+!O{7q zzWSX@CE>aU3qymvt+}IdwK! zf#yu24sD&iTl>OcBz)8<(ME~p&Ql}LbFp-rm)ZTNJff>0m@y5|UZ7V~ zvDC_7KAT6!1;o)So0%=->(2a<1(mrWDS9#n43D47-gh1N{$bW=XeZ%Wp`LnvzU!=P!c>hG&z{AsDJg2Af>xU7(u2M z?+IMxl(f!azHKx>`S2&#lk0q<*~c&aI6&S`Hy$b>2TiU|zAJr!>EiI%v~I_%5+tta zoq&Q^lMVNwp`W(tMft_S-fgj%%CBDE-R$dY%(Zs0^(2 zuZd)rzcH%%`OmdN{L7PIOmelAVkk(lb=KDj9cw!^XQcz!FY2!}h_qj$vPq9j9M+X~ zgU&DhkTp|wlxF>jmGz&hluwywe6)6*lkX`Yu)w&4-Uv?W57U^TP;!m_6Cj-AY+gUL zB24>cT=CyO5&1t?l)U)lMg4_;ef{sySTg(JVKn7XzRGQ0iSj?n^1;hjiN9++6zuIQ zqW<6EEgEGe#ghNukzW6c9Mpe49`FJGU(vMmcNswkU6a*yebf#F;rk@u43}C=OHnyL zKpte`^>17Di$kVBF9=P}tHG9!Z5sdly`kUl8RUK#2$~wrDxi%J7?&ErQMCv2dc|}r zMJG1+<&a0*mVG_Vlw-T&bTRAT1dGp0b*}7Bld5yKe<_6U##aK*e)9Lv_iF&I09Xx; zNVvN0W7rerpU3x^WQ+7*FIz+9Ur;R`^VoJ_JEkeT5s=VRP+kQT=J=Kdn_;YPLaoeexVi z-engz>V+Ac&trG_!7PAv&$#3aT)wjzh06IF9B~1!DlsEX>M0NJTgj%KU>;LXl^SjI zuFab0bp7cUmUmHq#h3ZEeu)+q?~y!|JGFmE^?>;w6K?X6WSCcXfj99%jzxZxE3&LqrXrlk?rm zB~#_YXytlwkR9V2+=VNH21B!_wj~2)SPVQPklZIRR^uWMo{RMqx+t+}Cd%%d!(FYr z^wv%ngLPHkzdQxDnu%nxPX{GP;$NIt%4#4JjYz8c==;ONZ4^=DC2^wQG*=~vJ=q$X zxqa-pUV~^X#m^vTEYHzcw}MTlQ-vLJ6`YyMmO{CLE2-$_BsK`4#uXw*$8u*59zOye zjsPi2GXRrQr5C>HzQ%%zbo1%@`tCQ6-=D^$nIk4cxz@euW5ivsYe<2@4LsrRR|9J($MKFemLSW2Xa^3P7Po-}>56yN2wpC^323f9FS||DF-SLY67lDSLX6 zI&FbkcOqs#FaW9`!6Hdt0frJx0@HK+8Nr3QKUcq!bk%vk+_u^oZ$g3pDZHf%CRRfh z!sER?winm^od(Nui$BzF_X~x|DWWjd4mKbx?T)*^CD#Jx+*n7;NsTE*2i>;*XzCt| zk=MUVzZvB*K9Feu<`?)hRmr(7?UNG=Y{w}}co7`L{W_#_{M$--b~WvLD@Ub6t>>@;sN?6TOA>RjFX&|*5)P%^DlW+S+-*Cm1_4xGJgrW^l`7kN23fms&+B>amXCI~hC zwf5hSH^di)F*VN2CLig%yaKixRn!nXXkwlll4tF!!3H}0`tnm~dIKPJe?bdOh%f6W z^-M5`)y)ex61DxV4#|Uc@>uF%7B&!F2jcG`?;sVepKtgah4FrbK`;3xi~qCa#0wjW zJI{yE17`D~Ot^8pfc|GH%V^feHabtOKmrERJEJRXGf~RtSngi;KK^X%|Bi6Fm2*0E zCO~&eVkTf7&dfqhnz1+m-)$btBorVGnyO=KL2j{b2@F=e&?Z)Q1SPT_lnmIWfozKr zA25)-Iid$em;Nzx= zWzN%5HR_dzvxC{gJM3U-*r@}9Q9rTE2bpErP**E6u$t)fah*iwZV;YghQuQ-3tc8s zH(Ry`W`RKf^PF~DAtrpICUti!X9ll1{lJgx8KO1c9_~+3W-9In>Bz)pkc-M-Vc zEI-YxeCAlRW>6!m@4@_ZUX8`ZjWSMS*S#lGP~D4W5?0gerkl=qO0&2Bek(c|3W z@-U8nfX>{a$;?=S;pOt)v{bQyG0vcLYARu}dXeWFXp$+XwWhha9;Yc^1~5#FySZl! zlE;hRj76;c@;~eoGhe31Fem^M-UCpgDd;zymIB~mTnZKW)z}eW6%8)p=M+M&xf6XJ zwSow2#taxN* zlSg;VgJX!MLoWPZqxJ!E;oZu}UmE;y%Et>ZP|8N{Ednj}>6pzHviMnBS7cCN>?|0T z{wFZh?=ZJBqD$=FN0i8-)wVB()r#&N` zE*!nU1}|74e2|#-jz^+6`^gVrd&Tpoeb=l}$8= z_KVruG)gSwF*J}}@4CgE5U1>K(K1?Uhyoee*MJW!2dwNQXi2NLWrT9>upe6}-h zrlNaCF%g%d9Sl)&mMc_>WJe_Q1vaMIYx#cPU0)e&rNZvTU_Q4g zJU8)b8tCrdgHcU`4X>!i{-lXqOnd5y;V) zbHXwNB1Mi^$bcv!9`KDtbnY z7TTAzuIW8a1Kg9vr~l49tw{Ba?rpSYQx!aqZA6Hn!jnl2cfId$qZDDwpq_Q&FTKZe z`%9KDmcIGJNYY>VU+5WaN6Modcw(wqHE=R}%SIB&*9Z(|0yH80Mlz;Vu4h9fG}5Hn zo$FWl(AgrgRGx{hMlC^RL|W&aYK9h@%G1W2kzx^@W8lP2R)Y;KAqYs1&O`mL+v_32 z_X}wRgO83M#rhsV#GFUQA<_je&+qn26KXv`xUrE3*=loRS+c|f9{8j~>0e73=bTkX zUI%-hOI^G9X%4AMpU6jgbzVFrmPi0(e0E8KJuE11N^gWBx(DSOQ4!u8`UlvF+=w*j zs)G<0EObx1M-+)%8!u~>@>&1Ge*k=Yr`FKuA3*Ix{1vKSA2n9q-*6l)#%x^TE&)T( z)@zZ(xt-iZ3rFH~Ff!H0(l&>R%aL?SO~i;t+)w>{BH6NVk0U=RIC!E!0fNa}P=cdZ z_|@h&3R@*QfSExa9S&1dTf5twx6(Yz!JxN+z))pf(V5WOudslkB2GKX`J|!#15wef z?mWC=%U`dVpIag|x$RynM_GHoF8;bezeH~WVv3xg7F^}2r@say0lN5wIkf%9Y``zLFD< zptn!tq;mm)=^T0kdn5C5w&*|n51bfXGxs+qj-Rl(GMRU;KKX`8!1OZ{{9Q96nN!epbH3? zU|k&kJKO{gI@Z+QYhJZ0i0)r+noi@@K%%3>H;nOUXt|J>6m%{#x^mB1+r=s^_+`Mq zc4&TJfA+nW2(ptfYa>~OR56J4xhuUs=;c|R?9ZS>xi)|Zx|Al&eWvl<2cWorrTdH+ z|5H(1z+8J5*sd7kC%x9d-kfQxnJGPGnXLf{+9uc8v=uK#G7eT43KQ$MhN(R1Is%Z< z@{UPc>jMh48_>Gr1zYBC9>TuDtVLm%Ub-&vP1QGA2ch%n{^cMIAroy#ZBd zrBB?fK^O*hLw&iDy=(B(`P~LGefKTTem>1)YtT{yc4zrd*V2M`o{$0y0&KT(!i2o# zMD_+h5DX|d!f^S^%^F|dsHe%Q?zW@zw`AgT?A$7scx87;wewLz&fSk7q{jq6Bcpho zSDQiB!UT>DoRYh6P4t&o({Sa@pQ3!=zIpq#ySydWE`x@K)ikf@Is@dAC5R;vI!1pU z?J?GaiNMuPu(}RQ+^->eFK~tv%H*)P{@s>pQWVQjz*z%74IWQ^6(cu=_4>cnHISoF z1IL?V@{C5nOyg7u!tTq^d*`f;bFSvTyU)8Pmh;Lt;x_<#dxcc^6t#PM-U!59sofDN zO+~|+q%znK?zv_rIy8ZE-CFa{6EIgbQJDs%xif-ahnJT6{8fq?EoiQPuhU`%Sd&!< zozlpeXRS`4_DfdVDvhr8ija{#=oYL53gdy=ya2N(11{-4gDGg+Hsk%mpQv{x$AUG2 zMQ{uKIdRInr4XG4y>{2QVH}7wIBPFxZuN8KE4#J%`Nh|D;lR<<_%Eo5hvR>OnhLLc z$a{$yD;?YI7xD)50MBFsov;2rua6gQHAGx5`U~eYp&Agd^(195e2Lq@BG;CpcP#f` zoDfRf zdK4&1(;IfS=Q*pt7b=B<|B>HVNCdUDD(t=-X9t70ioWRESpA7pQ;AP7$9_BxEH=%r7I<>v&CbAvA4peK18#}OaRUCXEs|Zrw=B;&>tStwg!FK}CV2DL z-5Y7&4T_1{rG~&pE?))~|2A49NIG*QTSt*nX!vWSaF}t|Nbgv_^*T_sQVUx6ztZKj z_~+zQ_PyCtR+KAxSMofydT-|e$_NZWgmmnzz!>kC46e@?=BF)&tmwP6kWODvt@_R{ z$xk!pEz0Bg(+LDEAH3q3NZ?0;WoDIsR^W#AP}=}$R`S0zA|r|QQBo2H7ERBTY5zVnBIDoV#tN(zbbmuAE46% zy3Y@tkC`Ojrbx8jw)>wiWb`Rgw=z(PX}G^*)o z2atEsm?^YH%`xIMa48^Fpo%msNmC;-?|x6ZEFx9ohU8$$HaL^k1$dLZYi{uyjwoic z77U`Oh!Vf`sLgI+KA({wA($S?A(iqD)`w|G%A2tUF{=u&VXNm{SXto>uKkLF8yDyG zpn-|iC8(>3^D!uOXI?6Nj=15sWws{8`Egk9s?@ESfIv^^iV|3R=PcuU*{r22*A(Bm zN9{bEwB;}2LEB&Nia+r&Q6KEthq&!v--M!0d48)$A#6|yeU@yRr2GzZB$-XV%HjVg z@65xg-rs(&+G?jX$u2`wLJ>BZGFCDtgk-KH^D-_Ot=bY<0{aZ;a-}U+2_v`(73*vOorW9n`PWN+CUHcrF zVPPV4EBwUs>wc*>8^as2eUtqtGy+Z|N9h@VDR>;H|2q|x{3~6ZtiOmTWR^sEy`s)> zS%U42A=i5i4$So(G)5#y;0z-DTZO6-6Nx=%C4Ke=FYHZDQI0IT0iK_~p{QdSe?n0- zM^_Cy0E%*%U5MhSIiv3JR@^1TscQK)F6m~yfkj!L+5k-3m?d041YbLeTrZvQZP8b% zO$`L`w?abF)RR7AUfRJ>cek@!78{!O&c1-DPN&`oY`(;szGeVe_$L1eMOl`ODQIpa zG{u^0q*aukV)a-^xKJ;-zx$Zg=to7wq)2uJX(_=gz1Ct~za(*QZP9#uh+dTnt`ghZ zqFwfAS^#IPzI@su{ZnC8n{qJC{7i37)JxM2uQX>qtvzwo+^dXQCf%vQOxCM2F4?yU z74xSl+t&Ev)yjDm7Vnc-!Igqkc_0aGVi+5q-6>CEtWCZU;}l^^ zav@a(HqkxxpP<#Qr{DS9@WSn5ocp{Rw{CWNGoDy+I5t!-*c-Wvkzr=oOz}pQmReiF z{$>O-W~>r?R}i-@z$cZ?-we_r1NKy|Rt;<~d&-iZ0&Q|gvRQTLwa6}kyGd_~A~TZV zT+1^#UURIam_t74@*yhQ?ZAFibG-LjG-dXsr{QCc99U95Y7Q65LafwpIWK?d^OX{O zXOK69%x(kgY!f5}_Ixu-S4;5WzSX(yVL9xHGh!qO^6j%jtV40aTpowg_DUD0x4D}e z;!aPSZ6eOt)_48A@2|@sj?A|jDw6Jk-=qAV{qo0(+6#?62@m5Q#xqOUerO532Wrf~ ziB!6rTtgA>-9`VJ3zt?q!y-!9Y^pX=nS4q#(prVh7LI9`AN!N5LVG^D!)V_C49$AK zemSpwb0XofMW^nE(=AelATd8EbJ|~8@LkS4Cvs^Z-puS)8yR}z&stJU?5$wQoXLsl z^|{=#XFW9PHlLQ*VqR2Y+pV@;YQdIQG#*azk}*~LwHnhq^btKKOKn~Vh2B6u#($~q zkVDy!mFVuVqk#0LdQ$eno88D_`ZE_=qkqv>G8zZEKd?t&>Q$v~d&B|)8qFJ@?cr#j zXdv$(V&pcib-bCr=U2sL|K}J_p?HFXh-R5T@%jNz)^7vybiQ$wg4s-aLtQE>WQ z9RU+%Nhz)g<)2I4^A|Mux>B)G5qmyda zugdAlZh4w<9n|V3p}nIhtul^B*V$s1?N~8p&6>AYyp%K5LQ3G3P}4=ZA&6t7qDpv( z@sUXXrL)~8q5jx(xgVV}H!Tq}f*8_m0N+}R;z(ItGKl3HMU&hQX4G3}&;X( zw0knXKE4kR)wS9Kq%H3~A4b$)Xk=@A)tG$+^TGytRF?LmvKzRQ_KP-);h%U}_6s`3 zq4BYhS38@48MfJ`(Je=pIq&VLTCU=H&nQ126|A)fL z{HpNWY)yTcdH;`>#G_<%VFVoebLhF&h>V8EG{T`A7+s-aR%PaOwL_=5}R?t`IKZf+JTjDCY*v)u9ydRMIJsF{jS_ zI_fOg{Y`FJ$sgPE1t=;mEw0$_ZprVvkwT+YdyB~nlo$8Op@fIyf(uKQBmFaq)%NgfPr$^Qs{5c!+|S0 z;jyNAcfO4Ovl~x})IRIwENJe*%)u__qt=CKe)Nh=Z-S?|$S={o*m5@q+^fnhf=ho= zXowS0Vt3sbf^{~yQ97y+VUri)jnm85xQ?IdGmI6NX5vWdRE)WiN64H+iTs= z4mu;&NC(fN@s_u^B{YL)vF*`^DWlUeM?>tR&rk*U(cEw+&rGA~xI!+bUP4lxy_Y5e zX=VjO%^Sm02HPfcvF?P!VdHT8P@W_{L(`; z!v&8U9|9q9OM%Z%3hv(1y;a*w%{e-SOyENs$`i*9jy%jqry??!w{%*P2iSS=@1X6K z(3A5P@6Cgwh_QSk1FE6}7z_bDLvJrX+3HL-Ae>*jaPTHJ)I8sIWG}ZyMFd{EpVA>e zU+G2OaZwCWKC1P?V^YMmXRtKJNPR1Tv{?_6EV6d zo5+%HfE}8y_V(N@Ta0YKGzH zQ}Tp7Jozvo)#{{{n0C5aM!(@aoRl(BDSw!CzGFJ@1MROBU)E}v=tFKMVg#{e8s8hWYk&F!LKhSv>8ND zmE6C#S4!_}t`$QNt{-bTv>MrCcTnuoJo`OP)o2S?xD}elc@6A$Wson9o0WcFL(iq( zm$Q#b{;jT6)&k!AqFs3SYT~NqgTZ=Zmi*ROlEOtb@t7jkeFtcr zqxnCXeo~^Rfi|>qZLY-&;pCy30!dnpTJIWOYk~B zl!l7v=X7RiaHtl5+iL(I6^>bV-4dN-1$B{?#W())*m1ECWCTZBF8by9>UGiy?Z%Zw zFOe0K97KIAYrw!@0uikvr6GA35jZyKaU zOqthijdN{n_~f&Zs6$SzI%zp;6x%qG@4h> zv_(te>H9A6rJNHd_GY=<>fEouI{IML8lpG|z$YHrrP*8>{f%H;?WGq7UfRY}NScy9JtxrMEA>W|!Li_{teNJIg+w-wZ|qh?wvt zNHK<3oY`@XII4YFYdm)}yf<2K@e(cz8#Am{b**;q5Yd~Xau*ZmKJODH3u zN2sBQYjb5Y?}5yivA>H)Ow3t!bIEx#b8H2xnRK__Rn<6&UG5AGooU$47pQQ>PYn;p z#r!@bUR{T=5)$l9Pg{9vco^p~dEG5*bo+~X(h=+xO_*<*RkYZRHDJSTu&h3;Zh8t4 zbY;?@^!@UxolU-}QfBLDCEcdXE_=gW?hgG>hJGV&%AEA`v<&s#?JL&7eN49n7G3|_`xKOHx`xbw{G=0v7H=7>zfnr>LpU76vx{ppyQWpwTZx zJH<@gc=27qnv<;$8lH)JlCIM4`FP|{;7LI`xG2xI_6F{)4x9bA_4i@Fl%nu6=yyhr z9kQUsq7pduqi*TgD?!eYQFdjziQykG6h&xtd$7XkITD_wm8CiB3=kSPrapu%)*fK( z+gv3I$ku1vE3lfrgU|D-dVN{FvsIen;eCmUD*DhrbWlhD+#m)5Ib+QbIy5#)5-Yj3 zPN%N@^2*1}{6gqqdn@D+3I7CArfm(JMOqGe%i3nco?E{xFWBu-_IT6lW>8W6@zwWF z1`EEXf3Q6y4M_@5jQAUjufwo=S~Bjs`8wbxSNk7JZDp?#@i-`qvw~n_39rkLIZXZ( z#zm>lYWyd4Rr^!se-NPmTQyR*1D4m@C>l_uw-W!8XX~XV$Y1_{lv7<=pH7Ru*BWYGRR6r8YjT-#|Qc%9$wy7q+6*6*hnAhB|MZSLLnBFsDOY9b@_?J z3LQVG|A1Qcb}ZsaH5+YI-)c^MtUoe`XMej$D=?c7?Fuk&x2s&RSzT8EI$2Y6<7eV( zF9&^VHdKJ>7F#_4$CmN`gxKl{O-HIq?2Mtfe#fkF*|*A@T^|&IyjuC+A+OA)-yua^ zD6`&f0yo=1isV$Gg=X#q&BC1%C*ND{wEM3uXB?!Ph3WqqPGSYmbGIk}#$Me8nou17zzrdns#WZDD0o=fz-f5 zm%@Yowq_KZCzg$_UI;LOo_mD=n}#Gw_chRsac4vNK9ZRD95h+SNIO9JQ7=#G5%p|} zAycB)qFa1|w;rZ)uCKb@&|`$U*;5@AReiYf->a@P)lSA>f}Mft zSq^TA*~r#{uJRZ`YYV8BbZR#A+MoPdchN;@&pew=GwB8wH^xN`LX8 z>=iY(Db}~me<+g!AvI7Ou3rjoYFfOB#XdeRMfP^36XSo0;Du*yt(w!{brf|ue>=5PyW^q55;WK@PM zDvVB$K=@#=DWwofbnv4+GgBQ3&z5qN#POq{EU`0_9`MoZ=I{g-?Wq_aJKBxT2`KbF z+oX8&x+Y_HsAYHF^^YFDQ-#fum(GZ|EhPsuM1_AVJ-J(DCJt{O&$<5=W0`vw4;NeZ zI5wmV>)Ef(6NtTCZYp#4*!!F0`dk zk4^q7ni3U>o9JI^Oq-5eIbx7?eU=8ZtbpSazzlnBwGg!HjZKq@wB~8c?x650ch~;Q z-<7$=LG?)ZCqm4*>QYbBVXB8ubaTP!)Uo=T+uv?1#N0`_jAr#*34^8bfJJZiIC?At zR|i<$-HKDd}n=9*wi2jSND0IKP2iO&uVhjeFZ0R}lMK$dtPCV{D(Q6e+cItyD5 zm>~sGEhw|d^oBU}1$c}OAlVFbzhV*o#rJLv)ned<29Ur%2(or3`GRljuJL~xm(*{Q zA|!#$eu_^et``gMod%>&YDiq5A>A-Mv8{hfoHV6wd9g~vri!PBRSyG`w0%ivJ^1pA7WsFYc^ay#6Z?+``x_z<#2T8N_xizROi`b zYi0E!@zX4|{6q>3)yK$NMvzMBRpgAF;_^q3W07Z(6A28`Uhir?pNk3Qh;hrT^R3}~ zqpG}o+gvJ-MX~~0-Y+Px1=BVCJ=aBZMDAbn772Ybkz~=A_k@Y1T9srNI8hCGR^)<- zGViFPC5iq?hH3VtY@CvrM0GDOTs7n zyxhW-VwU;JJ|JZxo<%nC;zQ7nqSwRqnjlflb@~MDK}llyN)3!rqLA#Sn_bpuPTP;uLDYUTL+i{dA(jp7S!NQNSm>WQ|aOV!th zu4s%8JTZ=S!8z_b8p8P6_TAmh$oQN`~Dm8_<`!wg7ta4jlt8*_VLZZA1+ezxmvP%{tY)5 z39;RI0?C>DF{0@fNKdoc$`Pn*QqP2+tL=yZrp@hsU*1jHn((cbnJTEmP+ULql*D(dWwFb^EKQx2Tswm?`m3K$t_bbv=$8MX~zR#2K)#m!Bgb|Rn zvxSfVhDvJ6H@)sD)B=>32|n0%)&7!LKJcUd4Bk5sc3qL{+<9xxt6c5cms_IvYD~!P zkKnn7L&gz(S103$yGK%JPSfA>9GjD|KW}~IU9a10M}CP%zksESyEyin&!KJY#8w{(}}UtUWk2!=PQO1p0@wTN6=V+sCT9lF-v z$Qk=6M$Z}AU^!3DW-O3iYa2RKzw}pbNWM|Jy+KFr?Y7CXOZq(TvH$gp1SC=I!V5Q_ zsP8VWmw%D;cbb3dqxnex$8ls~>KqG;v}Qu~#wwGMODrube;uQsl^Iaqd3$yal)Z7v zh7e->+Bcb_1JM6Tn4;aO+7Yd7ZaxYG7pSv{xlWGFM?z(X3?|p&SS0mdv`cIcP$F}5 z2eNgp5F~a-G_SguM)4x;!R7V`B~R)VA%oimoS26g2_&_~HE43dR;6g_aD6!YbL$8f zDJ}JFaHis`AQlPB@B+^vCr=<3c|ZSxY(RMQKD#Ki@2EC(6>8fQpU#u6a%ED;_c|b!|MPc2;lM|*Yj{)6CC3sV=k;U8B9B=K>vM7bvfVOZ?hJ$ITN&&l`?An`;NG=`*rv&hpYt5z9>*2xByk$t;tFvM6F4z96InP6NsWtfbL zEn+r4D~US<2eL+>*pz-r?}_9}QWe{Hgs9>vuZ>M{7=zvlElY%3Lu&6<|MVM0jo?Rg zEuZUJs6s53P{hixl}>QN5l{v@(lfRGl}z>?%C=OZ%uR1HO@nB7dX_||&YWn3DzbuA zVsAf4xc&vP<$M1Hu|1EW-zY(_8 zo74ET+%2oQrz}6oxHP{0viI71%?uf8POfD2>rIebsHl^r_j`uVdr;-M-N>m(gJS}% zH~~vW+9`jA*c@O~gZhBF)Q1em(66A6q?U({z^yq_+<;}JUh&Miw^8CkVhEqD z=9I5e7IGvZyG_vWd_}Ozee>91g5`mujE^+ZZY|A7(sZp1w;9a{{plnST5`sU}vLE zO?4sfWw3#NfBos)(C&^kp`sXbXYHOwo0HI2hOH@MUhnM6K(iQDo-xt}VVe6W2(wlS$aAqkH4xK*#;v?4;8`RhJanwqvM ztxEw?XC5lGR>l;3;pLrZ#WLh7e8$Dmu4{bSmDR(nXuQ!O@U3vJTuTf_Unl-b`}0Bz z*VIcwb!iK~rUdEiq-w>{c}SycxZc`ebAoH`dK|Tgh0Ty|nYzS<^_GnD29m)~Nw*qA z9eN#{3BZgXy@E|;vcV&QF-=uF2QEagOOAUQl@k6G0P>0|3@fhVyJXskIGg)0GE}{XamXeU6KrN&h{8XY@He&nWvvvA$tLIY(HuIwOs3mS@Ccwj>-+Up4U(Dhk~mE$zGe z`OfR{rgp#9;~blM4*q+tq0^}}gB>PX+zBSS=hah@bQB6DT|99lr7z`{k6-s;n+#8Q zu=TSyK3akK!GyrRC(3+X6>f7gS*pPyf6Er0N}OJ=eP zN*n0b^cLC8?k9=TZ8BZbPtJSmJX#1SjknD}QO8`pfy?mRnl$^R*U`_q%s4C3_6y$J z9*;7b7=3Vt#7w=F>3Qi+SpXu!z}SnNh;?{9oIaukUnM$E>97bc9j*>B#s_lzVx2a( zhZW(XPAFojEjj_LIqjkDLlR|vMOEMwZ;`~g!0al%kB0}PXumVfoM~Fccy@NE3U3r6 zW#qBwTWUip8&Q*&-*49YP;0(l zM$o%JvcfVgSL7uPXF#d9#-n7YrLWrSPx%c6UGSKfF%j*-a#Z@O93u)EB?_?a!C82W z-XwM;VSgCIdNbw(_^4j8aCv0tmls&~7kr{0pw{feT)jl>{Zkm$48pMT5&E9zY*WV* z4EOhBYP)EtJ-fU2LTRkpjC#g7hMukaGu`HaG}e$y8~u}>v)YqGV|9DE_t0w)HV&}T ze#)Q`ppTH;`FaKATF=mxhE+;7L)fM`=NKlrb#N`t?LK*Whv(X@5VVnnIAHgsJ~(~j zF4M0H1w2|_DscimT6N}M8qYmFfc5E8Phu&0&R5+B$`{<63p(B9e)0_~`lXEf_sH5p zeJa88#f&Th{~aQSE96Lb?JhYYlAE;UsP=$SqT8602f0+c03@eC+W3@@cpF)Gk*!Sq z*i*04FpRXP>7;8eHGM@xIOgqOIo}#3=v1||Ja%@$Y?9z~_&}wx0;Y20 z(9(CkTF_cGZ#Td741Pov|XhU`8Yz96zPo>5^%`^}RJZlJd>-aq?1TeORXuodS`6f2VsDtdT-) zX>Da*{oFId{iQv<)cJS8TXIq3f&yw(A#uyC;%ybq*k&op_7&W+yv%u)gG#fUQT?L& zT>6?56$lE~@Lb^Z-zc0u6`*iFsS7?q2ny#@@DmD`4t7q&4@R?xb~Wv|sI%W;ETF(Q z7p~mH>`BBBCYSt=A#6s)9-os#M~|}j zB15lKY|+z6>ySMX!lpj%&*g$l-Y3@G7i#_WuWMbf_*K|$^a8%b)8AcU=W8KKT55HT z(}NdZ52et&F0GmhjJK&XxRSTof=1|`CY*mN@qA6Z*gb>h?y5lsZmJgozg?e$G1|9c zE1U@YyV_ENRd}gQv-r2h{6*J}H5?cnIrp)?2*?6i2??nSWGpRn;PKx=QeWJ4e$!j& zewVZ@r)+Y1XTAz26nD_uEMTGD+RQOIy;3JQ{*HrS)2+_)F%EG9PRD75KA<LQW{84;V^wnNL>CHgHL<`&&cAMQl zo!wC|T8Sz^4)Top55gxV^|t0A{pZTKHZxn;W+!Q_x&GU2YA=h%x8%-B41Z@wazY-I z*IB~@yvS|&RM|#CccHvYe#VErRGl*Xx9N`uxz)b(o_PSkg5KR9#MX@5sRBFy|3e1-0Inj$s^i8Z@W%xOp zvUc^E?_aO9I`U66apx+TU8CDnOUj-_MtGjH<`hk-#HCj+l$JY98)JG@r0qnPjfjTH z$JI)0hUe$6k90pZlH8DCGMEEpWAa}oFp0{%0hRFFF_PEf_v@XusKTse;`@px-$}%g@ z?r=}J)N|!ieY4FtmIG`W>U2KR*U_8p?>BXaMBAeGj~%S(V&$5yM`#qpQ?`^tSxjQQ zRs_^6o-m6&8Y{8J&ptgmM5gThqdw_$+P$hOtk8p?6#7XIM*l9|@yvVZUEfK#<8=YMZrsAUN8>dc0Vu8CqpMlm8I5Qy)COzchNOy-QIM=v4E3S z^n8YcNPRFLWw?3X{m9e?F}Lb*lzT(6&tQ`5zaiAFG6_AK_?I*+z!|0T=<*LL)m%nG z;u)y=)!E{qys6^N@%B||_cbeAJNp;X9p}@r@cqyH+Pggv6c`koFy!s69iG9{y`Ye< zMviPRi&2jt&(ks5JpyQrBj^c3px>2T&HV5jgDnhG2Yb$vYfWjQ?DKv|4B`D~1Kpnx z#oe6NvM|@9=dmXY4;m#a92W`tK=E3ytx9!IVZ0(q8C+Iu?T3yIf|DB@UEfStg?=s_ z_IR88KsKElQ`Q;eM&?R!TERZQkb}G!JmAHk&w!ih$-?$NFd)s2`cd7HRc|41Y&Q}rFHLRSnu3t|g053&xj z3vvo_OWb>>#aOrC(It^0OHr+PGZbObuwr%%kFRhXd%@6^1I--x?TzJZ&>>;kFBH$E zUt0x(6^~`)Olvp$1sz3MZ}n_UwMzwFxGhzF32K+x&ZyUFe~%`j)`VxToQf z)=2ynu;iAxnnAmNUs#mTiNp_6!$b zk=#GzU4vM+y<5Jl#5!S#ykvY=l}b(VH}Q6tg8RE3*oNn;o0yv#e>l!`cNlQ%k`Q%0 zyqoK@SG{!~#A*W{$kPZrmiJCsktn9Bt(D+Dh076g{*7U5Y4{LEFO_&H!rffM*za+v z`pin>=kS4G><=!Ilvm7jZ+*$`7?@GoW$SkQaU@X9wq^Stz&qtmqKc zx2b@}bG`T?YfHkQeq}tCskQr(hW-ucHu&0|r9J#Pn3bgaT3XCGo0diJ3mmAFnV{jY z*>f?BL3cmZ-kDE{bv3q4CnbL7$4<8oo7iifCNI2^M`kCTgG`gQX43nQFwP1z2DRLFGV};R@@_aw=9;gEP9wnGVgyJc3zgy-eAnaG8ajN66|GFk&_c=`FamjdFiuv zHEiW*W^^78Wzz(^B1^o-W+0IvF@d2zR5=u32PJQRA9QFfMnuW;dKKO|de~k<>5Up9 zTY~!7XI=tknVzC|dd|xf1`Us3p}vL_LnAvUoMi??=kDg+zwSLfqB!r8TQ1Zfl91g z+#3m#Ok)1l*Dh786Mg)q`|$OII^Uh*(P`Z~<o_9AY+fVg<#uO zxA|hQ{BL}^-$VEVR$o<-^vF;CkQ3<$V4NQs^DMOxOeHGOw_msF-bBZXp?;a19j9zb zpORj^+VPb;*E%C#`vFPh3RF&z-~M{0ha;jy1U2Z2`@q*n@n`X9S5dT$9@dcLX>cvt zStSqe7P`j#Hr^)P)%yo6)k_dDiiCY}Ileu)(v$8x4Bjy-xc*T3Up@f3B|5BASH|yf z$x#=QvqJ?7>Qimlz-_trET`-Jj@bE{cbt5;=L>THQrPt5tE{AOkIYIVXM;)RxmQjzN~lD9 zE8f)bapip`>hvlfnb&P&k&ioBle#hq`p0a?XaUqk6RP~Du5V5+9{aF(_DaMVUcHKL z;cO!tcI6012QBbSF>@czkK2P7hlEiBQxnrokRpQC#Wuj@J@)3q^a&+(PGI~80Yr6e z;0#G7o0VkZ50B+S*#GEE3#5SUbZ`yP9Km94Et1b=Suyk*a3^?$jIbB`5>5h)LWz8$b<0HD%Ym zl;XDZ-EM0L3~u6J-`o*Gl;5;J@VY<$CKVO`ldE5TBE9&Z{6}*bJU0INlT=jy$EY;X zbFFYJR<#~1>+lBu=wH9C-GPPwO8l9)!x}&LJbvi-c#QbhpZT}?tRw&Y?*EgekpGja hu>Ya|>z>Dyqq}Uo4JXr0`_DPg!fOx#r@_I~4^IA{wGASFVsKDaxu{xpLhV z|M0y#hv+u&Pi|PrD9c>AQWZmdW^xn%{I;{AuG^I>57{mr zSC!Nr?OeHn%Ttn-(eO6f#J;y?Rmzff2HK$*1e_d2z7nmHW(9X6qzU6_37V5}*`o&% zI;}j_B{7Ljq4JKFKPLv~rn53%IZg%pQdQD6X>Y@HH$&2&rswr?H`o?2SZ;sOVy zAL457SdlXE$aV99vaxf7hX>7S{$|M3BR5}NQHo&UxGuS(>3-uO z7HStUIp?b*(dtCViF@34b6k~#QLQ)Bf;kY;NM#oGv2hH~meIH3eGQk`TR&-~Wxm_C z>hm+^TQKy@S1U zI6J9=`t`aSf0#7(J|V2;<5Af?6&JHK*^s*Umyz!ZQQ^~SDcqGq?& zA4Ouvy3s-2e!Ja;vY57?pn!7W7(vbUfYViow<@aQV!_-w%{$-LJLEcay1#fq_h39O zPDIxxkB7}I$80VlzkZAtJXVhg4s@1Kugs#j?PS+l&Bm$nx^>dvVYMN&ZB9)^#L}r8 zB9d2?2JTn=px!`MeceLcHtCnx*x>sOS=rKR77p{!7i{77T0*__<2ASWD>{o3_iAV= zl26h+Rvp>`(Dt4F4(&SknkDD-<583#gx4Pja%E8-)FX&P!mr{`&uVEiZji!@%~f9q zc+xh+kZ}p>$lY&8@pIvU95i+;B64W}DMZ;8%Yu&x#R#!YriGGYn>@1qb2SyWV;bO9C ztRqS$kI`9GPC+J`2zpO64ad2V|H&k4-0sWwP5^(2kB-jx&f!Wp!hjSMe;1Az=durv zu#9M6Vwlyp_PkQcx7kk``-V;K%;<%;N7|`^mDRWPK>#Ztd@XhVTrQE&|lB8Wh2jm z9El-^~<;^gsakE`jVB6FVr!d}5gFdD7Nuev20N?o{j;0hGPhyQQwR=le{V zx2nVlO7mem9QcL{2v-ci24FS(_f|lQFnASf?}axY2y(IePU~if$Z@ad+}6z%!~N$Q=o~rV;Kh(Em{NN{1|dMlVw`d_Lst z@!&fYA$n!_dTqBbRm^^`Kt~*CBK2H=rsp#~19Gu>iZ2imSZYcmPVeIvhXi2u4{wV! zO_q#vyBwqfGUa|SN(nJ~?Z{WA_j?%L_js_~pjcTHHh9Q5Vzk(+(_HfSiLOAlzJ!iS zUKN|PHEVl}vo~!3-A=A2F>B!(^V3CtOruJb->xo=k0ynbS#?~#OnrBQfzfvs++eWh z*Vm;~5D5f~Ym>=bW!n{MR%2jC2Xn|+p?A)vgYB;N7aW6Ai*GZYZ-dwp+*EgvTNs_Q zwyJ~+zvrlWRGQevqy>upT0u<$9g7be5)s;W^EHi{o?vTgW)pryTP4pw$&xMJ`b9We z!^rcIcF>NY-&ifPcVO7Y#uK{+2?_W0E=`U1d7^_JwczH|BaadTnPG*oyuh@!0@wqe zmQeTi=jcH*4-}o;1a;A}%K=lN_@l&qfPX1}lR){FQ28E5(007~qE|qBm{%P9o5uc6 z%9faH9P+;8u9E1$ZoQ4NTW$^d{%%UWQWtSX|`_RQ5600Hwa- z^*8K=ZW0`?E*O|e4U+I5^QnB&dTz0KSpG_x}~RS!$)N6t}2 z3qv@L_b8=%jN3gaon~-s=aPx>p{1MS&v10c1`@ygEV)_mS6V4Uf!1p`21zx`-`X0W zq0p5H@|Zs>QDaj~;*m;7iJ{y3n8+;EXEmXu(b?ZUMpv(`DvWd5(p8vvaI#95kd}ld zi`XCs0l{N$a+enL0p7}z=I>h60|2pcf1O39hUc_9pfBkH} z4kakg0&i{(^OD|{0J}IZO*@wN+hv6mg(zJY`&FCJ70nP#KQt9BOgQTo8&Bj~q`FIb z1phhPenNfzO{x~+C<(s#N85NH2mgX#hG2Cl8yN7 zQ`zG2bYB-;_c2kHD48^QC5~WkLo!i>V)ei##_d))JDH*Guh#cl;`#5Lgtb@7QVU+6 zYFB~CzxtKUI4#9|9k8c{0Pot^_ojCvKK3_>J8Zwo1O`{UFGYu2n&QqKkt@_vXaH^tKql1*hiZWH7*sb*~l z0W)G7?-PaXO1Heg;G~UJa-WGT8X+P`O7@H>B)o0o3FOwmn7!g4>&-QDE38t zey|c&I)LpVZ1VSC&-*JyLnK2F`l2jO!B;wDo^(#m?p_O}h!L@=2TxRsk0Gp20@h>7 z8`3$LNHcG3J6`@(bf#mdfk(-=RK@RY?z*#N0!}fzSL9_egLYL#2>jrQ`Q+Q=H_;Gh z2oG|hB`jPN_HD9ofy3=Hq5kR zd6w|Loez#upUcMF_8W=KrX9EYF%M8Z^1rI$ zINnxLhq=*y)(f9c=RAR)!`{Zx1Uy|x55U}>J6@1xwaO>QUn9$+hdWe}BcBELa<}32 z<8}TfY<Wm2-8Qo~D!i1OLp1H%0D|IlC+?d0-n`+H&eX$k1t(WTw;An|l8=kkjqf z<|J6p=L_DItZTX}gdj%9qm-@?HcBuUxOshf?Mv?ki3VGNY$p5PTwt7v99&RjXwR!0 z7w=E-0{+6Y?A6_XENx+aob)2jn)^MamF77d$8#o)JFz-$KZ9p2;_M#7%XK+h z7hzGj7)DmW%sYzi;wAEtNE3zV3r7}a-BZc>uXm?nSuZvlOWO0zzRQo1gQ+~1FFzJ$ zc}Lv!au8Ym)r$U?FAgI4vRa&0-5suum=iU+(tFqeF3|RaxRIOu!<-#{q+jB>UQhUz zIC>anFjbAdr<}X8NJu&4gYp5tH6v60j%)iM2lc;t`8BgNP;XQ&m$`z@~s0M|BquSvV-aDED6wZAF(Vu@%YQ}YI3_4I5&2d>I$Y?C5t?E1+t zBU|cYF_A!cHMc1qntLn|hnO2?W#o6-Pk#Z{<AdRb-N6P*=P4Vk4f2ncw+3wgZ$DPX+CNC>*q~#I=y+6{FLdo>;}R zEGC|4smLl7P;|-sJon`k>eAJG=EP`7V?%8|N3x{sKG%>s$=TAZTcbj}I3ihL#!#@+ zqn`7_NGCa4a52NGL6OLee^qwWTmwdq6mU^`$N$4 zr_nQ5__@-Wv)cJytEE(li+`P_$~n3VH8YKl(P)&XQ9pdp=mb0ej8zmzpK!MU{i@n}U0aOLk*kK%&-#@MYyS+FP zwQEEphyDo)&o#Zu{)OToWA2gj$J{a|iBo|=-m}vKNyb1VrlIso*8KHNl&8wx^O%(t z(eXWnDI$!=`5zVeq_-=^i8!g=&I2}$*t741w+fS|>`S@LRL-B}A4Pt4Nnmb@^Z~rK zVAzN;TGu{!40kiaIxq#CH>yx;$OBc-S%`7){#dV=Lv=aqAva0gv&*AlBxzZ(-9+9P zaL*W*tY`GF9rtssvPH5b_J=iNVNrO8u3Fditz30ZcEqE;riLkZs=9DmRx5C9=IWDo zhRbnBpY4ZWd-@lc(oVK?|KK&Uwm(BLEjQTgX^mwDdO=L5e z%3ap+qr-x!?9goeKknuOuMyb!Im^*gpj&>AuK#f}Jn7w#acNICNc3hk2JR*Mqz{C>Lb3N0GhW^8ho#!Wsn}2-fW9Szp8qHU!vxiBC(NBSgW1LZA z9Cm$lfbo$Ns;ZJSsk-}aZq-OTXitum=DT1)&L1q|P4bq5RWUCwof5=(B37L~nkQh_ z>6w7*Ubt1O;~=S}y-Vye3e3`SkCDq{EWj;uA`TQ7 zleBwBKAjNxt=Udf;8%OUw!i;`c@x`Em9TK~9WkIJRVwv12Y0-rEuzWqqu4ePn)36* zin*cDZ%O$$Sc}7AYThHygQ$JIo@VL4Q%+~#zWiVCLzL46eh3<2E6LrZL<@(CMI=yc_1k+83f5Iv@MZh(_iF@7mLYgX{&$Gxx{X%$po)=0-1?5PU09Ycar zIw|-RRKa;6y9o=T3=EbBzLLM5nG;zl_9Um(cyV)qQ_+^*O z`|08st>=9hq@H@CE8zoAqwY?d7}dSR7ame}Jsnch+dOL&yKOvAA~eSPVQC~IK9A)J zcESxM0T#Lm6L!ReEc0KjBrJBq`($Jen%L9wt;z)UO49v~IOW=P853cRF*8hPGIC$O zer}KVPpF9XEWB!-{lnZ)MQZaKMD_s!jn9{ycB0a{mfFFOiguIlwVi;n=c5?U`CY|U zo_kJ$oZXFN^YVL5-ja-S$Yn4}zIf6Qvb6e^mB+c|VHd)P<|JIym0yi#XC#(}djHp& z-8>(bY#7Y;Y>A_jSOUA_al@=&Wyq_vlvJeTGeFWrtMoSwQ^;cw`cptPUZT=A^0jc5{TE!BiDixq{fk5di2s9Z{+rn4ziZq7@o-~vvHS90Tb_K^ zqa=GN&uznf=^9vaY)p`Sa?Y-)JzCZbZVdbvkPm<5tCX-(8isCmDp8nwcI?0#gTy0X zzJDp00$Elv1FsE#q_&T!<7%cW;Yds(l}DY>(A z?(%mibyUUn%r0|7Q_$P)ppzYjLm@ERKVOn~PUQV*O;uWcQ-CMicb-%(>fi6A6==2b z;_h93*NFSl7U5qL|0nSHp9L60^ch}K1}CdgYyTP=e}ASo1y6cwT7o0Gh#p32{9_$o zS@g{Qs~`I$CqF~~%!!7-e6bwY!}rgdH1&4NSxdRjRN@;fw#Cx_oC)=f=sPA7k1jux zqx(~r^Y7gMKicyDy6*)d^Bz@eUS%%s+a?&4#UGL1RK^P2sqxZ|2*UD64Gngtf^6c1 zsLxMLlgctW&}w<}F2+qv9TWJzn| zL84rt5RcKW9r5t6^+e%MGv)_R z&9Lj=IghtPG(@ta(tWHZdRQOydyMOonr1+A5Lq>cwcLR%rU6<9YzUH1{l13` z?6YPH_>ApHD#^-%O#JB^2RJnjf@nC5i`w^k^S|GJSMngL-7?UrZ5YQeZBvoIq0NqyxBdvQ+RXocXRL$qGaP~ukpNQ(Qry|`vP({;$-N8%iwW;GQ0!Jc$&P08IIYi-{WRH;EJQVCHQG8BhU_KK34aM;Vlzu#Q<%NqZabwv+ZEcWJiM=v7z` zVQ(5QB#Ox^<{U{yV=u-!%W^1S#X#Fsot=YUbc&)e4<$f8Gk?YxI&u3 z8qdeC+L&F>wjHzhv)7;TNhGeQv@CRlxn6 zkJo#z#*$=gM4W>0#JKw0cpcT8Vs#lE+V!DQ=(UnPO9%8jZM1VWR5FLJt8FQ&;GJ5* z#)QQQtL36{q%E$_t+2+@P-HTd)Cq8K6QA5*Z0s+&_+cl@D(X@op#=A4fq>)9sAK|= zo{iL1ezd*AZTxXrj7ve8wIj?2U^Cr< z!<|`vx&W%4*g0MXL8fubZ@$j0&k}CRl5V2e_O;$Lh=ldC&9)rfQ>5^vr|dz$MPQRX zdEQO<6gMc|SZ?zV43wH2-)l&PgO55z+Au6rx}^Qnj!f;0J&U2e-sdkZ&h8om4!K{F z4x#J!xq3AgsoEK50QH{`gW$IE##R;IpYSUn%(6&ZE`p7@@qJN)ojT18s4 z8L0L3d`<;P=2$*HVco8rQTAaTj6syTvzX(4qlM@nC0o%j4X zrCjtJCv{ujt-rU@jjh}wJqp0EyUAQs5$ekPc24Pc8h8hM=}XF4*?ZWFt-ONm9fbz+ zSUzm)Ow>fxA8b2MNrPS8oz(3Do_&c=)H?l%o_EzRL&dlb7{rTfuui(m~hgjYaR9oWx+>8nSDw7pEVmrU_s5MIy1sryMwT48; z3cz1idni+KXUp-7_Cu1{JRt6}dKdcnw_FWtvcTA2&&SrP59bXqgYXH`5A5wfy3 z4q~PQb(DUjMdj})bs1=5VjKjI6z$8o`rIoTk{fvEw9k2Ie8g$^=lrU#ekk2(Qju?u z&S>6yc|M;k$DR0K*Y9f0^G%9R$E@%F_&7v$hd~SD?1m-7Bl2#t0!*HA#Oa!KZ;QKD zw=`S&SXe##Q)R#Z@>x;DW;sOB&hAV@?vSZmI$OAsd1%nrNyz^iVTbinqAW)h%fkb) z39C0mC$STOlfI#MoMvW{5jS`HiVME3AC^NIbSCJzFX^IxLPbafg#`AHshj z2k|yw57E(7P^XUr|Evym^q2VCNWz)Zk=iU6@Iw^i?`r>~sC+(+GoTNoi zmtqZYNAui|KKI6Cb;ileT#Bx(UEhqIU4o|qiqQqMvPHkkzZBqJc2qexHg~%=$2fPf zDVmOnR`;}QT0!*V=Req2p?B*MBJ{FiVkTNaE$%tl6&Zz&R)z-lV(ycRR!t0>xCp7{ z=hg};+wk4PrpkJk4fF1|81`Ls0JTp5?o-7xC#!}MW8vOl>g$4ztayKew6@plbsvtU z<6K6faVqX~JPuL%%}q}-x9aJ$%Mri8^*h@%nD#-x$ygAlJyH_(jy`g-`Vg(xYdXQ@ zR1#$B;aqA4ZM$2reg>o(@X9`E+@wd8^X^YE#++kJ!mtqLrppOq-RNsPBdOdHhXhDp zvQSr_|N5;$C*edj#(2E?yJ~vbP$WFC4Pj(2Pn*Z@h%*?N1_ z5M(eG!S9RD^J@Xz^a>^bk{`YN%XNU7CjsGgONU~1DK!tg(A2AtNDZRdK-7FrBu;vcq)4L)3VSZ?+XB@a%Uzmf3XAOkgk6 zd)~RlegA_IIKjIK))Hb{=u2g;-<50sLs%P1*hdW`s; z1MCMceK%2eF5xWO4ln8R+b!6*4zSg3u~(@X&_)zCHxT8)Fv6+E*wH z(AKEgt|eA8f|tfm2y!{sy34uZ6$E*Y3_R(e>kYARES6y?mfTf#>2;%&U5H8Y zy}jd9;;s3EuEXrROT5zTM*$~g&K_T4hi^WiUEhKS?lq33-#Nqb{GTi}YDOI!S(AGcZBJ}&ml9ZbEx0oJQJ>VT>4(rH5DU=~TDmC+ zJsR}s7CYwk8uOG{x+hLLKIr3ii{A2U(};5HOrr3PGoh~~N}gQ7)_l~qw%@r;JCjre z1mB;j{k7*#YJ-Naw2@7sc{d)uLE*g!bRRxoLd9 z*n5nGY%fM(+Pm5dTnh!v3mi|@ju#hi&+)ra=YIp1K{+i7UXb?RWcaz>Yq&VRD@~vD zbe!m+7#IlXf3SH@P7xXTZ?DddUwiwL$LsW|sSEf1kP@2ZRKs!V@y+Bio zPr+eqn3&A;)rT57?|Ew8dx10&4PBZ_PzzY93D7iNwqv=>W5fDol*2 z^lyivYQTW51JPP)*6%S&0O^_9p;HtxC}r?+k2GEEk>?7_64hgscT}GTy%I$1FWyQ< z9Q5xbxkwkK^&e2E@Jv+X3^sdw(O?Puc8-;6Y4{3n2WYlthpgs8wGU>kW-nAU* zuY`{lS(m0sG;tf1TvjV|p{+xa>FEk*MnA0&QdUF)zUjMH?_2rTn?awCE7wguB`UhX zA}<#?-iKoKLjD)-N`E4>oAGoRm^(gl90BA#KNVCkV>$wltpYboeSBB;I1ZD+V;rjD zD!i(Um!^+_q%RC>s8DD;kWK604-~4iwH)K9%U-ovV&!?q2&CQbUPqEUwy8N>@g;xNjDt51Pb!t{hmR*|e2jcq9 z&XOpz7Zhx3OAF5#^=-bzNq1{mlf$$|NdQ1^$Ft#Dd?rU4e>Z1@%guRf%9A6%cz{Xk zXtXaKLK~&`7+{kCdf(N!e^Zx#_5Rr&V?dBoxvljXDD{!xxmt%X?(lxgZfAh}&|BI7 ztWDEEE^0`X{mliN zWtWCA%(gK;MPwaB9eTJCfjJA5@JxzzKAzeOF&}Esb=gJj_^4NM=cnBXO zmBRD;>rtNTFo3;7)cFr9d>xO=bGh)<^}3Qfcg>hvu+)BdZik0(iAE0Kuz`FvvmJyd zqK4?H5p-|h z)by+N2`k0K?Y@n*YZj~vlk4fZ{jSS#mK~3}Ug~IhnRe49bt1)VO!H0j@8}V5!exbr zxOPp2^^-j`x}hPd?$WYk$4#v^$d~n`gJVGYVmw?zUhdBEHf5bc5FOd_ih#{_n4Ddyq zc-|1ch9W|UhmgfJ(yFG-tK~y3$Bn6z5$P@1$eN)Z7lS7?^>Z#MAppQ+3@G_F=;myK zu%lgt;h0eKW7NxoD^|gL2(XYg{lw_ay95r-h8Tq9x6=bZ3@O5BQz;h-vH>FA) zxBALINIL@IQD_EpLnis>1Ys$asy+^82fI#9!cKfqtHCGJ8P8@pS(=~5a)Kr~ zh?!iA49Rz=jhz7Xo?F@QNEzvL%`XsZ4A*t12rciWr|;DmD~!kp$=4*xP5%t6>)vZ0Khza5}2lJuQgYIjn>ILryhb@YrsyHLA3yX~aTd)R3h5^jQkG^bA> zd9r2cl3}@4Mxn!&jZmQFHgY8)tayplhxzq{W!V>3AscZaM^6I*$aLK^gHjMRF^lg9 zo|0*IHWwE%3SzLt_9T*|3(wX$=od^gzNS1B`}%yn-uZqxD4iVP$7hF;Dk(wL#4A^s z514gb!JK}zaK3*XP=Ta6Xr2zgdPs=e|BWgff+&FLyN~UaPD)H9jHX-3dM3-lBV=DN z;MiXR>ugpuS{&%FJ4DDFWqz*@#-M6sOy`$6N3@$$77yXOS%xeu#$T`MgU)}FD( zFLo`d4Fs+bV(lk|M+NDmBO)q+Hxkp!2Q+oi@A|2wc{4+b2tgi}s}-xRlJ&te+R1tr zZ8(^8DsfX{yMF~5YQNA1WL=bPmpz{+$Vh_asv4C5722|OF}_OXesqjz`y5uMW?*mk z2Uth9uVx=X@0TT&{3%+7?MWC2@tU2*bcNnse`*ro&@ktSZD&VTf3kO~y<1yB`kp}e z`OZ;O3Cfl_Xq$9$jkc0i8{9t>p(04Z-6aPj;1M*I-l^vu;Ejeyn6wQOd}))bVx)w4 zEH6KAw*yp={4=3my}>0^$9`6Sun;WJvin2(Dn#2PAE6<+(`UmY007g)U z1ma&m1Q9t4n-v(xjc<%j;`IVd#y@kz>wOEuGft!vSW7}>_B<1q{m39NDD4!PRnOzv zEl$)IcCoU55g1j`5FA9co81`5*@n$@>+JQwI%aI(Y&1!t=A@l14+da|Q2EB}Ixo-S zMg>zh3z>Ys?$)m06Wtp6isz;~ON&hoBMbnDojx~$%_T`-vZS9j>>u``%CKA?<*0>? z@loqS-5fkkMn+2CyJ^^dm;Rc=Pltua1W?CGoY8=oVk*ihLHOx%?>k~yPY4Y)ovAUS zHQa@qyA3i6)Fy3_J~(+hDHaJBon(F=wH>VNV$xP&`&p_9^k;Ks9nuVa*tsc=KMo5Q zOZO>;xVKX5mZnRU4Q&yFw|=1jCH#GPG_lw7b)eAkInq_Srkkn#6<8wpdd>cHv)k%p zCqJ&RyoMPsk9N(~sG}l%;r8G=JtgGPU+za9@<1Hx?;7p*mSA4QWK-kZG{tmBhSQA~ z?`Cq?>DDk?mV?S<8Y&+x{;pZ2%-?N)bJgX8fAau@K+gyKuE2x_{z|@}g1>1F!oV%1 z&wqLr2DYCDfLrd@4vo zmxJ=feAaBwgo~Hg2d7hgXfDIkFYjAhUF_vrCO+_uhD<>Sr@aVBOSUU;MqVd|Tb2Rq z`>AOwcE~>6%$P~1Otik)igt{lLxjm;=BN7ZM{UE?xyT0RTXybmGa051XZd#O-`NBO zC^U+58+84|q^4u>3$@CTR-n|6f|v6%F1J~sG8%u|g=m&Pp8dY5&GYv(uv+ei%%7;2 z(u0iWr+F(Z(ca_AS=Vlz0QQ`2CU5*&L++PlrH#$^KQUUg=8W`-G4KL1R(VbMcH9~& z$&kx%@-h~{EY=9@o$488+K51a_1d3HLqXEGA%D{pZ^;M4y9;B{#6{8r17$oX*X7Qy@|xY2u%4^hvXV2e$AujVO7~0~ddOgMPW*3OcOa%T9k^Az zF={TkjM4{{#JFJ2N3U zs&<0O|8!t+g>M_sDlH60a<`ZC)=599HnVUq0DPcBMi4Tbe47iX0?_;%y-U^IlN9|o(#C( z&p4Gt)OOY#vkR%1?WR2n_!6MH^3JAD{?Fd;*<}E= zh-1W6%}Dv-jNubS2CeypXcyEEJjsF_*b#15-DXN^vmDw+N*Hw-!cI4<*3Sc)?Ku>C zGax0o4l8Ce5JI88qox5A;`tWob|duR65pwV#EeVT=jD^{{)XhCC3aNk7aQoF%4Y;~ z!;bA`^L z2dAYr)5E7u5q8Vq^q$jK!tK!ZC^!{goI{kPzw_ChviKlM-hc?)z?fb03MZl+ZINpu zX!_{RAhr#-59kG7OoFX2Cdi}H1nP2U{l=KuJ#oaG)+-vIeuMB-J=N?{DrTu8!kdF+ zDY9Rx00Ew^r}CCgpR4a_pzxR-D7ViA^ts$?cap7H&!dkOZxv{p4@BBL(tfxsYvG#LWzVU9S+c^0-82(%NU{*n z=q%KrBtu`j+XF9epcY2YKSs?+EFN8x&+VNF7-B4Ri?HpZ(}f*tA2%HcwjC#DFP43) zvpT6few8g1Oi+l|++e?fKcH!U4Hf&h_pqse%A1*fDjOyDG-Q+5e{)#qxZov>$+MX1 zhupktZ2;Un*J70=`d6J7c@g}DqPp6&zQO;ND4TDR-{=47DXwDNPm|zhzxg0o<63MR ztydUecBQQ*VKAo{$KD(8M)6JpYV$ z&(3fwh=cIJx882GJ-W~mDUDH5vTd*8xdev@JEX}x)}GHH3fTVYaEt-QN?=A-Cuq9y z*olYu&3k*PewN&JNQ4L+*RS&}YWGN)Xfq8~X7rLnYO4Nm+G9ihZ*PV4__;)Dz@E#N zAsnduhCgFs9`BAaea%Y?+zuNiH?;scqWtkS^_T&jBiW7IldN(}cr^>l!Lr_6f>SO) zhgABwGGv9L$B6X$a$WzQSC~PY>@X*=J3AV8mZ)RD>d^fHZKqOWAPI9ea*UDLk1hl1 z*R&b>(Z-rYM=(s|!xy?(=XIKTop==h)u8K?-7-7>B8M%99_!RQI?ezhbzo4PiU^12^-JC<4iY~- z-P{ZgX77e*`4G-N1J<;wBrno*H6fSdA^XbSKgwf?JbH)BXW3w4<_#y$=veOcXyk;9e$jF1>-_N6uB8Ri*Lr+Mn#hUSur_3kws2XsibAi; z6BE`d&J$hr@Q%rvKuox(c*4yacBbPw443J9jt^@V4yGS+OXB6)?||iliKj8x$4feM9Yeg$*d@VI$GrEo zWq&wI@M>*NL75Z!glB;cp?cCBFkhF9DB zl5gI?&xFj%nWqgBWrl#(Q9*UIqrdgjGHpx0R(Ms}hO(#Z4FX zam>{Z@15+PlfVKmI4jWo`=DXDwSy+zO#l_YKkKUokHuVn(|so6>sOTX zxaNA=_yVe!qCC0Q&j$WX%}W9^ydF`3bY7BMB9JmWPF^%pa3>;{_gTpL+dIUpM`(r=s}#=ho(z zLJX+2qd*odY1-aYyBndG`*9T=tYakaxyB+fYH595-cS@V>ZJdcXyC<#`bVI2*JC-H z0{S+|mIA7*-bS+{P>T;YnNPn|7;go30_uffk7=L`z^F?c<8 z)X|yc!}Q?wtJN!$zDP8mEBjs6lvnn|m!ieifUAV${JW10l4Jn&5o#rl!G%jtHu;l1 zY3%jyw5wh!oRk?|{KzSas_i`^G8Dz0kT&ghYt2>IML08WLD$HtS*;!)u#3BH zPul5w2_{oi=Z=+eOAo}QLcqQjGq|nn!JD)F#%++n0#l{(sg12fU+$;oR^`vyVPQ11 z@->jLM>%jSbyp?+iUEhqiur|Hx`pfcFLln)9f@3m_dg~T-{!uTk!p=Wzax_ZaO9Kz zLbE=Yc(Tv{Siza_UXfX^~}rik}2Wdi)$<&r{4O4rLEmfQ`IKB^?ip~zdO+dnD& zuSkAezs*uV)-Q4F3-45&JO6a1|BDg0Yu2(W9m#k8ZwYqRwZfZsoogvR7q|o;s8F4+ z`X0GF9hi@`fWkfKc6*;J9koyYefk$t}__K#V-H%NrU0XP08RFI;@{o;uVK2 za_1iYyIZ)l+dZaFbXUHzM7|JFZ#QI47rZuj=ap;o+@h$I|7nN6=_wbfQjy4-U;#Yiy%m5S`0Ao+g=P1c_I!x$+XI zxlP19rW*A_=1$W;;_!RwbFmS4>Z}v2j%acDv1hYcO0cjWxf60N*Qla*^GBlr3Uv-7 zM?GqnDO&x+{aakQCQ37H?vaec2{rr8EzDO z3KiGU9Hy0{E8|Irgiw>eL2@>Q@KvMrlJhh}o;m&RYIb-)s)s~|cRTRIx%N!v7Dk0) z(p5Zr|FuAGT@)N|{|+tb5n%6*RN1BN6fCqj-1)W3?_ZGplsF~38MvGWIbakvtgzTH zp+Z;^MwPt5`X8gU{ws6@^sK-aGmoP3d?c;fNC!%C8+d*S_{?O?SOOaXc11Ae%|;PG zz1u(c_cp(Rb&Z6n`s5bn%ANW^+Z*|T2S!LK*M5BSR@6t^b)FATv$}MdV_M(EjHC^4 zHWDbctqPET0_u{MPl^l29JhWP5jD_xdBzmFPl!0{rQueM(Xbu+fW%U?aRZ`w&Q}V& zISZRB;z%Q;4}SIODlGAwUX310J_TC0{VhykrN+O?0~s5yW*Q+lVPpoXtc}&*jtDhD z-K;h0sIKmMXU@uWIZZ=99Uf*1Mu6n~3*SyM;PNox_h&&n3m!b1&^+GHsQkqUS~9^< zqlE`Jk7Dko9Vxig7}@1_G4vNTd<6rJklpw;s?5dG^X&F}5tF_PczrX4_QRsWM6ZU1 zI!vFBaCh)~!L4!01qNyl>G66hzI(bb5r;)N8E@6L$63At9idr%EE zS;{8kn%dNR!L}tXhCFLsN{d-LX;G*6&bi3oLXo~Cxz?rpk;A+FKaqyhWQ0YfPky)5 z&y<}_`ZXEy_%D{>khoX=hQ;BhI8~le1TI_pO9c*v`T`N3ED>{yolWRV+*+xeX<=Q9 zO3(b`D1$_-Y;d@Bsa(cM<(v4ZDvA$lA`?f^ zyaM5&VZlE9{3qkoY_xH?fIuB zv1EFvsKa#)c#Mcz!9JNC}HE~AaO6F&U8je z;rj(&)3=1U$KDZG&|x}j{e>=8BF*N0i+uT{eWei1Vf5g=f7+j-I5SWcX3z>T2`_VY z?$2nf+XK5*;*Ey~(~j{1Bo{;e zjjs3J)J{(L)^{&oaw7>GYcvSngOon)Q~YzGcKpf-Q~kxonmjGn1tiG#c^22S-AAjm zn4{saT9I6%sF#`!;rgFLd~(Z$+R?t(=9^{$cifi6iw8xn7+(#MtRi7+ABTrIgniS9 z@8yUEb9K+CtwFv7^}X2A<{#LD349YuG#_ch>}JdEgV!F7ZNC4G@)JSD6-~ON2sio- z9JRIZA5U83ITOkI_RAfh(zO+={m88v%6U=8OY-W8n*wV^QHtPu)Mo5f1+@)$9?0rS zBi;>%f5tcV&(l;d%yB8elM_@vZw{pRv4!ai9U3RiFEIH#emC5HRr3=d#(x-&V zVouX5V(GuvA4E@qll~FOElk)Lk%!@_*4DXdMY(3<+z!Of0kV&}{HfFYiwEv%N{Y}!>}wVDgf)!#J;;kstUr*U-EQsBt1weg?)gC9h#Y8k&1vE( z-iKwWDxAHAys}FGBl?Pbo2@(rN-L9A>}_i9YXOABQFjM?9fGxVC1xZ4BzYrcnuW1cy??jW4?@`_7yxF%M=j)=`L0hO4iMSjB1EK(Qq5QU zX%9<=*JZ5RM-R`%qC4I-N@NY$b%poY8c6%-=Q+x*1o6a?_zH;n2qI#;0P(;w35;dA_yo5BHhy6-IpSzFf>RjNH<6iAR! z-NJrd(I+)Y4%OEtByM-)ta@|DCosCy`!?9zzV_F^z90wC)kFbh=g7 zo3@r8AdXU$LkDEfB39a1Dr{Js1mD#{`bcc5$1~i1{j%&g7%jFVTJ@#;aVFv>YQLQ;pMNB3xFpu~ z?^ADoms60Y!(CGCxk+^BHHYTtZss`RixQ0HTYTbObJgXM89nVg>f{?rTrEN-o8WzBc<0#D zNxG^%XkKOz(hKd2w=ZXSh3kDOWLIfC5@S{{7SE9x8aJFt7&%E zqI|#b(sd!7a?F3_PloAvQ?>iXpyAKhmNwV~jO^W;33cqa5e;Gmj?F{3SPWi+ciGN4!;CP`4%b z8+H;9(;V&{ZkMG~qPK;={tMdWGdCWHDgXW5{}5RIr(NN{pTEI9E4EV%gDUOsILGz< zJSPOOD99Mz6CLF%XGgs*JZ+1sH1=3r=F2t|1gCKN_$R}b2dHGm)%d^=sRvQWES$0I zmC_J~2GYkuZvIaOhIHLssB0@@`NZVBc`PP#R8jtQ{f5q74vSyO?=))+k)yzjcPn3> z@l(}Y<6vQYCHeLN*>!;}txU@~c|>q#l_AngC+1^DH;<`0+HlKkupdD<-;W^saaVZ| zL*z&3Mx^A@SVXRTeVEFLofbmBfZq?4!dT%NLk9<;aAAL-K$k-(Z++pGg-NL>tu2zu|lS zb^6YQXB+k4+spK$IKX8V13d4N2xKJ(RmR0wV(&Q4SxLSkQqRLnhM49*c3r2F$a!f6 zQM+8*TOGoBKifZ-m?j9H^LwD2Q1z5Q;VxdG)i`6f_4B!vCc)j3wshyw?cw$w_k27B z2fiFH3DakmLhbMEYvDuhA8l0~S{m!@icCnq(uykR_ONox_XOK~OL0pB8zH*qIYql~ z`2zVCi23G@7v>g(16darx^``vThx`=a&;_k4WF86-s69`WTZk4)6n@1S78DU=Zd?& zPIJrYiM_;&O5N`zO8bnG5UO{E^LihwDRt9#LS^(Tq$plEqs7EoY5wa^vR$UFx``A9i|kxZcbB<5ug}bK0s^5E9yK$KBRjhv zh&xB?5`WFao94~36W-rADVw30{wI33&jekja44w@<(9Uu7gt-)nZ>nkZIPKD(pdVP zRywo>^vIzt(+bJkDlcr%?-kQ+Kh7|AR>9jD4?jG?SpQ;|K8V!(KH)8~;6!(Xixk7@ zseIzjkk?@@DvTY?rOyHDf|(>>qD@CyR10arjrML(K2Fhou-)RU)kRWOJ0uY8G|AUM zaCizN6c;!JX@`H*Gu`ECDbzI}A>YEb8ege^ihlRWpvRVnpF(+bHVlHv%G($cApX{ZheMZcNoW{c5wYVA)`4G$g55sPMm4Ee26DO zFq0-1D7>fU81;!7=dD3;aU?(9o1cC3cAGIDH7nc{0J8#*WV5G0q+qOSHI)eAh!|t> zRbeA&JmdLmbgBU~8?EV*QqEaKDFJHTxF_%5y|oo7EyA-^<5qO?Ab@GO7&~`4+o*^z zzI6sYw#1{~Y;f!149hi?l$w+LVRE}uxuBDnQ&748TbnJ#I#s^AazoWQl{Rpq~=@=i`(g79?cY_x^ClI8%I-ks9MLMZpq8YD^;fB zv+ppgq)LbTRyV|TsV2T#12}%bRhgieCgAq_>h4)7Q~2_YGFN`ve_j(U_=Jg}u}%A)3F(z-Kh^6qq3=#vuc;8n8&yjOF1Ej~ zBrKX-D4-ehuL~Iz(dw&Lq$^A7k+N55R>qNnb zzpVJ_Qn5RTfBo&Hlw{$g3AiVS`~@Kg?=ei*5QYd|Tbzz*qt4uCN_>7oA?=NKz^9X! z&{wEq1bMXNQGk+Pdgp+aNW>fR7vG}K!-R|iCwsub0a|++%?g}?akueJVAjo7WLq4+ zJ`ZD2K5AZ`?oBx8)f0*Nm7E-7{nN((i8 z-i93?gt&B_9=S(l)<=8r~QfZoW`LttwT$yR*A6JtKzQ@yN(Es%G(Fn z(DF;gDn={y=O524w;Vg=ei*a%AdZ<^SdP|q*6>?7f?58)*P^AVqTGfgBv`WwX`5rN zpH5l@FNP8ntR?AV({EPGOq5zUR)p6ZH!Rvt_}ZE`5?|OYI#0STC&p~OVLE!k{30~EYA*L&fK3# zTxh}LUm|+=ZitVwV(@!L*mz3$NqA(0j`6@k-n`Lo=uN@R)@IH3z0PxJf+4WQHsw-v zJ)U$dKTNw`=Oe>sh+Q5*ZV>Q89PdDY^NyQj9n$^~uR_2ff8tfE0GLkz7;)PydpA!y zYZqI=r0Jcq$b1HJnY_h0f}r27-9$an(UGEd-}$?r^6J0OE)BLAs9!8X&hN3aw8Paz zqMj3b5sq`L2G`hU;R9I9)op7z;Y_){_p>1bjTx1uduRPwqfbh=(VG3(vtAJrCXlZ$ z;7+{bc2@;nw?K?Vxlxp3jYiG<$Ft@(Q3beRGLc9%l5IUSGHT`QMVizXSB^ez@lF&8AQ^ z4#5t!;{ztoOhw(P!%d!vF@7m5itFM?fq|Fe#_Lxg^|_xiSk)pJmjVu^LMNxUa`b8M zV@xICY`U)$?5a zt|`6%{sD~j4hBKRE&2IdZZx08E#^Yq6_P5s_QXX1MTwJeqJ`7pStMI=I}s^G2T3dD`{S^z3wgvE$6%iO_#y$LVrXTmVcABRo{hbhlJ z8EFJZzMR&gxKP=?%gUdbWc#khLoky#mG5f9OfJVz1s~4I@a=dX!Fi|LVSugf>@wHd(zXq0V{hAIY1Ll@lvBwM_VD)fv+H&*5*0x2DjvtIdlj}qSS5t9RjbI(#3TIkpf|mniV8H?(X8UUM zU!^LNF!ej5#=a|oA)MREwoX8Ekf7~BCfgt^-vWp5^1>k3X8v)sda2~{$s274W9e)i z+-wOYW)`AD=$pVHPe-cfgf&NQ+Y_(d5we-;Oi1e3+eAohes&w5mlvbV0H>vhd2KB4 zHq77W)Y4#=24@FNZD=Adt6b+pVachI~5sbe$mAn5oD|tiChW1*U38ZLcspoz_6`eZ6-&%(=KgAba?$aj|#7y z&A6+_;8rma!jBsZPPU$8 zn>+{Px7vS&kQ8u8xfYd~2>JZC!m%3Z($;-<^hvdvMNFB(k6A~ickpg0yYc?}PCSXS zM?d*kzA7{yE~%}F_V|vpP&H$7R^|*Zs}79HVKkH(#5IA(aWJT<}Q% zkAy2dHJd|DRg*JDVAB6$nXdB`rEQpFd0}Z^Ocg85s2>vk1_&V+U!4AbfA{~L#Nw{Z z^3U7__=&yDmuw0wi2-TmzatlV?rKIbU=r|7m5vVS)(d^3^PKC2J{5C!HoAivb|LbM zvtmi1{HV*1pY(F}M*Yau-5H8{8Pu5L`p;n`DUp;jzlg+!t==>zPjp+2#GW+t&49(l4KNr9Xo=FgPdKTWQ7(L+fmGP1tyog+6j5p>4~l|{`u z)i(hC002NzDf?d@K0l2PDe{+lod1f8qVvl?SrYckhrS!fLaqcO$;tebfZD_dTL{zQ zz}LNDU9ouqffxzZy>Ue8Nxe!Rr?~CQ zjAwIuZOyq5#Wogq%Vt;yDH7BJ$&`K;51!5FN?J06FqIX$y>+#1+wRv9fqTUU%eRRZ zo+IRa-i6j5$%&#gtZJ+aZbL~G-2h|BhYU}r?Y_^Qic9@Y>=V*=2-D4xj@9<}egwih zO*hbHq%%q$C?jE>sX9-WsDmJR8NZDQ`|5?7mq2HZex%Wy9FJXOL+Trmgwy_}{7>Qc z#>~^>dfk$GAJ02gvE0TCq|o{rU8Tb^J#(KiR+@?7!P3rEY_f%kp>J`?iD{N1E&!Y$ zbmofHAxK=st*pyx_$2{t^d4fVZa&I$?kTMqn*;fLUf-Dm%%qgq?6i8KWww^pV#90v zk0(NCu>b6jDWU^+l5WEF7M&B8ruLc)9;e-PG~!jq^IFaagiiD!vmOE9;K=w;{rvnM z4WnVxtM;42F^+219}MM;qO3~a_OLAhDdk;7^knB6iga*XU{yPyrP9`-TT#tC`pTkq zFObAfb^8k+t8N6+StI>bH=UoQ68E-F1*^yHo#7*6^YD-pggZKGVbz*gg`cJR2mID{ z<@P6goQ8FO@jW1V=;!+wS*BvCLu7QpN8lLhn7nQCYE9vJK^)IPdC}gFh&JO~cehM; zo?fl>*D0{TaCl+dxTTMzbUke}7QtvrjM**5^SESX~xfe}HO-{>eGbVY~FnEv07Wa1d zoAHxWe)E*oT9N0-%$Z2GdVLE_+Z5*5k$jT!>lN#GcEgz{PqeJR^rKPU5lH5QU zI1+jbH_Pl_MaZB4(Vu(oibiTnR`v6g%w{NzGgXTu5M1Nh(vF6sGWzfHh69C>ZKLER z+j+V=cNm!VcHR|3mg9zses*$vb(*^uBO&BANT$w`B;i7=f`-wBMN`RA@Z z-P)ez#RG)|*DPndh?J$ev`^0>502{l;|(+CuIYMAJPcJK5M)~?6b^mC3GAzYfv~!d zeQ`Go9uB@K=gjd0Wj?QeltM&;SV5-fs_ENm}jTEE+E#z66zt=0=?AKX^H72100&RvmW^)K;gmoO_lO&;STri|jg@QTp| zzV@u)V+5W?h4xsK+5qw*wZH0_o0)HakIn8YK?}5V6vSiq))bRWDy^G%2G$E}xekDjQhMzXk9;NEiYsg#}lEN+v%x_8Z`E&%SmK|cWm zQrZ`BZ@YOQ9I{xvDfw^zlLV+9UE*8vhXiO0s|G-DEm2C&#&;l0W+v424q^hx!Z!z73rK*8>rCjm4)Ko?aY&pT1MAa>v*Jg1A z2g}uWZNc?pT@*R3dW@RV-s}?$ci<8Bn(N^w?c@T7VRVC7p_LG8lTZ175RMu9_Ag!4 zdBg+zaz3X>%ZOuQ@Scq)$ClHW#9_7+;k|^7++hA5$;UKTOt@^<-goImrg7D~3Ea&n zJ8}$YG7x^1T|m~+6=?nHa=+C(PeiVoviftywhf+0Pi@QCKGc3ZK+!dTk?=bYy}tfC z4?SXI6hKIs9&XcC@~$Ebo2^Nazg2JHyB(`+lL_hm*`qcd3PNzK{nPL4lpllg&n)#R zy%8Ys>BaHqDL8J!Y9A=(4{JbL4xKVzIAo+$fkP%`s!JSJN>T7N=?K+?PZ$r64g3Znj17(G|K883=Zsx z9Ofs=fm)aQy$9T5tGdWN_agnK#Cdr;XkntdfBF6rv32=Vuv)XQ3Hq!*)y>m#G{F9i z$GP+zVx@a7;c1Z}kbS;T*qqwM>p2vf-mn+ikXojm7+WL2qYW@D0uKAN22UG5dJnu5 zz+)o+rAW!DLZLMFq41*WXvt#Z&W%izv-YO{dDg6ZMV~lX2Adt-_J}?2HaZ*<;p$e{HAb`MwF14j+ONTYW51MMF9|UYbMi{HRB$J8BU>xN zm*P@Euvb{i)d5SaK5EuAZ3ip43@Hxu&jHt%35Me^XIHyj19(#Hf-c-TvcKFq&3$^A zfq;>l8U*CH7gSD)>!>U;uL)s5Z z@(WXtWX!=2>+8PJF4>5S8ho9G0BDF1f0r}HYYQ!g$1Z{?O~+<3Wqj673>=+1IdR_t zwXTK4A0E^WqMEP)quB7{R-4@2F_t@6xp{e_(|t3#Ab`2sJEdBMx_N%Giw=rn;{E=N+7 zBK4Y+`?ymvZ3O?Y7xHNV@5o`iVVByV0qF}`G#1|kFZ<47R69xKuXYmu5Y_$4UvOAg zr+?cAUbDK1E_IA?JlE7h0ItMi^Sz=2GB3+nJ(`t-4;B zlo#H(s_CJo8aq_h7YkFVTVhPs0xR+BmYYjyBhfX+K&gFbJ{$+vH&}>S0!N~JjKnAh z-a+kB@-RkV%k7$7xUA9BY;)4^991wtKcwF4W!V;wQdF1@q5b|eJ12!{*ItE|ro6ky zY<(Q`Ja1;wW#Ur8_=NP5}1Q%>_2Y)6vhA*X@LL?2cBT zYY`n^0be){@(gw%{Gqv?LSo=Bw#4IWm77q2~rAb6QTtcMXW!fN8`U)EtfbL z*#z#b5=O~MG`CwA=MmmA4#*Yw72>MGjp{6q||SIH~E zmX3LSfq(J!)J9itjy-kD=g5{*npEUGR#Ev-i$AbWw|8Wfyry<%*fO`zOtqWdpRwst zZyx@VB+@*2&<#s{f6(IMk6){-1o_#ec{!BfI0g=5Z~k?7eAF7-T19Vs)b+^Xl64&S z?Fyv)?Z#r?_4(s0#p~+_xLT8~MmILDQ@-}8;AWEkV>qreo}igk`hJKzC`iw}b8x!x z`E78Owa)>rTQnTMdAT~=gvbG0?y{zT3K{)m=x}50$Q>jd4fn%1{G7YOh_gWA0g+Xx z|K@5=@&y{Y|MNi(dYv*E0VdzGyl;B$_^&;B`Q~4J_nwgMSg-imSy{6;q()zruNxQm z?^I{+tIBf&pW7b=%O1U|XFy#GCoHwCs|riSp#O=J-rW&B-|yZqV+<(KsQ5n5e)0Gn z2{;W2vb28ei!Z^9Dc5l-!ZbRM!!%?y*A|enGg(PB+>- z#_`1N&}7ds2>i7;Wcx_IjR0IB1*r9-z$82EqSjj!r@vfRQRN zkRA~O;A&}~j_){ptby%)0%NC0ND_zu_IWC@X$DwynRL1@(hB(WwR^rDi_H4Uv)r>N5U77uUEi;K*QGR?KNdAoGB z$MNEi$a){9DFe2%*0njJ52FIAzyh^nc@{zq8H|Nlya^6Wce-K|%Y9p=>MCntFtQmD zJM9^y^e?LVvqvp`2}f(}<&$Su^fQmN@wCP{erkU_I!bynn_v1r1q9{B{{#d%Zad!w zqZ?kY;kdoj8dGA9IzH{>viNPzp+1?qSCQvOMNoGy^xkz&$!hbs%WPbYJIibDHMGp) zxFl9rp%M?H(x_%go!!K1uoJ~o!cmf1vulB>Y7uD$t>Kf`CL9N5D@1FwNE3x;5|nQD zm^fy^&0-C5bCTThK<)eF!FpXhxegYfV)M7|N zDX)M}6`)p?$O5w=MHb1`e-%U&GwEYI|_b~HP2hEFOF zNpP5D68Jh6KnK#hL;ldX2W~ayo<8Iq-f3wFO#h-fABaB8lgjMPxC2>1&aGT3pGsCihn%_-44b6X zteo~sZZ5eT#j&wTmGGMWYH{3rbf3lfMfXNL^fEWL6Af}>EH8oSoE!FkGMy7O0(8%? zJ<<{8UK@=RwHg=*>YlpIqX!SsU2Ey;+=2g;gAR+I3rCTkAbDqPCe z1yT-bg--2;$L=%$Fx%*h2CPfW-mbyFHiD%tc<#0ZQV~KO?9qz_(1OZJonB?)F&*@! zCQu3T#^!v?`~4CC$#75f9V=hf^Xcqbkl3D=ZMP^s7#KJvw8dq|4*S^$Oua=GWU^c}4B4q%bSD+$ycm zU4(@FGlV8T9^Ed~ot{Tv&`bi9>+N6$FIcyK$a?giZZg*@NltIxYN3+FpHaLFJuxgP-`dKEh&9hDhpPhl2)rJ+X>EYA30*i$Ww%5Q_}#t6eODqm z#>m8f8&`gOzb>Eec*o!8PwmF9QIxA7Y$AL;O&)89sC$MTt{2g^*VM%9F^+p9tS^0MZwSP|#vcV!q*@i)7VGrrf0$hyZp}*uhzL70$o-c`p=5qRRw z1PiXwUa0CaaC5^hJHab&^o~PW`6Oe1;A?T0R8DUZq3+D7KkQegU(iQ15>Y+~iX_OK zKTVqq9BU6EsmS^8;e`#Hqq+MXNrfro)lSes9D8H0XDGt-nfjNRRb=^A3=mtltBJz# zQ65OgC^rz5BY2p^wY^Ke$qtyMI7$-~X?ic_qr$X*lsl>Q+GtiXiF@p5vz?)0bmnI2 zCugX}InAMV+w$U`@|9|iF>|$f=b-=%J*$f9PG|YHg6O7_#7$`Tk-+{B1@b?iR&Ogy zXj_Q98qO}NKZL7r)eP*Wm-h@ogUF-ixscbYAv66}@HSwSN0P=lb)@L8s_7;U_CGRd z+HiG;8smO<@I3hHReJyuck-#-DmoP{$~wG~I{xyT37p&$bN|U86^Jl$J$BfpmhEds z>RDbI?71yNY+2*G(HD*`-^HM+d5G3ip45R!{?2h@j~)R3Olj#d#}(H5eu? z$H!51-snA7!~J&She70Cv(N@+pj*m6DHN~|B0%wn?j})J&(-Tj%lh56WrKPB%G~XbiVXwKBJV@*quYAJj5t`OYWD}YA^Vhr|a;hN( z094@JcNO)lpuh$x{Upm_cukFHdw%ydtcb9dKBYe%1~f+mvu78Ii`CI%Qag~to~8%S zi}vl52ny`MKX=Oh@T5Vl2SogUHxJ59`k8ma#ra41u}2l7jfH=c#X8M`v1a8%-(0Jc zzX!di$Xcy|CR@FHDKH9Z^jc7s)CYW6MHr_zI@}(n4lf&bD{!P%5s2aZWlgiDP-M55 z|1irvw%cm!sw43|QS7Bfzb(k2`?7G~nIFU?E4)!$9V=O<4|%e)^~=kjuNCr~0!Z@* zp#_~$dH@el49xmvh-2igH3-^QksvD}%oXa8sS!I1o<_i52e({@c$?h93kj0w?T1lU z2+RA7Qwcv3R zp;QM)AR+)QibS0?l0oo4on`+QVSqLIn20u&8}G8HYe*mAqvjYocjb*C5TZ|w9lMDC zS*~QE$^Rq%SITy;v7~yN9Z^K41Aj)tUa?WgUAvpYCfj5KOxO=j)>)n)gCb41uV*gm3M;2{j_}P>1iji()5^F7YD>cm@ zhRfM=73@Odt5~W@4Q1@Z&F4B+ITlTb1}pc`D@GfmE%tVUh)Qn12~gAC`NKO2W7Z$U#%y&dgGghjN=k3l zd&1_I?j^^YDf+c$qyN6o?l8lHSiI3^v(M-E zuWwG-Mx6J_TBSbxQt@_!YimeXyJ-`X)2q|i!)LL+P~Ja*!?I28FZnuJ-?UKruWyzR z)=NW{yjaHq;0m2<1}v5OPtTfV%5H55Oy@SpH-PG73LmKdeA4aUa*sCY%e)}-bLCk_ zYVuvi=YSgkHKu2IucXe(lsQMkM*RbG)MEL83G8G~@z5~svUb=s>8D{qg@GGf{l%lx_eJ`TKvWmx}K#dXWwNE zvHhj05#O+cLysjW^r+1P1q@YGJhmAOp$`(e$;TXhK)->;Z&ZOB8PXDPT}b6WE5#!7 zI^2Uk2JzbY&Vp$c(v!F%ltP)hn)f`wD^pi^W9TcixfSsO&@jRMVy-z~l7nHCs3be= zy)zr=ASmX7%W{?qq8J49Jlm3fmY&%XsHtlPHFX`H!Ofz(HEaZjvp8cDz+tMj_5m4G4x|mVJqK@jUh=_O<*_ zE|B|vOzf)*uw_lSwvVBMMY;(w11QPc!f)4agDAqC*Rldu#I)8eCcgReaXNRGuQnTO z(~0t2I-zAX`RL_XEwQ4EM;apn8M@=KQX&R6mhe$5{RYhtrrhGJGx(8?ly9rXAjxnq z`;4SEkd<_hKD`4A%V)Zd0ElV*kylV~&?DF15n3x|JfOa0n9gEzIMZl~Q67@|wYB}( zGvh2UTLwt#KnM6A{WNUStycy)%%N@icNA*C7>mVZWqI*hFg25stg^5rE!0($V2-Xv z3o^>)>WLC$F`B#g1ryN2A*+@lgKb`4SjMSbElJq7Tj?*i=-KbV7X4?6&F)t>mVjTB zHk=;RPP@R0LfGbdO*UD()95Y(5Gs!la@dy>-S)qP09lPYyakZeV&35;s`>!n&|0$A z)OQoJxdA^zk)&)ofUJiM{;Fu`AWE(RSZ|%X~PY56C0niq{HT(+%Dq?r;a!JBp#<3 zIn2qkO_}7JW}Y#z9-rn)%ZtGW6V1niI@1JXUq}^b1E8)<;@Z1M^_3wAr<3KY=bj{j zxnc)~;)sDcMJvAH#%c}*(nTe)RsTpFu7bS_s5W?n-8Qtae@E)-8P(etbNqyz2=10?;iSH8V13;5_3eN$b;Pl+Yj- zQS0-`qi;>*c{%6O)_3i`*4_5uJST7d*)krYY&uXGl7^JLROtno;wXaY3%K$Ef?VS@h@h2C|&!5mkI=CnVcBm^wgX3IO zovRJ!u{=7iSOkP6-SZoL;>Hbm0iIOiu@wcV7dqEDHN^hV(`_(6Qa;7}kgm08>Jj#IXjg_wvp11BHuCWPcwrsb~J+bgm zW2L#_75|#%KrSj@f&nDj~6_RY%+^N=*>CA)=#fo=d-IPE(c*!QhQGmDQ2iD^q z_9|U=d~Y#9K_JfTNDFJoiHLoHL{aH7I!P?wILTChRh1jKJ_SP{z@smQy?`@^oTmum zH=pcwwcHw7xqBf?cIU>9w4-DxUX)|BxiLNjrdNGf5E!pmE|{efqCQb=($W!RxZv(C zDY1BSl8mbZo_RZFt(yZ}z-AF94ujS5QNbdmTk56j-0)EYO|JE41J09=3Iq3<-o*!X z>uH=~Iq-;l-<(i37^MUtZ_Uc=QmQ76Q2RcoD(vl;YXhZN3-c;!yFKEgJNrUBAyBsM zVtzxSeJE$NT=RQzic5pfnnAhb90jTXIz%4^z4z2yY0Lf2?elQE_i)&62-PEo5YlkG zLe*0n&&#+;IRTHkY8zP#?pJvXj;r0}O|GB1X1A^vN6W=!|1)MPu&9wjnM_J^-@K)< ziB#t=&i=DU1y(C^fFaW_j*6Xuo=uLc(jpjoa&^atFU48yH4~i3v;?h_+*=L$z8REu zv}y*lSSI~Ro{lFP;Dk01NvY9bz#(YtE%@R1297_b(R#FdO_~EYx4!d*zOYce1MIf~ z%$KdP(;~)OB>eGWm@+M8%9>)Xs8#pIno@<{tQe7qlhx=nmNoxlwpcrg1Vl9)W+qg~ zA@yhVJhBI*5GNl_2OOh*6Az;;zNFfS`dVVdv-qEB%<)RA1oObWE5##IPW`*C+=iPwZx zog(^TltL7ou!7-lHmDXdEyke5w{fA?YrrE~8+wW5rZ1e_Vlt#5w-NDQN=)zOg= zRVPnqRqj>CbU+e|p|RCtA~NKKajAjvP7yK!Y!v|sP-}f4Qkva%guZyjoEO;qOfCv3 zdB|KsvyhnbYr)n_fTCddOE$Uon+ow#aLpI{pn8Qj4EW3aXbeoR)oqACunkq$=m>{| zTc>m6MRI^*3Hj8W^g*uhKSqK&G_hGrPk?szfy+tvs5*F9iSoCHU?#;V1*_aS@DhhQx zJZ$?Qy>%7UC=B=)hVbkV-&nmcuqn(#pBB4zc>3s`s1WGoVmt-8%i$UfVZMNzo89)Z zbmeve30oSI!cDWl00WH-U(Y(Sr=ro`x=>2XyV=r!r!}<{du(8M3Q5k!J8JdFx-fHl zIzP1TTZNCcsMntS-mI~=S>P-TjJsb7 za`P@!Pll;OJ+#AiI*^5c?jZsyxdaozNg**O2Y)m^*C=q>AwZr72C>vn_b`WF@$|(+ z@b}tDswfJ_eogWx#;vK+;nxg?s_;LjPKbsXqwiWab|N!wUqfi~hp#g$cQ^a5mgQpv zUem@a85kGxTO*l|+SJ(Yf8N?R2z{o$4eXW{5CjF0nzsT`NT}9^`xz*T*%I4m#7g6pBm^u<+H4>5ExU%O0n@(C3&qEjf zOSq6NaJLD{Zm;l+hQ4nEG!OjN4r|wX3R6VNtX{r<^ziuFW_g$en*wpWIflYl4B8})%7wtZhoSkV4pakY_T|7I6os60WjM&qPTcXofhbrJp5F%Ez9T( z_emW!WbUk_Fkn2m&paR+goRh%N#ZSJhB}d;WHT6cE5(H2OgtVx@t`!s-BNZ%0YrW# z3OoZ-ZgR8slilFZRTCavY_q5}QU8*fWabnuGl5^izaBP8RA#T}|7JVhXjPC}53wX$ zv7EUO7~NM*h;n<-u`k$5f)FVa|8?2K ztZ~`IJa)_C%UAOlcux1A^Vf;Y= zmiTyM$1J6>TO^0cSHx$z?NS?T1+K5gX`WsUi09JodBWWVTSeu>gSrCLy4Ne&MgI>*9hV$@7ZVb~Q3v`J~3@-LXG+guK zRSytOqwayjxF8d(9pxjutu`(wrNI4w$ql8MNP5hBQc@y=`wY6^$4XUM3V1X>AFnRo z`QzTaWkZ&Y8d}XI8}O1__zQNsKK;M69(k4EE2i}pFLW&QabLOU5FL+LT5Ef%Qk-|p zmTytnzx#Aa4H^HXAdDQJ<-RV{@zaoYf&%k=gsr$ULJ6I|(m66b$cRJZR z3UVV+oHRUfN7ENp6_l0R!q7cm-p#evRT?v35$$n#3{>>5b(T6(#uDci^+%*|_i+ah zYE1txOXt6rI~)H5nwe9MDlvYx21-y@ZM*9-7Zc`LX%1Gdor_V>WchJa9%$jY?r;#* zVm4Lj_O+9#vUP6KD3C=S8hB&Z^nw_z>zL1Af{8UaUt<3q=>#a;={J1=%L=gDJPz(7 zv-rKW{|RJQ>jTC6tz|mAW0n%$M|bP^ufy>J3-YFPQlQqA51XdkM4LX> znIxlkc(^6fQ9mkSeN7kMIIkm}g6;0)opqskoUw-liS{pU}qE(o<_ThGZu>KD=R?KJnpNmX9+T8t?cqNGvM(NNT= zP>sTy#F@fc7V;QbontKzYpEypZ{){4s13?n^dhXP&Wd4`;LwM?9*Q?AhOfls6G3km zY`M>RAyeUAUHYJ*@P+Y=wpa zzWq5*@ZAdfL z?TjgVIra7E9tNL}6}qq(JR<5N9mH_7_R z$4g!yRL%%~BUA)d`b$ywP_{R*juLD9BDVuJrXHlNQ^B2umD1ik-z1a5>93s|3ZjX} z+Ttsi3rESS0)iJMz-&vuX{8-VI`Uu5Fz#+B1s3(iW$<^|Fj%@@e8GtRiC@{VS9?ya zNr0RBe#QEmEG-G})%lf#9cu~)%tc(V)wslfEJ^23qL5EA_|G`BghV(a>8^FC)=#aI zlE8n=p(7#16d8KDlrqFR;a(;fnm8(-Z4}l3x{{z5D2|gTS{GaGzv-*%qU>iTH6~G; zbKs_KblLq9X{{g$JNK*SX-8n{T%nn~*Oe5YqK4InjnZ6CbNw&tZ{aIQe7hIK@mME& zS*jgv=@Egf9}lw%Pn)n;brt7XnQe_l~{YkJgcYpE*4 zS@t*D=sd*L8gDe4@Xnd~xSvG4hXVd6*LvFEjdpi7n{i+r)1nT8f$N3gx!k08Lj3bT zpHi+9VNsK(P-o&h9DI#)CR{%Wkb`=K!df&r|51LsL@$8+s$5|a3S(BxZLJegIPG}( ztX0El`7-l5BV2RQoG{mRI2E)lKIZ+M#$GGmC+?V zMuEa}wLpsdngzVE@QWBzZ+yzPN@s~$YqR~U%1MQwh~!@r2RCoIU&SgDvPQVr%o#mG zKAGRY*sCkR3&T;X^CN5YS2e3fPJD>` z6G-bxR=p2O17ZwX3X*TGC^4d*t50!cm1!^N`j?@2=3zYDA<1xT3*Lv+_>Q3R?=jWP-LE|O^8(vr3aAAI zAsxpm4oebkBCSLfe(%AqeW*rG6KvYy$kO52YIho` z-hlQP`|8Z6*R%xKSGAGf5Pk~le!j->$6lGVCBr#76WPfxxZr}e5{g}|af7uf6Danq z5sE!)(osX}>=C8NbcwQKs?d3`!-puP*83GQ-^>A&HkPL;kVN6Uduf)<{H&^Ye7M!M zYHUGDAOyAOScuUaNu8_t#3_7yx1B3@lQG-B50&>WCjtE;pnCLL*|Ar_Qd>yw?Lqu} z#u9Wpys!{Ho7durzhsTW$GMT&>TcuE zIyY^A#@uLub%|+PPj(5An|vJYFgxE^GY-Ly977k3%_bVC>+_@pp{OC9LVd;cgYqMC z^GS9khtOt3``a!bHaopRm%&btzQwYXI)>!MosxsoJx%@1W67g`M4t)oBr>O?Qhzapd}P{THG(yS}4c#M^_p4Y6xm$KZ@Ge z2cWr}$U6HdCCHtwLkEI#;@vbu#Bz%*xL?-{I=leZDWf8h`jzWs5(0x(A*NAsBYiO2 zzTsl2lTIT3MfY*(3cu$THo-38Nx`NI0-d(o!$KV!&-Nuy<9E zv{9N7SOz>M-nHd$D1nEZIG(XO#n^SH?iE>$-euRapVoKscgrY`&uQz<*rGv(m-4`J zDM>FxHmAfnRMvgoE-$xjS&0|8HO0wn3NdrNWf+*OmM%4Towbish76Ged)*yA!l1B1 z1D*`brvBCQA6wJbuN!4)&n*5wqi388q|fyeF1g9U6S z?5JK1B@ge-$|ld))ym>2?7w(kE&&wJ`@&kxP6wyfYO+rN3k8-ro~(J-0$wLHl*8J? zrDyXPZNWvj8#tcxc_V%{?A&hcp#NNf6?-I>*v>j%^OCCaQnHGIXc8+W1bSq5j?$o} z4+ek{));H^cu04IFag+>(Hes~PdJGYcJ6!%>~@4@s7smEk2htRZpuV_D!%ZA1a)&D z*`$GUyK+5yr>Fh}i5N7?=Eb?^Xmn#(1y(!fzmj_APq6Q~4`{l%yyNaQuOiOV(OGt+ z^*ish#^OqD>GxVcP>_(1*u(79b6jhhjxB}fT{lf9LlG4^d;h&IL+IcwpJn=X2dw}I z@Xq(8gk~w-)nGQjuLLn~y!`PuE4)kENt^=nTHhoewb+;@Y->oGA8+)3|I@e2m>8$=>d4^a zB=tXCQU8X}n}SfEnKP*V5Ms79fbU@$aKR{00A_kvf@33H={le|a&y9WXvA6P?khWH zwc^AI*yuU;lISo0GxBdg)jNk#&- zGR1f}k&CQ>&(O$$yJL4|W7Z_pD&(qCHM|&WkZ3yvWs?f^^4j}kY&NNZsyJZd0G)>V zXU-GQyAR&qz@@&hiUYbkwbkd8%$xV_wwX`%f!I#G&;YZPodRH%ny))aHBm2RgExjr zXdSz=SVDD7ZweNw035%w2l>83?&f6@P<@h}yeo+zWSo}|C=^H!|8(sqq$P|fF{Cd; zK41mJKj9LQ!uf~OU4Kp$&ECu216MnAZwvl4d+=e3U+A|&wJ>Xv|5CD9ZXzYtda3KI zKl!aLF?C`X)sVdI=S{6Ivo0TpafZX(-*dbp=O5hW*tI@*>XF-(mrmX*EHV-C<@7J1 zDHrF}oNN@a58YC-4+3N1Y)ORLG-v5ANvlFRnPAv#Y*7dxY7mnXDQ^ItR{4Et1VXZ{5I`&=f@KBO@tu1ZGPtTL9>S^r}etje=e~$ z(E+P};0s&*-ntwI26TDqi1yU*kd+*%V+8`j2yU&Z_52EvSy8FMCB>$WcisCrpX-Gt z2kAHgs<>$o4PZ>MK5Q?s+MTece8oUPl$K)^$-w@?lf??J{l>+6Mt z55+rRDe*THWY_UsK%%-qkeB@RH)H(5Yu(F*9f9B-1kT`fE@D(s1m44?_L&x!`Y^jN z>)&xjn`J!sD9u7p{r^{5(ZIIz>c906LHB=np-kU_Ccm{1FAKZu|D}cC!Nb&dlM_m4 zw|CW{edhu zR0we20Rh5O3blROrI{%*lrx1tGG|?EvKH;wZUF~DF9-f{j}cfdi}3U@ZG*QKLJXCF zq;Zrwzlze2W+W@}+@D0xJ5J>UpG?5K7B)_-N_A$5j*kEkNv){T_q}{fQys3D^p^n{@@SM0mSN& zC;5|M_BMfHHoiSobW!<7of(O&%m8nGIz%>a-X(nKE=rED-gI%=D*P4|UM*bfLsXv1 zSu$R8gpyUb54B_6__ZPhem)r$C`7-|GzKloQ|q$1)a64RwL|6gEGaz7pLtfyTEquT zihK(OFS-u_b1j97AWMz>lb`C(BmQUy|O1?>xb2Pk(L1?%Y089o? zz1BWFNVIwWgNitbe2uN6zkX07W;?9uB%x0$n70-=8|-Fc|7IZP&ewg+A#%# zNH`Fa&@)I9yWoM5^C5Msm&)z6>!`tjaAD&T60CIy=P1CeV zGm$4_T?bVHN1Uzh-+y^-83F#V6D7W6{g`~GEiFlP7}J`cm9~qeR;kLuP0oScP0m4W zveMXq!AMn5YgL`9~+Xp?3g3a=^HQ_!QS(){3%!Aa*2jgT)Gw)0ITB_Q00q84M-$M z#GRS*S*skTz%V?xE~9gS;oghV>c4_K?b<)crpPAXi98LHD&0=$G0|NT?>R}|?zY|# zln|?2xZ>xy59{fbd)L%VNhZSa1zj2iuqCi&BN;*}u_x#(nP8yOiOA^Gyj7vfc4PnQ z0kip%l)PQl=H_Ub;tBqUAm-P*_ z8~Zk(jYHy8VIH@+`23B=Fk@HhigqJUBPA95AtN-NpWq`$h`T^Lu@gh?vh|#u^4v~M zM!nDRR!{Fv#*5H{1(`q&>cXrmrDx{CYS+EXFG??k{t7W{@4|=RBJZ7WxN#!cI*?CN zD7G6AMZ1`H8uC$SuW+iLvnMD9xcjn*J?Ky>y&a?A^|#8^sNZ7n%GXT5yJ>ZATc#fI=Au21t}W2E^&i$lp?qSZPL6N*=ZbUbxh zHOfTlR4VB9E=_N{2sUnU6fE@jrN7Ea=sc+)_A1k*NoHJbW zfjk98r*V(+j1G)?HLv5P^e{*Yp=L4N^0=OB0j{U=CnZJJ*T+$DC_G@ZY9nC3WG+N* z-0sR=aZC=n-n}E}dd5AUF47=R-_tdr(LhcqpeVhu$sOm^szX)HAMuUpogi#n{h?li zVa%J(sZ6}-le14~i=7OMK4i9FQ;|%wG+hi?YOAI#+#kwE9pB=s#P-)sr#+7lffR-I z`;<*h`mz)~q*1wO6-6v|Wlf*M@fx{zYvzo~h4SVFD^IrOC^Fq1^5cIJo+&)lVKGOM z@MceUfjET|YKz$6FhZ8{3>yqIR965`zI9*pi)P{-GnmrL6p$jbfS!$7?C z-k3pN_^M$?KGnAba2$G-NEy-I_X@X;n(SfHqs`cWu#focK~3>}n@-8$x$mdtpU%CT zNN>NbcoFmAUarSpepcG(tiSVNUI79FMq~82okaizpAZ9f_%UHUep`>QvS$Vq2 znc62~q+Y|sIu&27bkjl?sNwk^_$;yu*J>nk9JN)o)Z6Dy4Lq`5rP~8i7fRA(<1JlV zq3-??<|9Y55_7NugNMJ!$cdT1ob|B$QPd=y+s3ELH?v~r+#a+wlu~qOX9enF9vd03 z!>y+dm$s|6zVHvRH=EeGf=vp4&W*1so@S@`^gVXeV1yF;&n@5mOo83w&=jYjXLKwd zsvdV8+7NUCN#~UVGnG#mZH??SEVC_?gWX?6=}GH$PaiIeAwQVknUQg75jX#)DA*-o zM36k0CECQ>Ce8bKXN8I$YL<$MRGk+kU4s6285LhuBGi7ebzd%@l0!BATLgLt|Wl}B2 zGJX6_EJI)qO&TDe)*|eWu`5CoW#eSV!HqzY4x`oMqaN4|nhp+oaYsqw3-X3-5b2WI zpQgIQ&!)c}aWAlje^dGI{-*L@UAuI5DaZ0A=xk~N!%*P|&y zn_b0egT>T3FM(VJ7Tdku^P5D}43c_(j+@l=YbyE+pJes>YvErC9AXA>WQo_iTp5an zy0J;uKa})We>ob9NjtXRQX00AF+=m8CtqIr!&BJdW*a?%9$G@};_V;otsu7M00&!{ z@f_bBr;qQ#Y^X2gKDc1O+5gqb;CczM9SCwBE<1cb$U~LJRnynZCIPpy69_Nc`k`V! z4SK-cukG)0>e-0;07k;*mxX{lu{(_;tOBINs{21Dr@i*|aNY=I1~%7h;=spyC+dZZ z;hJtHFTPXS<(bw#f1EOTO&H-5cq)8d>HQ8h1#v#e1VYeMjiNORR0f7-*2U^p2b+}3 zQzA=|fiH&N7fcTJ1%b?uB5#w>9y2=)}-o zt}$_1_|RCZ!JWwem>)WD?)xEq@exGC7-9=8`=*{#v|ha{a8$#De`-wdgJjS9bLq9B zBt*8bZ)pz5cUbwB*unlv=!lm6WxmJs7U6V65?;WM!HJj!Se6!fpDgj4%bQ_oE?dIj zX|z=EXDgKl=cU`yyaN#!Gj3m{snScgVp6xxi%l-F%2`dbtG-&FO;%iDM8*|+m>N?e zSO%*c>|2`^Co$hrlC+y>GJu;WbA{&Dr!;K@X09!?(v*50YV1|1-e2W+9I6xsD$}5x zwsUP>iK2oRkXmSp&DtsU%ZtwNkEIEG z=80^Vu}4L-_lbkZwyA`7qA42MHW%pIZgE^5-d9|IlAs2=_1!CryKTSMab}0+ZgM}w zSN6sA72fs^ma|2tmv{H(6&>MRn^K}sSHvQ+1quEva&;)_x?>yaghX5)ad>{E`!+w1 z>)UTU9ER8ebb>-H5KFD*@wcafF*E3}8z(7*8Bk0>{N_09fwV|w^qG0b1hukv4&fa^ zcK7q$oZG?FhZp#7G*X@;bvAd(6PSA)o$P9MzcSlVjYnyjW~2u0nXZ;B5-jv>t1X9IE2J}ph&17u$qPV7=!MtMFPBZ`ro9r~=Kd;33$+Ww z5TbSonun(Ew|SbD4Ji&L?a}z)3v7joL!3pTLdT=L_cdia7oJ-0vxn?to@6^~j^5Ec z!<{LtVp5W{z_92Q)_s)=AF%fB?t{;@X(f7nTujS5GQNcz+mn7tDBLNT9KnhZGTiMT z>E(9THK8uP>DO_zd{ITc{#oRctb+4ETsyk<>HE@6I-&P(cD6_}iPp=y^I~z-jN-dj zX~3uRd)ICRwlrYze5lwnBs%ykLLUB%e68u|2N|BB-`v?k94bHQ5nn?sS^dv3YsNx6 z%rKcO)%8J-PoWzPxkaNtPk+3-*VcuwRQVbPlyauBHJax*3@drlM#Zxi{;JfyLia)R zi8Y;UOr4d=irP@kh$dd&6XrwUM+_=Qn^etB%OqlhuWrmJJE$L`_oGg^IBu>}KvMTR zT)C7;R^CawOO=y?o-Fj4+u#}OjZlr(A4mOSq_v>Km_>zh@{*k+$}HLhXw)=_7-`?w z+F$hfHS`X$KXYn-e-ChD6%5?Fx@CLWksx4h1LQBUR4Pp9qK?!Cozv4%=`jEvRDUJ* zxBVL+IBHLxoHNU@tX;RTa?4@zYDc{Gx$Eth0plGY{K_qfC)k$;TaUZ9++EjWMQQPz zlvwSYEH=r`nw!|RanA~W=n0E#7AYDW77KYI_L2|1#3fjW2muKl|ld0$%*&U zA)Vppf9@-uhR%f{JS28!9>nof)D=~eXH4Yb+clAivN{>dm7iPSRW9*9v{&2eP*y_S z->vs+k~5>4evC*z?Qhh;AM}8IX|wc}T;^K{w|(ZJVObJC)Gl$iG_Bx>*Y{A-WN&5a z`a;Xojpk?{41Jz|F!i_vIZUxqO@SnN0Id>*%s8w{)Pyz1%;>>So5Swl7k7+_GA6R1 z5a@=D;8(yG1rYr-n72tR1iwiW*dYQ7QFnkNZ1++KxRk{>9Hh1h%PbylxyQNQ5pRtjF`|Sr8 z&97z>ST!dXS)LDKTy_B0xLaj+HAR>tt4KCTR^QuPMV>ez7b%x?tKVgMw?WQ1NlUWf zy+rc@hPKVrn&hLA6D9IoGSm($^J^PR9Ie}H&`4jq!H`uYm z6W0|7^FQ(47itr;T**aDc6EZ@f4QjlwDlv7*v`s)ncTy%WoJ_TYWrByn)uIy6$(p`kMNto zo;9eGdmo9Z)uXMfP|GaJxE>jLF?bGgYo?(4$g^;HSNA%5 z0g1=}b=K;7`*n+QybTaNL@Xz-yV|bN**ApVNl2TDPBt+>^u)skk&`fE{889L(_L+- z%QtH~Y=m(QiN2wxYbMuV=*gP<%f(w;St605Zz1if;2+-ODZF=WhBz<8FrIU`#S|3p z)cRg;j9mI$9r3=|)a~)~1JaJ#; zVW~ly%&JRlFgnJHy-rbfGKgHXc$XgC@2r`n7~lUD`_M$Q^xUbM$$emtp2IS6s*GjI z$r}xep;WpQZuex8yHSpB3@N*~{4(2rTdn3Ao8w|i*VY)Cz56?&nAL{G=3rEM4@q+L zlNKG2R9-&IX*)_dnfTyc7X0Cr&gZkcxmyHOx=#;2m53bMi;Nl~&j$DUuNlr(SbY4Z zuDZ?!7O&IOmwaV!86Q;$3oJUSuh+WbO1{s*W+wY)1~O=vH`N7lNeX*M}z zXBF1`cvjMa8cTQO0f04{2hebCqnGY3X`4W3`weZo`I`Zaf><@*9OD$4M;9LlVl7iu zP}|L9pwS-*tyu5!atf14A=mObb><{~f?w&O9_IJxC#p{Fla}KpS*~Xy;jxjWU z7iI7rv3A&Af@mh>lFbe|4-5o}A7;6k6vTwrWIH(#^hj%gaS;kW9v5(q6-F^Sh%h7+ zHe@!P=`*Vv#BwD$c!MTBB-n;PH{&aKHImJf<5}e@d$*a1$1YMKk+5XBs!10%9Yws( z8FxvdJgF4)>Q#5|{uJ(4-T`hBL*!m@iw|(l$tul?(~gkd`V#@5bTZY{V^x>G7^hky zLk9`wGSB%2oQ*@${4g3>#77A`oP*l*|+=A0ZeDqt`ywv^3Gg)ze+Dfk9L7s@G z4rBaE_f~sdzfUJT>*+VMN8~{EB;o+tz2mFPIq-+7Nbm-#uohoUo_Uq-bSLQPAZE#LUC4?s(W0yl?ta@X-_ z-@j>=M5Tb;hVT(woa8>c7>r+^6d_;qY5#n`i*kpWe0bn zd~M=8I(DYS=H8Neqld600R6Cq?5wfg7W4i&-^|1TJTw{cJ=1{vfm~$&SEK71qI6~F z^vW;X!Mt4`GU?#!u{ZzU@XD>&FIKOHuWzTPcm;Qx6ePPI40gME%rwO_<93f-er3zd z|7>{0w46XyNU%FgO}<^{fs z2gM=QrmR9-MI61C{Z{)8sN_iTOl}RbdQCAAHMtYzvPOa^Y)_HbL1Os!BBlIRyY;QiRfxeayb0M@lC;HSZ+ z@)3iT_Wjep;gMjF;hSv<8^s^H{R3JMbBvu;1(nm037MYf^IkU|{w4>~dux+zq%Fe`j)siaI9XHK z%*@Q8L^_$OC+~-z`&k(fo9hU!08tw(<_9fjvnkN5t3~jmN>%cv(AzTr5rb<94g9if zu$TfR#5g(vJn49q!h4ipP>p{sd!x(*#HjA~qt*qRJ zvEbsSonD9RD)sGz;oli=b#AhgM0|qXa|hT)ES6m}&+--MmR+eotI1E)-$`D%Luxc^ zXPnA6x@sBgE%152Z^UdDY_Zpsd-PyHRDdkB#dB|)&wg07tSPcH zy9i8BxO-oTr@nSfCebZlfN9S<;nb4;Z>(hI`kVIn{+8e__jp)dEaNhc+K0vnMOxHN za{XdEl=M*;*OBnJ%0y6fi9Ow)&94$40W@Ux(jbvN9L|A<71n>JgIYv#{pjole?d`5 z>Pt@@4p$?gx)tFr3y8Y-UQ5$KePf@S;w*$~gz^Cj29 zGcGb{6XWH^>1|`fw!seSgmgug99D2u0WIW#W%Gl#4zESnjDVb=x%LUk{1EqFjvnWU zP6a8EG+q%96&*E+W(p6k+HlA3q3+GqBKiB_h!?=2{jNrfm-?nsmL((Oy4Jx)HV7zm z55e1}eZ8Md*N9?6;?>&E&86ktH_ybRw$r~W7ti&Tgxgbw75k^rxJa7d%9x;%+im+T z@ApoJCYn?=2zsiMj`-%zQfyAaHxF4z??EXSqS^E zh$5L9?$x?RXcy1?Va3T$lKEzvi^N!Tpqu9_yPW8=vZ{db7DK?I!yRxrP9Asr(0JuR zu18@44)Gcxx@1{{OK^XZ#U6~tshQNBoGf|PXEoJw29@WX^~5W^+Sf7s43%{3t}809wz02IObvJ9 z=vP~Gcp(y9rCXyR$+xIOU~@>4&hwzrz9B63G;JlB@S=ErT(`HWM9=xeT9AWQW88jN zy0}8cM| zg=GaGAC^%d@Q7l@g{x=AxHn4v-zRZKpMB)S9xC6+=)VWRb;%cY_EE zAzSu3P|f~o$pN5T06ElaEWo4~N%okMVN5=rCK?%Qie6Rb-R8i5>F;HdA)LGE8M=LJH9d-Gg%gz8=t+rBa z>s>5o+5DVcE5txTUd>JFK_VBI*s2TCUh{RzhOmTAO0f%LJ0()ftx`dQz*I{iRZUNV z(Z)E5Y{Z`5BFA=5P#H78z{^fT?li=|m?KkxN#GuTF$~$a>7W{*T>uJnPZ(ufS42wtKonvbw)32J0J3aVwr?l3`cC zIWq6Om#&rP$<*~G94kO%@S8piYw8HHF(NT-9~cVR-pwKu7nXg>IqsmVRX)9XEEUueWB#MWOPn%TFX9VmW ztW)d!p+tGA$E7T)u8bU&!j9==)qRBs$v@P92g7zDnT+rJT-?J=6J8qwvXT*yBH!gN zn%D+kres=*>;_&rwO^KZz`Xy;?lhZU)}yW6K_OL$A>j{^%Mw5PB_+?Qb9CU_0d+o* zERUvhgz&^@j^gZZIioOct<4EL3gdRO{5k|NC({Uh^~H&7mY!Rjiq!nv=RdseR4;=L zJD_B?1J;nNoi}U9PYk!ao;_xY@3FqZ*s(MXJLD-`bQ|0YS+`j2{G+YVqlbXOtOvg} z8#^mltxk$|pj*}t7o%WU`9qplNp9UryXT8SG-Y%A)3U0nAQ2}k;#0x6M81L*Wh0Wr z;x_|%<`?C-bAfp(=Gsg14Yz<`_Z#_I2NbC*QWpulIXQImlEi17eys4vzVrgJa-@=)?@PK|uIS`ysl zWBeeG(@4zfituc8TS<^x$sdKKFH^f{6bp~gxhedA9h@sp=DAkju_ipIIG9}A4W4L!#LlDTWStK8rUp~LT#0+QWxkNniEgcMoK zC5-{m9+lW!1X;a6+*6w}UDU)^&)G#*&-Xl?x!wsAt%*_|-MU&Ev2;Ci5oxD@ zt0-Q7to1e+z$VW9^uB)wwHf{C{(1r{N9foQn#R1@<+HLipYTgmA!3vK2lCJ{n%cnqn%yiRrA&xS1vSrN znl4w?rA>PO3b7=E`a(}H6WNc$R=&|YF3_gf#DlL}#P)NG-KVy&l^^F)}o2xaG;~(UQ!*J9g+_9@+THgy9RHS7kJP z%gafe;rIM=k$cLy@^ER-ghk%?%?wro0pHGItfBOwem-pc%0`O}+T9}(v5O49%66xY zqC>@1XOPr(W|>9GX~7c!I&`l~pwTrYy|Gs)iD~gE{Ma8elfSo8h~pEu)=Wj*V%~ux zSGu`+vRpinm!~3jP^_7Ps9s0+-w}TOeLGhQ<%vI5nD!}#0 z0@)8`2i~k^SyD;S`qVOsK3F#WkTX!6x%@a-kohuTDku~u{E=}rmX z>u;6zFGh%WMwGlSsYYs9XC?8h9s(*6O7pC0A+^D`2-eHuNIH)&s@Vs%=gl@GGRAWb zGf3F-z{^ADt#i)+iJ4jn0!LTCJfKT9d|WBB#&>|K z>!C`IKs4P}oW;w&l-&u$8612?pbMJ#d8X?SHGXD^p?kF+aWIQ>g?-O~I4!^bu%gbf z&h%x%R^8&x*&k>#4qiTyOw~K&nVGj(&xCZY8UK3Sw?4ALa&JkvEEcBT7S5VK5S!9_SiXj(R3OFc_qCzrrJ_40Knvw zoU~_;L81<2orDz20Wu^#pn@Y}X`pP9jhm`+y6Ocy`>;Ax$f-{;wOnv8c}!^ky$Oqb zH*2Zm8?iXAVrw$5grso2m1*9&4Vs<2c?oiR`|F=R8I-kq2TThN>&7A{9qr{EE8bRa zwktn)`%C`b9dDtUH}zOcLh^n_VB>8iI@EA){AbD|~^V#||`CJS$K{u(pswGG|HT^KkS-Fc6XS}nid$LJK zIb9)rzFZ6#uQs^(fc{OaE~iJ25tAA*!sA}i3#0s(#rhq<&(Mz;LU6+f5mXismcBnx z(ufEtEl|eEv!sh_8DN^BTpUs(D!v7@=%v@Z*Q*^gGm(~ z8blPp`J3dIJNV&=O6><;c%Oka_|5D8Kxh9h75Fdv>YJ*rK(n@+Iqemy`TL&*byq;_ z6tIr|DUX#{QBHpH0X`zYW`0hFx1#E^J{idzqflCFE4immfg1F7eg8d)?XAw2S@}fo@v{)B&Rw_=vpA34TiOpTpINj5V+(KVncm4k4ybFT6JPt@{on zv(|HhWV1}w-Om2NA%6-?PnLWw08^85!$7-C+7e}6G}e(xsy`8@3E0WjbI>Z-w|Nb_ zgL)gP>pMMwpsg<-G7rKIGTuG%sJU;!KyI*>n7G>FUh_G?8rDQBBeuyH9pFw6@rP~g zZHRv!ySQFHz&Ti0_n9ocnU&YL0sh?h4YyY|AnlCt^gfaq8$iU33rSy@JvPm@II3uO z=Zi2Jw|&8R_M7vCoA9Hy(sAOFib{8`{F#iH3-V4iO4K;Yy;l2+1%ZYufKN`~SjXAg zjkBC*$*F0dA0jH?*Lh;9MR|s2uB{w49Ls^h(Y!Rf#=R#KUH*tW$Dc=YY`_eXX#$GV z8tPH=7LPWqvDT5~v$a|8}wkMLSo#B)&f5yt(xUd@8-?Th^|AVLup;i}vBC zDH|opilXRqvh_JC zx<(wu%jMS_5sn4xopIpU1=-yqU=}Hc)XZB@vKWaqY3V?%ORBX!Izk5u?G#DZhi`_F ze8Q;L+#kq<<72YFA2Ua{#t9T5iO&n6#%@HFScIm_Mb_;xO-xhs52qr@_#En0A#_2W zAZJ>#@gpsE9jR^Ir+X|XVuONQhL;09bDiF&f;jrI#iM;Ie?02vo!XOIlRe__3K;@T z0n^6C{)Wrq*0~&t2bU2rOEvn9pRw@6@od?eTvoA+?P{uDnyeltc6urNWa???v8^86 zTkX&I`Zl=ZwbU7$6O2ytu+v{oiy$#!%)XEcoQ_L5LwOu9*%368u{*)KH;4Oh2NU9x z7cbs5P#77I^;JWOL)^Q2@vD){sGnCK()JFC8<^;%aB1xmE`QL^nJM3|(dM9_ zFS^(B@YURLP1#oXcTHY=SO|xGgD#_0Dp4xsOud@3U{r8MZjbZ_kq# z{nxthQ=8o~lZ1z1Q*trK*!G9sFXkD|3JJVyLp?F0A=YE5ZPIgAO`83&*!!1el7?ga zT1tP;3}UWq#Y1Wnoihz$cew4S8bj?%gbl~p_L9QqfAy28dKV*A2CIs#&753|!I>bO z7+ra?`Ucq=J!d`s^(O zjG+q({oCp?3p2isPIQ43<+6s7kJ+*X;rY6%~Itjz4$f&sGGAb; zd(Pg|T7hqww8M&gmr|czJ%5%8}MCF&%b^RLNDl^Qfrc6U!w@pr4mnis^x4sKB==B266^6<@~CCFng65yUW%>Lq@b8QFp-1{zPs_S!Q-rrf` zDH#gGAjgNh!U5VE$Bxl`(^zXaOk&vf2s_PWc;vlXP`8l?^XIbCFWOs>@P2mM{<1B1 zpC|b26u)%Io4*A3oN^!)(r1xqO>jKJ-Mp=br~{g>v6hUl|7MB5^eSQYh$HjmI4GVkGUHOyl^NSMgQvIb;H{{3oweaU)ldC?WM`P)hVYudN zQ^FQ&dTY2(+@Fb~6(gOmb$H56!dLTnh1G0+luc@wuN^?`cJg9DTMfAv`~M=s2R*S= zr)rPCe$P?VWON?*Gq0&tkGK0$i2Bs(UO$P3_M~RJ9Vh)8Qd>z}S*Q6uXU~tm+k7QP znp#^X7XX9(F@B->uf;w?>K)(tj{dUwbyp7*DIH9#WSl1~%*!=&l0U+X^TowMTW*rF zdA^HAE}~I#kCceT2@-vJ0Q0$IYH2F?e(=BB_QQreNYE~@^0~=6qRvrP>A(w*XQ+yB z5V1q=ZF>@ZPPz17u{^XF-|w8hu6Xv02T)s5U46J$JADu3XG>B)y&~t!cmZpXoUz>J z3g(?Qq1}~BoHJB$TFxre4n~zCQBlPMto1I~=+^7>!*XRKQyUChZ{F5n(u5D?vP9h% zi5OqH)^06Fre_|xAyH54Dj*2hpaHTz=mUIR{Zi}7fBrl@G(KHM2lvU50-tRp;Xi@^ z6d#UynYESuUyB5yZJ2{RQQ1<50+bHRPm`;VQJ?0*Q2$90fTeQD+ZdJGOaDhOr4aaU zg@EPM+SFLhQ`@cYQ!bi3UpARxGj(J#(BC-g#0Q{yXUhG6|NliFQ_4**`Zb}#$hC{T z%|KO~MH9qSsP7x-&H3_OL=Z00q>s6qF9l{_yoBV;riDz;QZn~BjZ2PXkiPM5e!A8G z$Ls$#U++bhY2~dqFb{VgD-npB|NQgegL$_%LsOm*9qHaNPS-O?cBzicU~&ifSjN zR832KyDQ{DbeD}{@l_u$_U9j?2q)v;JSAt0-Hj8C0z6YfY~2xW%IT=ct-CM35^#^JnhRv7$8TU4@plzY0TmF7M%UTCb{W!(p6|_ znpdC;2*&_EewHo#)TiM3)Z6ymAGS>hjFu~z=6X;8Y0Kpywcx{~w@Igzz0>FC-+?5|Yhd0^WXPJAKtpYFCXsN(bl)2@w z`>ZKu@0pX=jp}jjLPdsmE~1x@0B3G+r3FJH*fPK^23CV~79abg`>_v|Z&X7-vG=FT zJU%=0`IKIG3)8%PImH~7^E|2%@ok2t><#Vli z*NElUKCf#E;G7IzjUcyw^a|XgaHb-HnfE;LmTTXiAD$PaP35O8Zb{7zv7r`vv8Ec~ zsr}_OAw#9>P7aNb68S=2+xV>cS$CTV_q}XSp>d}tSAJ3g1SN_D6)Yw>@D|AYPBLY= z(uSJBmlE(2WzkOQbZy~!pmEAnt`Z<<2+g(D4}pc#l$;oHG>z;2ndKKvRO@QKwtx0n z^zM668xM?DG#p%Q{#Ob*7HgP>Gu+=m|58QHXx^wIRc1HQRR!)VBt956oCP*Yt@Lf5 z(9r$TU!`M3_lMcyur5oRQRIiQdWJC=4K@+GO}E!;m&h~w*mifyA1|(szs2a~Z(mtk zNa{X2NM4M;R@?6e)ODqoVF!ueYY~xlw8YzeP#TNr6l>@##wgQ&UND{0_mp74_^lcRI)Ep}t)epN{|& zgO87XHhMhL~Easg7l@#`;+vL;3Oo8_vpj+h?H@z8QAV;;1*; za*aXSC))9kek(I8o5@|~?dmBQ+WAp3iIHiPN&>`ty|ri{U^s%zZ)9Z0@R_rJOxvXq zqUc_3-Jqmyo(%TX>Mzy}yfj1DmwTHaD|Bvv=3?na$YxZE5}_%KtY0~j_Ypl|m&TJq zEcet@^UJCbUx(@Gwy=DxF4)@w<_)ra* z-%d7}1=b^44U_IO!wYsxNH7`P(y7~vH=jm}xUpXeiF8BQALu`F*KYcFib#z+{(&wmenM~UqYKDC z=?R4w-|c4FuiWS`lF|QDhhe+>xPDONd-He^2VW%=aSO{$%XP`S(I23muNioUh2yUy zKKCCwX-%yhb>)S`YgoB#i-|3nEOJVIPYJf7uBHy0n{2 zZGNwN#qQ?8Rv^g?*Dh6HFfBLF+3x_{F)v99`}OaBIru^Afp#$2$yz+8a{|kqNBm7d zd!qYMED>HG(J zs0i`U{o|$=Fx9C4f@*afl`{JirpW4BkM?H(-4NJojS}Q>Y>8CM`6w;MeSh8Oll+iy zryFM_t^jkrJ(6DM0@+Hod{+r-k9>dDXolhT0^k}#{v1+ZIN`fc& za*J*BPJ(Vr@7cP8l(0^mOeC{|d*3hmmqx-rz=H1BIM=(TXPGUEFpB+2`Otc~E^{fr z5^H^-mzvHAuiZbJGY44{id~;-@|@1?XgJ^|ZJwWG=P&KK*gDdsdZcZ+k1$s1-R%`1 z4p?x_bH=XU*;_%Bde+X=pY675G+lz$jkBVS)w@%#F7~?H`EH)Wx__{IXcR0Vd9!oe?PG+dGWUP0I|`1LqD1^QE+~ik_^dXPljwVP zHHRaQmU+%Hj_(PdpQbN|l}*%Rpa8O05ZQalmC}nhArqoe#x6}y{Nt@~!ji2OIEI)h z>p~%1v6B(+mvQ~)zt~YE;1R;0#*Jj@u*MTy&>&SkZ)RDLDc{T&VG5hqe8rW6imL57FYh3r}kVpk^rn{_L}h)dU> zD{^ME5d{qc)u7ie*pSw!oQU>yKw-P%&!wotQuAoLDO7QK{ahYsP~ET_d~});%Mmo0 z_lY@;VS<=$gypf9+K^@~tnV9&<{dD0A8bb~TRJ2~U-(>03~2USODJ!A+9R!sng>_naeO0hTSM}`}UmD%X6I?Ax39Yorwymv-#@~GGf@W;DhggzSmZ@MaM~} zGX*&(M6qI`RV!MP9O5+wj^&Y{a8f3m7)_LN4p-k|D+1>`PJO!3s5D!JMDBExZHuzG*_@%0rSb>#0!)53M@c8oMjSSU|a8t zZ544wP)%5Gcqzzn6F4?}*Yk#~JsbBFNf7V|Pnoh_N{YX9En5Lb1t`aL%;vMWfq39U z1A1E!$jKg! zFrn*%-*-e?rg^{bEm>abi#!jPpo^nhQ5WH8{aGjYO7PIZQ8)r6C+@-otUn`67xzVU zgMYoHpR%LK8aMl9?-o3cw*r!Cc-Q5XH`C19R$76QCUau^Ge7JDavaoa1h4}AKh6{b zfS989wjVBgUr)#JUHoH@PZezX9R@uyVPI2~E9hNqcL8Rt`q>s`x38`3Wa_8+b76Vl z9Xvj)`wv@?apm_Zk$*F;m7sPkgI=r$^f;>LQ?QqW>{4AO1Du>+(>>kad9kdFr6-sR zk>u`7nx<3mi4fF`HjozC7pvW%%EzeDt3l*HbT7Naf9hU3rG(o1+Rt`W?w4KQ8eOpVN*aX|c=&%HZkeJeNizOa2~T=SK!vo|LOs_cIo-Y} zPH1|Qt$99Hm;mX>W@hE;=!qD4RzQg59Mi&N)K-o}FMZY=Nf`Eox_MZRwSEojE}1#p ztE{wLN#x7Fu{ka7`Oqc%=wl{^SR5UK0roj-$Vz}^PCZ+Qp*k+V?^!iI>w40~e6A@( z-X$7Q_XR{dh%691&wShLJ!tF_GxKb2P|I7#X64q28!#Iv>M&O_!^{BP^0#VQnS{9O zDf_v=CI`RLE5^m9v-^@F>782#v7W#h+*6AN<$G!%>^Kuw>v`8(QSJkte7i25iWJK=drN@4%8^NvKCj?=IR2~=Yw zrgG7s8&;@T|8T`5F(GXXJqqFcRmMMbL#%y2upqF>-@m0S&?ouG3Lrd?qa<2q(Tx{Gil z!ooinYt1XPzo_mjfq5!94GzZ*m^5o1ixhV*bo(Y$-a5x4c%c@t)l({UYibv{;Se6mVDSzvdG5aaiY?0T2nbYgH z+{z&~%? zMr2&mmyj&Y-tDPUS)EHmz=+=6r*$=cR>dEEVa7mIHhb;~Q~zC#P1u(nM9=(XG>mvp zS)etJESD%slMrr(FO)=w!EB5xLX~x1_)FkK``nvbq5*6ilkfP=)->k%Gp2wN54hq z?h?W&d8Zf734AY^x4QbMRZYm|YJc(^$Q3RS{x*h~QpF^GReH;h1kUoMt1oXk3TJ%G z-4NQ7?rd?|o$IdLzIH=;RGm|@K)~zcFM8qTTJI8P5t;>7D&Q}U*hut`VC~yuRlIdI zN-&$)mAcrnMYk;vJdJ()!WXx4E%YTW?ob$v4GQ+mt$-N!fcX|4HzRqf&iURGo!J(D zfL_AXiB3PbgjZR&li|I&-%n~!p`qK=j7CLZ{{3;ASmS9@M+5%v3VY*YE{#itbS>w6)6=f64Qk1RT2bqZ(MZgJ!?F^2!U813$^%i8l+ zo#cBea%)NdmQVcJN{eUAU+xQCMO3yuec0G9cE89X=Awdz751!n3Ym2SOG3rjH{GGu zwR6+IV%vPK+&kKI;1*uvLhF!$#Z&thtv@LISC-NmJanV52 zJguCGCTd&>S^Gs}kRw_>Xr;MOdtMGpMThSlx{I24czCTrCZrOI&Tmf_1}r1BaFfoP zWe_#6Ivef~P(SMPI}fCwY0PJ~r&kGhGFTgPv9;i7bY*}(&iCEmY72;88C~SQ@b^La zjK7Ih4(b_P88yelQ<%l7;=4NUqcm@oM7X|_ybG_o^eU|GJ&K4u!{P=KQga;px5BpW zjo)ED1)_2WF(Z=^e6vG?Svnnyw)*bLFJA$1)j+ImQIPMpVuGInVHRNf!j5Ul;LMf+ z*1E4O8B71z%4;9Fv*gswM~dL#pSyUxw5 zx7glQ6t!)rr)nM?LgqpMgRQu?$r(!zjnK~N#{mL**CaPg>#p6OG#$lb-QqSs69j-(mT`Gk5=+eBD0`3E;wNsvVW<ZeF4d}csKm=H{dNc zHdevwx6gEwtz@F#pj_f^qiLZWrUP65w2_0;?XnPuPTpzMHb%hzxa40Gb;S=lO^ljJ z_bu+4`dLP^hs&0gi)w#EWMS1-qGS|rU&Zoix>`4qMG-=+`(EsQ{$Pu#Z}Y_6poHv8 z4INx*xq6(B?*`MZUdx-EtE*C%Ap}x_yZc zi*7>oKaC4xYAiweKhTnpPPFi0J4FVHeX5Tu&nLcm0^u0DwGHby90{w(2ooTgSqMq( zL_VoI-{6KfvpP1_2tA$;MI&VVeO;HX1_{Zu*)w=JM03y8~QV(Gi-%G<;StW)aQ=*X!TMk%~1)P6R{k_p_ZLzD{JY0M?t4vw#P$LDhA~ zw-3_b&2jG%(69h`0*H;=pg3wQ8(tSMlVlaYE~7QVz*3c^4VWEp6{Y z`WckDB6jjTc>X94@KylCwJ4i+GQc4?^+amYyqPVPL5sH}Wtf$j{H>@&PT;Ak<*|0j z(@dURsB!xpSN3(3mAiWdW#wj1uwo#@sol9oP88@CX|)IHD(#6{haI>MvlSZX71W*{ ze=c7J#L3;#dX#q?^b%MriZ$A1aN=o0s#q$dG6C~-cG=B5t(lN-{UQg(urgKyT=Tes z9hF%wh>6=FsI5~}YQg=Rjv!=6d*i9W5K+3?6rrq(I=5w7^%%2&P2lWioK%XU>aJ_G z2^Y$R!6^DH#2gGUHf{U;m_b_)b?L%0TGnbnyP}(ZA>as`j=vFM4{mUS_=C$to0> zjJMXMJJ#Q^eI}*4 zbz|8krGMUo0 z4#eJwQ`+5)E_ho^IQc@3kp}-I)w=*?D)h9R)dWcZ$l`fcuC3NE^D8^=W^0n?$L?@@ z1ax<+qk3s96aE#cLXvY~f&hA^#x zEp!qL#AcFoQW()YKe;=ju9yy#U{F--fCvsfI2=B zH9>64F7w|;lXcce(}l8J2Gyp*x%D(W_$_^@q%S)_Y>;)6w^-cb?rL3lPo~5*1(c-% zxW4}aJUAi{_lkNrO!MT@rH$VRxU^fxzP>=fd{hNmzvNFw`10m_?8zisgC_uzJE$Vv zrnc>s#OoxddU8C})i7LHxuq+*@w;O;X@>lVyHutKW*ap4C09jH0Py*Nc?dhekZ~)3 z*mNEmeYejc9z?IND4o-SqMy7+Sw2vPxdkf^K6`k&>xV5I;#|w~j3{GD8gK!9q`=W% zdiY@I>2E`J0m_h_#X>!~SV=+Dx_a?k26Vt*bL;KA#<^NG8=54l;f(8!^cGF%bCcqF zVu=@~{<=<-6Woj42989GJD!EtNv1ML49+|w*_bLHh|RIo*n6$DL*|tdI;WQ0?g8h= zu<&Aj%EP(1knMvKS3TLM!I?UuH2{`@=x~sybuA-CF8kkk45)k~PxoK>#_d^Zh`4rk zWYSvu=cw^bYlI1x(#-*uw#c=IKL#Jl`RmYJ%I^wyqh95A#~o%8%&zi!h|Z^P^qR?b zH}Li!pPIZD<&$R2R?MyH+NP*rfQ_-_Du=f;wzZMPY=b996l=(%Tlj>MiQb% z^Vjg^OKlI>#*ZyA+$azx0@NpV*q=N(7Zf+0v?EbRra>F4%`o?ay-@-B${_1f9D6Dv zff`;?;Z|{z`+aX9HhupRiTsI&ibS$71?QlgAR-mLFzLLH&{3WH9hd=RDb3{fsxdqZ zJHZ;@zIViJS_(X-6P{j4n;Ef`*KHPv1$$)jdFIe8HJ!Fr z%b1?669A!;cjtrn1clL4DmZBK7E=$D*t%lnSpEu6`nqRpGEc8|FJqkX+NZIUoEZik z$O5y6w_cs)WG*QlwFV~Pu$)#F@fyt3}9x#-6OW&WR=+0%b}H-`(O3Y$FP@^uyO^?0^t50 za^s0faN}={CROT{LdL53PC>^@z`k{HM0&~`%oJV5=n!qND8Irqpx_$?+AY#^8OKc< zBa4Y>9)d){mP@A9N*T9SX8fs^wEy6chHE}mMv}c!22Z^ev~>bV<~5@{Do)Q z|JTrfLC_tFD9GcspVgdi0&tj-5zp+(KKi|^h7Cw7uidu>DuShFJA7Ru*ITev8?mj( z@Fw~>fgU!JX6(eNW;J-(Pv9C&QAYc@5|fjY9FIy$^o+goq{<)CQv~(3-of!iY2(bT z<};47xT~9OXqgh8Z_;!~uWo+L^i7~|0#JRO-!f^uu%QfUUBRi_p)Sltp=J@_eF9#J zRCj9=%z(2Sa>g{>e~#b4v*w4&SK4TmTqEbVWqdLgqtzHkwo~#N^@Lu2YeNPoQzXWm z!@kU8w&VPLivHWE@;@Y3!1)1Bj0n2_<#86_04D~13GhWIozHGBM0R7A=b(h38Fp#= z1diEW4ZBv0ry$^UT!eiZsSs!%(0=`nW z2e?K%mLg)2Ur>?+pqW3B%)jJa0j!N+lIrXqsegS()?ISr^xhNX%-#+uCJy-#I2(A2 z0$&^wr0ow|rCUP8`26Z!9xB1V%}w6~1O?lxM_ld(>1b-?4)(qYA%A-HON$4m!?Y%w zrdtJWlmoztCUk*cW0&qAid4G+;9K_$HP4+RCR*HkAV2RL(V?VxV8@5ura*5Q(bJ{& z``6kK|DkwsH2jBK8eI{r&GC>$@9L-fs@VAL*#Q)+p|b{P0id1}D50FefKq%a;BVYH zr|$eqMy*Z#{CvX2rs2=M>8~j(>3gwwdTsmJRlF9sKVvru8eM+h*6{afswnUWARPS9 z*<$~P3x)q3s_f6hd7uHqk;n@kF>>>a5|;cA<`^=T`kFTf2&0F8l-P zO$~B$x#X~be|Xf~p6h5~0^|28v|KPgH!G@4Ot4Pu#DqbKbWW(m-(1Beg8ni1E=RC# z$tJQoK|qeX5&c#McJB#@IS;~dL-&x|`{BTcYmM^3cCqp7H2u&GepR0e=Wku#2Tj%= z;w|#6rX4l%chA;k=nlT~itP{Aea(PoE1^NNNndE}Gy<|ut=N8GctRuL)$)99z+O=w zu>HBGzdzu7V~)bZY0U`k^L2jasKC8*vF=J;5fUC)a(Xg+s6jH+PXO3|OupbUo3D`i zXV}#VhGa`%yF+c~=7r-1;s9TekGBDa9}OPu1j3HjCz^NWS6ibh;q7W|df9r-#xXCM z^A@?Z*V2^SUySwxDf1XMQ$_*!W|%nj&s}?}j)XHpcJ5=t2-K+T`3 z?_qX|aDBWZ;~p}f&g-i_QOh6~Uy+}AoZHC!XyyLwQGmTfd$2b9dOX9tu5={Wi`DtQ zIYH$^n}hW0z}=k_8`jQtqaHr%Hpgd{_gMPrgT^9qu(SBM-TN?hKv`fA^}#i%KI!@8 zs0=IXiCq!lOMs;LCEm;RAs0l=q}ZJ5_Hd#hC&Pd$5HH81)b~2PwWJnSV|5J}uDEf# znx_Ga>Dxn9RKpbk6V`_@E>hCrjAa*(q1UUsdJc=+_8Q~I=d#aVqnMh_K3gdt zpi0%Sbk|#5Zl}Ly?}mV}7lkny50}5d&qWi@!Z~Z$!dbJ9;j~sZH=nEL(QL7i zvl+`q=Q>D*E4#(S)Yp7x@giD2P49Rx!HfpPDZ+q!xc6Ch)Gh_V`nifFbp`Xz;;^mQ zzMBRRs}MahHj`*R=n>1d&~hrL0$_lK8H@>fV$N)-`cNNO9_?EvvB7hC-)fsh8JVLr zDLd7i)x*~lH5$h6Fv^K7$Ijn~0NO%DT_@~Izeb55mY^55(<$eqwU_m*jaIa4FXU-w ziS#(Mim4OXEucr%rMK@Kzl88N-Yb-Db;nxl#dda=uxSS=O1?m4E#?rAK`lsGXU#4U zwg><~LtWQE{nAwhkeh>2%(Flo^b4DV77f@a>v(dqJBH;oU{0tIX-s-`-?e?PGe&He zy`aZwTU$208!zcG08jzy|o_v0jI%FK%4=TSw39o)=!5=e_G)-#B2LY zT_*5rac>3tv*6ih`AVZZw(EGR1R)c}nttW8+TK0xC&4OE>kAKr`eZo-!+k2Ym|AYH z!G-+5J$|LU1d(&j73F*uGr>ujl9iZ$e=Of34o?;lJIs)#kiP#IN5#9I%zLvAY&O9> zS&NSR*dAG;y|(g$W;8K3}A-IX@LBcvo3l~@Pi zsEV!`3NP^J`JI1_{}nt*yZSvy5^^#e-U>RqP!eLb2!5vNZK=Rby?*kMakwW4Qpl8|UBsz< zdVlUsrE&qUmkY+OA7!+A4yn6(IBu*Rl*tH(7y^R0NyL$D>@Jl_$6RMbpyRT*1dR>N8eSF7WCmLMVKyuf?Gae4kaezNt z2eE$T3uv2Dsvj*mYJw9P9=Nx%>7KPEeK{09(eyZTFI6(cin@CF`>cuDG%B6dC$J%O zob!ybz7t+&2Xc~=1tpy1n0O|!B-{x0#1H_`j#_WR321op-$g%kU~gqJfg4hobD5xx zOXgvQDs~03>)dtosC-I?8OK^eH@qgMEbv?71vJ;w5zl-=>jst}G=>x+#ckOSoKZ2W|DY_{@xV`FgP^(pD$fs?~ z(HD>`r1Ph~ie)<=dv+1S8J^U3&#V*u^{9mV^C!GUGNt)iOL$I8HJnXda^p04iw71| z`!)=nTcLUY8D=3xK_%SWKJp} zERehaQ|YKv)yrz*y9N=rwdWjni3D3VTKqH~?+dQ+DFkX)Mg%W96~vjI(>k%;229nn z{>I-U?`S6`1fF76FfxTroZ^f}oj#z)8tR%Tg}X-yLHfD1pu#uKjuv`Limg2i81l34 z+Ox}KYiDV7(Db&iE}$K)2hfFIJ6~~r_U(SsTw0f8^jRY7;V=-c5}o#|8=7H#UOLXJ zNHz}r^=K@!YZh}H{Ojmf15CvK*3iY1c+({4g&(42SGMl_HQ-FXnPvlp5Nl7r$Z`1` zxTo0`y3DCe_XM9a-I$Iiq`l56^+7nZ|Ioa2{5pfS@cV$MvNP?(xuqWdU@S6RDl--%9*b4^kk*~=nr-^L(i82vDv()Qu@mJ$wC7S??s*7PzGS$vw+@MSTNXG=yB4zlPJ?w^jV%dV@Pn?zG{3#G zx!Y?p4okJA<>~#k8zno?3pb%UB~>q-6G_;mGxf-ViYp-{N&#DK^}Yk$`{YyRJ*toT z^NOV203*n1Zy_UdPj#q}rW+lxu<62{{q5Q{`4}m&m&*SIfV#b}w@SMt+-Rf{oyPTH z|F9b>6Q=iL9fJlroozqqioDb1_f+lOP+F3!1F#wo%Nw=dC#)8;U!k-oI)?@m@!Y2$#z4E%z z`e-wX)bcvG#@U98%s8kQuY)MSWpb+j?y!A&5x~X&Rh@CJ zx)*~}jm7(!O%~PIc*rfYuewo|GD(*}t5A6Ce@c2c6g-ptIs(57^uidz7S;r!VMv>-$*UU?qEWh8(CIA+5@#ZecZ8AT(kN`RYArC1KvWm{78sl(`k*W$gMP&1jxieM4(%Lpzpn#y7Av zKdMX@CaA+k7zQu4B@Q0ia1}^Qh-;H_EgFd$)dKLj!z0(HN#{@6X%KZ#Qyg6-Z}~;% z_mATBHm7OQT1~E|(L0NQESB7fXh^I^x2e}N`agCC`F zmsrof?B;pq_oKB$U<)ryx}%cJ#BMse(c|=P#$wnj5`XG`;FI%TB-@lriXB^m;*~Sm zk8h=AVQ^;qIXkmJL}B2m+w;n5O7uW%Ho3&F90cLMRV9DdhuT@AGv(4gA zfV9T~9+Ulx&1poLw|zYhP+BStCXGA-6Bh>;!+torRM#twE##kjIXvaRz2mL-7O%SL z7Toc+Dxxw(gs$K)EqB+56C35&Ad+uWqFtj2VpH0mEqeb=NKh|qe@!sL@vS-9PRYp3 z%b?TRmJqP(lz5x*MtigvGo!--j%9O_r9{3X=jt~-s=V2c#2RTl7!MuTlH9VWXet(u zak{Vr``smD$?MC1 zJhA*5kzf2lOZ27tb3b4*AWX{&2mE%{a?Xkun=}4n0MuL?HR7b7W0ql6-(}u+7Bhy| zY?OtNE|m$FOUNQ1lLb50zH!!TDX>#S{*ugC_L3+G;l$ucRz!Z^oLh;oH=Wz)`D7*& z8$^e)(diV!&uxSdyITsN%fatRBc2^IsacnPvM#G;MpM{{u&a_&M8**}b3AJ)Y@8*t0U^2ywP2+S~oq~2{QV4hz4t|HRIH^62~ZkK>r zHfWi&8jnZwu8}Ku;9QYyE6Vk81xS``$dFjShcY>9aj!#u7athz;_0=#!jp7yDxGH| zEliwWe-;z6`=zFG_;-(jIn*pov3c9+*3WN3h2Hlisu(A0^6()tQZ17V?ALTmQbXb`CqEwnyA}JU2q=!GRBql4YH=A(2vc1o7}6a43Nf;8Fl`yW}xax zG;jyq%pQ=|=;@M*g$3pyvT6Kfpo>}&XGs3&5G#aU`}#?UOi-@&J$Z`Rg0Q*4nNdNm z?rY1XH!@oZLJ%AlPqY(rjPGn8*PcPH*L~lYi1evWXrhU=RjC-uMgoGWOTB~jQCh7U8C;}@!t$vD`>K*nXz*fkzr;h~LO~Sk zvh_jx&JWX0ZMG?kEw$O)L2geiIqKK0Jm5d|CmCQ%5|Kb#h26Peh!CWTeS%H7!}OQ43Qewr>JT^2?8{Mi~}QCVyeFr;@w-(oAS5 z4+<*E%bz?@ZaJ1VGBLr()&XHT+#Xw}Sw1<^bbEd&08+AH>_@kE4pk!)%>?RrG=J{s zVq*xtQ6cS~Uo1NB$5-f?gpue!?|orsJ2v|jAeCMgK2w$ijGoh1wVk>QYmd?5}_ed=wcCDGwAR81;UB3X>cSh8&)%FrD{vohjP#a zRZBrPvs@Vc0BeiosyN0{=5xVIHQVelaZfuk;|Ac*`&Fg>!oEBHmCqkHcX0jhANqHw z;ib~rl*w-&VWrI_q;gYP;vMPsIzs`Wy)SbR4H`32gW&2??I^$7Q&SI0yC048i0O1a zzU`nX^R|<(*#9SUY6rVQ4&n1pG8)}9;)62{K{2BZ?NRw0Y%28(_f|lxrqV`Yf2k>5 zkmp0Wb3jYOqYxi%DFmbTBDY5Gu5t|EZoZOo>f`Y`vLK98AU^1{PK@ge?nvtkWQ4an z4duOx(@v3xpJBm=keMg!6cx65%+<>lQt|6;%`#eiQLgx7PVAN9ej@z`mHF@D(6ltG zlMjsB{bRh}71cET0oviE5PBqFh>)CrUu%3$Lc*)?20YFWisCf4z zahIRQ$?eoy)`<nWYBNv+JMoEGZVY=1A}0nH^R zWoa;McXI*kn_~5VXkeTuZ>TXvT`xXt;LOkf0W*v4^v#kZ0x*Neo>FfsaJ$%Py|7?#+EO+lt!Q~VO944&EcIGu^ZydM@g4?f4M9c6`iqWb2nUjsHcXIqiDC9sb?TnJTb8+gkJ)_6 z4=^GU%^QbFm1WAuRgPeLgk-5^TNXqwq zTburM1@6Xn{R$21v#eN@<2DJi1(Zt^Sf1xjrjp%SQ@`DX`jdXWJ_)xXL-vi(9JLcE z%Zopmll9VWke?qoL^Q)u*}mD&$nGuFWT^kV^mt0~o#y%F460dxLMuyJBR#Gs;2vFr z2xhlm+&s#hiFm{0@g;SR!^8*Q(C{V< zIU-SATizFrrS6Wccw{CD%Hr6)0d)aAlzF}Zbuh!)G>-|4Xg_k>$`3)}Q$WfWi21^| zjz0V=qgit0@IoN4@~d8|@-F#9uTOfXZJ7Wb2J~(Bk__{9=WC?Iv#0!bb|9TkzO;VA zd@{JVJ9vjhFx~G&4ODb-?VJ*J$=T_PMtGh6@Y$S;*n|XE&L9K^=2ZZ5aJdYCR&I{G zCv>tHvQ=3q&}EMVk&R`#SY@!eNFhE)od$REEd0cnUkl@#cyft= zv*-=iityDvR{r7I!AJ>f5{vzIML=%)b@XB@j!tzjJM z^zG<15?FB`(O}z zI69M&Gb7cAZh`kz{0=Ln%X%=O`Yox7=M2CT;`ekPrIeONeM)nQ*t?y+a4wS&mEr5I z^wXn)h3&_WCEY&wr(0mrO$zZ$U}2=m>|?(FJ;9=6A5~3eRJp{1M@%~i`DoX7PHCo5 zUC+8^j}k^Ze@c@|lusEF#H5|anhP$bjLZ}S2HrQ4pwEx0VSlB*-?b2Wp&CTT`1@Vm zL`um^iT00vi9|PdGRXPJ%p5eAknlf1m3JeD?=vGwnjPxufmOfjZTPQGm=XzS%-Rcw zfA;zc#m_7T3qtw*DLukJ*f)$fTdAL)0X|*Up|=d~Hz#^vchg`#aFbf_m(xqyv#}0$ z<|QUWY-=@}@4|$8wPyE0ZCk5`aJ#odX4`Q@sY3eY2DcWCO*!OhRp?LM?BCt~dlj7Z z-~4(0zun{pHBfR#i8atY6?=kA2;~jixK-J5)`s$BitQ=ldrC5q{yhEW#`+nVt|Az) z(Jo!aXc$wn219@R75*uzg{9K2BpLdq&hhiB_hkIYn)8>x-gd>Ko^GQ>ev!w&CS{~k zlL_tY&%po)SyzeKf=5_(MQX6^4-LWvUa@8JZNgA_(q`UHo!c8dVBs#)9)Z{gduo&J z<%P=~Sd89OF#!6Cd{;r%6cm$c+}~gG7@BOw1SNH=zBJNyd}{wTR7XTQA}U`juz9mU z&Tgxi7sbJ74LlXW+qtio6}2Ar&Eea}CV|#=3iEF@v{VU8?Aqco6((Rq$HYy#jopfO zr8a4r7ct_+5lsH}Q|fi%P7A~XJslp7RMuZf6v+8mapHzS&1{WXechT+@ZGf4nYAiX z+1$^AKniD*=XW%43Jr~)JXPz-_-K=jK+t=vtOPRs%`(GoyN9y#E|d?*2&-iB4TS)V z*bRd`(#I)s0>_Q=MU{(5ureRojoF_!t7QnToU}X4*^8~kQ;1I)rj{-xk3)%Q{03{8 zVdlVn<#4JyvnP58U>yQbAgy8M?){vj187L|eDYc8aAD&*aZfN67?SD*K9mff%TpfO zjBw*+{@T~A_i3ql+(7pmqTXv4mt>{BImmxKDL}Eje9i6O)>OjjZ22`47L&#GZRYQnM`b^;q>&)WL#=|&%z;%<)Sf^DL`nwnJdfR8CrK84 zSH4qY^{fjxIXdsS@kb3P_#tf|H?KMif&}V3W`&QZD&4+>@0f;IC+$zWX6b43=F<@lZM4t7x^y((!JRJ;I^TSuJ0?JnuLd(%4qS$G3OCPEAvKw_bzM>$-drrl={_ z<(M{stII@Qy7LC$85^SxT~WX&xcIUdb$y7qEaM{US*BC?4FDh(ybD^xHxD{YTW=qd zzCBxI={V^3GR;}CTeA=de60@{6ELp%v**$c^-!}|pPX9Gj|Xe(EL0A<(_{HKEu@O* zsXS+D_R4Z^IN7{*6^f$7I@CJ~X~{I9T*QjA^#{5XR{pWxIGNU)^W0Rku+)xh85>R& zI^is>Vh$3D8+s9Dz-hAjER1#FC)uNbvyZ*j1fH#JG6>c@fgIx`DjbUML|IqXdN{`F4HZjpC2O? zoxn};92-;$x0(=H0w5g2L1kShmU*q|SKP5xs~{A2EM|hkHe>%`U)dVrDpp{lfe5S% zf4~%2sl;$|`FaWpMveJbiub4s4}f4R4^-G;b-Z1OT5vw_=Cs~Vp}Pl1s$WDm z`xkB`=G8fx_2avX&lmLDEf>*xbDOuURtm736VS$f$(HHmM6eVR&;cgaepUJ5@%}OI zyN8ozs7*G$0WvW=$)#el)-_zytpSegrlB~nl^I`GoEl1!q1X1%60#mSU%UL{7c}eV_fziD4x4=Izt~~HPf)yI zFC)*i6q|W805ze{@ayy*9hy>@HE?1Fr_>ESgr7|K-&#Nbn1`h70MeEv?1PRA=F-uP zcG22rpE8Fo014_;LcZ92+W=QQV)4D);GD@+-Od$4%@)J1fTEn^*Up;ug7fpN;XYIV zZhaH+it%Oo4suYUxK_+&SKdr-2SEBL`*6czH>d8AKT?LGqG^-SjtL48V?|LX$Ouw= zQQTy0>E~rugZz5<(s1_r8%h>qo_FpNP-~D)pC0wViJHKOLYm(jg3p9Lq8N?ESE)6( z~P#^TMggp&N-*w6^c`5@Xxr?}V>E6ZY?d9Lr z5j5Dhh@z_Ufa0dH?jpT$>_>gTs`yPV}ENezZ0##N z+5MqictbXrM4Rqx7bg0I-Oq3K(!7>nK$&}2qrAqdpJ3*XBU_iD&mpIjf?gV z{O6c}T`!e-EG!&j)_=xhVs0i3thnD;T&(`DR$)-u?$uE}tps3rj;e{;oSYn;)6ZCQ zMMF;B;o3q*Tssoc#OJ@t-lBZf4X{TR-em_;`nLy*##pzc6v#A2@L9V!OnLu&$RQ`* z!8L-aP01O0)BGUAHjU=_6Hp-Md*osk>+G;#Q~I=7$$58W)HmUB=wZ*k;HhxJH=xgpP%5n~y5_m(0(~br1`5wK^Zc@9U z^m&YlEX|tW{rTZZIi9OHBB7 zl}((h80~=@c8e<#TLQcKo5zU(?h^PptSw1jGeIDmNADNniyx>~8W5^$5@oN1YLA?C z5A_$XlkVmJa_p%}cI)rQY%0xcgKJb9TOr7zblbbXkC)hlAYMP7fR?zA@U(49Ku%;g z&-vd2CrB&U_4)V+>mIR7SVzfkSVvmc9+5%UATp0Gvu~GAveXjeZ1X!)PI~E2GDU$X z4nJjQLn4fUBo@if4#Nkh99W3qFIlW2DLy9SLW^2}ulXBKsx`S*CPg1)XH?>0y$x0U z^(M%)8&Eo-bDkjTU?qgN*sEgFg}+m=^$1Rh&QUG+7Dq>3PuNnWAMOCJvzkX)q(7_{ z2EGfM8J=0w>*)G*8PeMr5|@Ck{-Bf`(1gLq|d?`4_z-fydg<%z_4kez_H0% z2Vxd##){$!tyf-p@$C*>i;8*vWe_fT5<|ihzB@<1G!(>7n9^)?_SCNYBNZnFem6`ns!c&<( zbG`=5PUQep3aqDY`fxQhG#;pbLh(OtFP&O3qK;mUVjR}-E48C|5j8JK@E{>oC}z4!uF_FQtJT9watB9WR&^w_ChSpE#;D2 zmn!?W4OiuWHQvi4^a7v|{-|4G6pf=GbV^r(XA3|+x1)C(ftUjg)5!;V^N%35 zvnh1$BxK3SG`L$Y9mYlL_PzJTQn^yVf@`f!Koqvx$?JXnz!%=OmmJ`E0LNwq)PsLP zCg*8gqCVcxkb2J2j85#h%U`M@mCz%Fab(nqi8>@+uc?9fa?GluRk4OFjpPCd=f?^V zPb6!YLT2h7^Sl?fY~q-Z65e86%(Me3Y|)99YTbL{fy3Bp>A9I=d_>N1y(06HINR#x z5iDMv9~Nj|KT>_KFKpVfj=5o28mU>g$uZ;Lb#o4=!ofyW5c1VhRHDjos7TS)SAwDg z)&uL-_vGqzaX;_5wT(q7SaUy_-f`DyhJAT6YL{3@8QEtl20mm$1pjkv8-gG6+Hyx> zkK^4&BF{#HylnGr-D3!goeT#fR>x{Wb&4un`y8cuO1nc{r4W2~vao1_4*J&o9glGu+(q%1CgIiXnU(nYVOOof!7K3JcSis2bwt`RnvfcE>hL6xgc?d z@F^DH=>Wv+B`6WXwRngjDRgwjnKvgJVe4|wnS|FFdDT!zFohyBYgL>`uK-F>-QtMs zQI~-Bnji5JVwANXe^YWIEH~<2>Vk4R$%J(;Fj$lh=Q8vwoH%Mo+~=QzjR)z|CdUqWLzL^8OZFj6R-WsZoA4oV{5;=xqZeJ2P_~=SLOjLM8xfV(8=E)=l z$EPrK!|bCqCh;Va@|kwDOf+|4U@LH7kc#ekC{RrL$!5aoyixc~6#&>M=wK!dln41j z=YEfc1OHUfwJ15tm>oTf3gf12q{z85W61&CT_X*6Zn2OcA|S%&Fg{gW{5gg@)729Z z{KRHB-?~;s+(3BPv=)Q3p5NYNN!+R752GVWUiznzre#ChI~B4zV&HBh1P8}^zjVR} zb0QiJZEu0TUhyvGGg6qkEQM1PQ7tZgk5}ztqM)s6g|DKcEXxU7RQ-~fG8rAU8;!dV zW(=62XuvZzMk`ZRSQ#+`5d0Xe_uu9-CY(Kx$Ti?Kt6FcbZfEv-)^J2dxlRUX>*?!3 z;-1yoK!B0o>ZCaUK>3zhxs7L4#GRbh1hRB}jRyh2mq^;}#U^i+H`AzqEGHfe4uOYZch6A*g z`RMsR@^xGdjdo2(-GNI0STy2KX^Z~7ze-!45-s~&*2N@i+hS+|^Uim&&c$Ex zAt;4jffw`N@qO!&9|v~y$SB++Dy%ao%c(4VH48MQY7K0;50RktU3x(tKbXKCWxXgA z9if6@WG*Wk>TUfxUnl9Mh_94QCAaW-DYCVuF#>1I6i z3<7-cQqCQ#v%LbkBcnP*FpdXlHw?_pal9=GVg2Z?P9Dx+ zv=%$NJtHy~x;2l+Bil_NRrfoMm?zP{8-ueMU|QR*+j-$Rpgt|wl5U}_`sJ12T|}_l zRo%<{{Qq(nz#-wAG(%CK%P zN3?EY*u5BJ29%WC4rzPT1Cn%t&r4uESwcg@OyFtyzK&`$bi9Zm;f?#74$|v!Ne2-` z7o2JZ8bUzeuv9~7aN3QJl=mAs4)7G zdcVR;<+n#=jI*8+*;*GCL{D)HfWJna)@;L;+iz#EVhO7*`ItRc8l@j*;e-TnGEgMD z&#Lk5pQ(totmej=4(ocJ7;*Gq_`XF`+pMGu14?n`&(!CNH#oYB#yIX}0*#EcOu zw0!8RLxb9*+GNyHn!4$-5=nV_-QFBpxVx%aY;kc}9is^rhUshSHF62u)H~))Misd= z{9Wv#fV?Vp>6U)bCVTrc4DBdNvT$~G=Inv@U_#tgi6kxvDtI~27<`(vt~^KX&rPCC zGpTN*n!wt?{phI7zjaU`awH?jLg;(&r1gl@VQ^?IhnL6Y08@JD`(cj+&t;#ENRP)6 zofkKIPMH(u>$_6Y2xDJ1&Is~5bZ%X}x@0|;*4~j6e}0oozKCT&UL4YBp$^FhaSg)U zn;!4mlf>2YO{O#h=Wld3xwgd$IaU)_y4I-@dZ7(@MV0^OiPQO;$bU3x=gC>q zUWc7Oy=Ejm*msoc^#L`2RI&USKnmk>*Wp4C-Gv~)er3f#8AM_K9C^^h&`qQi9U}a* z>{O}zwL&IIJISyV^R)Eh9#>*;=9^J@e5CTB3n^}Be`W(6V8~&@JoxJLR8%3m(bsz=hvB$c}*2uP8y_Zr{VI29kv=C$2jcyey0@@KO9vrtuOGU zGYSK*>6if{O5ZvZZAvscJFw4i49)E!FreqL>s_%;Vnv+a)eHdvLxCCM z7En}#7GOYj`N7_XwOo{Mt22z?wLJD;rMg<8v|`Nh1I`X*t3$Wz7=v_CJhFl>fyp8G zC3gC6n)f}}hl3hHr6@XMyOnoX8Z4Ya&=Ktg12Nr&VDgK+VY9(Emh}8&85xwLJfz)= zCQaLadM!CQ&PU>@IL|d3qb`s}bq7A)qCev^?$q;MIbsacSwAY=owDL)M(+PAF^oS8 zL!JMh6#?h}K0M=k$gu>35H>X=Wjn|fe0ly4SqfX<(FZPwb`M;m~&0F~nFY8goI6MR>m!!~7K2s#(&;Qs{{=@l0owWVUs$3+x!)>>A z)6o;Z2f6!>+aSz2-c$>SuLjs{q98uNhicZ}QMTFt8>7bMqx^rL>HB|qPxXKFaFPE; za+&udsdi`fmC@jQJ&wY*;9$$@b%&_fvg$2fiil*sH z`h>8GAQ9@jnQ+YKhkNRCH5=-}lfZtB4%n{=Yq8A8C&%D_1qjX+WX-FKH~JCQ?x8B9AN@MH>qWQTr`Q5`YJ zlU0X}-JQAu*OYi*Qev{wXf^&6b5+HCb;n(bE0TqM;7b(JruDVsoTgBsTIoth?*q;@RhpGa_z4!=XNIQoXOgspq0uFtQaWcHD@J zHtA`)<&EcMO1XBEP_5ktKytVM1o*eNmWpel#Ebhw&HXn%lxM1|fa2uPP+6FO1py%S0RAwYlt5ds7V;oIz5>Gk%oVNAe8JYiZnHo5k4Gc;AGYqHxx z09~r-E`~I~ENZdh#r4Zx?KR|}{&y26W)@aOCfW;bO8kyf!-3lJXEfk6RNsW68Z?u6Ye!m1lJ)6b)ZY;q0wvv`3l<1EN} zM*D9lWeQ8{e7N-!Pz5pM5PHM^1%?uC1j70+Qn#hX=WgjPe!K5z@iwB`T5N8+a)7}* z^kp~Hv(*o;lgCU(YzDpqxW78&M@Q9k_+lc{R%UUPCMZAzB9M`Ki} zk?fAfmpdxSU?5kAU1T)nsA;u+^V)cP5i?DHM-farpra-oIZim#{a`S4+jmi6>Dz78 zcKr#JtxCg_BP+_#sQv!jBbHYVIbz~*v*y0dDSL?G%GGmyPP_)f`Z zv3x2}rMH9B_yT;sDP8w!l8Ao>G&@l@eQ1NF;ss0s|T z1tFxXV?We~Xak3v?5&qSuMxTICF&y6pL=%HhxGK+(;3qj6UcB1ZjnkHNv=h`5AffI zk41+nrgr%LeIh^tpJ0>EPx6{-1AhqB#JuC`GT1f~Zy)KkJWmN%6e)0{nh34iHnN?z zD~y)DdOrnX5kg;l88RY!VOu) zOa^i1rrLRLJJLuyUlNi>!abWEqc4iM&C1!*(|RRS_ZXESS@=FGF-PM~P}mInE3D7&T|U%D~Z2qu>w zpe5%TeyXbu&tG$vB5rz*ZXG+cw?K#Tp?)R#q3Vmf0~HP+?-_@yT*GXy4M)#%l-%uU^7Yl0oxPGyp7L1ljHGQt;f^(}L;@)n|EOq<6h~+v0#bQ{oGx zr{ua{u9z(C)z%6*R>Q9i_y3$MsvfiAEZ_^gnBW6h8-2OpFvGvPf6s-CEDdhOEuITW zRuZ8;MNxc6_Hplt7#+Jk1gZ2;67>(C$O%(@wS+Uas#Q>TvAcTsIBbDy!IO&c2Z}fc zcER`{YcK(L{{8_8<`81~LG-cUy-xD9drIPQ--XsCjBj?pO9A=~3{@P?#GQBkkw^&_ zk4Z1jP}O08RViTX?vM*r^W6I_l}jNGlICt7)3Z=sU167#;F0P0F|hqR@-IVa9=V7c`$rDA4{g#sC< z4bpaP?X}b?=4OsA8oG<82seq>nA}Ru>M*MrY#wCkGt#TacO~Z#AG5-4s!F;Ss}LB= zSs}s&*KgxKJw`IM+Sr!5SJ$TlgTy{gbN%an!?y6&kQ1;bo$~a=P{ChEKCD(6E#Jp! zyhr9-E{g&nJc*ojuevcyM-(<=$R?CNfvQ*_L@YjPIbjv%ca3OvM6Vd2>&HhL^=pAv zZq&beHRd4T@SuF-Itd&SQri+>wiZ+*BtL*I!R5fKahxSXhbp@|>l0UMp4v!-v_r}h z3)_Uf3)mXKuo3Q9px$9SMpQAtk>e0swWrTyW@Q4ly- zjxEl@aBbvr2IHKpyrsI^?NM{h&_8G+A&ka;e##}J&+bweTRTR`Hkg6q&VmI?I1gLy=eWb|b% zuiaa#ey+a8N{@#`?bFqEAZA}y6Egnh+KV!8sm1)tJwVR&NND`FSOry4?X&XNZsn_q z$e%?U6vh@}$3e;BJnnSOOSd=l_beZrJHKUTX^;AI!=y`bgY=q{+Z02r(dQCqN`4cx zXDyUZ?pqC@2|s>Q!O$c9XrcV&XysHs70L+K?Mt3A^ z)|1ZHX(M5UqVTGu*K+9`yfv9q-i1}c#re|I{4^V6$=Jhc;MdigV@pN1;gwSmyQc$3 zS92U@GcLx^8`}HdKel*cRUJ|P)8L+kFZE%Iv%Kq@iCpb=98-h?H$F$oI zuE;|4vcxN+ur}v?f?5isW7lyx3za#XsOh`Ic=}*Lc|~A9n`WK`iP1h|=w+c1ZYpN8 z=c%O#3o)v!&slfv^qBqrG)m`A@ko)mpeQrvZ~z0#LDMo9^(rPyF^u-Xo~A2E&d&{D zY@D{NXQ{%V8fz;xS-K0>cZ9*8V9f$1#e>Gmeye-jiFM<-{4;W5vA&3L@f*kf(Wq+c zarg4GmRG91u(W2OURzk*KdlkdF?vFAluh)ig|E}MOfl2@jRw^Ql7^M^;KtjgS-6M4 zU>3q=4YDSwYihtx*2SjQlj6sK0(qgd=IJ#DeGSjw zg=0TZ#Md&+KolGLV3tinJ;I5M6)E3H&tvQCXE|ifQkCT{JG#AfbG<7MbJBHB&@4iu z0-iV5k{6r9>HLr{_@ee(n6R(a{m$^9p;`@Q9z(mT+K4Mvsmm%^L#whAT}}4^`DIU} zJr7!p#M*vEw^2=#s)J|Zqa3>1FDPZa*?m$M({sVi&6MHjAO9&G@@X^&+Y7_@ottgf zp}Wg1DZj-xGf4O{*FWkT$^xIvKVfga=>JdgjpVpp@GpF0@^c}aR>M>Dt7qN|P~v!9 z{5aE6bV~XPDxiQsjd4-gzQ}U8p70CskRgc|&;MLJ?=Zb>q)0q1kY}8Fbh{=ZK;~S= zK$`S5YAhUPG>WZX&md^Hr!6+Tq}t=AB*6^%rs_Dk_>~?1$48TeMX138Ma!176di5m z`e9b*9x9FI<+6!w+Jwx$$jGfg4%T6U6&{)%U7ZG7vtl^-OXr(6dt3KF-ufO$dDUNj zI~^e9+EOQDO6EB{v*nFT$CF_P(DQw*alMRBQO5y!gvp@k+3}63pyk|Bc1ws8-KRO% zm_5owqWz;ywWbe%$0vfjBuC+dN;aWzd&*8~`e%uD->8UQ0oQu;l}0wA?5xAB|o61-dMI*y-O=>V&J-3x`505+8Ku#u)-RtcU&kYr;dd zS8~=cnQ<*g@^o-2#DL*o6EU7ydC1lK@9@jA*H7OJ|1uDzkaHsAlW8g(4KM2}S`b|{ z)Jp)Laif!<7th(_?-7vh4arRH&PqSaGEzEdgD+5Ev3!ouB7w-#z!Q`o>rcv)2i{|8 z2}fy0r&oxbbh(=%pAg?b4L82}DUv4QtK8K?B?YO$hK^Q6J$3;SQ-L~MBg6-jk(i>5 z>RFGq6heJz9^Jfr5fEAyqYvd~xV3ykHA@eNp4@MEt7!L&`Cob21KDZt>?`<1<>#?$ z2J{otuwRy~H(Q0s)B#4h*4@{1^+TpHwPDpIysir6Ol{ZHh3b?{Z zL2}Q-wacQD1Zt5~hj@DimApF{HlF~5n0eeu< zx@K9(P0!*+XM7qaBN@7go-l#GrSlGXVYOzgrM^T-^2ksuVMMZpYts~F+CkCBih3I}L!5TI%TjO6leb=OA+!&~&-Z9pS@Sd@ zC;XHPQL<52sHx-?CX#tfWNJirK<##KvVasD6Ju4dY0R7JgQN?8l;wF%#sR4KPE6P7 z{|(=9{9o`Lk6_mMm!G&>hy9sNgv$O8AP+27+i>UQ#fST8YJZ4ZuO3nI@|Mun!+SsG zzVB656yr8xW1Q{md?~8y&snydGm5X6$jn$s5z32Qd)PG)CeMM@gz8L4j`a7RUA~hW zd>2!9!3+|tA!j=>@j%=sxF35l$EJxDnO|B-6h8IULG+!@^h#{|*9%==kevL9{|5dT zW8P)5od!wAuD(3dTP7aW-B+C%M1O4lYUIIwT`?hlvC29+|359HCyNodiM9Z#lbFDZ zV^Q5nP$lM$1S(urT#2K#y916qf?ms{2B-H^;|V1!x@^g-4^B__`ngasi`QCw3M}jI zFld0D@L2I3u(3JcwY-y`)i3zvmdsE3tDi4w{LOAM_~_5CZU6F(fAiSuoYBS4Rvfo3 z)((o@sK5TjaOd_{{emx&ALS3@!mi|){!5S_&;X#wH^^5lCTJf*USbmbBM9^B59W>r z%7MMd$^}p@F78S=Bv157` z(JL?$$y%wiGKA5eS#5r|XYHa$1_bQ^xn5|U?m3%*LL;?ei1dDW?c3q8Lzj|5gdz|( znrH1S0&~maJcyvJB{~}m6NqQkg@<}6WyBBC?)ll8rl+U#1)bR-wFBO7&Af`LxgP;Z z9~8lH(&68DimNokRU_zBYwH0fvusjrQi%#cp40NDeNJdi#g|#6d#{QWcMf_04!g&9 zMThk~V0uhVqqgQ2&Sjcy-t?D+JL=uH$c9^!OoGlI#y<_F&#_#6eRc7IJOf=?fzvgo z(U)_=@5BX-oGtDbIZ1Ep(Mj(xY#P>F-Kfo0B*8izsyI`?mJ{-X@n_wijHt<unn3!q90(@miJk_p$q?GwGo&C%%(NDt1Iii(vS zlURCBg0$p>w)5_RuITK|V-*_3KKv{ts#lj80Yhg26>7CTAwW)PliYTb;(S|HRBq$k zXJwF*mtxrt(^Q()6@vtyq)uPStLz`AHEie$yj*b{&iJT{l=m{X%;I$9d<7V#d0&@H z&_wPpI3?g|aoo%$vg;2Det6BbiBxZWeU!MTx-rg%?tB%RK=Cw+6#==*2}@YTZhrK0C!;i3&%Acc9sned-{xr$TkQFM$)y^jg`)yJ>X z*4l+DP7oq2V{w495{31ylp{@g3zBSj{XbUR&fl5gE%uai+3K#LaleL;xkS>tEI(4c zd(d56yU!++za2myF6K7&BA5rfa20(qPo?Fix5dI1wI&Gsl+Z{+s7!X*c{;G;X!d?v zdfi`A&BGOKqEovPAwPnwSB0x(ljzlRU83muXV2So3%QMeGEnlmE#EWDbiN-NZOA(3 znYUVTI4}P$&UIttIoaQpx%jIx3*6pMjVVurWYWOb4FacEp9Vks=Jsck$+^J1;%2nS z@2W`fH3G;JHJbW5DM+m@nxvmBxd=N?#HM650X4j3>gz9+)s$B_Uv3Lrr~!r;pXzGD6<3+uMEgADEs{Q!@n%SI$!bpbHxld0-&*qYy*F$= zU{g)heLmVd(SOZNF*t>ZdrqV~TOnP!JBpg1!amNVC8?mk>7N>s+{lGxmP8GX1b94k z2qI(;tgwV0x65bP95OZKUrT-c3`Y=sXSwsvGH++B5iRIF+*vcI_$bomI2-iJN9TRv zhmiQ^!0T7;Ff$2EW(mJ8*JZ3^9OVy$ww>5SYE|v#gk=lny^FT^Mt~VIMJ{xny-W@V zU42^xv-Bae8t;kC#dnz?Rf(LAHM|22?03DczP?}fcS$?EQ_i$n!ZOQG)-&En<2XaV zi^!c*vi3R1xRKdOUh~AoVHgFNd|H>)bm6)f&%8lNJPG^^qUZ7TrZv>gb!;gW4Et25 zZ|~y7k4i7;)q)XurSt;RjOOf4{|Y>5x8~C9jA8HBy9Cmvsp;tt8z=U2C+cNDpPaa# zwoUR9XQD0E*RGSXJf5Akr@`Aj4cu|y(4T;9FxSjBLszVl|EAbYzmS2h+$N8p)b$4T z2LT^GsV_?FO=0%@0b1Kyb20hD{CfK|W{69jf;O)C856|S29m+{iYusMFlR9e-v8J# zz3c+P*Gx{KvBji_@@JHP*WN>C0P)kiM-#Ncxn3#QhsAO%)%UwdZCea=wzdQs>vD4Y zWb@3s!&H})CO);WSRsj@iFpcq_&u?E>q%&t+vpQ@uZGB}Y~|qBF9}gB{oz^LWmgs} znhY*hy=sYQ9qmyuixHok^FP`m!1XlBR}MZZ9Fs0pkS%IiwI?9 zCr#gQhoo0te~pq{AfzL1$aq1bxN5J&2{BtNCpBjd2Vhiu+t|f8A1mOY{nDp8axJgI|zaa?0fed?WWu{g6%U3q+fs~ z^Ay2`eLTeqM~S(VoVlE_+L$D_l*I$L6Pqe`#oQ}T_dbxow;8sO?%#zkG}7_B&#k^* z=diC?8na#CF`G67%HLeHfqtoK*esYZn6<2Hp3cht_)}c%j&~86&wKHeQV~Yx&pX}N zj3C!nqj$U=Prm6Nj&^HVJd7=~F;MW-ot`%kX16*BWpuk7{R&Z6HF=&GLrE7)D(%=U z7>?XR`d4ys$*3T5kqv^T|LU$u0JlCxNjbX611kLzC4}ul4BQnzU;5Z#=Ad*RRNgcemSZIb`fbX8xAtw)|mCZQl1oJbuUcM+(gH&b;OB$}8UJI?099N;PG7 zQ(E1*H{~~y9@QoByj_FdzZ)^sQXV~8@OE4w`HkP*k(b2JU+RGzDT`4u6kA=;0``wa z;(L)VhHq#bH_B%xC0vedo-|uXpO%AArSbSC8qMv7PGeJXb!WOd?9rkcWz;@6d5?+x zbIG%9tJ=MFO|GXK#^++#yf6La8!KJ$je32cSz|ZV7(y#la$A5%%ed-pFE2q7N~uuO zH(v_ulBlTq5X7zhN0~JunLble_~nzs45lb=p)ZEf2-eAZXiAc3vm7ejBrr{X=Gz-x zr;{nTs?*3-PT$y7>zwNX)kfKfp$}ynv_BpsXl3gOG~>-jDylx4-YTv9`2^yT0^KiC z8UjEMk55~lyxq+(*;$VzuTbXknwNx<&FIfX$E(Rr$Zze0HRPF93CpdIo_Cc#Z*G6+ zSnT`LnuFrQJV!4RP$skO#NVTf(O24Bxt3V2;|gHwa7Y#xqMIU%4kO+3ztQy9zNfG0 zm}lB;h%{v%r?vo}(rj-kb8cXGyQeKfr?fo;R7t)9+CXmTShQ z?LFvZ`5_kgVd1LE_6IZLB$3#@UD&<@&gLK-i@yn*qq?#ap(^hKIE2rgeFA7-#9m!u z8i~5O-CuHLf%lwatA~H(eK#YGCIElNM3LInK*-6(7@1!epZjWFHAGiu9;&snq`kd} zZ+Ju0_op_Qn{%O?*o(g}c`4;UQeW(ps)PDGN=I$0kC2g_dULXnX?h*pw z4ZZLFo@Zv>nKd*2yld8)vyhXs&)zxvo2{SgN`#tINUdGihp`TB{ooW2_h3K9MN?*n-a zx+4@6kxqFjaV;;C{R}Y&T6xdA#Wxe2WU^BatP>Sf{NSG%ubcpGsS`wo55NS-Ct}>b4t*q>nlwx~?e8>-0YL4Se zJ=7x2@K6&GNP*bZ+Ds|(Itt3^75lkZvxioRJvW!ERf8563JUb`fX9v=pMVMvkxA68 zas0Ods)LE(Fjc6s`t!gC$ii%g*J8vuvjqS9f1{k`3aA6hf*ZR(u zU!)Tjhn*29XxX3Jyt%j;I?&PnLHCmp;!he)5%_jKAof#UTq|Yq~Lr&J<59STZ9XWE)`q5g+RrM@z;Z>EMkSQl`zo1a= z?Y=U2Rt=K;BgOh`C;Da?tHZ}-#j(|xz@}*2r4OewD_VBSNmu&OFv&E>99UP3I2cep9pKhEIH1Y{}hl3#V`3oZgXoN^fbp3vS~kqEuO5 z_FCwu!OrEm6+%E|)q3WrUxNKiKfMrJ96zpdQAsSb9q>!B2cN}l5N}!tt8H-QMp|qV zPg%yiAs13rh787+-}RKGxgI`k{3+JCE0p|#L{Tx^L2_zX7j=FUxP8VWsTEou?K5(i zxXkP%pC=VufQ3cMG4BA$5*OM!)IUB9&l^x%vNmLPcFvHLSnRo3RN2(GJgJ~Vyf3cZ zsw$LG7!Qm1(R}R2s@}jV>?0VzI(>V@Lmp+gKGvyQF$BJ0GyKs2_M6aqZT&5+$t`|% z)O|j3H47S6mdtcKuxhoNo4@%cI*WZLaYc`YilEbkcaB~?jW5Yl*qfDbQO^!Xn^M(zu>{=AX(WAhny2vbLOJ@#U-cah7R6hMy%q>;LwQ} zMyHY$GLIraXCh(3)8D5Uhq90Rbb#OUY6RcmSr6p}M6q65vQ?YrDhC`Ua$Z61+>=%@ zy8}S*nbE7`tEObVxutjh6wVNO(ne1`KI4Lj88x1>q#ALz*HAh<%3j=Dp95!!Z9 zhhj^f)4OlZxw>y1V>`$w_<-htb>D|SUK&>Xl{egcWRQ0#i^ za4o>*+Atq`RlrT@0y5@xSLz2uP4nSM0Di>-iZ%J6Ir8{a6MYEm`{mbyWM!!WVY{xqx-;Ms5pO(UF&g&? zD0p7Yp?%B?(*~Br^Jcp&rAbrEZ`rNH&TBQFyPH*J;2wBW%#jT_^{f4cWmhuu`U3;y z!vjkmhoWK5abIEa>S3&y2bW!e2o*rI#obMfQ%Zyem6QIP>_|BV_YP}q&|`Xvm#|K1 zjJtU&8z0xnGt^oxvocnem>192yL4_AUNrv*gbIa2Hnbujah|pLPfE8Q2|6CWH_zpk zdzb#6^j+FjwH#Z2t+8d5*>?-d=OF~7mazUlL0GFO!aMv$xmcob;m!k++3#WS=A0$+fP zJaL?RM>VYiybfVSud4JSZk3vHY&UzqWyi1&l0z5@1*@Qpn&-r}H*6KEk2QT|Ga|1< z!i^PG)hqx^>s}|x1I=<1x}z%F5{PP8xC%$;l0}_^$%uJKe@eCU)zJ>US$0 z*k;GX))LKIWB|M2lmlIUr;(jX)g#)=M<4BEtL7KoC=@H_HtJ}!*h@d_ETChOCV(%x4MHQ@FFlv(d%ID%g=#7%i+5gkr-fcJ z4YxG8j*{3H5b>o8n(lD}-)V~Jv8UPsnC87s_$-Eu*0nxvDT|(yOWF>wZ;}AD6N(Er z-gH;KWCS0^!qx*7Y10FbgOw#=Sat`;$+PJ`98^Iurt^uDpP*?N#y@~xv~OAHJA$$b z&bYd(#?Uk=zp3-<4M~m6q>M`0i+Sua;57c=fo)qle>pHv7!Q4aWxhvFl(wgxKHT9w z>8&yA69st#ts>jATd0#C$#1|EL0h`z}=XeqmT`M^B^JdGHk(K=|ve+@wO%>?l!N z@QyMl@iwT_=kJhT^yO5!Ue-I4##p!qaiP zAr%1`duIAMLvmgm8)B4J9nBn4VG63lpfF9lic8l^Xc;g%^j-7-50uu#{I(jp-H2I4 zFVCy8N2_$;0D7Qu@!}i<1ty-@#TxeIFkh{T^3U6T{qb__21aOOU_^}Cmv&-h>h^Hd zQfR=GOXpTlD@3SnLCZI0A-JU_FuNMzKpc~7f;Qe~jT_*M0*sHc&3%AfD0Y<*u|er{_SCIi7(*p~Uw^tvgYvQ5^^4C>O4V{E))rpr zp?v81Fy7b-weyWozH%#TJXe`XdaG+!=Zo(TjY_G|dh&0Gtn3Yb(G(IiUO#`2C(y}r zOwCwBry26Nw97NM4XekMm*>SZKVK35dCjGPjg$1q67O)(U_7O;{TkYS@Yu?G&Fdy@ z1snqHcBUlkpv|TI2!5g$sIgtE;~#{gogWr`DblNL=W|M^ub|rfl1A){;MQh)(x7b3 zbSUu!O2#76VO|Oyg-Uxlsv)N*8(Kw0HQIeZgQ)jBf+jjE)nPqIwbo~q*d{q8JCwH! ztANCJL4$-}MY|x6CP>Wct?hf-V}kb1_rLlYwrVFdg|;5SqwNw81CJ~adz*`o4`=E@ z8+|g6XFQi)!C`qR{^%Y#*UEYU_!E6`jp{y&LiKSy&*qZ=lFEzKX)cCtMe&Towvya_ zT%Op|K^S#6zjdD)9zG}9mYe7fBkW5UB4`g}-+s$m-tX2v(n*QzYd3}FcBBwLR=s$h zW_wbW8Pu_M&IB#IfHJV3B}zFt!|ivM=^D!xKtS@&0?PZ3f(pcnXL>xDHU!Oun_r?1 zNgYgU@ZhN`NixtmO;6ksALqvlhjqQ7KFb`wEAd>qWyk$if94>EGJk<5h5qcNJOHNQ z*;7EWOMJe*pWC)5i*kL<@~u;LHX_T?e$w#8^6(t@^^Z+Z?wxaBBEj~;JS>Vq3F4Hb zSlcR=2f8_epN$;eh6ga?08eqYRS{6u4*8)zUm4;9(x-;?yPPX{YBqb5sQL|6^H!yw zEww@R@-5PguF{|AFrPuQ_oLjLaz0m}pI^aB9TJRWEq@D`u)BfBSPvfrkf73xUPk$N zU60+qf3Wi|5DYFzejzInM;Ylk>jmU-nufH zymLFEZE0=s91z*Q3EG2Hdx`6u3mwmS>mJql$r_%pDy{hLPdAUNZ;n<}MKEucHBJMc zc6;7gogZ+|i<3Pin*0^4QBQrV!nqvPfl5NVb}4vK^+++ut(X`M|1-O2rTrpdR>>61 z%gm(@gqikJ2b6F8+o|ct7u%?&76p7NqA2>^qW}c~dKFdX^oyH0Ht)%TdQccq3UYUc z!*htequi}kBHX=L(C?IP(Fo?P!iqYU91djgXwlrNWS`7nXTCc~?g}o9pH;?IzJi)Am13>^ z>EyLU#BfKet+NPMBhM7DR8K=dhghMA`uYR8STL#1(CCH;oRTtlRM=^P2fA=F1}fOT z-yPA2lKgIe#QX7%qW~+lH?c|QIJ&1pkm@qjA-0RQ=aFJKaT%0y_C#P2<6RiXOq=kt z{h1neCzl5v=FzAjE%5oZOTz*ow1UssV8XK>C)i&0%iE zh^g&^Gh^aL8#|F=GMMA_ga>-r$n3_u!>>3DS*-32DxH*afx{)psgB`(s^-@uYyoE; zp&L8NzzOYSR-Qxm)yuF|qnufba-6dZFiYl>}!3m)*~S~z!k<0or^4Nb0_{@I6bBz{bGM)z3eOR^O9hP%t& zI@{wSq{3Vi5bMnQpwkBxbF3Fg4ugX79guH@J1D*f!<}!rs{vztzfSat&uDKiI8sFv%+P|pid=sR3g7gy-ZP^6qZ-fgkV309 zw`|Z&Py}4G51iy|!~Q1;#jFK-ZLRj_eUVqzf(`x93I9!coB1~A@0+|Nekp#>#qN(d z%((1_|D2-yLX-Qi%n#}AA=~%Y%uP10-kVcSX6tK^-IpBqh_1LPnZ*Mj@F8-*uEZP# zr5P(}cdEw0^_vY_I}yC?Y^m~QnM1_us(YRQ?U)#uE+Gp z?k7~laIsx_#o{nc;5U?i&9JsloCd_(+SIEMlmT|I_RWU+u%l)D?M&fO5yzHos(CKI zs4T@6XK^!M%acL~6K8>EXv|SVw9Q2N2iEN8@H7o3^@{1d93kIN{h5R}b+yV$2`{WV z<6b1rYhRen{iRIQcBGyuA-+;b$~3I_zoSfq|4^n5K2;!hSjBs0b5kOZSHnhh2W*1D z4GkgLO_FGpC3-9G>Ru?m*gMJT7?GoRpGD>?oj0s(gWUE@R%q{)d4{B@FuJy{_zrj1 zG;3q;`&MYJ%S}eV1iMt2T`A!Wld47rbZVQ7@u4g13AH+g1S%bLX)7jqtsmF&s=36H zQAF)WXfopUr`IW$SaR9vq+?LK(o8OXsI0i^)$rZYZslHa%==jo#KM}~@_VP&$|EjY zWist|m%?MYkTjbci+f1K>Koi8QPSHdNyzt;Sb~M(A~XRTC)VDGV_-C;`FEpNc_R*K zDXKBQA%>5lR&mLLbU@AeZQSmohV3wIH<Y3?1~&cHI>e- zv*ic2Ug!FE6aBrxCdI%}Jh-Nv*89nAx zDBG7$7%}Quw71(g&!X->(y}<$4m!;xXP{i{ZYjCcZpUCGaS~^n(+u{W9BOF+TO1}q zXc&}|37ZAfcz-AKza@qApAa(F9Of&jNe1W?*Efri!V#;psE*nUyJkHBI(AVtdmkX$ zhcaDfE^k8{nd_5YXxmipCb<5V>Q}>NmpqOJKe2pUI^1f|@b)3^DQzCME)n!F?CvH5 zOxlNlSuAqk7li0uYX5<0Yw*yeR&n#zAhUh6Q?qKJITu3DH0X@>_SwuB zpFyVry`v^rFDPYy7Dj_#A0(XN!DjdwOmov-PXr{?q})dlljIIoGM=L!-KGxtv*X ztz;|VQq&n0IevuqUBozFQLQi8Dn=Jyv;TC%+GkN735ECF*%@WFr97cRuaYHaQjlxx zs?3aukehd>xEV&zN+xHyIUSCU{af8OV~XPPch>#U<& zKPDoTb>HGR_L8?&r5e8|WLwM)Q&rt=5Y|yY9F6I&W-Pnzcx+u%)vbaiecoX2N>m&kR} zh6-9ACY;k@*6Y_l1a(8Y&`TG6_7Ru47F5j5l0s1U$d z=r%xcvuggZ)#Wntia#0HxgN|D0O(P3L(>e^DkOn{uiN*J`B#-t-jv$b?ywuYv`88N~(S$5D zhisnc)9C?1>X$w&FeHyzA00Jc{XjA>;MrP9mFIkU)@unZ)>_i2=rJC=ApI28)uqBN zI!$Z)P`lWBS2MBxisgt_F@%Zd3#OhqL@|s2A@t=lC>-MND{|jCtYA_h6SG_AmEx)0CpTX$_#V?m(A&Rk84DF&O+-EY-ZvvG-jVaQ z_4=xft>WF@qRLBnhJMYG)3;sl^Dg{A=$3bOAIVT$F9r}|ekt?lpp^cj|$ZbCouz9?U z{>VQjHxZyY>l0S}>jSg0pPmbwKI-;q#-qti-HLk=gP%}Smn<-)g!i*QzI#DEX&3pI2^Gbwac{vkv;X*oQN{Ds|}d5M|0z>6efDHdDTKSadWhl>Mp zb};OBrB52zf8VHa^L_$VXDc&8{9+QVEqVj3PeGt3t|WGh+K-os+~EWF%G-En*}%=P@^bGvt#NI;@9 zH~%_=pmFoSjx_yjNxcUW_Z8VS#A+UuhcIe1C`gE=}Z`a_z0aE*<< z?>N!MO}`1_F2q?598Vv?>93!F$UD|J5f@=M3ylGCMkeytWC7a&S3-!D z+y2q#DQT!q;xyLX^WK=vblO3y=Zkf8ca=_>Ya(}6i>^=4yB{j(Pak$$ZyNtF-D#_n zs3M3^#r-z+vFRxKNEiti4&j5utnkt2pAHHu(g7SvxmeqmD-nldLUCLYqGbVlro73I zbl;rkng!ML^m**Jt#E%4q{3l4xH^yf`Mb(AENuRCbT>;Ft=(~Hc8~IZlA(rx~bUYh&M^Ly^l7|^T*ElX+V}>zE9m2B+sL`t( z@;vt3+Lu$~jw%rd2hG_In`em%qdU*8#Xx?9c_PHm*wPUbrEPw)XLPV^F zHStF6Yuh4Hw5>u!n8x((-NdpGytzB40NsT3-5jhT>S=nNvmc$m4WV#!&t;Vq zT*bYFO#gCI!DX)tz~}MP981uhhmH!kZo_Q!4MI@Yv}i{430lAhr@zi_CE&)Y5N%c~ zGM1SZGJ{_~Z%sV7KBV$}NbH1AxfHV$!hOvl4|UUw8y)(@Vm>&VC;dYr<~SCxJLvzR z4(P}Hh8602lbb(z;-*LQo?u>H+8z%V^G4CPa(!~{<-_sq^LqvRW+Hcbm>rs^f?Fod zMup@dwXdQ9*h#&>d?o*Mi@IrBslMq@x8>hqHCXH4NAbG3K{2(pSj= zLOWrGQQ@fWOpIrynG*;hs#PUA&Ovxp` z8@D3h^#bF&b@+5ef9^$s1PMp0AcK8yH*wY0S{@)__mzpUa8Xy6Q@g~!cc8E?Uo40h zu(q}e7ft5*g9B#H?C}4l@%L8*KK>6~5N+-O{ueuV@`oM#xzqIlp4Q(iEhtY|{yqO- z^x@HeGIRXDLKFXg@&8k96GZaFF21yaL%&fHo4Y1yH4flWqRq}i_V+_D6M*8HANIYn zveUl@?l}QjOD9Pei?9!!8lb-gqRjMop*Kv49w$te&A4Bm;R2i%a)f}N8Y#yT^E3rP z?Hb8{i~D{O2UMfAGuSf+metgLH5iz+>lr9DhOnPpOq$y=2XgSkg*_E}p-xH7YP&~c zke37Y%zzG%Hq&(TG{uq4o>$1fwv3P?7wtI_wzffS7UzO#9RJ>TzS(=1g2Jv%SS`j+ z15I{6_#U{-*3?Q=4AQnJ%KA0pu?N4z2>R!zkfl?dG5K{wnRJ3sum(f%>PI=6`HIMQ zS@4}v@6Q@wpFl;b(0h{t!lmSqwx8!KwbX-0BiYn@3Q$TP5DtX??(nMgQd)4AsCVGz z8lO(#g!*sMFZooCZ+GUHjek+`QH}Ta#0f@=82ql415ycR`=%6~S?Mh9*W z!=6xxLS6TPS()PnOmnjVbckDCf1m5fb}=~amo-_5DJqd{EcNT1GtCD2B_%(VgRno_ zJui)WvUYzYm=76Yej$=|dKKe6YwuE_6%HsjeXZ32OGP&5r&1fYaf=GjtI9 zp#M3JanFsQ<_~(^Ckl;l}!xZJO8(tFI^AGt4ZGU z>7E_KL5gtGR#n@Hi#$muUu-7->m*7*Bo#8$YyGHT*DUe#`oJAgtkyS+!g-pow+Dqj zF%8agZ4ff|^PMEojAT93f1g`U`Q(xI@o<5{)mg@XZdC``$L_=UkWT~bKG$mRqvz@x zwv|`?-7Y={9Kou##Gs3G(yc%sm|!t~t0#eP`$vHGT2Whl$8qS0ifHOr%4h$Ux+M4l zZ;Hhuly-+|rleK#X(lgwl1Ec&-A^q71!wa+Ej07Ztlo|Fr_PS{ zqWZi%IgOgM=GonzoR`Jf${dQ~Z`@M9x#j!Y5S}5cUbVHIh(r@E;wer)6$y;T(+4qq zs1v5<_i?t|0t0sW&x+t-?mox8rej+Qbakeb2NP|a$?@b2OJz7) zsQpFlS2#Gl&?dp%j&It=1|zCwGwe|hXm@=r2~ z9v^ZxZS^1+)Ur1`lb|ai)7?C~VNTHeH~H5?sCb6VAPtec?e_vX4XO!vU@UO(-^8~> zOV~R`m0QER+&-P4s5OFrufKlu-)2o@0sl9t{GZ(at7g_$BH|UE{qGt0e%UdTVL6DH z?LIKXnf3Yp8?}+L`usx$`ahRq%N-u*;XD7A0Kw5r+r1F`Z^co*?|i5D|IWhTgEn%b zW;WCJAAOQf%wsBf ztJnEXLX_$tW5NZ&{?@sN&mZp71SX|fW>AbHE*Jm~#el)3L2jRO8N^YjNyi%({&|ky zzo<%$Yp1zF*C`K=A4nTm4@S;;H}dJv6Qzc#w`8m38kEUOURH`G&R3KMJ<;f4;>vWm zwB^Abso~GuQ?n?_cHnU_1cIU|mYEfE)i90EYHUwfiT)8y_6GlmCY#6k^cV8}IfFE( zOtsR6H3 z*tUxM1bgD(KOS2h>*9u!FuRlvFh9P4$#KW~6+I|R*hPmO;brr9jUL@MT&W<^CS}6B zjn9m<=dT8J_L`822~eG|xey!|HcTUq^+i`egIs*}_fu*JIa7`5&LRDduParhL2fr| zY)VD&#J48>#vr+v#NPYrkQUfVwp^b7(Mc$>{!euh5u{E+{;y7g+WAK(nQs0W-7@jc z$!qKAsJVAN_r@>69uU=M2hYwSootDwF31vN~BxsnA0-tNx>O+zfrqE{sq|7dbQKP7aRCKb`9DLtetE4}`!f0@s{%3}@Sl6Rixb-Ikb{W~7jSAGHCX6F0nC8}ke_`l zqa6tB7B%xMKREu>+NScfG~K&zxde#x`G7=LW3qvcsy_amnAsO!e@^_Ppoo{>uja~G z-mZN1o^o=L)&)O=(}UM8MPWgpTUA+Jg^#m`z`JV_v4sgf65E_rcIN`-gxjNag}(P? zkaisrx>D2N1Z*EmXP}U-^{@TNxeYL0Fp&pOz)O)W@2)Q{AWHjJg#Ol&Xj>k2!?Adc z)cYx+t1|%vu@uskjc{C$doS%lQ<>4{*@8ND9f&YS1GQ{pj>^3A485|S9F^i2$HIo^ zGPAR#eNnv(su??Ax?pI_T=!*SpPPqq-(FipXyp` zuX1)p%C32twzK;#vBa-?6Sc&%&mP*2#Vhf({!~eXx3Xj)NWn6Lx+UEJIib{dOE%&#)K_xY(UdF0C-c$6F zmi`azt7U(MlqMD@m%bN+n|7~do@`qhspvzWV133E@+)_|cm{D*aOOtLRZnH$7n#PU z&}+PE08W*JFQVQlCS`|?+^+Q`eL;p~=TN91pop&6V({cbtiPLJ3VI)o!W|mn z>la8rzLuh$B<$FutJgJM`xfJn+_k92x_OW*ha~uSbsDO7N_9^Ig}-9k_X04NFE9z~ zBh7dK)#;2Q0DKb_ySNHpJZ%KQL4m)-ZedL~`**zjF-l2GUYOAzH@~iU!4U*IG>0LD zh*?JzEPsx&Yi$L=t$5vbBSq_9eeyxqG!s}ezflDV-}JmKIDinsvhxbru6})Qb!=?) zoBm_S%(Ycp1xk#B`&Oi#0GCt#p-i7{m}&s>JxrHek0`S8tD5w99_W7$F2ue@%2wtz zkM>vC9f(^KGi8~?hXoM|>nu8^iuM~g8ljeNRU+&SS<)$^4s$to%HG(LdJ(7DJzIjS zAXZ|SlSj4LWaPE4W;-ZoNlvqk*O6w{HiVh%BF6ZW={N}e?Oa?TgL(hj%yhNLvC>BS zqXs0COYhKRb2zi8Ui&=oGQwNgljPDC@`|Yh5FUN3UT5=!h8GvNV zsmH3!Wpcn7Lzd4%HqZJ8d%dCRE*TEte@M`sr%+QVn_?s<1^fIRTQzBeV&306bS(xpC_wKGzz%A8LbdPG74iSd z31jziLQ4caaz;GK{=PrFUg`J}u|ccDDT$2JWWock7v&|=GJeBPG!kQ}*Vqrb&0$K) zQR)i!aE$TrGiERT=<5-MMxM|B>&CMwlhilqIMofWH$SzP6cv9oSw3eg}UzT_C~u9mO*#6wSO>>wT>xS>zq`X zD>MGyX87+GRovX1XN6+f_ZHQvgQSkK-s6*(;ZlvrF9s--QJsAfd=sB7RYke|y(FGk z9$R8^q|2kxvC+qn5~-CBAN9;;%gm(_Jq$;Bc11s>O2u#@U4!y$E+L-r#AuFA9H5e` zwrjl(wu&6FtshyD?5?eOcSA@G#S_&c&h;M+h4gBj`QU{)Olvq&T_VSG`PsU0MuP8Z zUXkw8FHg+3M%;2H2&{et3GamqR^Jd zV>yqrGk7X{JneYlMAwGhQ+(3zMHvG5Z1z`Rp4-JbR&t)!SQ1pE>1Z1j>LI- zwXh-DA>g&AbI$ZuP}y#d>z%ihH?PyYgCxW)PvDQr^qBYBdzWsXKcoVP5%p-4=lER@ za;TxveF|ML3eY?THq`i}8b}6ym3wUTrQ6K7C+t@)!@#=<2CcGKp-l4{Xt6gJ%M0#a z{O*S{XWtx;=Z>tEPQbc0xTT*a7HOXpj)r|HS8>#f@Yi50rajnWZVT6%*nZZ&XdNwZ zPGfq}oo7>dvJ84xAmHTTgmM7k82r0H5;*o)?cJVG5!(JrZJp_RNjutK(Q)HRmV5qeqT! zYL?u;AT&*vO1KVRj;bwS!+GApja`#$f+80qGrpvGJzMiEIL)L|xL>hIb9Tr2+B_H5&R8v!tO+Y*&irGT71G&QY4ekAw z*obK3!?MDy7z^xD2v`WRe$%kX+4HB96gWr<9G~}N{nb^bO(WEb)mA71Js9VnP)Ugu zkwskb>!tFQX8$<5LP{#~l`jZ83jka0_H5M z)W$Gj#sfw2P~U1;99I?SB)XYy9f-9Nw5B7wT8mmFUp~J4F@+EMYZ))rFFR{mc+c$4 z{-dOXe(|21y*}SPs)j5L)b~J)kfTpj4_-ZHKV+8UA=)Z0($CXvTJoiPr@Y<~@rs@V z<3KOu@!i0?1o~oua3TDOfcL@(0xkv9PjP*-C1E;7RiAX&co&%el~G8GB3hAHtx(I+ zmJ9~{HpfuuuIabickLA3nhC5qXZZ4y@s=bm-i>-S$;4LJy+#gQ7{*pMf@TSE*xfEg zdO@Y1o^FCP`bX1?gG?U~uKl-F`@%&WNACYp`QI_j7%JKbS>FkRiF) zcbL4+x8vEe7_XxA|AQga4?X^~V7qm-eAS~qvNT`EpX5g=Mj&nn-oluEs!vap)@=zE zX0&ct<$eeaDb3Cw{WRWvpN@{)7fkx8(?v;Ey<8#75h`PnM2gko=+^L5=+yr&5rraHUUCe-H z=~%uJ-v4oomXu8ioo*8xpQg+>4u|jCt<4pLC+mYSv3=GEIWOH}j6wwsl6AHpBfras zT&@eh_6Lmx%uISt|Mh_0(e#QinKUfx*O*?GVV-s)l zGK5IKoKI0zRttF@@h6IQ(Kqj8UN4Dpv$8=Ki+UvTbf|y{SE+~vTZ<&W5H;)P(c3h| zr^SIo=<(LEUBULaGtyA1Uzbluzfsq%2_eH6_D7sa>`TKhIF@JDyxW;|@E{$p>Bymk zx|utq3mh$KZL()}%NxS5cX!t8pb}BAsy^2XGMmn-A{$A8%kw{y%o{QHX7+$);euPB zXm(Zm@IRmfDr!JfLr$JWHJ$;dDvL&el7k8mApd_Lk`zNx(2O;soXWqBO|uZ_z@r9m zLjV52Ws>9utCIi31Yl?w?y;T1Bc-!Yt^203K$C ADF6Tf literal 0 HcmV?d00001 diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/benchmarkTemplate.json b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/benchmarkTemplate.json new file mode 100644 index 0000000000..13bb3070da --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/benchmarkTemplate.json @@ -0,0 +1,154 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "endpoint": { + "type": "string", + "metadata": { + "description": "Your account endpoint" + } + }, + "key": { + "type": "securestring", + "metadata": { + "description": "Your account key" + } + }, + "throughput": { + "type": "string", + "metadata": { + "description": "The throughput for the container." + } + }, + "documents": { + "type": "string", + "metadata": { + "description": "The amount of items to insert." + } + }, + "parallelism": { + "type": "string", + "metadata": { + "description": "The degree of parallelism." + }, + "defaultValue": "-1" + }, + "cleanUpOnFinish": { + "type": "string", + "metadata": { + "description": "Whether to delete the container after the benchmark is run." + }, + "defaultValue": "false" + }, + "containerGroupName": { + "type": "string", + "metadata": { + "description": "Name for the container group" + }, + "defaultValue": "CosmosDBBenchmark" + }, + "containerName": { + "type": "string", + "metadata": { + "description": "Name for the container" + }, + "defaultValue": "cosmosdbsdkperf" + }, + "volumeName": { + "type": "string", + "metadata": { + "description": "Name for the gitRepo volume" + }, + "defaultValue": "cosmosdbsdk" + }, + "port": { + "type": "string", + "metadata": { + "description": "Port to open on the container and the public IP address." + }, + "defaultValue": "80" + }, + "cpuCores": { + "type": "string", + "metadata": { + "description": "The number of CPU cores to allocate to the container." + }, + "defaultValue": "4" + }, + "memoryInGb": { + "type": "string", + "metadata": { + "description": "The amount of memory to allocate to the container in gigabytes." + }, + "defaultValue": "8" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "Location for all resources." + } + } + }, + "variables": {}, + "resources": [ + { + "name": "[parameters('containerGroupName')]", + "type": "Microsoft.ContainerInstance/containerGroups", + "apiVersion": "2020-11-01", + "location": "[parameters('location')]", + "properties": { + "containers": [ + { + "name": "[parameters('containerName')]", + "properties": { + "image": "mcr.microsoft.com/dotnet/sdk:6.0", + "ports": [ + { + "port": "[parameters('port')]" + } + ], + "resources": { + "requests": { + "cpu": "[parameters('cpuCores')]", + "memoryInGB": "[parameters('memoryInGb')]" + } + }, + "volumeMounts": [ + { + "name": "[parameters('volumeName')]", + "mountPath": "/mnt/gitrepos/", + "readOnly": false + } + ], + "command": [ + "/bin/bash", + "-c", + "[concat('cd /mnt/gitrepos/azure-cosmos-dotnet-v3/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate;export ENDPOINT=\"', parameters('endpoint'),'\";export KEY=\"', parameters('key'),'\";export THROUGHPUT=\"', parameters('throughput'),'\";export DOCUMENTS=\"', parameters('documents'),'\";export PARALLELISM=\"', parameters('parallelism'),'\";export CLEANUPFINISH=\"', parameters('cleanUpOnFinish'),'\";chmod +x run.sh;./run.sh')]" + ] + } + } + ], + "osType": "Linux", + "restartPolicy": "Never", + "ipAddress": { + "type": "Public", + "ports": [ + { + "protocol": "TCP", + "port": "[parameters('port')]" + } + ] + }, + "volumes": [ + { + "name": "[parameters('volumeName')]", + "gitRepo": { + "repository": "https://github.com/Azure/azure-cosmos-dotnet-v3" + } + } + ] + } + } + ] +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/parameters.json b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/parameters.json new file mode 100644 index 0000000000..f8b1983b33 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/parameters.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "endpoint": { + "value": "" + }, + "key": { + "value": "" + }, + "throughput": { + "value": "" + }, + "documents": { + "value": "" + }, + "parallelism": { + "value": "-1" + }, + "cleanUpOnFinish": { + "value": "false" + }, + "containergroupname": { + "value": "CosmosDBBenchmark" + }, + "containername": { + "value": "cosmosdbsdkperf" + }, + "volumename": { + "value": "cosmosdbsdk" + }, + "cpuCores": { + "value": "4" + }, + "memoryInGb": { + "value": "8" + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/run.sh b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/run.sh new file mode 100644 index 0000000000..3b8855a95f --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/run.sh @@ -0,0 +1,2 @@ +cd .. +dotnet run -c Release -e ${ENDPOINT} -k ${KEY} -t ${THROUGHPUT} -n ${DOCUMENTS} --pl ${PARALLELISM} --CleanupOnFinish ${CLEANUPFINISH} -w InsertV2BenchmarkOperation \ No newline at end of file From 83bad122481303a66e7a1ae9a84ec9fbdb561aee Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Fri, 26 May 2023 13:51:46 -0400 Subject: [PATCH 122/240] Update README.md (#3875) URL typo. --- .../Tools/Benchmark/ARMTemplate/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md index f829b79bc6..7821e1eefd 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md @@ -10,7 +10,7 @@ For the below steps, you will **need an Azure Subscription**. Just click in the **Deploy to Azure button** and it will guide you into automatically configuring, deploying, and running the benchmark. -[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-cosmos-dotnet-v3%2Fmaster%2FARMBenchmarking%2FMicrosoft.Azure.Cosmos.Samples%2FTools%2FBenchmark%2FARMTemplate%2FbenchmarkTemplate.json) +[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-cosmos-dotnet-v3%2Fmaster%2FMicrosoft.Azure.Cosmos.Samples%2FTools%2FBenchmark%2FARMTemplate%2FbenchmarkTemplate.json) Please populate the `endpoint` and `key` for your Azure Cosmos DB account. You can [obtain these from the Azure Portal or through CLI](https://learn.microsoft.com/azure/cosmos-db/secure-access-to-data?tabs=using-primary-key#primary-keys). From c5ef47e1e70fab32ff1aa81b370607d8b9b7fbb8 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Sat, 27 May 2023 23:40:23 +0530 Subject: [PATCH 123/240] moved to new file (#3876) --- docs/SdkDesign.md | 29 ----------------------------- docs/observability.md | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 29 deletions(-) create mode 100644 docs/observability.md diff --git a/docs/SdkDesign.md b/docs/SdkDesign.md index 62d4a751f7..f3f2ec1581 100644 --- a/docs/SdkDesign.md +++ b/docs/SdkDesign.md @@ -186,32 +186,3 @@ flowchart LR ConsistencyWriter --> TCPClient ``` -## Distributed Tracing (Preview) - -For detail about usage of this feature, please see the [Azure Cosmos DB SDK observability](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/sdk-observability?tabs=dotnet) - -```mermaid -flowchart TD - classDef orange fill:#f96 - classDef blue fill:#6fa8dc - subgraph ClientContextCore - OpenTelemetryRecorderFactory --> CheckFeatureFlag{isDistributedTracing Enabled?} - CheckFeatureFlag --> |Yes| CreateActivity(Start an Activity or Child activity with specific kind Using DiagnosticScope
and preloaded attributes like containerName, databaseName, operationType) - CreateActivity --> HandlerPipeline - GetResponse --> TriggerDispose(Trigger Dispose of Disagnostic Scope) - TriggerDispose --> CheckLatencyThreshold{Is high latency/errored response?} - CheckLatencyThreshold -- Yes --> GenerateTraceEvent(Generate Warning or Error Trace Event With Request Diagnostics) --> StopActivity - CheckLatencyThreshold -- No --> StopActivity - StopActivity --> SendResponse(Send Response to Caller):::blue - end - OperationRequest[Operation Request]:::blue --> ClientContextCore - subgraph Application - OperationCall(User Application):::orange - end - OperationCall(User Application):::orange --> OperationRequest - CheckFeatureFlag --> |No| HandlerPipeline - HandlerPipeline --> OtherLogic(Goes through TCP/HTTP calls
based on Connection Mode):::blue - OtherLogic --> GetResponse(Get Response for the request) - SendResponse --> OperationCall - -``` \ No newline at end of file diff --git a/docs/observability.md b/docs/observability.md new file mode 100644 index 0000000000..b74b55cd21 --- /dev/null +++ b/docs/observability.md @@ -0,0 +1,36 @@ +# .NET SDK Observability Feature Design + +## Distributed Tracing (Preview) + +**Source to capture operation level activities**: _Azure.Cosmos.Operation_\ +**Source to capture event with request diagnostics** : _Azure-Cosmos-Operation-Request-Diagnostics_ + +For detail about usage of this feature, please see the [Azure Cosmos DB SDK observability](https://learn.microsoft.com/azure/cosmos-db/nosql/sdk-observability?tabs=dotnet) + +```mermaid +flowchart TD + classDef orange fill:#f96 + classDef blue fill:#6fa8dc + subgraph ClientContextCore + OpenTelemetryRecorderFactory --> CheckFeatureFlag{isDistributedTracing Enabled?} + CheckFeatureFlag --> |Yes| CreateActivity(Start an Activity or Child activity
with preloaded attributes) + CreateActivity --> HandlerPipeline{Handler Pipeline} + GetResponse --> TriggerDispose(Trigger Dispose of Diagnostic Scope) + subgraph Dispose + TriggerDispose --> CheckLatencyThreshold{Is high latency/errored response?} + CheckLatencyThreshold -- Yes --> GenerateEvent(Generate Warning or Error Event With Request Diagnostics) --> StopActivity + CheckLatencyThreshold -- No --> StopActivity + end + StopActivity --> SendResponse(Send Response to Caller):::blue + end + OperationRequest[Operation Request]:::blue --> ClientContextCore + subgraph Application + OperationCall(User Application):::orange + end + OperationCall(User Application):::orange --> OperationRequest + CheckFeatureFlag --> |No| HandlerPipeline + HandlerPipeline --> OtherLogic(Goes through TCP/HTTP calls
based on Connection Mode):::blue + OtherLogic --> GetResponse(Get Response for the request) + SendResponse --> OperationCall + +``` \ No newline at end of file From ee7f86ddd2ea141103c0d57c82e8ff429cd1f6ed Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 30 May 2023 20:16:32 +0530 Subject: [PATCH 124/240] Direct Package Upgrade 3.31.0: Refactors code to make compatible with latest direct (#3877) * upgrade to 3.31.0 * add more regions * enable dt for operations * updated contract file --- Directory.Build.props | 2 +- Microsoft.Azure.Cosmos/src/DocumentClient.cs | 7 ++++++- Microsoft.Azure.Cosmos/src/Regions.cs | 10 ++++++++++ .../src/Routing/GatewayAddressCache.cs | 2 +- .../Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs | 4 ++-- .../Contracts/DotNetSDKAPI.json | 10 ++++++++++ 6 files changed, 30 insertions(+), 5 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index ef1ffd2e01..52e815227a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,7 +3,7 @@ 3.34.0 3.34.0 preview - 3.30.8 + 3.31.0 2.0.1 2.0.1 preview diff --git a/Microsoft.Azure.Cosmos/src/DocumentClient.cs b/Microsoft.Azure.Cosmos/src/DocumentClient.cs index 451166618d..068bb5b857 100644 --- a/Microsoft.Azure.Cosmos/src/DocumentClient.cs +++ b/Microsoft.Azure.Cosmos/src/DocumentClient.cs @@ -6644,6 +6644,11 @@ private void InitializeDirectConnectivity(IStoreClientFactory storeClientFactory } else { + Documents.Telemetry.DistributedTracingOptions distributedTracingOptions = new () + { + IsDistributedTracingEnabled = this.isDistributedTracingEnabled + }; + StoreClientFactory newClientFactory = new StoreClientFactory( this.ConnectionPolicy.ConnectionProtocol, (int)this.ConnectionPolicy.RequestTimeout.TotalSeconds, @@ -6667,7 +6672,7 @@ private void InitializeDirectConnectivity(IStoreClientFactory storeClientFactory addressResolver: this.AddressResolver, rntbdMaxConcurrentOpeningConnectionCount: this.rntbdMaxConcurrentOpeningConnectionCount, remoteCertificateValidationCallback: this.remoteCertificateValidationCallback, - isDistributedTracingEnabled: this.isDistributedTracingEnabled); + distributedTracingOptions: distributedTracingOptions); if (this.transportClientHandlerFactory != null) { diff --git a/Microsoft.Azure.Cosmos/src/Regions.cs b/Microsoft.Azure.Cosmos/src/Regions.cs index 853bc48267..666ec0435b 100644 --- a/Microsoft.Azure.Cosmos/src/Regions.cs +++ b/Microsoft.Azure.Cosmos/src/Regions.cs @@ -349,5 +349,15 @@ public static class Regions /// Name of the Azure Poland Central region in the Azure Cosmos DB service. ///
public const string PolandCentral = "Poland Central"; + + /// + /// Name of the Azure Malaysia South region in the Azure Cosmos DB service. + /// + public const string MalaysiaSouth = "Malaysia South"; + + /// + /// Name of the Azure Italy North region in the Azure Cosmos DB service. + /// + public const string ItalyNorth = "Italy North"; } } diff --git a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs index d99be609ea..182243ec40 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs @@ -85,7 +85,7 @@ public GatewayAddressCache( GatewayAddressCache.ProtocolString(this.protocol)); this.openConnectionsHandler = openConnectionsHandler; - this.isReplicaAddressValidationEnabled = Helpers.GetEnvironmentVariableAsBool( + this.isReplicaAddressValidationEnabled = Helpers.GetEnvironmentVariable( name: Constants.EnvironmentVariables.ReplicaConnectivityValidationEnabled, defaultValue: false); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs index 366cc68811..4773c7de96 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs @@ -548,11 +548,11 @@ internal static CustomListener ConfigureOpenTelemetryAndCustomListeners() // Open Telemetry Listener Util.OTelTracerProvider = Sdk.CreateTracerProviderBuilder() .AddCustomOtelExporter() // use any exporter here - .AddSource($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.*") + .AddSource($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation") .Build(); // Custom Listener - Util.TestListener = new CustomListener($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.*", "Azure-Cosmos-Operation-Request-Diagnostics"); + Util.TestListener = new CustomListener($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", "Azure-Cosmos-Operation-Request-Diagnostics"); return Util.TestListener; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 074be1ee37..e5b95a7ed9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -6680,6 +6680,11 @@ "Attributes": [], "MethodInfo": "System.String GermanyWestCentral;IsInitOnly:False;IsStatic:True;" }, + "System.String ItalyNorth": { + "Type": "Field", + "Attributes": [], + "MethodInfo": "System.String ItalyNorth;IsInitOnly:False;IsStatic:True;" + }, "System.String JapanEast": { "Type": "Field", "Attributes": [], @@ -6710,6 +6715,11 @@ "Attributes": [], "MethodInfo": "System.String KoreaSouth;IsInitOnly:False;IsStatic:True;" }, + "System.String MalaysiaSouth": { + "Type": "Field", + "Attributes": [], + "MethodInfo": "System.String MalaysiaSouth;IsInitOnly:False;IsStatic:True;" + }, "System.String NorthCentralUS": { "Type": "Field", "Attributes": [], From 89cc257324d8caf8fe9826c7dfebf88add7ad42c Mon Sep 17 00:00:00 2001 From: jiajunpeng-msft <32749342+jiajunpeng-msft@users.noreply.github.com> Date: Wed, 31 May 2023 09:12:59 -0700 Subject: [PATCH 125/240] [Preview] Integrated cache: Adds BypassIntegratedCache to DedicatedGatewayRequestOptions (#3836) * Integrated cache: Add BypassIntegratedCache to DedicatedGatewayRequestOptions Currently, integrated cache is used by default for Dedicated Gateway. Customers cannot skip cache for particular requests or data unless they shift to multi-tenant Gateway,which will lose the benefits of Dedicated Gateway. For customers to have more control over integrated cache, we're introducing a new "RequestOption" called "BypassIntegratedCache". This option will allow the customer to decide whether to use integrated cache for each request or not. If this value is set to true, the item/query will be served from backend and won't be cached in Dedicated Gateway. * Move this feature to public preview * Address comments 1. Add more tests 2. Add more detail and example code for BypassIntegratedCache * Revert changes in EncryptionCustomAPI --------- Co-authored-by: Jiajun Peng Co-authored-by: Matias Quaranta --- .../src/RequestOptions/ItemRequestOptions.cs | 1 + .../src/RequestOptions/QueryRequestOptions.cs | 1 + .../DedicatedGatewayRequestOptions.cs | 42 +++++++++ .../Contracts/DotNetPreviewSDKAPI.json | 25 +++++ .../DedicatedGatewayRequestOptionsTests.cs | 94 +++++++++++++++++++ 5 files changed, 163 insertions(+) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Resource/Settings/DedicatedGatewayRequestOptionsTests.cs diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/ItemRequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/ItemRequestOptions.cs index 59b5b245f7..d807f42f57 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/ItemRequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/ItemRequestOptions.cs @@ -151,6 +151,7 @@ internal override void PopulateRequestOptions(RequestMessage request) } DedicatedGatewayRequestOptions.PopulateMaxIntegratedCacheStalenessOption(this.DedicatedGatewayRequestOptions, request); + DedicatedGatewayRequestOptions.PopulateBypassIntegratedCacheOption(this.DedicatedGatewayRequestOptions, request); RequestOptions.SetSessionToken(request, this.SessionToken); base.PopulateRequestOptions(request); diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs index 8711836191..8ce4761c31 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs @@ -264,6 +264,7 @@ internal override void PopulateRequestOptions(RequestMessage request) } DedicatedGatewayRequestOptions.PopulateMaxIntegratedCacheStalenessOption(this.DedicatedGatewayRequestOptions, request); + DedicatedGatewayRequestOptions.PopulateBypassIntegratedCacheOption(this.DedicatedGatewayRequestOptions, request); request.Headers.Add(HttpConstants.HttpHeaders.PopulateQueryMetrics, bool.TrueString); diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/DedicatedGatewayRequestOptions.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/DedicatedGatewayRequestOptions.cs index e3b7dccf3f..9ca854388c 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Settings/DedicatedGatewayRequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/DedicatedGatewayRequestOptions.cs @@ -23,6 +23,40 @@ public class DedicatedGatewayRequestOptions /// public TimeSpan? MaxIntegratedCacheStaleness { get; set; } + /// + /// Gets or sets if bypass the integrated cache or not associated with the request in the Azure CosmosDB service. + /// When set this value to true, the request will not be served from the integrated cache, and the response will not be cached either. + /// + /// Default value is false. + /// + /// + /// + /// + /// +#if PREVIEW + public +#else + internal +#endif + bool? BypassIntegratedCache { get; set; } + internal static void PopulateMaxIntegratedCacheStalenessOption(DedicatedGatewayRequestOptions dedicatedGatewayRequestOptions, RequestMessage request) { if (dedicatedGatewayRequestOptions?.MaxIntegratedCacheStaleness != null) @@ -37,5 +71,13 @@ internal static void PopulateMaxIntegratedCacheStalenessOption(DedicatedGatewayR request.Headers.Set(HttpConstants.HttpHeaders.DedicatedGatewayPerRequestCacheStaleness, cacheStalenessInMilliseconds.ToString(CultureInfo.InvariantCulture)); } } + + internal static void PopulateBypassIntegratedCacheOption(DedicatedGatewayRequestOptions dedicatedGatewayRequestOptions, RequestMessage request) + { + if (dedicatedGatewayRequestOptions != null && dedicatedGatewayRequestOptions.BypassIntegratedCache.HasValue && dedicatedGatewayRequestOptions.BypassIntegratedCache.Value) + { + request.Headers.Set(HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache, true.ToString(CultureInfo.InvariantCulture)); + } + } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index 08d0d65a7e..de49584da2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -377,6 +377,31 @@ }, "NestedTypes": {} }, + "Microsoft.Azure.Cosmos.DedicatedGatewayRequestOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "System.Nullable`1[System.Boolean] BypassIntegratedCache": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.Nullable`1[System.Boolean] BypassIntegratedCache;CanRead:True;CanWrite:True;System.Nullable`1[System.Boolean] get_BypassIntegratedCache();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_BypassIntegratedCache(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Nullable`1[System.Boolean] get_BypassIntegratedCache()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.Nullable`1[System.Boolean] get_BypassIntegratedCache();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_BypassIntegratedCache(System.Nullable`1[System.Boolean])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_BypassIntegratedCache(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.Fluent.ChangeFeedPolicyDefinition;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Resource/Settings/DedicatedGatewayRequestOptionsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Resource/Settings/DedicatedGatewayRequestOptionsTests.cs new file mode 100644 index 0000000000..b0f5cd2ea0 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Resource/Settings/DedicatedGatewayRequestOptionsTests.cs @@ -0,0 +1,94 @@ +namespace Microsoft.Azure.Cosmos.Tests.Resource.Settings +{ + using Microsoft.Azure.Documents; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + [TestClass] + public class DedicatedGatewayRequestOptionsTests + { + [TestMethod] + public void BypassIntegratedCacheHeaderIsSetWhenTrue() + { + DedicatedGatewayRequestOptions dedicatedGatewayRequestOptions = new DedicatedGatewayRequestOptions + { + BypassIntegratedCache = true + }; + + ItemRequestOptions itemRequestOptions = new ItemRequestOptions + { + DedicatedGatewayRequestOptions = dedicatedGatewayRequestOptions + }; + + QueryRequestOptions queryRequestOptions = new QueryRequestOptions + { + DedicatedGatewayRequestOptions = dedicatedGatewayRequestOptions + }; + + RequestMessage itemRequestMessage = new RequestMessage(); + RequestMessage queryRequestMessage = new RequestMessage(); + + itemRequestOptions.PopulateRequestOptions(itemRequestMessage); + queryRequestOptions.PopulateRequestOptions(queryRequestMessage); + + + Assert.IsNotNull(itemRequestMessage.Headers[HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache]); + Assert.IsNotNull(queryRequestMessage.Headers[HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache]); + + Assert.AreEqual("True", itemRequestMessage.Headers[HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache]); + Assert.AreEqual("True", queryRequestMessage.Headers[HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache]); + } + + [TestMethod] + public void BypassIntegratedCacheHeaderIsNotSetWhenFalse() + { + DedicatedGatewayRequestOptions dedicatedGatewayRequestOptions = new DedicatedGatewayRequestOptions + { + BypassIntegratedCache = false + }; + + ItemRequestOptions itemRequestOptions = new ItemRequestOptions + { + DedicatedGatewayRequestOptions = dedicatedGatewayRequestOptions + }; + + QueryRequestOptions queryRequestOptions = new QueryRequestOptions + { + DedicatedGatewayRequestOptions = dedicatedGatewayRequestOptions + }; + + RequestMessage itemRequestMessage = new RequestMessage(); + RequestMessage queryRequestMessage = new RequestMessage(); + + itemRequestOptions.PopulateRequestOptions(itemRequestMessage); + queryRequestOptions.PopulateRequestOptions(queryRequestMessage); + + + Assert.IsNull(itemRequestMessage.Headers[HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache]); + Assert.IsNull(queryRequestMessage.Headers[HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache]); + } + + [TestMethod] + public void BypassIntegratedCacheHeaderIsNotSetWhenNotSet() + { + ItemRequestOptions itemRequestOptions = new ItemRequestOptions + { + DedicatedGatewayRequestOptions = new DedicatedGatewayRequestOptions() + }; + + QueryRequestOptions queryRequestOptions = new QueryRequestOptions + { + DedicatedGatewayRequestOptions = new DedicatedGatewayRequestOptions() + }; + + RequestMessage itemRequestMessage = new RequestMessage(); + RequestMessage queryRequestMessage = new RequestMessage(); + + itemRequestOptions.PopulateRequestOptions(itemRequestMessage); + queryRequestOptions.PopulateRequestOptions(queryRequestMessage); + + + Assert.IsNull(itemRequestMessage.Headers[HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache]); + Assert.IsNull(queryRequestMessage.Headers[HttpConstants.HttpHeaders.DedicatedGatewayPerRequestBypassIntegratedCache]); + } + } +} From 327422b02180029899d283ee385d3f7e2abeb24b Mon Sep 17 00:00:00 2001 From: vipulvishal-ms <110802706+vipulvishal-ms@users.noreply.github.com> Date: Thu, 1 Jun 2023 22:05:15 +0530 Subject: [PATCH 126/240] Client Encryption: Adds Microsoft.Azure.Cosmos compatibility to version 3.34.0 (#3874) * chaging Microsoft.Azure.Cosmos support version * resolved merge conflicts --- Directory.Build.props | 4 ++-- Microsoft.Azure.Cosmos.Encryption/changelog.md | 10 ++++++++++ .../src/Microsoft.Azure.Cosmos.Encryption.csproj | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 52e815227a..7eecd3c8e2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,8 +4,8 @@ 3.34.0 preview 3.31.0 - 2.0.1 - 2.0.1 + 2.0.2 + 2.0.2 preview 1.0.0-preview05 1.1.0-preview3 diff --git a/Microsoft.Azure.Cosmos.Encryption/changelog.md b/Microsoft.Azure.Cosmos.Encryption/changelog.md index a5e7101074..a8edf3441d 100644 --- a/Microsoft.Azure.Cosmos.Encryption/changelog.md +++ b/Microsoft.Azure.Cosmos.Encryption/changelog.md @@ -3,6 +3,16 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [2.0.2](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.2) - 2023-06-01 + +#### Added +- [#3874](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3874) Adds support for Microsoft.Azure.Cosmos up to 3.34.0. + +### [2.0.2-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.2-preview) - 2023-06-01 + +#### Added +- [#3874](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3874) Adds support for Microsoft.Azure.Cosmos 3.34.0-preview. + ### [2.0.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.1) - 2023-03-11 #### Added diff --git a/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj b/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj index f58b171cd5..94e93aa6fe 100644 --- a/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj +++ b/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj @@ -28,11 +28,11 @@ - + - + From 3e3bbe5d53bd771ead625f5aee6e55cca9dd8764 Mon Sep 17 00:00:00 2001 From: Rinat Minibaev <132935507+rinatmini@users.noreply.github.com> Date: Thu, 1 Jun 2023 15:03:04 -0700 Subject: [PATCH 127/240] CosmosClient: Fixes missing Trace when converting HTTP Timeout to 503 (#3866) * Added tracing when converting HTTP Timeout to 503 * Fixed tracing when converting HTTP Timeout to 503 * Resolved PR comments * Using ITrace as part of ClientSideRequestStatisticsTraceDatum * Refactoring * Test update * Unit tests fix --- .../src/GatewayAccountReader.cs | 2 +- .../src/Handler/TransportHandler.cs | 2 +- .../src/HttpClient/CosmosHttpClientCore.cs | 4 + .../src/Routing/ClientCollectionCache.cs | 2 +- .../src/Routing/PartitionKeyRangeCache.cs | 2 +- .../ClientSideRequestStatisticsTraceDatum.cs | 13 ++- .../RegionContactedInDiagnosticsBenchmark.cs | 2 +- .../TraceWriterBaselineTests.TraceData.xml | 6 +- .../CosmosHttpClientCoreTests.cs | 92 ++++++++++++------- .../GatewayAccountReaderTests.cs | 23 +++-- .../GatewayStoreModelTest.cs | 35 ++++--- ...entSideRequestStatisticsTraceDatumTests.cs | 6 +- .../Tracing/ContactedRegionsTests.cs | 2 +- .../Tracing/TraceTests.cs | 2 +- .../Tracing/TraceWriterBaselineTests.cs | 6 +- 15 files changed, 121 insertions(+), 78 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/GatewayAccountReader.cs b/Microsoft.Azure.Cosmos/src/GatewayAccountReader.cs index 2754dfaa40..5413103fee 100644 --- a/Microsoft.Azure.Cosmos/src/GatewayAccountReader.cs +++ b/Microsoft.Azure.Cosmos/src/GatewayAccountReader.cs @@ -49,7 +49,7 @@ await this.cosmosAuthorization.AddAuthorizationHeaderAsync( using (ITrace trace = Trace.GetRootTrace("Account Read", TraceComponent.Transport, TraceLevel.Info)) { - IClientSideRequestStatistics stats = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace.Summary); + IClientSideRequestStatistics stats = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace); try { diff --git a/Microsoft.Azure.Cosmos/src/Handler/TransportHandler.cs b/Microsoft.Azure.Cosmos/src/Handler/TransportHandler.cs index e524214976..7baf8a7254 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/TransportHandler.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/TransportHandler.cs @@ -93,7 +93,7 @@ internal async Task ProcessMessageAsync( DocumentServiceRequest serviceRequest = request.ToDocumentServiceRequest(); - ClientSideRequestStatisticsTraceDatum clientSideRequestStatisticsTraceDatum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, request.Trace.Summary); + ClientSideRequestStatisticsTraceDatum clientSideRequestStatisticsTraceDatum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, request.Trace); serviceRequest.RequestContext.ClientRequestStatistics = clientSideRequestStatisticsTraceDatum; //TODO: extrace auth into a separate handler diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs b/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs index 0fde01afb5..c29c3a5b94 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.Cosmos using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Core.Trace; using Microsoft.Azure.Cosmos.Resource.CosmosExceptions; + using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; using Microsoft.Azure.Documents; using Microsoft.Azure.Documents.Collections; @@ -361,9 +362,11 @@ private async Task SendHttpHelperAsync( } catch (Exception e) { + ITrace trace = NoOpTrace.Singleton; if (clientSideRequestStatistics is ClientSideRequestStatisticsTraceDatum datum) { datum.RecordHttpException(requestMessage, e, resourceType, requestStartTime); + trace = datum.Trace; } bool isOutOfRetries = CosmosHttpClientCore.IsOutOfRetries(timeoutPolicy, startDateTimeUtc, timeoutEnumerator); @@ -394,6 +397,7 @@ private async Task SendHttpHelperAsync( ActivityId = System.Diagnostics.Trace.CorrelationManager.ActivityId.ToString(), SubStatusCode = SubStatusCodes.TransportGenerated503 }, + trace: trace, innerException: e); } diff --git a/Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs b/Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs index 30ece5015b..530bbfceb5 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs @@ -186,7 +186,7 @@ private async Task ReadCollectionAsync( { headers.XDate = Rfc1123DateTimeCache.UtcNow(); - request.RequestContext.ClientRequestStatistics = clientSideRequestStatistics ?? new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace.Summary); + request.RequestContext.ClientRequestStatistics = clientSideRequestStatistics ?? new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace); if (clientSideRequestStatistics == null) { childTrace.AddDatum( diff --git a/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyRangeCache.cs b/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyRangeCache.cs index 4373d61f56..d9e2854b2b 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyRangeCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyRangeCache.cs @@ -316,7 +316,7 @@ private async Task ExecutePartitionKeyRangeReadChangeFe } request.Headers[HttpConstants.HttpHeaders.Authorization] = authorizationToken; - request.RequestContext.ClientRequestStatistics = clientSideRequestStatistics ?? new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace.Summary); + request.RequestContext.ClientRequestStatistics = clientSideRequestStatistics ?? new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace); if (clientSideRequestStatistics == null) { childTrace.AddDatum("Client Side Request Stats", request.RequestContext.ClientRequestStatistics); diff --git a/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs b/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs index 10845f133f..def12c8262 100644 --- a/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs +++ b/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs @@ -33,9 +33,8 @@ internal sealed class ClientSideRequestStatisticsTraceDatum : TraceDatum, IClien private IReadOnlyList shallowCopyOfStoreResponseStatistics = null; private IReadOnlyList shallowCopyOfHttpResponseStatistics = null; private SystemUsageHistory systemUsageHistory = null; - public TraceSummary TraceSummary = null; - public ClientSideRequestStatisticsTraceDatum(DateTime startTime, TraceSummary summary) + public ClientSideRequestStatisticsTraceDatum(DateTime startTime, ITrace trace) { this.RequestStartTimeUtc = startTime; this.RequestEndTimeUtc = null; @@ -45,7 +44,7 @@ public ClientSideRequestStatisticsTraceDatum(DateTime startTime, TraceSummary su this.FailedReplicas = new HashSet(); this.RegionsContacted = new HashSet<(string, Uri)>(); this.httpResponseStatistics = new List(); - this.TraceSummary = summary; + this.Trace = trace; } public DateTime RequestStartTimeUtc { get; } @@ -75,6 +74,10 @@ public IReadOnlyDictionary EndpointToAddres public HashSet<(string, Uri)> RegionsContacted { get; } + public ITrace Trace { get; private set; } + + public TraceSummary TraceSummary => this.Trace?.Summary; + public IReadOnlyList StoreResponseStatisticsList { get @@ -502,11 +505,11 @@ public HttpResponseStatistics( if (responseMessage != null) { Headers headers = new Headers(GatewayStoreClient.ExtractResponseHeaders(responseMessage)); - this.ActivityId = headers.ActivityId ?? Trace.CorrelationManager.ActivityId.ToString(); + this.ActivityId = headers.ActivityId ?? System.Diagnostics.Trace.CorrelationManager.ActivityId.ToString(); } else { - this.ActivityId = Trace.CorrelationManager.ActivityId.ToString(); + this.ActivityId = System.Diagnostics.Trace.CorrelationManager.ActivityId.ToString(); } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/RegionContactedInDiagnosticsBenchmark.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/RegionContactedInDiagnosticsBenchmark.cs index bcf95ba776..0d3d2ffd81 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/RegionContactedInDiagnosticsBenchmark.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/RegionContactedInDiagnosticsBenchmark.cs @@ -42,7 +42,7 @@ private ITrace CreateTestTraceTree() private TraceDatum GetDatumObject(string regionName1, string regionName2 = null) { - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, Trace.GetRootTrace(nameof(RegionContactedInDiagnosticsBenchmark))); Uri uri1 = new Uri("http://someUri1.com"); datum.RegionsContacted.Add((regionName1, uri1)); if (regionName2 != null) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml index d3b996a0e9..8b6adc1c15 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml @@ -187,7 +187,7 @@ TraceForBaselineTesting rootTrace; using (rootTrace = TraceForBaselineTesting.GetRootTrace()) { - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, rootTrace); TransportAddressUri uri1 = new TransportAddressUri(new Uri("http://someUri1.com")); TransportAddressUri uri2 = new TransportAddressUri(new Uri("http://someUri2.com")); @@ -405,7 +405,7 @@ TraceForBaselineTesting rootTrace; using (rootTrace = TraceForBaselineTesting.GetRootTrace()) { - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, rootTrace); datum.ContactedReplicas.Add(default); TraceWriterBaselineTests.GetPrivateField>(datum, "endpointToAddressResolutionStats").Add("asdf", default); @@ -546,7 +546,7 @@ TraceForBaselineTesting rootTrace; using (rootTrace = TraceForBaselineTesting.GetRootTrace()) { - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, rootTrace); TraceWriterBaselineTests.SetEndRequestTime(datum,DateTime.MaxValue); HttpResponseStatistics httpResponseStatistics = new HttpResponseStatistics( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs index 0d475ca370..03fdb84ead 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs @@ -42,14 +42,17 @@ static Task sendFunc(HttpRequestMessage request, Cancellati HttpRequestMessage httpRequestMessage = new HttpRequestMessage(HttpMethod.Post, new Uri("http://localhost")); - HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => - new ValueTask(httpRequestMessage), - ResourceType.Collection, - timeoutPolicy: HttpTimeoutPolicyDefault.Instance, - new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow,new TraceSummary()), - default); - - Assert.AreEqual(httpRequestMessage, responseMessage.RequestMessage); + using (ITrace trace = Trace.GetRootTrace(nameof(ResponseMessageHasRequestMessageAsync))) + { + HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => + new ValueTask(httpRequestMessage), + ResourceType.Collection, + timeoutPolicy: HttpTimeoutPolicyDefault.Instance, + new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace), + default); + + Assert.AreEqual(httpRequestMessage, responseMessage.RequestMessage); + } } [TestMethod] @@ -111,15 +114,18 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio HttpMessageHandler messageHandler = new MockMessageHandler(sendFunc); using CosmosHttpClient cosmoshttpClient = MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(messageHandler)); - HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => + using (ITrace trace = Trace.GetRootTrace(nameof(RetryTransientIssuesTestAsync))) + { + HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => new ValueTask( result: new HttpRequestMessage(HttpMethod.Get, new Uri("http://localhost"))), resourceType: ResourceType.Collection, timeoutPolicy: currentTimeoutPolicy.Key, - clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), + clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace), cancellationToken: default); - Assert.AreEqual(HttpStatusCode.OK, responseMessage.StatusCode); + Assert.AreEqual(HttpStatusCode.OK, responseMessage.StatusCode); + } } } @@ -178,15 +184,18 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio HttpMessageHandler messageHandler = new MockMessageHandler(sendFunc); using CosmosHttpClient cosmoshttpClient = MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(messageHandler)); - HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => + using (ITrace trace = Trace.GetRootTrace(nameof(RetryTransient408sTestAsync))) + { + HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => new ValueTask( result: new HttpRequestMessage(HttpMethod.Get, new Uri("http://localhost"))), resourceType: ResourceType.Collection, timeoutPolicy: HttpTimeoutPolicyControlPlaneRetriableHotPath.Instance, - clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), + clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace), cancellationToken: default); - Assert.AreEqual(HttpStatusCode.OK, responseMessage.StatusCode); + Assert.AreEqual(HttpStatusCode.OK, responseMessage.StatusCode); + } } [TestMethod] @@ -216,15 +225,18 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio HttpMessageHandler messageHandler = new MockMessageHandler(sendFunc); using CosmosHttpClient cosmoshttpClient = MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(messageHandler)); - HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => + using (ITrace trace = Trace.GetRootTrace(nameof(DoesNotRetryTransient408sOnDefaultPolicyTestAsync))) + { + HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => new ValueTask( result: new HttpRequestMessage(HttpMethod.Get, new Uri("http://localhost"))), resourceType: ResourceType.Collection, timeoutPolicy: HttpTimeoutPolicyControlPlaneRead.Instance, - clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), + clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace), cancellationToken: default); - - Assert.AreEqual(HttpStatusCode.RequestTimeout, responseMessage.StatusCode, "Should be a request timeout"); + + Assert.AreEqual(HttpStatusCode.RequestTimeout, responseMessage.StatusCode, "Should be a request timeout"); + } } [TestMethod] @@ -245,13 +257,16 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio try { - HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => + using (ITrace trace = Trace.GetRootTrace(nameof(Retry3TimesOnDefaultPolicyTestAsync))) + { + HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => new ValueTask( result: new HttpRequestMessage(HttpMethod.Get, new Uri("http://localhost"))), resourceType: ResourceType.Collection, timeoutPolicy: HttpTimeoutPolicyDefault.Instance, - clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), + clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace), cancellationToken: default); + } } catch (Exception ex) { @@ -282,14 +297,16 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio try { - - HttpResponseMessage responseMessage1 = await cosmoshttpClient.SendHttpAsync(() => + using (ITrace trace = Trace.GetRootTrace(nameof(NoRetryOnNoRetryPolicyTestAsync))) + { + HttpResponseMessage responseMessage1 = await cosmoshttpClient.SendHttpAsync(() => new ValueTask( result: new HttpRequestMessage(method, new Uri("http://localhost"))), resourceType: resourceType, timeoutPolicy: timeoutPolicy, - clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), + clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace), cancellationToken: default); + } } catch (Exception e) { @@ -301,6 +318,9 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio CosmosException cosmosException = (CosmosException)e; Assert.AreEqual(cosmosException.StatusCode, System.Net.HttpStatusCode.ServiceUnavailable); Assert.AreEqual((int)cosmosException.SubStatusCode,(int)SubStatusCodes.TransportGenerated503); + + Assert.IsNotNull(cosmosException.Trace); + Assert.AreNotEqual(cosmosException.Trace, NoOpTrace.Singleton); } } @@ -344,13 +364,16 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio try { - HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => + using (ITrace trace = Trace.GetRootTrace(nameof(NoRetryOnNoRetryPolicyTestAsync))) + { + HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => new ValueTask( result: new HttpRequestMessage(HttpMethod.Get, new Uri("http://localhost"))), resourceType: ResourceType.Collection, timeoutPolicy: HttpTimeoutPolicyNoRetry.Instance, - clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), + clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace), cancellationToken: default); + } } catch (Exception ex) { @@ -401,15 +424,18 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio HttpMessageHandler messageHandler = new MockMessageHandler(sendFunc); using CosmosHttpClient cosmoshttpClient = MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(messageHandler)); - HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => - new ValueTask( - result: new HttpRequestMessage(HttpMethod.Post, new Uri("http://localhost"))), - resourceType: ResourceType.Document, - timeoutPolicy: HttpTimeoutPolicyControlPlaneRetriableHotPath.Instance, - clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), - cancellationToken: default); + using (ITrace trace = Trace.GetRootTrace(nameof(RetryTransientIssuesForQueryPlanTestAsync))) + { + HttpResponseMessage responseMessage = await cosmoshttpClient.SendHttpAsync(() => + new ValueTask( + result: new HttpRequestMessage(HttpMethod.Post, new Uri("http://localhost"))), + resourceType: ResourceType.Document, + timeoutPolicy: HttpTimeoutPolicyControlPlaneRetriableHotPath.Instance, + clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace), + cancellationToken: default); - Assert.AreEqual(HttpStatusCode.OK, responseMessage.StatusCode); + Assert.AreEqual(HttpStatusCode.OK, responseMessage.StatusCode); + } } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAccountReaderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAccountReaderTests.cs index 2fc8359f68..cf54b12a52 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAccountReaderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAccountReaderTests.cs @@ -57,15 +57,20 @@ public async Task DocumentClient_BuildHttpClientFactory_WithHandler() receivedResponseEventArgs: null); Assert.IsNotNull(httpClient); - HttpResponseMessage response = await httpClient.GetAsync( - uri: new Uri("https://localhost"), - additionalHeaders: new RequestNameValueCollection(), - resourceType: ResourceType.Document, - timeoutPolicy: HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, - clientSideRequestStatistics: new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()), - cancellationToken: default); - - Assert.AreEqual(HttpStatusCode.Conflict, response.StatusCode); + + using (ITrace trace = Trace.GetRootTrace(nameof(DocumentClient_BuildHttpClientFactory_WithHandler))) + { + IClientSideRequestStatistics stats = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace); + HttpResponseMessage response = await httpClient.GetAsync( + uri: new Uri("https://localhost"), + additionalHeaders: new RequestNameValueCollection(), + resourceType: ResourceType.Document, + timeoutPolicy: HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, + clientSideRequestStatistics: stats, + cancellationToken: default); + + Assert.AreEqual(HttpStatusCode.Conflict, response.StatusCode); + } } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs index 36b350a751..e16f176e61 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs @@ -865,21 +865,26 @@ public async Task GatewayStatsDurationTest() HttpMessageHandler mockMessageHandler = new MockMessageHandler(sendFunc); CosmosHttpClient cosmosHttpClient = MockCosmosUtil.CreateCosmosHttpClient(() => new HttpClient(mockMessageHandler), DocumentClientEventSource.Instance); - Tracing.TraceData.ClientSideRequestStatisticsTraceDatum clientSideRequestStatistics = new Tracing.TraceData.ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()); - - await cosmosHttpClient.SendHttpAsync(() => new ValueTask(new HttpRequestMessage(HttpMethod.Get, "http://someuri.com")), - ResourceType.Document, - HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, - clientSideRequestStatistics, - CancellationToken.None); - - Assert.AreEqual(clientSideRequestStatistics.HttpResponseStatisticsList.Count, 2); - // The duration is calculated using date times which can cause the duration to be slightly off. This allows for up to 15 Ms of variance. - // https://stackoverflow.com/questions/2143140/c-sharp-datetime-now-precision#:~:text=The%20precision%20is%20related%20to,35%2D40%20ms%20accuracy - Assert.IsTrue(clientSideRequestStatistics.HttpResponseStatisticsList[0].Duration.TotalMilliseconds >= 985, $"First request did was not delayed by at least 1 second. {JsonConvert.SerializeObject(clientSideRequestStatistics.HttpResponseStatisticsList[0])}"); - Assert.IsTrue(clientSideRequestStatistics.HttpResponseStatisticsList[1].Duration.TotalMilliseconds >= 985, $"Second request did was not delayed by at least 1 second. {JsonConvert.SerializeObject(clientSideRequestStatistics.HttpResponseStatisticsList[1])}"); - Assert.IsTrue(clientSideRequestStatistics.HttpResponseStatisticsList[0].RequestStartTime < - clientSideRequestStatistics.HttpResponseStatisticsList[1].RequestStartTime); + + using(ITrace trace = Tracing.Trace.GetRootTrace(nameof(GatewayStatsDurationTest))) + { + + Tracing.TraceData.ClientSideRequestStatisticsTraceDatum clientSideRequestStatistics = new Tracing.TraceData.ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace); + + await cosmosHttpClient.SendHttpAsync(() => new ValueTask(new HttpRequestMessage(HttpMethod.Get, "http://someuri.com")), + ResourceType.Document, + HttpTimeoutPolicyDefault.InstanceShouldThrow503OnTimeout, + clientSideRequestStatistics, + CancellationToken.None); + + Assert.AreEqual(clientSideRequestStatistics.HttpResponseStatisticsList.Count, 2); + // The duration is calculated using date times which can cause the duration to be slightly off. This allows for up to 15 Ms of variance. + // https://stackoverflow.com/questions/2143140/c-sharp-datetime-now-precision#:~:text=The%20precision%20is%20related%20to,35%2D40%20ms%20accuracy + Assert.IsTrue(clientSideRequestStatistics.HttpResponseStatisticsList[0].Duration.TotalMilliseconds >= 985, $"First request did was not delayed by at least 1 second. {JsonConvert.SerializeObject(clientSideRequestStatistics.HttpResponseStatisticsList[0])}"); + Assert.IsTrue(clientSideRequestStatistics.HttpResponseStatisticsList[1].Duration.TotalMilliseconds >= 985, $"Second request did was not delayed by at least 1 second. {JsonConvert.SerializeObject(clientSideRequestStatistics.HttpResponseStatisticsList[1])}"); + Assert.IsTrue(clientSideRequestStatistics.HttpResponseStatisticsList[0].RequestStartTime < + clientSideRequestStatistics.HttpResponseStatisticsList[1].RequestStartTime); + } } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ClientSideRequestStatisticsTraceDatumTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ClientSideRequestStatisticsTraceDatumTests.cs index 2ec6e9db62..a28300d82f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ClientSideRequestStatisticsTraceDatumTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ClientSideRequestStatisticsTraceDatumTests.cs @@ -48,7 +48,7 @@ public async Task ConcurrentUpdateHttpResponseStatisticsListTests() [TestMethod] public void DuplicateContactedReplicasTests() { - ClientSideRequestStatisticsTraceDatum clientSideRequestStatisticsTraceDatum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum clientSideRequestStatisticsTraceDatum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, Trace.GetRootTrace(nameof(DuplicateContactedReplicasTests))); clientSideRequestStatisticsTraceDatum.ContactedReplicas.Add(new TransportAddressUri(new Uri("http://storephysicaladdress1.com"))); clientSideRequestStatisticsTraceDatum.ContactedReplicas.Add(new TransportAddressUri(new Uri("http://storephysicaladdress2.com"))); clientSideRequestStatisticsTraceDatum.ContactedReplicas.Add(new TransportAddressUri(new Uri("http://storephysicaladdress2.com"))); @@ -89,7 +89,7 @@ public async Task ConcurrentUpdateStoreResponseStatisticsListTests() [TestMethod] public void VerifyIClientSideRequestStatisticsNullTests() { - IClientSideRequestStatistics clientSideRequestStatistics = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new Cosmos.Tracing.TraceSummary()); + IClientSideRequestStatistics clientSideRequestStatistics = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, Trace.GetRootTrace(nameof(VerifyIClientSideRequestStatisticsNullTests))); Assert.IsNotNull(clientSideRequestStatistics.ContactedReplicas); Assert.IsNotNull(clientSideRequestStatistics.FailedReplicas); Assert.IsNotNull(clientSideRequestStatistics.RegionsContacted); @@ -101,7 +101,7 @@ private async Task ConcurrentUpdateTestHelper( { using CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new Cosmos.Tracing.TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, Trace.GetRootTrace(nameof(ConcurrentUpdateTestHelper))); Task backgroundTask = Task.Run(() => backgroundUpdater(datum, cancellationTokenSource.Token)); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ContactedRegionsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ContactedRegionsTests.cs index 6f6a84cbe2..53a04e5228 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ContactedRegionsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/ContactedRegionsTests.cs @@ -54,7 +54,7 @@ private ITrace CreateTestTraceTree() private TraceDatum GetDatumObject(string regionName1, string regionName2 = null) { - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, Trace.GetRootTrace(nameof(ContactedRegionsTests))); Uri uri1 = new Uri("http://someUri1.com"); datum.RegionsContacted.Add((regionName1, uri1)); if (regionName2 != null) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs index ff27842308..ad21070609 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs @@ -97,7 +97,7 @@ public void ValidateStoreResultSerialization() HashSet storeResultProperties = typeof(StoreResult).GetProperties(BindingFlags.Public | BindingFlags.Instance).Select(x => x.Name).ToHashSet(); string datumKey = "ClientStats"; Trace trace = Trace.GetRootTrace("Test"); - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.UtcNow, trace); trace.AddDatum(datumKey, datum); ReferenceCountedDisposable storeResult = StoreResult.CreateForTesting(storeResponse: new StoreResponse()); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs index 67bafdbf56..fe3dc7054f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs @@ -336,7 +336,7 @@ public void TraceData() TraceForBaselineTesting rootTrace; using (rootTrace = TraceForBaselineTesting.GetRootTrace()) { - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, rootTrace); TransportAddressUri uri1 = new TransportAddressUri(new Uri("http://someUri1.com")); TransportAddressUri uri2 = new TransportAddressUri(new Uri("http://someUri2.com")); @@ -382,7 +382,7 @@ public void TraceData() TraceForBaselineTesting rootTrace; using (rootTrace = TraceForBaselineTesting.GetRootTrace()) { - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, rootTrace); datum.ContactedReplicas.Add(default); TraceWriterBaselineTests.GetPrivateField>(datum, "endpointToAddressResolutionStats").Add("asdf", default); @@ -416,7 +416,7 @@ public void TraceData() TraceForBaselineTesting rootTrace; using (rootTrace = TraceForBaselineTesting.GetRootTrace()) { - ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, new TraceSummary()); + ClientSideRequestStatisticsTraceDatum datum = new ClientSideRequestStatisticsTraceDatum(DateTime.MinValue, rootTrace); TraceWriterBaselineTests.SetEndRequestTime(datum,DateTime.MaxValue); HttpResponseStatistics httpResponseStatistics = new HttpResponseStatistics( From 387ab62dbb55bcc99491bf16b88a32ad1cd663a5 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Fri, 2 Jun 2023 22:09:59 +0530 Subject: [PATCH 128/240] AI Integration: Fixes Open Telemetry Example (#3868) * first draft * add filter * revert csproj * fix sample * changed log message * remove unused library --- .../Usage/OpenTelemetry/AppSettings.json | 6 ++-- .../Usage/OpenTelemetry/OpenTelemetry.csproj | 4 --- .../Usage/OpenTelemetry/Program.cs | 31 +++++++++++++------ 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/AppSettings.json b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/AppSettings.json index 1ea1245434..e0d21e3e09 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/AppSettings.json +++ b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/AppSettings.json @@ -1,7 +1,9 @@ { "Logging": { - "LogLevel": { - "Azure-Cosmos-Operation-Request-Diagnostics": "Information" + "OpenTelemetry": { + "LogLevel": { + "Azure.Cosmos.Operation.Request.Diagnostics": "Warning" + } } }, "CosmosDBEndPointUrl": "https://localhost:8081", diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/OpenTelemetry.csproj b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/OpenTelemetry.csproj index 46fe296b80..83224d4570 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/OpenTelemetry.csproj +++ b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/OpenTelemetry.csproj @@ -12,10 +12,6 @@ - - - - diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/Program.cs b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/Program.cs index 4d6431823e..b4729e41c7 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/Program.cs +++ b/Microsoft.Azure.Cosmos.Samples/Usage/OpenTelemetry/Program.cs @@ -25,8 +25,8 @@ static async Task Main() try { IConfigurationRoot configuration = new ConfigurationBuilder() - .AddJsonFile("AppSettings.json") - .Build(); + .AddJsonFile("AppSettings.json") + .Build(); string endpoint = configuration["CosmosDBEndPointUrl"]; if (string.IsNullOrEmpty(endpoint)) @@ -52,12 +52,16 @@ static async Task Main() serviceVersion: "1.0.0"); // Set up logging to forward logs to chosen exporter - using ILoggerFactory loggerFactory = LoggerFactory.Create(builder => builder.AddOpenTelemetry(options => - { - options.IncludeFormattedMessage = true; - options.SetResourceBuilder(resource); - options.AddAzureMonitorLogExporter(o => o.ConnectionString = aiConnectionString); // Set up exporter of your choice - })); + using ILoggerFactory loggerFactory + = LoggerFactory.Create(builder => builder + .AddConfiguration(configuration.GetSection("Logging")) + .AddOpenTelemetry(options => + { + options.IncludeFormattedMessage = true; + options.SetResourceBuilder(resource); + options.AddAzureMonitorLogExporter(o => o.ConnectionString = aiConnectionString); // Set up exporter of your choice + })); + /*.AddFilter(level => level == LogLevel.Error) // Filter is irrespective of event type or event name*/ AzureEventSourceLogForwarder logforwader = new AzureEventSourceLogForwarder(loggerFactory); logforwader.Start(); @@ -76,6 +80,7 @@ static async Task Main() { IsDistributedTracingEnabled = true // Defaults to true, set to false to disable }; + // using (CosmosClient client = new CosmosClient(endpoint, authKey, options)) { @@ -88,7 +93,6 @@ static async Task Main() await Program.RunCrudDemo(container); } - } finally { @@ -116,6 +120,15 @@ public static async Task RunCrudDemo(Container container) Console.WriteLine($"Read document with id: {i}"); } + try + { + await container.ReadItemAsync($"random key", new PartitionKey($"random partition")); + } + catch(Exception) + { + Console.WriteLine("Generate exception by reading an invalid key"); + } + for (int i = 1; i <= 5; i++) { await container.ReplaceItemAsync(new Item { Id = $"{i}", Status = "updated" }, $"{i}", new PartitionKey($"{i}")); From f19acb073173fd9cbf640044f506c45cbe478e80 Mon Sep 17 00:00:00 2001 From: akotalwar <94020786+akotalwar@users.noreply.github.com> Date: Mon, 5 Jun 2023 15:02:17 -0700 Subject: [PATCH 129/240] [Internal] Query: Adds OptimisticDirectExecute and RequiresDistribution headers (#3882) * Adding ODE and RequiresDistribution Headers * Fixed comments * Updated parameter in SwitchToFallbackPipelineAsync * Renamed TryUnwrapContinuationToken to UnwrapContinuationToken --------- Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com> --- .../Headers/CosmosMessageHeadersInternal.cs | 12 + Microsoft.Azure.Cosmos/src/Headers/Headers.cs | 12 + .../src/Headers/StoreRequestHeaders.cs | 6 + .../NetworkAttachedDocumentContainer.cs | 5 +- .../Query/Core/AdditionalRequestHeaders.cs | 36 ++ .../CosmosQueryExecutionContextFactory.cs | 1 - ...misticDirectExecutionQueryPipelineStage.cs | 92 ++++-- .../Pagination/QueryPaginationOptions.cs | 4 + .../Core/QueryClient/CosmosQueryClient.cs | 3 +- .../Query/v3Query/CosmosQueryClientCore.cs | 8 +- .../Query/v3Query/CosmosQueryContextCore.cs | 5 +- .../src/RequestOptions/QueryRequestOptions.cs | 2 +- .../Query/MockCosmosQueryClient.cs | 8 +- .../OptimisticDirectExecutionQueryTests.cs | 312 ++++++++++++++++-- ...ositiveOptimisticDirectExecutionOutput.xml | 15 +- ...misticDirectExecutionQueryBaselineTests.cs | 246 ++++++++++++-- 16 files changed, 655 insertions(+), 112 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/AdditionalRequestHeaders.cs diff --git a/Microsoft.Azure.Cosmos/src/Headers/CosmosMessageHeadersInternal.cs b/Microsoft.Azure.Cosmos/src/Headers/CosmosMessageHeadersInternal.cs index e8c584d782..f12595d832 100644 --- a/Microsoft.Azure.Cosmos/src/Headers/CosmosMessageHeadersInternal.cs +++ b/Microsoft.Azure.Cosmos/src/Headers/CosmosMessageHeadersInternal.cs @@ -177,6 +177,18 @@ public virtual string EndEpk set => this.SetProperty(HttpConstants.HttpHeaders.EndEpk, value); } + public virtual string OptimisticDirectExecute + { + get => this.GetValueOrDefault(HttpConstants.HttpHeaders.OptimisticDirectExecute); + set => this.SetProperty(HttpConstants.HttpHeaders.OptimisticDirectExecute, value); + } + + public virtual string RequiresDistribution + { + get => this.GetValueOrDefault(HttpConstants.HttpHeaders.RequiresDistribution); + set => this.SetProperty(HttpConstants.HttpHeaders.RequiresDistribution, value); + } + public abstract INameValueCollection INameValueCollection { get; } public virtual string this[string headerName] diff --git a/Microsoft.Azure.Cosmos/src/Headers/Headers.cs b/Microsoft.Azure.Cosmos/src/Headers/Headers.cs index 611de5f147..40f90c423a 100644 --- a/Microsoft.Azure.Cosmos/src/Headers/Headers.cs +++ b/Microsoft.Azure.Cosmos/src/Headers/Headers.cs @@ -171,6 +171,18 @@ internal virtual string PartitionKey set => this.CosmosMessageHeaders.PartitionKey = value; } + internal virtual string OptimisticDirectExecute + { + get => this.CosmosMessageHeaders.OptimisticDirectExecute; + set => this.CosmosMessageHeaders.OptimisticDirectExecute = value; + } + + internal virtual string RequiresDistribution + { + get => this.CosmosMessageHeaders.RequiresDistribution; + set => this.CosmosMessageHeaders.RequiresDistribution = value; + } + internal virtual string PartitionKeyRangeId { get => this.CosmosMessageHeaders.PartitionKeyRangeId; diff --git a/Microsoft.Azure.Cosmos/src/Headers/StoreRequestHeaders.cs b/Microsoft.Azure.Cosmos/src/Headers/StoreRequestHeaders.cs index 9147c31026..68086095f7 100644 --- a/Microsoft.Azure.Cosmos/src/Headers/StoreRequestHeaders.cs +++ b/Microsoft.Azure.Cosmos/src/Headers/StoreRequestHeaders.cs @@ -46,6 +46,12 @@ public override string XDate set => this.requestNameValueCollection.XDate = value; } + public override string OptimisticDirectExecute + { + get => this.requestNameValueCollection.OptimisticDirectExecute; + set => this.requestNameValueCollection.OptimisticDirectExecute = value; + } + public override string ConsistencyLevel { get => this.requestNameValueCollection.ConsistencyLevel; diff --git a/Microsoft.Azure.Cosmos/src/Pagination/NetworkAttachedDocumentContainer.cs b/Microsoft.Azure.Cosmos/src/Pagination/NetworkAttachedDocumentContainer.cs index 1132a40a35..7d8683c3fe 100644 --- a/Microsoft.Azure.Cosmos/src/Pagination/NetworkAttachedDocumentContainer.cs +++ b/Microsoft.Azure.Cosmos/src/Pagination/NetworkAttachedDocumentContainer.cs @@ -258,16 +258,17 @@ public async Task> MonadicQueryAsync( } QueryRequestOptions queryRequestOptions = this.queryRequestOptions == null ? new QueryRequestOptions() : this.queryRequestOptions; + AdditionalRequestHeaders additionalRequestHeaders = new AdditionalRequestHeaders(this.correlatedActivityId, isContinuationExpected: false, optimisticDirectExecute: queryPaginationOptions.OptimisticDirectExecute); + TryCatch monadicQueryPage = await this.cosmosQueryClient.ExecuteItemQueryAsync( this.resourceLink, this.resourceType, Documents.OperationType.Query, - this.correlatedActivityId, feedRangeState.FeedRange, queryRequestOptions, + additionalRequestHeaders, sqlQuerySpec, feedRangeState.State == null ? null : ((CosmosString)feedRangeState.State.Value).Value, - isContinuationExpected: false, queryPaginationOptions.PageSizeLimit ?? int.MaxValue, trace, cancellationToken); diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/AdditionalRequestHeaders.cs b/Microsoft.Azure.Cosmos/src/Query/Core/AdditionalRequestHeaders.cs new file mode 100644 index 0000000000..add4e15c99 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/AdditionalRequestHeaders.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core +{ + using System; + + /// + /// Captures additional headers to be sent in the web request. + /// + internal sealed class AdditionalRequestHeaders + { + /// + /// Enable backend to link multiple activityIds that belong to the same operation. + /// + public Guid CorrelatedActivityId { get; } + + /// + /// Let the backend know if continuations are expected for a certain query. + /// + public bool IsContinuationExpected { get; } + + /// + /// Let the backend know if a query is utilizing the OptimisticDirectExecute pipeline. + /// + public bool OptimisticDirectExecute { get; } + + public AdditionalRequestHeaders(Guid correlatedActivityId, bool isContinuationExpected, bool optimisticDirectExecute) + { + this.CorrelatedActivityId = correlatedActivityId; + this.IsContinuationExpected = isContinuationExpected; + this.OptimisticDirectExecute = optimisticDirectExecute; + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs index e276466f9d..8f35ff821a 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs @@ -477,7 +477,6 @@ private static TryCatch TryCreateOptimisticDirectExecutionC documentContainer: documentContainer, inputParameters: inputParameters, targetRange: new FeedRangeEpk(targetRange.ToRange()), - queryPaginationOptions: new QueryPaginationOptions(pageSizeHint: inputParameters.MaxItemCount), fallbackQueryPipelineStageFactory: (continuationToken) => { // In fallback scenario, the Specialized pipeline is always invoked diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionQueryPipelineStage.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionQueryPipelineStage.cs index 0664603024..e62ecf41f0 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionQueryPipelineStage.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionQueryPipelineStage.cs @@ -19,6 +19,7 @@ namespace Microsoft.Azure.Cosmos.Query.Core.Pipeline.OptimisticDirectExecutionQu using Microsoft.Azure.Cosmos.Query.Core.Pipeline.CrossPartition.Parallel; using Microsoft.Azure.Cosmos.Query.Core.Pipeline.Pagination; using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Documents; internal sealed class OptimisticDirectExecutionQueryPipelineStage : IQueryPipelineStage { @@ -28,11 +29,12 @@ private enum ExecutionState SpecializedDocumentQueryExecution, } - private const string optimisticDirectExecutionToken = "OptimisticDirectExecutionToken"; + private const string OptimisticDirectExecutionToken = "OptimisticDirectExecutionToken"; private readonly FallbackQueryPipelineStageFactory queryPipelineStageFactory; private TryCatch inner; private CosmosElement continuationToken; private ExecutionState executionState; + private bool? previousRequiresDistribution; private OptimisticDirectExecutionQueryPipelineStage(TryCatch inner, FallbackQueryPipelineStageFactory queryPipelineStageFactory, CosmosElement continuationToken) { @@ -40,6 +42,12 @@ private OptimisticDirectExecutionQueryPipelineStage(TryCatch> FallbackQueryPipelineStageFactory(CosmosElement continuationToken); @@ -55,22 +63,43 @@ public async ValueTask MoveNextAsync(ITrace trace) { TryCatch hasNext = await this.inner.TryAsync(pipelineStage => pipelineStage.MoveNextAsync(trace)); bool success = hasNext.Succeeded && hasNext.Result; - bool isPartitionSplitException = hasNext.Succeeded && this.Current.Failed && this.Current.InnerMostException.IsPartitionSplitException(); - - if (success && !isPartitionSplitException) - { - this.continuationToken = this.Current.Succeeded ? this.Current.Result.State?.Value : null; - } - else if (isPartitionSplitException && this.executionState == ExecutionState.OptimisticDirectExecution) + if (this.executionState == ExecutionState.OptimisticDirectExecution) { - this.inner = await this.queryPipelineStageFactory(this.TryUnwrapContinuationToken()); - this.executionState = ExecutionState.SpecializedDocumentQueryExecution; - if (this.inner.Failed) + bool isPartitionSplitException = hasNext.Succeeded && this.Current.Failed && this.Current.InnerMostException.IsPartitionSplitException(); + if (success && !isPartitionSplitException) { - return false; + this.continuationToken = this.Current.Succeeded ? this.Current.Result.State?.Value : null; + if (this.continuationToken != null) + { + bool requiresDistribution; + if (this.Current.Result.AdditionalHeaders.TryGetValue(HttpConstants.HttpHeaders.RequiresDistribution, out string requiresDistributionHeaderValue)) + { + requiresDistribution = bool.Parse(requiresDistributionHeaderValue); + } + else + { + requiresDistribution = true; + } + + if (this.previousRequiresDistribution.HasValue && this.previousRequiresDistribution != requiresDistribution) + { + // We should never enter this if statement as requiresDistribution flag can never switch mid execution. + // Hence, this exception should never be thrown. + throw new InvalidOperationException($"Unexpected switch in {HttpConstants.HttpHeaders.RequiresDistribution} value. Previous value : {this.previousRequiresDistribution} Current value : {requiresDistribution}."); + } + + if (requiresDistribution) + { + success = await this.SwitchToFallbackPipelineAsync(continuationToken: null, trace); + } + + this.previousRequiresDistribution = requiresDistribution; + } + } + else if (isPartitionSplitException) + { + success = await this.SwitchToFallbackPipelineAsync(continuationToken: UnwrapContinuationToken(this.continuationToken), trace); } - - success = await this.inner.Result.MoveNextAsync(trace); } return success; @@ -81,32 +110,46 @@ public void SetCancellationToken(CancellationToken cancellationToken) this.inner.Try(pipelineStage => pipelineStage.SetCancellationToken(cancellationToken)); } - private CosmosElement TryUnwrapContinuationToken() + private static CosmosElement UnwrapContinuationToken(CosmosElement continuationToken) { - if (this.continuationToken != null) + if (continuationToken == null) return null; + + CosmosObject cosmosObject = continuationToken as CosmosObject; + CosmosElement backendContinuationToken = cosmosObject[OptimisticDirectExecutionToken]; + Debug.Assert(backendContinuationToken != null); + + return CosmosArray.Create(backendContinuationToken); + } + + private async Task SwitchToFallbackPipelineAsync(CosmosElement continuationToken, ITrace trace) + { + Debug.Assert(this.executionState == ExecutionState.OptimisticDirectExecution, "OptimisticDirectExecuteQueryPipelineStage Assert!", "Only OptimisticDirectExecute pipeline can create this fallback pipeline"); + this.executionState = ExecutionState.SpecializedDocumentQueryExecution; + this.inner = continuationToken != null + ? await this.queryPipelineStageFactory(continuationToken) + : await this.queryPipelineStageFactory(null); + + if (this.inner.Failed) { - CosmosObject cosmosObject = this.continuationToken as CosmosObject; - CosmosElement backendContinuationToken = cosmosObject[optimisticDirectExecutionToken]; - Debug.Assert(backendContinuationToken != null); - return CosmosArray.Create(backendContinuationToken); + return false; } - return null; + return await this.inner.Result.MoveNextAsync(trace); } public static TryCatch MonadicCreate( DocumentContainer documentContainer, CosmosQueryExecutionContextFactory.InputParameters inputParameters, FeedRangeEpk targetRange, - QueryPaginationOptions queryPaginationOptions, FallbackQueryPipelineStageFactory fallbackQueryPipelineStageFactory, CancellationToken cancellationToken) { + QueryPaginationOptions paginationOptions = new QueryPaginationOptions(pageSizeHint: inputParameters.MaxItemCount, optimisticDirectExecute: true); TryCatch pipelineStage = OptimisticDirectExecutionQueryPipelineImpl.MonadicCreate( documentContainer: documentContainer, sqlQuerySpec: inputParameters.SqlQuerySpec, targetRange: targetRange, - queryPaginationOptions: queryPaginationOptions, + queryPaginationOptions: paginationOptions, partitionKey: inputParameters.PartitionKey, continuationToken: inputParameters.InitialUserContinuationToken, cancellationToken: cancellationToken); @@ -120,7 +163,7 @@ public static TryCatch MonadicCreate( return TryCatch.FromResult(odePipelineStageMonadicCreate); } - private class OptimisticDirectExecutionQueryPipelineImpl : IQueryPipelineStage + private sealed class OptimisticDirectExecutionQueryPipelineImpl : IQueryPipelineStage { private readonly QueryPartitionRangePageAsyncEnumerator queryPartitionRangePageAsyncEnumerator; @@ -226,7 +269,6 @@ public static TryCatch MonadicCreate( } FeedRangeState feedRangeState = monadicExtractState.Result; - QueryPartitionRangePageAsyncEnumerator partitionPageEnumerator = new QueryPartitionRangePageAsyncEnumerator( documentContainer, sqlQuerySpec, diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Pagination/QueryPaginationOptions.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Pagination/QueryPaginationOptions.cs index 0b692160be..c285135feb 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Pagination/QueryPaginationOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Pagination/QueryPaginationOptions.cs @@ -15,6 +15,8 @@ internal sealed class QueryPaginationOptions : PaginationOptions { public static readonly QueryPaginationOptions Default = new QueryPaginationOptions(); + public bool OptimisticDirectExecute { get; } + public static readonly ImmutableHashSet BannedHeaders = new HashSet() { HttpConstants.HttpHeaders.Continuation, @@ -29,10 +31,12 @@ internal sealed class QueryPaginationOptions : PaginationOptions public QueryPaginationOptions( int? pageSizeHint = null, + bool optimisticDirectExecute = false, JsonSerializationFormat? jsonSerializationFormat = null, Dictionary additionalHeaders = null) : base(pageSizeHint, jsonSerializationFormat, additionalHeaders) { + this.OptimisticDirectExecute = optimisticDirectExecute; } protected override ImmutableHashSet BannedAdditionalHeaders => BannedHeaders; diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs b/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs index c2bcf91619..ac093cadce 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs @@ -54,12 +54,11 @@ public abstract Task> ExecuteItemQueryAsync( string resourceUri, Documents.ResourceType resourceType, Documents.OperationType operationType, - Guid clientQueryCorrelationId, FeedRange feedRange, QueryRequestOptions requestOptions, + AdditionalRequestHeaders additionalRequestHeaders, SqlQuerySpec sqlQuerySpec, string continuationToken, - bool isContinuationExpected, int pageSize, ITrace trace, CancellationToken cancellationToken); diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs index 138f32c593..daf47e151c 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs @@ -119,12 +119,11 @@ public override async Task> ExecuteItemQueryAsync( string resourceUri, ResourceType resourceType, OperationType operationType, - Guid clientQueryCorrelationId, FeedRange feedRange, QueryRequestOptions requestOptions, + AdditionalRequestHeaders additionalRequestHeaders, SqlQuerySpec sqlQuerySpec, string continuationToken, - bool isContinuationExpected, int pageSize, ITrace trace, CancellationToken cancellationToken) @@ -143,13 +142,14 @@ public override async Task> ExecuteItemQueryAsync( { cosmosRequestMessage.Headers.Add( HttpConstants.HttpHeaders.IsContinuationExpected, - isContinuationExpected.ToString()); + additionalRequestHeaders.IsContinuationExpected.ToString()); QueryRequestOptions.FillContinuationToken( cosmosRequestMessage, continuationToken); cosmosRequestMessage.Headers.Add(HttpConstants.HttpHeaders.ContentType, MediaTypes.QueryJson); cosmosRequestMessage.Headers.Add(HttpConstants.HttpHeaders.IsQuery, bool.TrueString); - cosmosRequestMessage.Headers.Add(WFConstants.BackendHeaders.CorrelatedActivityId, clientQueryCorrelationId.ToString()); + cosmosRequestMessage.Headers.Add(WFConstants.BackendHeaders.CorrelatedActivityId, additionalRequestHeaders.CorrelatedActivityId.ToString()); + cosmosRequestMessage.Headers.Add(HttpConstants.HttpHeaders.OptimisticDirectExecute, additionalRequestHeaders.OptimisticDirectExecute.ToString()); }, trace: trace, cancellationToken: cancellationToken); diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryContextCore.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryContextCore.cs index b1325f2652..215ca22b2c 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryContextCore.cs @@ -51,16 +51,17 @@ internal override Task> ExecuteQueryAsync( ITrace trace, CancellationToken cancellationToken) { + AdditionalRequestHeaders additionalRequestHeaders = new AdditionalRequestHeaders(this.CorrelatedActivityId, isContinuationExpected, optimisticDirectExecute: false); + return this.QueryClient.ExecuteItemQueryAsync( resourceUri: this.ResourceLink, resourceType: this.ResourceTypeEnum, operationType: this.OperationTypeEnum, - clientQueryCorrelationId: this.CorrelatedActivityId, requestOptions: queryRequestOptions, + additionalRequestHeaders: additionalRequestHeaders, sqlQuerySpec: querySpecForInit, continuationToken: continuationToken, feedRange: feedRange, - isContinuationExpected: isContinuationExpected, pageSize: pageSize, trace: trace, cancellationToken: cancellationToken); diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs index 8ce4761c31..cd505f1158 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs @@ -44,7 +44,7 @@ public class QueryRequestOptions : RequestOptions public bool? EnableLowPrecisionOrderBy { get; set; } /// - /// Gets or sets the option for customers to opt in for direct (optimistic) execution of the query.. + /// Gets or sets the option for customers to opt in for direct (optimistic) execution of the query. /// /// /// Direct (optimistic) execution offers improved performance for several kinds of queries such as a single partition streaming query. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/MockCosmosQueryClient.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/MockCosmosQueryClient.cs index ee6eec3004..11d51403b1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/MockCosmosQueryClient.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/MockCosmosQueryClient.cs @@ -68,12 +68,11 @@ public override Task> ExecuteItemQueryAsync( string resourceUri, ResourceType resourceType, OperationType operationType, - Guid clientQueryCorrelationId, FeedRange feedRange, QueryRequestOptions requestOptions, + AdditionalRequestHeaders additionalRequestHeaders, SqlQuerySpec sqlQuerySpec, string continuationToken, - bool isContinuationExpected, int pageSize, ITrace trace, CancellationToken cancellationToken) @@ -82,12 +81,11 @@ public override Task> ExecuteItemQueryAsync( resourceUri: resourceUri, resourceType: resourceType, operationType: operationType, - clientQueryCorrelationId: clientQueryCorrelationId, + feedRange: feedRange, requestOptions: requestOptions, + additionalRequestHeaders: additionalRequestHeaders, sqlQuerySpec: sqlQuerySpec, continuationToken: continuationToken, - feedRange: feedRange, - isContinuationExpected: isContinuationExpected, pageSize: pageSize, trace: trace, cancellationToken: cancellationToken); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs index cc9ef91733..78d4ddb8ed 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/OptimisticDirectExecutionQueryTests.cs @@ -20,7 +20,8 @@ public sealed class OptimisticDirectExecutionQueryTests : QueryTestsBase private static class PageSizeOptions { - public static readonly int[] NonGroupByPageSizeOptions = { -1, 1, 2, 10, 100 }; + public static readonly int[] NonGroupByAndNoContinuationTokenPageSizeOptions = { -1, 10 }; + public static readonly int[] NonGroupByWithContinuationTokenPageSizeOptions = { 1, 2 }; public static readonly int[] GroupByPageSizeOptions = { -1 }; public static readonly int[] PageSize100 = { 100 }; } @@ -42,49 +43,98 @@ public async Task TestPassingOptimisticDirectExecutionQueries() expectedResult: first5Integers, partitionKey: partitionKeyValue, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), CreateInput( query: $"SELECT TOP 5 VALUE r.numberField FROM r ORDER BY r.{PartitionKeyField}", expectedResult: first5Integers, partitionKey: partitionKeyValue, enableOptimisticDirectExecution: false, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.Passthrough), - // Simple query + // Simple query (requiresDist = false) CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: first7Integers, partitionKey: partitionKeyValue, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT VALUE r.numberField FROM r", + expectedResult: first7Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: first7Integers, partitionKey: null, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), - - // DISTINCT with ORDER BY + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT VALUE r.numberField FROM r", + expectedResult: first7Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + // DISTINCT with ORDER BY (requiresDist = true) CreateInput( query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", expectedResult: first7IntegersReversed, partitionKey: partitionKeyValue, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", + expectedResult: first7IntegersReversed, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), CreateInput( query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", expectedResult: first7IntegersReversed, partitionKey: null, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", + expectedResult: first7IntegersReversed, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), - // TOP with GROUP BY + // DISTINCT (requiresDist = true) + CreateInput( + query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r", + expectedResult: first7Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.GroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r", + expectedResult: first7Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.GroupByPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + // TOP with GROUP BY (requiresDist = true) CreateInput( query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r GROUP BY r.{NumberField}", expectedResult: first5Integers, @@ -99,72 +149,267 @@ public async Task TestPassingOptimisticDirectExecutionQueries() enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.GroupByPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), - - // OFFSET LIMIT with WHERE and BETWEEN + + // TOP (requiresDist = false) + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r", + expectedResult: first5Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r", + expectedResult: first5Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + // TOP with ORDER BY (requiresDist = false) + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r ORDER BY r.{NumberField}", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r ORDER BY r.{NumberField}", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r ORDER BY r.{NumberField}", + expectedResult: first5Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r ORDER BY r.{NumberField}", + expectedResult: first5Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + // OFFSET LIMIT with WHERE and BETWEEN (requiresDist = false) + CreateInput( + query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", + expectedResult: new List { 1 }, + partitionKey: partitionKeyValue, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + enableOptimisticDirectExecution: true, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, partitionKey: partitionKeyValue, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + enableOptimisticDirectExecution: true, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", + expectedResult: new List { 1 }, + partitionKey: null, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, enableOptimisticDirectExecution: true, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, partitionKey: null, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, enableOptimisticDirectExecution: true, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution) - }; - + }; + List multiPartitionContainerTestCases = new List() { - // Simple query + // Simple query (requiresDist = false) CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: first7Integers, partitionKey: partitionKeyValue, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT VALUE r.numberField FROM r", + expectedResult: first7Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: first7Integers, partitionKey: null, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Passthrough), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r", + expectedResult: first7Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.Passthrough), - // DISTINCT with ORDER BY + // DISTINCT with ORDER BY (requiresDist = true) CreateInput( query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", expectedResult: first7IntegersReversed, partitionKey: partitionKeyValue, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), CreateInput( query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", expectedResult: first7IntegersReversed, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( + query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", + expectedResult: first7IntegersReversed, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( + query: $"SELECT DISTINCT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", + expectedResult: first7IntegersReversed, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + // TOP (requiresDist = false) + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r", + expectedResult: first5Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r", + expectedResult: first5Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + // TOP with ORDER BY (requiresDist = false) + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r ORDER BY r.{NumberField}", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r ORDER BY r.{NumberField}", + expectedResult: first5Integers, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r ORDER BY r.{NumberField}", + expectedResult: first5Integers, partitionKey: null, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( + query: $"SELECT TOP 5 VALUE r.{NumberField} FROM r ORDER BY r.{NumberField}", + expectedResult: first5Integers, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.Specialized), - // OFFSET LIMIT with WHERE and BETWEEN + // OFFSET LIMIT with WHERE and BETWEEN (requiresDist = false) CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, partitionKey: partitionKeyValue, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", + expectedResult: new List { 1 }, + partitionKey: partitionKeyValue, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, partitionKey: null, enableOptimisticDirectExecution: true, - pageSizeOptions: PageSizeOptions.NonGroupByPageSizeOptions, + pageSizeOptions: PageSizeOptions.NonGroupByAndNoContinuationTokenPageSizeOptions, + expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( + query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", + expectedResult: new List { 1 }, + partitionKey: null, + enableOptimisticDirectExecution: true, + pageSizeOptions: PageSizeOptions.NonGroupByWithContinuationTokenPageSizeOptions, expectedPipelineType: TestInjections.PipelineType.Specialized) }; @@ -222,27 +467,34 @@ public async Task TestQueriesWithPartitionKeyNone() enableOptimisticDirectExecution: false, pageSizeOptions: PageSizeOptions.PageSize100, expectedPipelineType: TestInjections.PipelineType.Passthrough), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 CreateInput( query: $"SELECT VALUE r.numberField FROM r", expectedResult: first400Integers, partitionKey: PartitionKey.None, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.PageSize100, - expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + expectedPipelineType: TestInjections.PipelineType.Specialized), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 CreateInput( query: $"SELECT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} ASC", expectedResult: first400Integers, partitionKey: PartitionKey.None, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.PageSize100, - expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + expectedPipelineType: TestInjections.PipelineType.Specialized), + + //TODO: Change expectedPipelineType to OptimisticDirectExecution once emulator is updated to 0415 CreateInput( query: $"SELECT VALUE r.{NumberField} FROM r ORDER BY r.{NumberField} DESC", expectedResult: first400IntegersReversed, partitionKey: PartitionKey.None, enableOptimisticDirectExecution: true, pageSizeOptions: PageSizeOptions.PageSize100, - expectedPipelineType: TestInjections.PipelineType.OptimisticDirectExecution), + expectedPipelineType: TestInjections.PipelineType.Specialized), + CreateInput( query: $"SELECT VALUE r.numberField FROM r WHERE r.{NumberField} BETWEEN 0 AND {NumberOfDocuments} OFFSET 1 LIMIT 1", expectedResult: new List { 1 }, @@ -279,7 +531,7 @@ public async Task TestFailingOptimisticDirectExecutionOutput() { "SELECT TOP 10 * FOM r", null }, { "this is not a valid query", null }, }; - + await this.CreateIngestQueryDeleteAsync( ConnectionModes.Direct | ConnectionModes.Gateway, CollectionTypes.SinglePartition | CollectionTypes.MultiPartition, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml index 5e496fc564..a5e6d97841 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/OptimisticDirectExecutionQueryBaselineTests.PositiveOptimisticDirectExecutionOutput.xml @@ -66,20 +66,7 @@ - Null Partition Key Value - SELECT * FROM c - - /pk - - Hash - - - true - - - - - None Partition Key Value + Cosmos.PartitionKey.Null Partition Key Value SELECT * FROM c /pk diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs index 20de3f1f03..fad65e80db 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs @@ -2,6 +2,7 @@ { using System; using System.Collections.Generic; + using System.Collections.Immutable; using System.Collections.ObjectModel; using System.IO; using System.Linq; @@ -80,19 +81,12 @@ public void PositiveOptimisticDirectExecutionOutput() // Below cases are Ode because they have a collection with a single physical partition. // Added emulator tests (TestPassingOptimisticDirectExecutionQueries()) to verify the negation of the below cases. CreateInput( - description: @"Null Partition Key Value", + description: @"Cosmos.PartitionKey.Null Partition Key Value", query: "SELECT * FROM c", expectedOptimisticDirectExecution: true, partitionKeyPath: @"/pk", partitionKeyValue: Cosmos.PartitionKey.Null), - CreateInput( - description: @"None Partition Key Value", - query: "SELECT * FROM c", - expectedOptimisticDirectExecution: true, - partitionKeyPath: @"/pk", - partitionKeyValue: Cosmos.PartitionKey.None), - CreateInput( description: @"C# Null Partition Key Value", query: "SELECT * FROM c", @@ -133,7 +127,7 @@ public void NegativeOptimisticDirectExecutionOutput() partitionKeyPath: @"/pk", partitionKeyValue: "a", continuationToken: CosmosArray.Create(new List() { ParallelContinuationToken.ToCosmosElement(parallelContinuationToken) })), - + CreateInput( description: @"Single Partition Key with OrderBy continuation token", query: "SELECT * FROM c ORDER BY c._ts", @@ -144,7 +138,7 @@ public void NegativeOptimisticDirectExecutionOutput() }; this.ExecuteTestSuite(testVariations); } - + // This test confirms that TestInjection.EnableOptimisticDirectExection is set to false from default. // Check test "TestPipelineForDistributedQueryAsync" to understand why this is done [TestMethod] @@ -169,7 +163,6 @@ public async Task TestPipelineForBackendDocumentsOnSinglePartitionAsync() partitionKeyValue: "a"); QueryRequestOptions queryRequestOptions = GetQueryRequestOptions(enableOptimisticDirectExecution: true); - DocumentContainer inMemoryCollection = await CreateDocumentContainerAsync(numItems, multiPartition: false); IQueryPipelineStage queryPipelineStage = await GetOdePipelineAsync(input, inMemoryCollection, queryRequestOptions); int documentCountInSinglePartition = 0; @@ -192,6 +185,145 @@ public async Task TestPipelineForBackendDocumentsOnSinglePartitionAsync() Assert.AreEqual(100, documentCountInSinglePartition); } + [TestMethod] + public async Task TestQueriesWhichNeverRequireDistribution() + { + // requiresDist = false + int numItems = 100; + List singlePartitionContainerTestCases = new List() + { + new RequiresDistributionTestCase("SELECT * FROM r", 10, 100), + new RequiresDistributionTestCase("SELECT VALUE r.id FROM r", 0, 10), + new RequiresDistributionTestCase("SELECT * FROM r WHERE r.id > 5", 0, 0), + new RequiresDistributionTestCase("SELECT r.id FROM r JOIN id IN r.id",0, 0), + new RequiresDistributionTestCase("SELECT TOP 5 r.id FROM r ORDER BY r.id", 0, 5), + new RequiresDistributionTestCase("SELECT TOP 5 r.id FROM r WHERE r.id > 5 ORDER BY r.id", 0, 0), + new RequiresDistributionTestCase("SELECT * FROM r OFFSET 5 LIMIT 3", 1, 3), + new RequiresDistributionTestCase("SELECT * FROM r WHERE r.id > 5 OFFSET 5 LIMIT 3", 0, 0) + }; + + foreach (RequiresDistributionTestCase testCase in singlePartitionContainerTestCases) + { + OptimisticDirectExecutionTestInput input = CreateInput( + description: @"Queries which will never require distribution", + query: testCase.Query, + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: "a"); + + int result = await this.GetPipelineAndDrainAsync( + input, + numItems: numItems, + isMultiPartition: false, + expectedContinuationTokenCount: testCase.ExpectedContinuationTokenCount, + requiresDist: false); + + Assert.AreEqual(testCase.ExpectedDocumentCount, result); + } + } + + [TestMethod] + public async Task TestQueriesWhichWillAlwaysRequireDistribution() + { + // requiresDist = true + int numItems = 100; + List singlePartitionContainerTestCases = new List() + { + new RequiresDistributionTestCase("SELECT Sum(id) as sum_id FROM r JOIN id IN r.id", 0, 1), + new RequiresDistributionTestCase("SELECT DISTINCT TOP 5 r.id FROM r ORDER BY r.id", 0, 5), + new RequiresDistributionTestCase("SELECT DISTINCT r.id FROM r GROUP BY r.id", 0, 10), + new RequiresDistributionTestCase("SELECT DISTINCT r.id, Sum(r.id) as sum_a FROM r GROUP BY r.id",0, 10), + new RequiresDistributionTestCase("SELECT Count(1) FROM (SELECT DISTINCT r.id FROM root r)", 0, 1), + new RequiresDistributionTestCase("SELECT DISTINCT id FROM r JOIN id in r.id", 0, 0), + new RequiresDistributionTestCase("SELECT r.id, Count(1) AS count_a FROM r GROUP BY r.id ORDER BY r.id", 0, 10), + new RequiresDistributionTestCase("SELECT Count(1) as count FROM root r JOIN b IN r.id", 0, 1), + new RequiresDistributionTestCase("SELECT Avg(1) AS avg FROM root r", 0, 1), + new RequiresDistributionTestCase("SELECT r.id, Count(1) as count FROM r WHERE r.id > 0 GROUP BY r.id", 0, 0), + new RequiresDistributionTestCase("SELECT r.id FROM r WHERE r.id > 0 GROUP BY r.id ORDER BY r.id", 0, 0) + }; + + foreach (RequiresDistributionTestCase testCase in singlePartitionContainerTestCases) + { + OptimisticDirectExecutionTestInput input = CreateInput( + description: @"Queries which will always require distribution", + query: testCase.Query, + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: "a"); + + int result = await this.GetPipelineAndDrainAsync( + input, + numItems: numItems, + isMultiPartition: false, + expectedContinuationTokenCount: testCase.ExpectedContinuationTokenCount, + requiresDist: true); + + Assert.AreEqual(testCase.ExpectedDocumentCount, result); + } + } + + [TestMethod] + public async Task TestQueriesWhichCanSwitchDistribution() + { + // requiresDist = true/false + int numItems = 100; + bool[] requiresDistSet = { true, false }; + + List singlePartitionContainerTestCases = new List() + { + new RequiresDistributionTestCase("SELECT Count(r.id) AS count_a FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT DISTINCT r.id FROM r", 0, 10), + new RequiresDistributionTestCase("SELECT r.id, Count(1) AS count_a FROM r GROUP BY r.id", 0, 10), + new RequiresDistributionTestCase("SELECT Count(1) AS count FROM root r WHERE r.id < 2", 0, 1), + new RequiresDistributionTestCase("SELECT r.id, Count(r.id), Avg(r.id) FROM r WHERE r.id < 2 GROUP BY r.id", 0, 0), + new RequiresDistributionTestCase("SELECT TOP 5 Count(1) as count FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT TOP 5 Count(1) as count FROM r ORDER BY r.id", 0, 1), + new RequiresDistributionTestCase("SELECT r.id FROM r GROUP BY r.id OFFSET 5 LIMIT 3", 0, 3), + new RequiresDistributionTestCase("SELECT Count(1) as count FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT Sum(r.id) as sum_a FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT Min(r.a) as min_a FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT Max(r.a) as min_a FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT Avg(r.a) as min_a FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT Sum(r.a) as sum_a FROM r WHERE r.a > 0", 0, 1), + new RequiresDistributionTestCase("SELECT Sum(r.a) as sum_a FROM r WHERE r.a > 0 OFFSET 0 LIMIT 5", 0, 1), + new RequiresDistributionTestCase("SELECT Sum(r.a) as sum_a FROM r WHERE r.a > 0 OFFSET 5 LIMIT 5", 0, 0), + new RequiresDistributionTestCase("SELECT Sum(r.a) as sum_a FROM r ORDER BY r.a", 0, 1), + new RequiresDistributionTestCase("SELECT Sum(r.a) as sum_a FROM r ORDER BY r.a OFFSET 5 LIMIT 5", 0, 0), + new RequiresDistributionTestCase("SELECT Sum(r.a) as sum_a FROM r WHERE r.a > 0 ORDER BY r.a OFFSET 5 LIMIT 5", 0, 0), + new RequiresDistributionTestCase("SELECT DISTINCT VALUE r.id FROM r", 0, 10), + new RequiresDistributionTestCase("SELECT DISTINCT TOP 5 r.a FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT s.id FROM (SELECT DISTINCT r.id FROM root r) as s", 0, 10), + new RequiresDistributionTestCase("SELECT DISTINCT r.a FROM r OFFSET 3 LIMIT 5", 0, 0), + new RequiresDistributionTestCase("SELECT Count(r.id) AS count_a FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT r.id, Count(1) AS count_a FROM r GROUP BY r.id", 0, 10), + new RequiresDistributionTestCase("SELECT Count(1) AS count FROM root r WHERE r.id < 2", 0, 1), + new RequiresDistributionTestCase("SELECT TOP 5 Count(1) as count FROM r", 0, 1), + new RequiresDistributionTestCase("SELECT Count(1) AS count FROM root r WHERE r.id < 2", 0, 1), + }; + + foreach (RequiresDistributionTestCase testCase in singlePartitionContainerTestCases) + { + foreach (bool requiresDist in requiresDistSet) + { + OptimisticDirectExecutionTestInput input = CreateInput( + description: @"Queries which can require distribution in certain cases", + query: testCase.Query, + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: "a"); + + int result = await this.GetPipelineAndDrainAsync( + input, + numItems: numItems, + isMultiPartition: false, + expectedContinuationTokenCount: testCase.ExpectedContinuationTokenCount, + requiresDist: requiresDist); + + Assert.AreEqual(testCase.ExpectedDocumentCount, result); + } + } + } + // test checks that the pipeline can take a query to the backend and returns its associated document(s) + continuation token. [TestMethod] public async Task TestPipelineForContinuationTokenOnSinglePartitionAsync() @@ -269,7 +401,7 @@ private static async Task ExecuteGoneExceptionOnODEPipeline(bool isMultiPa { Assert.AreEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); } - else + else { Assert.AreNotEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); } @@ -345,18 +477,20 @@ private static async Task TestHandlingOfFailedFallbackPipeline(bool isMult return (mergeTest, queryPipelineStage); } - private async Task GetPipelineAndDrainAsync(OptimisticDirectExecutionTestInput input, int numItems, bool isMultiPartition, int expectedContinuationTokenCount) + private async Task GetPipelineAndDrainAsync(OptimisticDirectExecutionTestInput input, int numItems, bool isMultiPartition, int expectedContinuationTokenCount, bool requiresDist = false) { QueryRequestOptions queryRequestOptions = GetQueryRequestOptions(enableOptimisticDirectExecution: true); - DocumentContainer inMemoryCollection = await CreateDocumentContainerAsync(numItems, multiPartition: isMultiPartition); + DocumentContainer inMemoryCollection = await CreateDocumentContainerAsync(numItems, multiPartition: isMultiPartition, requiresDist: requiresDist); IQueryPipelineStage queryPipelineStage = await GetOdePipelineAsync(input, inMemoryCollection, queryRequestOptions); - List documents = new List(); int continuationTokenCount = 0; while (await queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton)) { - Assert.AreEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); + if (!requiresDist) + { + Assert.AreEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); + } TryCatch tryGetPage = queryPipelineStage.Current; tryGetPage.ThrowIfFailed(); @@ -420,6 +554,7 @@ private static async Task GetOdePipelineAsync(OptimisticDir private static async Task CreateDocumentContainerAsync( int numItems, bool multiPartition, + bool requiresDist = false, FlakyDocumentContainer.FailureConfigs failureConfigs = null) { PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition() @@ -432,7 +567,9 @@ private static async Task CreateDocumentContainerAsync( Version = PartitionKeyDefinitionVersion.V2, }; - IMonadicDocumentContainer monadicDocumentContainer = new InMemoryContainer(partitionKeyDefinition); + MockDocumentContainer mockContainer = new MockDocumentContainer(partitionKeyDefinition, requiresDist); + IMonadicDocumentContainer monadicDocumentContainer = mockContainer; + if (failureConfigs != null) { monadicDocumentContainer = new FlakyDocumentContainer(monadicDocumentContainer, failureConfigs); @@ -523,7 +660,7 @@ public override OptimisticDirectExecutionTestOutput ExecuteTest(OptimisticDirect NoOpTrace.Singleton); bool result = queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton).AsTask().GetAwaiter().GetResult(); - + if (input.ExpectedOptimisticDirectExecution) { Assert.AreEqual(TestInjections.PipelineType.OptimisticDirectExecution, queryRequestOptions.TestSettings.Stats.PipelineType.Value); @@ -546,11 +683,6 @@ public override OptimisticDirectExecutionTestOutput ExecuteTest(OptimisticDirect string sqlQuerySpecJsonString = streamReader.ReadToEnd(); PartitionedQueryExecutionInfo partitionedQueryExecutionInfo = GetPartitionedQueryExecutionInfo(sqlQuerySpecJsonString, input.PartitionKeyDefinition); - if (input.PartitionKeyValue == default || input.PartitionKeyValue == Cosmos.PartitionKey.None) - { - input.PartitionKeyValue = Cosmos.PartitionKey.Null; - } - CosmosQueryExecutionContextFactory.InputParameters inputParameters = new CosmosQueryExecutionContextFactory.InputParameters( sqlQuerySpec: new SqlQuerySpec(input.Query), initialUserContinuationToken: input.ContinuationToken, @@ -598,6 +730,68 @@ private static QueryRequestOptions GetQueryRequestOptions(bool enableOptimisticD }; } + internal readonly struct RequiresDistributionTestCase + { + public string Query { get; } + public int ExpectedContinuationTokenCount { get; } + public int ExpectedDocumentCount { get; } + + public RequiresDistributionTestCase( + string query, + int expectedContinuationTokenCount, + int expectedDocumentCount) + { + this.Query = query; + this.ExpectedContinuationTokenCount = expectedContinuationTokenCount; + this.ExpectedDocumentCount = expectedDocumentCount; + } + } + + private sealed class MockDocumentContainer : InMemoryContainer + { + private readonly bool requiresDistribution; + + public MockDocumentContainer( + PartitionKeyDefinition partitionKeyDefinition, + bool requiresDistribution) + : base(partitionKeyDefinition) + { + this.requiresDistribution = requiresDistribution; + } + + public override async Task> MonadicQueryAsync( + SqlQuerySpec sqlQuerySpec, + FeedRangeState feedRangeState, + QueryPaginationOptions queryPaginationOptions, + ITrace trace, + CancellationToken cancellationToken) + { + Task> queryPage = base.MonadicQueryAsync( + sqlQuerySpec, + feedRangeState, + queryPaginationOptions, + trace, + cancellationToken); + + ImmutableDictionary.Builder additionalHeaders = ImmutableDictionary.CreateBuilder(); + additionalHeaders.Add("x-ms-documentdb-partitionkeyrangeid", "0"); + additionalHeaders.Add("x-ms-test-header", "true"); + additionalHeaders.Add("x-ms-cosmos-query-requiresdistribution", this.requiresDistribution.ToString()); + + return await Task.FromResult( + TryCatch.FromResult( + new QueryPage( + queryPage.Result.Result.Documents, + requestCharge: 42, + activityId: Guid.NewGuid().ToString(), + responseLengthInBytes: 1337, + cosmosQueryExecutionInfo: default, + disallowContinuationTokenMessage: default, + additionalHeaders: additionalHeaders.ToImmutable(), + state: queryPage.Result.Result.State))); + } + } + private class MergeTestUtil { public int MoveNextCounter { get; private set; } @@ -626,7 +820,7 @@ public async Task ShouldReturnFailure() activityId: "0f8fad5b-d9cb-469f-a165-70867728950e", requestCharge: default); } - + if (this.IsFailedFallbackPipelineTest && this.GoneExceptionCreated && !this.TooManyRequestsFailureCreated) { this.TooManyRequestsFailureCreated = true; @@ -728,7 +922,7 @@ public override void SerializeAsXml(XmlWriter xmlWriter) } } } - + internal class TestCosmosQueryClient : CosmosQueryClient { public override Action OnExecuteScalarQueryCallback => throw new NotImplementedException(); @@ -743,7 +937,7 @@ public override void ClearSessionTokenCache(string collectionFullName) throw new NotImplementedException(); } - public override Task> ExecuteItemQueryAsync(string resourceUri, ResourceType resourceType, OperationType operationType, Guid clientQueryCorrelationId, Cosmos.FeedRange feedRange, QueryRequestOptions requestOptions, SqlQuerySpec sqlQuerySpec, string continuationToken, bool isContinuationExpected, int pageSize, ITrace trace, CancellationToken cancellationToken) + public override Task> ExecuteItemQueryAsync(string resourceUri, ResourceType resourceType, OperationType operationType, Cosmos.FeedRange feedRange, QueryRequestOptions requestOptions, AdditionalRequestHeaders additionalRequestHeaders, SqlQuerySpec sqlQuerySpec, string continuationToken, int pageSize, ITrace trace, CancellationToken cancellationToken) { throw new NotImplementedException(); } From c095bc1119684078737282dbe80ebbba100bab74 Mon Sep 17 00:00:00 2001 From: akotalwar <94020786+akotalwar@users.noreply.github.com> Date: Tue, 6 Jun 2023 17:26:50 -0700 Subject: [PATCH 130/240] Query: Refactors the EnableOptimisticDirectExecution flag to be public (#3883) * Made EnableOptimisticDirectExecution a public flag * Updated contract --- .../DotNetSDKEncryptionCustomAPI.json | 19 ++++++++++ .../src/RequestOptions/QueryRequestOptions.cs | 2 +- .../Contracts/DotNetSDKAPI.json | 38 +++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/tests/Microsoft.Azure.Cosmos.Encryption.Custom.Tests/Contracts/DotNetSDKEncryptionCustomAPI.json b/Microsoft.Azure.Cosmos.Encryption.Custom/tests/Microsoft.Azure.Cosmos.Encryption.Custom.Tests/Contracts/DotNetSDKEncryptionCustomAPI.json index 8f858ddb94..1912d16407 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/tests/Microsoft.Azure.Cosmos.Encryption.Custom.Tests/Contracts/DotNetSDKEncryptionCustomAPI.json +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/tests/Microsoft.Azure.Cosmos.Encryption.Custom.Tests/Contracts/DotNetSDKEncryptionCustomAPI.json @@ -51,6 +51,13 @@ ], "MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyAsync(System.String, System.String, System.Threading.CancellationToken);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyWithoutRawKeyAsync(System.String, System.String, System.Threading.CancellationToken)[System.Runtime.CompilerServices.AsyncStateMachineAttribute(typeof(Microsoft.Azure.Cosmos.Encryption.Custom.CosmosDataEncryptionKeyProvider+))]": { + "Type": "Method", + "Attributes": [ + "AsyncStateMachineAttribute" + ], + "MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyWithoutRawKeyAsync(System.String, System.String, System.Threading.CancellationToken);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Void .ctor(Microsoft.Azure.Cosmos.Encryption.Custom.EncryptionKeyWrapProvider, Microsoft.Data.Encryption.Cryptography.EncryptionKeyStoreProvider, System.Nullable`1[System.TimeSpan])[System.ObsoleteAttribute(\"Please use the constructor with EncryptionKeyStoreProvider only.\")]": { "Type": "Constructor", "Attributes": [ @@ -398,6 +405,13 @@ ], "MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyAsync(System.String, System.String, System.Threading.CancellationToken);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyWithoutRawKeyAsync(System.String, System.String, System.Threading.CancellationToken)[System.Runtime.CompilerServices.AsyncStateMachineAttribute(typeof(Microsoft.Azure.Cosmos.Encryption.Custom.CosmosDataEncryptionKeyProvider+))]": { + "Type": "Method", + "Attributes": [ + "AsyncStateMachineAttribute" + ], + "MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyWithoutRawKeyAsync(System.String, System.String, System.Threading.CancellationToken);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Void .ctor(Microsoft.Azure.Cosmos.Encryption.Custom.EncryptionKeyWrapProvider, Microsoft.Data.Encryption.Cryptography.EncryptionKeyStoreProvider, System.Nullable`1[System.TimeSpan])[System.ObsoleteAttribute(\"Please use the constructor with EncryptionKeyStoreProvider only.\")]": { "Type": "Constructor", "Attributes": [ @@ -426,6 +440,11 @@ "Type": "Method", "Attributes": [], "MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyAsync(System.String, System.String, System.Threading.CancellationToken);IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyWithoutRawKeyAsync(System.String, System.String, System.Threading.CancellationToken)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.Encryption.Custom.DataEncryptionKey] FetchDataEncryptionKeyWithoutRawKeyAsync(System.String, System.String, System.Threading.CancellationToken);IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {} diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs index cd505f1158..4cca513013 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs @@ -49,7 +49,7 @@ public class QueryRequestOptions : RequestOptions /// /// Direct (optimistic) execution offers improved performance for several kinds of queries such as a single partition streaming query. /// - internal bool EnableOptimisticDirectExecution { get; set; } + public bool EnableOptimisticDirectExecution { get; set; } /// /// Gets or sets the maximum number of items that can be buffered client side during diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index e5b95a7ed9..8a3bc7b462 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -6279,6 +6279,18 @@ "Microsoft.Azure.Cosmos.QueryRequestOptions;Microsoft.Azure.Cosmos.RequestOptions;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { + "Boolean EnableOptimisticDirectExecution": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Boolean EnableOptimisticDirectExecution;CanRead:True;CanWrite:True;Boolean get_EnableOptimisticDirectExecution();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_EnableOptimisticDirectExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean get_EnableOptimisticDirectExecution()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Boolean get_EnableOptimisticDirectExecution();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Microsoft.Azure.Cosmos.DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions": { "Type": "Property", "Attributes": [], @@ -6433,6 +6445,13 @@ ], "MethodInfo": "Void set_EnableLowPrecisionOrderBy(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Void set_EnableOptimisticDirectExecution(Boolean)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_EnableOptimisticDirectExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Void set_EnableScanInQuery(System.Nullable`1[System.Boolean])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ @@ -7301,6 +7320,18 @@ "Microsoft.Azure.Cosmos.QueryRequestOptions;Microsoft.Azure.Cosmos.RequestOptions;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { + "Boolean EnableOptimisticDirectExecution": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Boolean EnableOptimisticDirectExecution;CanRead:True;CanWrite:True;Boolean get_EnableOptimisticDirectExecution();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_EnableOptimisticDirectExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean get_EnableOptimisticDirectExecution()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Boolean get_EnableOptimisticDirectExecution();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Microsoft.Azure.Cosmos.DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions": { "Type": "Property", "Attributes": [], @@ -7455,6 +7486,13 @@ ], "MethodInfo": "Void set_EnableLowPrecisionOrderBy(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Void set_EnableOptimisticDirectExecution(Boolean)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_EnableOptimisticDirectExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Void set_EnableScanInQuery(System.Nullable`1[System.Boolean])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ From 6024f2433b342f58d738b0339492850a09018309 Mon Sep 17 00:00:00 2001 From: Arooshi Avasthy <113193425+aavasthy@users.noreply.github.com> Date: Wed, 7 Jun 2023 09:15:05 -0700 Subject: [PATCH 131/240] [Internal] OpenTelemetry : Adds Telemetry Distributed Tracing functionality (#3801) * Direct Package update and replacing dagnostic files * Resolve merge conflicts * Running updateCOnstracts script * Add code changes for distributed tracing open telemetry changes * Add distributed tracing tests * Updated tests for distributed tracing * Addin traceID for diagnostics * Running update contract script * Removed LinqTranslationWithCustomSerializerBaseline file * Adding isDistributedTracingEnabled flag * Running update contracts * Running update contracts * Updates based on differnt code review comments * Running update contracts * Running update contracts * Running update contracts * fix test * Code cleanup for test fix * Running Update contracts * resolving merge conflicts * resolving merge conflicts * Set EnableDistributedTracing to true for performance tests * Benchmark project change for distributed tracing * Updating tests * Updated unit tests * Updated unit tests * Updated tests and constructors based on review comments * Updated scope name in recorder * Updated distributedOtel tests to cover more scenarios * Updated distributedOtel tests * Reverting benchmark performance test changes * Update DistributedOpentelemetry tests * Update test cleanup * Update distributed tests with custom builder * Update distributed open telemetry tests * Update contracts * Cleanup files * Update distributed Otel tests * Update distributed Otel tests * code refactoring * fix custom listener * Update direct package to 3.31.1 * Code clean up * Update tests with display name --------- Co-authored-by: Sourabh Jain --- Directory.Build.props | 2 +- .../src/Resource/ClientContextCore.cs | 1 + .../OpenTelemetryAttributeKeys.cs | 1 + .../OpenTelemetryCoreRecorder.cs | 67 +++++- .../OpenTelemetryRecorderFactory.cs | 47 ++-- ...iterBaselineTests.BatchOperationsAsync.xml | 5 +- ...riterBaselineTests.BulkOperationsAsync.xml | 55 ++++- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 90 +++++-- ...eWriterBaselineTests.MiscellanousAsync.xml | 10 +- ...neTests.PointOperationsExceptionsAsync.xml | 30 ++- ...EndTraceWriterBaselineTests.QueryAsync.xml | 84 +++++++ ...TraceWriterBaselineTests.ReadFeedAsync.xml | 80 +++++-- ...TraceWriterBaselineTests.ReadManyAsync.xml | 10 +- ...selineTests.StreamPointOperationsAsync.xml | 20 +- ...aselineTests.TypedPointOperationsAsync.xml | 20 +- .../DistributedTracingOTelTests.cs | 222 ++++++++++++++++++ .../Tracing/AssertActivity.cs | 37 +-- .../Tracing/CustomListener.cs | 12 + .../Tracing/CustomOtelExporter.cs | 3 +- 19 files changed, 695 insertions(+), 101 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DistributedTracingOTelTests.cs diff --git a/Directory.Build.props b/Directory.Build.props index 7eecd3c8e2..c8b86ceed2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,7 +3,7 @@ 3.34.0 3.34.0 preview - 3.31.0 + 3.31.1 2.0.2 2.0.2 preview diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index d16d1c8bcc..42e128ac2e 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -497,6 +497,7 @@ private async Task RunWithDiagnosticsHelperAsync( databaseName: databaseName, operationType: operationType, requestOptions: requestOptions, + trace: trace, clientContext: this.isDisposed ? null : this)) using (new ActivityScope(Guid.NewGuid())) { diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs index 755e1e3a66..1bb66170b5 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryAttributeKeys.cs @@ -10,6 +10,7 @@ internal sealed class OpenTelemetryAttributeKeys public const string DiagnosticNamespace = "Azure.Cosmos"; public const string ResourceProviderNamespace = "Microsoft.DocumentDB"; public const string OperationPrefix = "Operation"; + public const string NetworkLevelPrefix = "Request"; // Common database attributes public const string DbSystemName = "db.system"; diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs index c199c0727c..2ef929ca8c 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos.Telemetry { using System; using System.Collections.Generic; + using System.Diagnostics; using global::Azure.Core; /// @@ -14,11 +15,12 @@ namespace Microsoft.Azure.Cosmos.Telemetry internal struct OpenTelemetryCoreRecorder : IDisposable { private const string CosmosDb = "cosmosdb"; - - private readonly DiagnosticScope scope; - private readonly DistributedTracingOptions config; - private readonly Documents.OperationType operationType; + private readonly DiagnosticScope scope = default; + private readonly DistributedTracingOptions config = null; + private readonly Activity activity = null; + + private readonly Documents.OperationType operationType = Documents.OperationType.Invalid; private OpenTelemetryAttributes response = null; internal static IDictionary> OTelCompatibleExceptions = new Dictionary>() @@ -30,7 +32,19 @@ internal struct OpenTelemetryCoreRecorder : IDisposable { typeof(ChangeFeedProcessorUserException), (exception, scope) => ChangeFeedProcessorUserException.RecordOtelAttributes((ChangeFeedProcessorUserException)exception, scope)} }; - public OpenTelemetryCoreRecorder( + private OpenTelemetryCoreRecorder(DiagnosticScope scope) + { + this.scope = scope; + this.scope.Start(); + } + + private OpenTelemetryCoreRecorder(string operationName) + { + this.activity = new Activity(operationName); + this.activity.Start(); + } + + private OpenTelemetryCoreRecorder( DiagnosticScope scope, string operationName, string containerName, @@ -54,6 +68,45 @@ public OpenTelemetryCoreRecorder( } } + /// + /// Used for creating parent activity in scenario where there are no listeners at operation level + /// but they are present at network level + /// + public static OpenTelemetryCoreRecorder CreateNetworkLevelParentActivity(DiagnosticScope networkScope) + { + return new OpenTelemetryCoreRecorder(networkScope); + } + + /// + /// Used for creating parent activity in scenario where there are no listeners at operation level and network level + /// + public static OpenTelemetryCoreRecorder CreateParentActivity(string operationName) + { + return new OpenTelemetryCoreRecorder(operationName); + } + + /// + /// Used for creating parent activity in scenario where there are listeners at operation level + /// + public static OpenTelemetryCoreRecorder CreateOperationLevelParentActivity( + DiagnosticScope operationScope, + string operationName, + string containerName, + string databaseName, + Documents.OperationType operationType, + CosmosClientContext clientContext, + DistributedTracingOptions config) + { + return new OpenTelemetryCoreRecorder( + operationScope, + operationName, + containerName, + databaseName, + operationType, + clientContext, + config); + } + public bool IsEnabled => this.scope.IsEnabled; public void Record(string key, string value) @@ -179,6 +232,10 @@ Documents.OperationType operationType this.scope.Dispose(); } + else + { + this.activity?.Stop(); + } } } } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs index fe10e7b22c..fee3282c1a 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs @@ -5,7 +5,9 @@ namespace Microsoft.Azure.Cosmos.Telemetry { using System; + using System.Diagnostics; using global::Azure.Core; + using Microsoft.Azure.Cosmos.Tracing; /// /// This class is used to generate Activities with Azure.Cosmos.Operation Source Name @@ -15,33 +17,42 @@ internal static class OpenTelemetryRecorderFactory /// /// Singleton to make sure we only have one instance of the DiagnosticScopeFactory and pattern matching of listener happens only once /// - private static DiagnosticScopeFactory ScopeFactory { get; set; } - + private static readonly Lazy LazyOperationScopeFactory = new Lazy( + valueFactory: () => new DiagnosticScopeFactory( + clientNamespace: $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.{OpenTelemetryAttributeKeys.OperationPrefix}", + resourceProviderNamespace: OpenTelemetryAttributeKeys.ResourceProviderNamespace, + isActivityEnabled: true, + suppressNestedClientActivities: true), + isThreadSafe: true); + + private static readonly Lazy LazyNetworkScopeFactory = new Lazy( + valueFactory: () => new DiagnosticScopeFactory( + clientNamespace: $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.{OpenTelemetryAttributeKeys.NetworkLevelPrefix}", + resourceProviderNamespace: OpenTelemetryAttributeKeys.ResourceProviderNamespace, + isActivityEnabled: true, + suppressNestedClientActivities: true), + isThreadSafe: true); + public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, string containerName, string databaseName, Documents.OperationType operationType, RequestOptions requestOptions, + ITrace trace, CosmosClientContext clientContext) { + OpenTelemetryCoreRecorder openTelemetryRecorder = default; if (clientContext is { ClientOptions.IsDistributedTracingEnabled: true }) { - OpenTelemetryRecorderFactory.ScopeFactory ??= new DiagnosticScopeFactory(clientNamespace: $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.{OpenTelemetryAttributeKeys.OperationPrefix}", - resourceProviderNamespace: OpenTelemetryAttributeKeys.ResourceProviderNamespace, - isActivityEnabled: true, - suppressNestedClientActivities: true); - // If there is no source then it will return default otherwise a valid diagnostic scope - DiagnosticScope scope = OpenTelemetryRecorderFactory - .ScopeFactory - .CreateScope(name: operationName, + DiagnosticScope scope = LazyOperationScopeFactory.Value.CreateScope(name: operationName, kind: clientContext.ClientOptions.ConnectionMode == ConnectionMode.Gateway ? DiagnosticScope.ActivityKind.Internal : DiagnosticScope.ActivityKind.Client); // Record values only when we have a valid Diagnostic Scope if (scope.IsEnabled) { - return new OpenTelemetryCoreRecorder( - scope: scope, + openTelemetryRecorder = OpenTelemetryCoreRecorder.CreateOperationLevelParentActivity( + operationScope: scope, operationName: operationName, containerName: containerName, databaseName: databaseName, @@ -49,9 +60,17 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, clientContext: clientContext, config: requestOptions?.DistributedTracingOptions ?? clientContext.ClientOptions?.DistributedTracingOptions); } - } +#if !INTERNAL + else if (Activity.Current is null) + { + DiagnosticScope requestScope = LazyNetworkScopeFactory.Value.CreateScope(name: operationName); - return default; + openTelemetryRecorder = requestScope.IsEnabled ? OpenTelemetryCoreRecorder.CreateNetworkLevelParentActivity(networkScope: requestScope) : OpenTelemetryCoreRecorder.CreateParentActivity(operationName); + } +#endif + trace.AddDatum("DistributedTraceId", Activity.Current?.TraceId); + } + return openTelemetryRecorder; } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index 09579f83b7..66ca36f8ba 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -38,6 +38,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) └── Execute Next Batch(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds ├── Create Batch Request(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds @@ -64,7 +66,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index be3a8c7910..b483975a57 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -35,6 +35,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -69,7 +71,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -431,6 +434,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -459,7 +464,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -808,6 +814,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -836,7 +844,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1185,6 +1194,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -1213,7 +1224,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1562,6 +1574,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -1590,7 +1604,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1939,6 +1954,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -1967,7 +1984,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2316,6 +2334,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -2344,7 +2364,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2693,6 +2714,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -2721,7 +2744,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -3070,6 +3094,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -3098,7 +3124,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -3447,6 +3474,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -3475,7 +3504,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -3840,6 +3870,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -4014,7 +4046,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml index 43d95de95d..ffc97ea44f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml @@ -30,6 +30,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -72,6 +74,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -99,6 +103,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -126,6 +132,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -153,6 +161,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -245,7 +255,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -408,7 +419,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -495,7 +507,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -582,7 +595,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -669,7 +683,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1106,6 +1121,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1149,6 +1166,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1177,6 +1196,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1205,6 +1226,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1240,7 +1263,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1407,7 +1431,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1498,7 +1523,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1589,7 +1615,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1833,6 +1860,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1875,6 +1904,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1902,6 +1933,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1929,6 +1962,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1963,7 +1998,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2126,7 +2162,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2213,7 +2250,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2300,7 +2338,8 @@ "name": "Change Feed Iterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2540,6 +2579,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -2583,6 +2624,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -2611,6 +2654,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -2639,6 +2684,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ChangeFeed MoveNextAsync(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -2674,7 +2721,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2841,7 +2889,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2932,7 +2981,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -3023,7 +3073,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -3262,6 +3313,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── Initialize Lease Store(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds ├── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -3331,7 +3384,8 @@ "name": "Change Feed Estimator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml index 29fc40f674..df53bd53d0 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml @@ -20,6 +20,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds │ ├── Waiting for Initialization of client to complete(00000000-0000-0000-0000-000000000000) Unknown-Component 00:00:00:000 0.00 milliseconds @@ -47,7 +49,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -175,6 +178,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds │ └── Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -200,7 +205,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml index 9ee0b6e650..902712a2a4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml @@ -37,6 +37,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get PkValue From Stream(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -71,7 +73,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -223,6 +226,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get PkValue From Stream(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -276,7 +281,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -510,6 +516,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get PkValue From Stream(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -555,7 +563,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -754,6 +763,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get PkValue From Stream(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -810,7 +821,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1030,6 +1042,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get PkValue From Stream(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -1108,7 +1122,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1331,6 +1346,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get PkValue From Stream(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -1365,7 +1382,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml index e9b0f96a00..5075d5d3e9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml @@ -24,6 +24,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -64,6 +66,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -97,6 +101,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -130,6 +136,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ [Query Correlated ActivityId] │ Redacted To Not Change The Baselines From Run To Run │ ) @@ -171,6 +179,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -298,6 +307,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -391,6 +401,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -484,6 +495,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -697,6 +709,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -738,6 +752,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -772,6 +788,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -806,6 +824,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ [Query Correlated ActivityId] │ Redacted To Not Change The Baselines From Run To Run │ ) @@ -848,6 +868,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -979,6 +1000,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -1076,6 +1098,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -1173,6 +1196,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -1391,6 +1415,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -1431,6 +1457,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -1464,6 +1492,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -1497,6 +1527,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ [Query Correlated ActivityId] │ Redacted To Not Change The Baselines From Run To Run │ ) @@ -1538,6 +1570,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -1665,6 +1698,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -1758,6 +1792,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -1851,6 +1886,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -2065,6 +2101,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -2106,6 +2144,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -2140,6 +2180,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -2174,6 +2216,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ [Query Correlated ActivityId] │ Redacted To Not Change The Baselines From Run To Run │ ) @@ -2216,6 +2260,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -2347,6 +2392,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -2444,6 +2490,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -2541,6 +2588,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -2762,6 +2810,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -2823,6 +2873,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -2857,6 +2909,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -2891,6 +2945,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ [Query Correlated ActivityId] │ Redacted To Not Change The Baselines From Run To Run │ ) @@ -2933,6 +2989,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -3108,6 +3165,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -3205,6 +3263,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -3302,6 +3361,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -3522,6 +3582,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -3563,6 +3625,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -3596,6 +3660,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -3629,6 +3695,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ [Query Correlated ActivityId] │ Redacted To Not Change The Baselines From Run To Run │ ) @@ -3670,6 +3738,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -3803,6 +3872,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -3896,6 +3966,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -3989,6 +4060,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -4205,6 +4277,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -4247,6 +4321,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -4281,6 +4357,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ [Query Correlated ActivityId] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) @@ -4315,6 +4393,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ [Query Correlated ActivityId] │ Redacted To Not Change The Baselines From Run To Run │ ) @@ -4357,6 +4437,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -4494,6 +4575,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -4591,6 +4673,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ @@ -4688,6 +4771,7 @@ "duration in milliseconds": 0, "data": { "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run", "Query Correlated ActivityId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml index 501a8b187e..2dd4424cb7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml @@ -24,6 +24,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -64,6 +66,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -89,6 +93,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -114,6 +120,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) └── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -146,7 +154,8 @@ "name": "FeedIterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -301,7 +310,8 @@ "name": "FeedIterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -380,7 +390,8 @@ "name": "FeedIterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -459,7 +470,8 @@ "name": "FeedIterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -659,6 +671,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -700,6 +714,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -726,6 +742,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -752,6 +770,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -785,7 +805,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -944,7 +965,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1027,7 +1049,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1110,7 +1133,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1315,6 +1339,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1355,6 +1381,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1380,6 +1408,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1405,6 +1435,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) └── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1437,7 +1469,8 @@ "name": "FeedIterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1592,7 +1625,8 @@ "name": "FeedIterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1671,7 +1705,8 @@ "name": "FeedIterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1750,7 +1785,8 @@ "name": "FeedIterator Read Next Async", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -1951,6 +1987,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -1992,6 +2030,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -2018,6 +2058,8 @@ │ │ ( │ │ [Client Configuration] │ │ Redacted To Not Change The Baselines From Run To Run + │ │ [DistributedTraceId] + │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) │ ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -2044,6 +2086,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) ReadFeed-Component 00:00:00:000 0.00 milliseconds │ └── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -2077,7 +2121,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2236,7 +2281,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2319,7 +2365,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -2402,7 +2449,8 @@ "name": "Typed FeedIterator ReadNextAsync", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml index 627a8ea66f..362afa7444 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml @@ -16,6 +16,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── Execute query for a partitionkeyrange(00000000-0000-0000-0000-000000000000) Query-Component 00:00:00:000 0.00 milliseconds │ │ ( @@ -141,7 +143,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -582,6 +585,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── Execute query for a partitionkeyrange(00000000-0000-0000-0000-000000000000) Query-Component 00:00:00:000 0.00 milliseconds │ │ ( @@ -710,7 +715,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml index 016a37aaaf..8816767262 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml @@ -22,6 +22,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) └── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds └── Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -44,7 +46,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -132,6 +135,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) └── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds └── Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -154,7 +159,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -250,6 +256,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) └── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds └── Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -272,7 +280,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -363,6 +372,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) └── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds └── Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -385,7 +396,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml index add1fcc343..f23344b440 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml @@ -20,6 +20,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Get PkValue From Stream(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -46,7 +48,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -152,6 +155,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds │ └── Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -175,7 +180,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -275,6 +281,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── ItemSerialize(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -299,7 +307,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { @@ -397,6 +406,8 @@ │ ( │ [Client Configuration] │ Redacted To Not Change The Baselines From Run To Run + │ [DistributedTraceId] + │ Redacted To Not Change The Baselines From Run To Run │ ) ├── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds │ └── Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds @@ -420,7 +431,8 @@ "start datetime": "0001-01-01T00:00:00Z", "duration in milliseconds": 0, "data": { - "Client Configuration": "Redacted To Not Change The Baselines From Run To Run" + "Client Configuration": "Redacted To Not Change The Baselines From Run To Run", + "DistributedTraceId": "Redacted To Not Change The Baselines From Run To Run" }, "children": [ { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DistributedTracingOTelTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DistributedTracingOTelTests.cs new file mode 100644 index 0000000000..8b5825831c --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DistributedTracingOTelTests.cs @@ -0,0 +1,222 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.CosmosElements; + using Microsoft.Azure.Cosmos.SDK.EmulatorTests; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using Newtonsoft.Json.Linq; + using OpenTelemetry.Trace; + using OpenTelemetry; + using AzureCore = global::Azure.Core; + using Microsoft.Azure.Cosmos.Telemetry; + using System.Diagnostics; + using Microsoft.Azure.Cosmos.Tracing; + using System.Net.Http; + using System.ComponentModel; + + [VisualStudio.TestTools.UnitTesting.TestClass] + public sealed class DistributedTracingOTelTests : BaseCosmosClientHelper + { + [TestInitialize] + public void TestInitialize() + { + AppContext.SetSwitch("Azure.Experimental.EnableActivitySource", true); + AzureCore.ActivityExtensions.ResetFeatureSwitch(); + } + + [DataTestMethod] + [DataRow($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Request", DisplayName = "DirectMode and DistributedFlag On: Asserts activity creation at operation and network level with Diagnostic TraceId being added to logs")] + [DataRow($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", null, DisplayName = "DirectMode and DistributedFlag On: Asserts activity creation at operation level with Diagnostic TraceId being added to logs")] + public async Task SourceEnabled_FlagOn_DirectMode_RecordsActivity_AssertLogTraceId_AssertTraceparent(string operationLevelSource, string networkLevelSource) + { + string[] sources = new string[] { operationLevelSource, networkLevelSource }; + sources = sources.Where(x => x != null).ToArray(); + + using TracerProvider provider = Sdk.CreateTracerProviderBuilder() + .AddCustomOtelExporter() + .AddSource(sources) + .Build(); + + await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, + customizeClientBuilder: (builder) => builder + .WithDistributedTracing(true) + .WithConnectionModeDirect()); + + Container containerResponse = await this.database.CreateContainerAsync( + id: Guid.NewGuid().ToString(), + partitionKeyPath: "/id", + throughput: 20000); + + CosmosObject cosmosObject = CosmosObject.Create( + new Dictionary() + { + { "id", CosmosString.Create("1") } + }); + + ItemResponse createResponse = await containerResponse.CreateItemAsync(JToken.Parse(cosmosObject.ToString())); + + //Assert traceparent header in Direct mode request + Assert.IsTrue(createResponse.RequestMessage.Headers.TryGetValue("traceparent", out string traceheader)); + Assert.IsNotNull(traceheader); + string[] traceheaderParts = traceheader.Split('-'); + string traceheaderId = traceheaderParts[1]; + + //Assert traceId in Diagnostics logs + string diagnosticsCreateItem = createResponse.Diagnostics.ToString(); + JObject objDiagnosticsCreate = JObject.Parse(diagnosticsCreateItem); + string distributedTraceId = (string)objDiagnosticsCreate["data"]["DistributedTraceId"]; + Assert.IsFalse(string.IsNullOrEmpty(distributedTraceId)); + + //Assert diagnostics log trace id is same as parent trace id of the activity + string operationName = (string)objDiagnosticsCreate["name"]; + string traceIdCreateItem = CustomOtelExporter.CollectedActivities + .Where(x => x.OperationName.Contains(operationName)) + .FirstOrDefault() + .TraceId + .ToString(); + //Assert created activity traceId and diagnosticsLog traceId + Assert.AreEqual(distributedTraceId, traceIdCreateItem); + + //Assert requestHeader trace id and and diagnosticsLog traceId + Assert.AreEqual(distributedTraceId, traceheaderId); + + //Assert activity creation + Assert.IsNotNull(CustomOtelExporter.CollectedActivities); + + if (networkLevelSource != null) + { + // Assert activity created at network level have an existing parent activity + Activity networkLevelChildActivity = CustomOtelExporter.CollectedActivities + .Where(x => x.OperationName.Contains("Request")) + .FirstOrDefault(); + Assert.IsNotNull(CustomOtelExporter.CollectedActivities + .Where(x => x.Id == networkLevelChildActivity.ParentId)); + } + } + + [DataTestMethod] + [DataRow($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Request", DisplayName = "GatewayMode and DistributedFlag On: Asserts activity creation at operation and network level with Diagnostic TraceId being added to logs")] + [DataRow($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", null, DisplayName = "GatewayMode and DistributedFlag On: Asserts activity creation at operation level with Diagnostic TraceId being added to logs")] + public async Task SourceEnabled_FlagOn_GatewayMode_RecordsActivity_AssertLogTraceId_AssertTraceparent(string operationLevelSource, string networkLevelSource) + { + string[] sources = new string[] { operationLevelSource, networkLevelSource }; + sources = sources.Where(x => x != null).ToArray(); + + HttpClientHandlerHelper httpClientHandlerHelper = new HttpClientHandlerHelper + { + RequestCallBack = (request, cancellation) => + { + if (request.Headers.TryGetValues("traceparent", out IEnumerable traceparentHeaderValues)) + { + Assert.IsNotNull(traceparentHeaderValues); + } + return null; + } + }; + + using TracerProvider provider = Sdk.CreateTracerProviderBuilder() + .AddCustomOtelExporter() + .AddSource(sources) + .Build(); + + await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, + customizeClientBuilder: (builder) => builder + .WithDistributedTracing(true) + .WithHttpClientFactory(() => new HttpClient(httpClientHandlerHelper)) + .WithConnectionModeGateway()); + + ContainerResponse containerResponse = await this.database.CreateContainerAsync( + id: Guid.NewGuid().ToString(), + partitionKeyPath: "/id", + throughput: 20000); + + List b = CustomOtelExporter.CollectedActivities.ToList(); + //Assert traceId in Diagnostics logs + string diagnosticsCreateContainer = containerResponse.Diagnostics.ToString(); + JObject objDiagnosticsCreate = JObject.Parse(diagnosticsCreateContainer); + string distributedTraceId = (string)objDiagnosticsCreate["data"]["DistributedTraceId"]; + Assert.IsFalse(string.IsNullOrEmpty(distributedTraceId)); + + //Assert diagnostics log trace id is same as parent trace id of the activity + string operationName = (string)objDiagnosticsCreate["name"]; + string traceIdCreateContainer = CustomOtelExporter.CollectedActivities + .Where(x => x.OperationName.Contains(operationName)) + .FirstOrDefault() + .TraceId + .ToString(); + Assert.AreEqual(distributedTraceId, traceIdCreateContainer); + + //Assert activity creation + Assert.IsNotNull(CustomOtelExporter.CollectedActivities); + } + + [DataTestMethod] + [DataRow(false, true, "random.source.name", DisplayName = "DirectMode, DistributedFlag On, Random/No Source:Asserts no activity creation")] + [DataRow(true, true, "random.source.name", DisplayName = "GatewayMode, DistributedFlag On, Random/No Source:Asserts no activity creation")] + [DataRow(false, false, "random.source.name", DisplayName = "DirectMode, DistributedFlag Off, Random/No Source:Asserts no activity creation")] + [DataRow(true, false, "random.source.name", DisplayName = "GatewayMode, DistributedFlag Off, Random/No Source:Asserts no activity creation")] + [DataRow(false, false, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", DisplayName = "DirectMode, DistributedFlag Off, OperationLevel Source:Asserts no activity creation")] + [DataRow(true, false, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", DisplayName = "GatewayMode, DistributedFlag Off, OperationLevel Source:Asserts no activity creation")] + public async Task NoSourceEnabled_ResultsInNoSourceParentActivityCreation_AssertLogTraceId(bool useGateway, bool enableDistributingTracing, string source) + { + using TracerProvider provider = Sdk.CreateTracerProviderBuilder() + .AddCustomOtelExporter() + .AddSource(source) + .Build(); + + if (useGateway) + { + await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, + customizeClientBuilder: (builder) => builder + .WithDistributedTracing(enableDistributingTracing) + .WithConnectionModeGateway()); + } + else + { + await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, + customizeClientBuilder: (builder) => builder + .WithDistributedTracing(enableDistributingTracing)); + } + + ContainerResponse containerResponse = await this.database.CreateContainerAsync( + id: Guid.NewGuid().ToString(), + partitionKeyPath: "/id", + throughput: 20000); + + //Assert traceId in Diagnostics logs + string diagnosticsCreateContainer = containerResponse.Diagnostics.ToString(); + JObject objDiagnosticsCreate = JObject.Parse(diagnosticsCreateContainer); + + if (enableDistributingTracing) + { + //DistributedTraceId present in logs + string distributedTraceId = (string)objDiagnosticsCreate["data"]["DistributedTraceId"]; + Assert.IsFalse(string.IsNullOrEmpty(distributedTraceId), "Distributed Trace Id is not there in diagnostics"); + } + else + { + //DistributedTraceId field not present in logs + Assert.IsNull(objDiagnosticsCreate["data"]["DistributedTraceId"], "Distributed Trace Id has value in diagnostics i.e. " + (string)objDiagnosticsCreate["data"]["DistributedTraceId"]); + } + + //Assert no activity with attached source is created + Assert.AreEqual(0, CustomOtelExporter.CollectedActivities.Count()); + } + + [TestCleanup] + public async Task CleanUp() + { + await base.TestCleanup(); + + AppContext.SetSwitch("Azure.Experimental.EnableActivitySource", false); + AzureCore.ActivityExtensions.ResetFeatureSwitch(); + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs index e25a46e44c..b1223656f1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs @@ -4,9 +4,11 @@ namespace Microsoft.Azure.Cosmos.Tracing { + using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; + using global::Azure; using Microsoft.Azure.Cosmos.Telemetry; using Microsoft.Azure.Cosmos.Tests; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -16,20 +18,22 @@ internal static class AssertActivity { public static void IsValidOperationActivity(Activity activity) { - Assert.IsTrue(activity.OperationName == activity.DisplayName); + if (string.Equals(activity.Source.Name, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", StringComparison.OrdinalIgnoreCase)) + { + Assert.IsTrue(activity.OperationName == activity.DisplayName); - Assert.IsFalse(string.IsNullOrEmpty(activity.GetTagItem("db.cosmosdb.connection_mode").ToString()), $"connection mode is emtpy for {activity.OperationName}"); + Assert.IsFalse(string.IsNullOrEmpty(activity.GetTagItem("db.cosmosdb.connection_mode").ToString()), $"connection mode is emtpy for {activity.OperationName}"); - if (activity.GetTagItem("db.cosmosdb.connection_mode").ToString() == ConnectionMode.Gateway.ToString()) - { - Assert.AreEqual(ActivityKind.Internal, activity.Kind, $" Actual Kind is {activity.Kind} but expected is {ActivityKind.Internal} for {activity.OperationName}"); - } - else if (activity.GetTagItem("db.cosmosdb.connection_mode").ToString() == ConnectionMode.Direct.ToString()) - { - Assert.AreEqual(ActivityKind.Client, activity.Kind, $" Actual Kind is {activity.Kind} but expected is {ActivityKind.Client} for {activity.OperationName}"); - } - - IList expectedTags = new List + if (activity.GetTagItem("db.cosmosdb.connection_mode").ToString() == ConnectionMode.Gateway.ToString()) + { + Assert.AreEqual(ActivityKind.Internal, activity.Kind, $" Actual Kind is {activity.Kind} but expected is {ActivityKind.Internal} for {activity.OperationName}"); + } + else if (activity.GetTagItem("db.cosmosdb.connection_mode").ToString() == ConnectionMode.Direct.ToString()) + { + Assert.AreEqual(ActivityKind.Client, activity.Kind, $" Actual Kind is {activity.Kind} but expected is {ActivityKind.Client} for {activity.OperationName}"); + } + + IList expectedTags = new List { "az.namespace", "az.schema_url", @@ -60,11 +64,12 @@ public static void IsValidOperationActivity(Activity activity) "db.cosmosdb.correlated_activity_id" }; - foreach (KeyValuePair actualTag in activity.Tags) - { - Assert.IsTrue(expectedTags.Contains(actualTag.Key), $"{actualTag.Key} is not allowed for {activity.OperationName}"); + foreach (KeyValuePair actualTag in activity.Tags) + { + Assert.IsTrue(expectedTags.Contains(actualTag.Key), $"{actualTag.Key} is not allowed for {activity.OperationName}"); - AssertActivity.AssertDatabaseAndContainerName(activity.OperationName, actualTag); + AssertActivity.AssertDatabaseAndContainerName(activity.OperationName, actualTag); + } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs index b0df15c3f2..44d34abece 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs @@ -34,6 +34,8 @@ internal class CustomListener : public static ConcurrentBag CollectedNetworkActivities { private set; get; } = new(); private static ConcurrentBag CollectedEvents { set; get; } = new(); + private static List EventSources { set; get; } = new(); + public CustomListener(string name, string eventName) : this(n => Regex.Match(n, name).Success, eventName) { @@ -43,6 +45,11 @@ public CustomListener(Func filter, string eventName) { this.sourceNameFilter = filter; this.eventName = eventName; + + foreach (EventSource eventSource in EventSources) + { + this.OnEventSourceCreated(eventSource); + } DiagnosticListener.AllListeners.Subscribe(this); } @@ -152,6 +159,11 @@ public void OnNext(DiagnosticListener value) /// protected override void OnEventSourceCreated(EventSource eventSource) { + if(this.eventName == null) + { + EventSources.Add(eventSource); + } + if (eventSource != null && eventSource.Name.Equals(this.eventName)) { this.EnableEvents(eventSource, EventLevel.Informational); // Enable information level events diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs index de819ee021..9572a298a6 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs @@ -18,11 +18,12 @@ internal class CustomOtelExporter : BaseExporter { private readonly string _name; - public static List CollectedActivities = new List(); + public static List CollectedActivities; public CustomOtelExporter(string name = "CustomOtelExporter") { this._name = name; + CollectedActivities = new List(); } public override ExportResult Export(in Batch batch) From e08fd5242f2129c4f0297447f35ec69881a11682 Mon Sep 17 00:00:00 2001 From: Rinat Minibaev <132935507+rinatmini@users.noreply.github.com> Date: Thu, 8 Jun 2023 07:29:04 -0700 Subject: [PATCH 132/240] Documentation: Adds additional remarks to CosmosClient (#3891) * CosmosClient documentation improvements * Cref fix * Link fix * Documentation fix * Typo fix --------- Co-authored-by: Matias Quaranta --- Microsoft.Azure.Cosmos/src/CosmosClient.cs | 20 ++++++++++++++++++- .../src/Fluent/CosmosClientBuilder.cs | 13 ++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/CosmosClient.cs b/Microsoft.Azure.Cosmos/src/CosmosClient.cs index d4fe7dcb9b..d622e9ddcb 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClient.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClient.cs @@ -92,6 +92,9 @@ namespace Microsoft.Azure.Cosmos /// ]]> /// /// + /// + /// The returned not-initialized reference doesn't guarantee credentials or connectivity validations because creation doesn't make any network calls + /// /// /// /// Performance Tips @@ -179,6 +182,9 @@ protected CosmosClient() /// ]]> /// /// + /// + /// The returned reference doesn't guarantee credentials or connectivity validations because creation doesn't make any network calls. + /// /// /// /// Performance Tips @@ -221,6 +227,9 @@ public CosmosClient( /// ]]> /// /// + /// + /// The returned reference doesn't guarantee credentials or connectivity validations because creation doesn't make any network calls. + /// /// /// /// Performance Tips @@ -274,7 +283,10 @@ public CosmosClient( /// /// Performance Tips /// Diagnose and troubleshoot issues - /// AzureKeyCredential enables changing/updating master-key/ResourceToken whle CosmosClient is still in use. + /// + /// AzureKeyCredential enables changing/updating master-key/ResourceToken whle CosmosClient is still in use. + /// The returned reference doesn't guarantee credentials or connectivity validations because creation doesn't make any network calls. + /// public CosmosClient( string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, @@ -292,6 +304,9 @@ public CosmosClient( /// of the application which enables efficient connection management and performance. Please refer to the /// performance guide. /// + /// + /// The returned reference doesn't guarantee credentials or connectivity validations because creation doesn't make any network calls. + /// /// The cosmos service endpoint to use. /// The token to provide AAD token for authorization. /// (Optional) client options @@ -368,6 +383,9 @@ internal CosmosClient( /// ]]> /// /// + /// + /// The returned reference doesn't guarantee credentials or connectivity validations because initialization doesn't make any network calls. + /// public static async Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList<(string databaseId, string containerId)> containers, diff --git a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs index 692d5b498a..8b72bfffa4 100644 --- a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs +++ b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs @@ -167,9 +167,13 @@ public CosmosClientBuilder( /// /// A method to create the cosmos client + /// CosmosClient is thread-safe. Its recommended to maintain a single instance of CosmosClient per lifetime + /// of the application which enables efficient connection management and performance. Please refer to the + /// performance guide. /// /// /// Setting this property after sending any request won't have any effect. + /// The returned reference doesn't guarantee credentials or connectivity validations because creation doesn't make any network calls. /// /// An instance of . public CosmosClient Build() @@ -191,6 +195,11 @@ public CosmosClient Build() /// /// A method to create the cosmos client and initialize the provided containers. + /// In addition to that it initializes the client with containers provided i.e The SDK warms up the caches and + /// connections before the first call to the service is made. Use this to obtain lower latency while startup of your application. + /// CosmosClient is thread-safe. Its recommended to maintain a single instance of CosmosClient per lifetime + /// of the application which enables efficient connection management and performance. Please refer to the + /// performance guide. /// /// Containers to be initialized identified by it's database name and container name. /// (Optional) Cancellation Token @@ -214,9 +223,13 @@ public Task BuildAndInitializeAsync(IReadOnlyList<(string database /// /// A method to create the cosmos client + /// CosmosClient is thread-safe. Its recommended to maintain a single instance of CosmosClient per lifetime + /// of the application which enables efficient connection management and performance. Please refer to the + /// performance guide. /// /// /// Setting this property after sending any request won't have any effect. + /// The returned reference doesn't guarantee credentials or connectivity validations because creation doesn't make any network calls. /// internal virtual CosmosClient Build(DocumentClient documentClient) { From d58b44138e07f17dcd8db5b80400a47c4561c095 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Fri, 9 Jun 2023 02:00:27 +0530 Subject: [PATCH 133/240] Open Telemetry End To End Test: Adds baseline for network level requests trace (#3887) * enable request level in end to end * made some changes * fix tests * fix display name * hardcoded containername and databasenam * fix tests * temp * fix tests * update contracts * fix tests * fixed display name --- .../OpenTelemetryRecorderFactory.cs | 2 + ...iterBaselineTests.BatchOperationsAsync.xml | 13 +- ...riterBaselineTests.BulkOperationsAsync.xml | 676 ++++++++++-------- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 189 +++-- ...eWriterBaselineTests.MiscellanousAsync.xml | 28 +- ...neTests.PointOperationsExceptionsAsync.xml | 36 +- ...EndTraceWriterBaselineTests.QueryAsync.xml | 217 +++--- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 124 ++-- ...TraceWriterBaselineTests.ReadManyAsync.xml | 26 +- ...selineTests.StreamPointOperationsAsync.xml | 52 +- ...aselineTests.TypedPointOperationsAsync.xml | 52 +- .../Tracing/AssertActivity.cs | 4 +- .../Tracing/CustomListener.cs | 35 +- .../Tracing/CustomOtelExporter.cs | 10 +- .../EndToEndTraceWriterBaselineTests.cs | 10 +- .../Utils/Util.cs | 4 +- 16 files changed, 895 insertions(+), 583 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs index fee3282c1a..ca0b864d2f 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs @@ -51,6 +51,8 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, // Record values only when we have a valid Diagnostic Scope if (scope.IsEnabled) { + scope.SetDisplayName($"{operationName} {containerName}"); + openTelemetryRecorder = OpenTelemetryCoreRecorder.CreateOperationLevelParentActivity( operationScope: scope, operationName: operationName, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index 66ca36f8ba..66edf29c06 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -132,12 +132,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 ExecuteAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -155,6 +155,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 1001 + 207 + diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index b483975a57..053f6ecc39 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -156,12 +156,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -179,12 +179,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -202,12 +202,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -225,12 +225,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -248,12 +248,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -271,12 +271,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -294,12 +294,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -317,12 +317,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -340,12 +340,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -363,12 +363,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -386,6 +386,13 @@ Some Value + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -536,12 +543,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -559,12 +566,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -582,12 +589,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -605,12 +612,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -628,12 +635,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -651,12 +658,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -674,12 +681,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -697,12 +704,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -720,12 +727,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -743,12 +750,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -766,6 +773,13 @@ Some Value + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -916,12 +930,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -939,12 +953,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -962,12 +976,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -985,12 +999,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1008,12 +1022,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1031,12 +1045,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1054,12 +1068,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1077,12 +1091,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1100,12 +1114,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1123,12 +1137,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1146,6 +1160,13 @@ Some Value + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -1296,12 +1317,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1319,12 +1340,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1342,12 +1363,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1365,12 +1386,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1388,12 +1409,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1411,12 +1432,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1434,12 +1455,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1457,12 +1478,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1480,12 +1501,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1503,12 +1524,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1526,6 +1547,13 @@ Some Value + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -1676,12 +1704,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1699,12 +1727,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1722,12 +1750,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1745,12 +1773,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1768,12 +1796,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1791,12 +1819,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1814,12 +1842,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1837,12 +1865,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1860,12 +1888,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1883,12 +1911,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1906,6 +1934,13 @@ Some Value + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -2056,12 +2091,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2079,12 +2114,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2102,12 +2137,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2125,12 +2160,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2148,12 +2183,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2171,12 +2206,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2194,12 +2229,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2217,12 +2252,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2240,12 +2275,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2263,12 +2298,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2286,6 +2321,13 @@ Some Value + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -2436,12 +2478,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2459,12 +2501,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2482,12 +2524,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2505,12 +2547,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2528,12 +2570,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2551,12 +2593,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2574,12 +2616,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2597,12 +2639,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2620,12 +2662,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2643,12 +2685,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2666,6 +2708,13 @@ Some Value + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -2816,12 +2865,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2839,12 +2888,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2862,12 +2911,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2885,12 +2934,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2908,12 +2957,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2931,12 +2980,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2954,12 +3003,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2977,12 +3026,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3000,12 +3049,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3023,12 +3072,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3046,6 +3095,13 @@ Some Value + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -3196,12 +3252,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3219,12 +3275,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3242,12 +3298,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3265,12 +3321,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3288,12 +3344,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3311,12 +3367,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3334,12 +3390,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3357,12 +3413,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3380,12 +3436,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3403,12 +3459,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3426,6 +3482,13 @@ Some Value + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -3576,12 +3639,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3599,12 +3662,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3622,12 +3685,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3645,12 +3708,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3668,12 +3731,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3691,12 +3754,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3714,12 +3777,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3737,12 +3800,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3760,12 +3823,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3783,12 +3846,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3806,6 +3869,13 @@ Some Value + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -4547,12 +4617,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml index ffc97ea44f..379c887104 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ChangeFeedAsync.xml @@ -967,12 +967,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Change Feed Iterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -990,12 +990,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Change Feed Iterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1013,12 +1013,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Change Feed Iterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1036,12 +1036,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Change Feed Iterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1059,12 +1059,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Change Feed Iterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1082,6 +1082,20 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 304 + @@ -1705,12 +1719,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1728,12 +1742,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1751,12 +1765,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1774,12 +1788,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1797,12 +1811,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1820,6 +1834,20 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 304 + @@ -2424,12 +2452,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Change Feed Iterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2447,12 +2475,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Change Feed Iterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2470,12 +2498,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Change Feed Iterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2493,12 +2521,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Change Feed Iterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2516,12 +2544,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Change Feed Iterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2539,6 +2567,20 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 304 + @@ -3163,12 +3205,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3186,12 +3228,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3209,12 +3251,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3232,12 +3274,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3255,12 +3297,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3278,6 +3320,20 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 304 + @@ -3556,12 +3612,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Change Feed Estimator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3579,6 +3635,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml index df53bd53d0..7341e76cb9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.MiscellanousAsync.xml @@ -4,7 +4,7 @@ Custom Handler - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 DeleteAsync - Some Value - Some Value + miscdbcustonhandler + cosmosdb Some Value 127.0.0.1 @@ -133,12 +133,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateDatabaseAsync - Some Value - Some Value + miscdbcustonhandler + cosmosdb Some Value 127.0.0.1 @@ -166,7 +166,7 @@ - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 DeleteAsync - Some Value - Some Value + miscdbdataplane + cosmosdb Some Value 127.0.0.1 @@ -279,12 +279,12 @@ Some Value - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateDatabaseAsync - Some Value - Some Value + miscdbdataplane + cosmosdb Some Value 127.0.0.1 diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml index 902712a2a4..4e11d5e4b7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml @@ -151,12 +151,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -415,12 +415,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -662,12 +662,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -941,12 +941,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1284,12 +1284,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1460,12 +1460,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml index 5075d5d3e9..8b737a419e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml @@ -586,12 +586,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -609,12 +609,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -632,12 +632,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -655,12 +655,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -678,6 +678,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -1291,12 +1298,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1314,12 +1321,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1337,12 +1344,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1360,12 +1367,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1383,6 +1390,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -1977,12 +1991,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2000,12 +2014,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2023,12 +2037,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2046,12 +2060,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2069,6 +2083,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -2683,12 +2704,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2706,12 +2727,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2729,12 +2750,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2752,12 +2773,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2775,6 +2796,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -3456,12 +3484,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3479,12 +3507,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3502,12 +3530,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3525,12 +3553,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -3548,6 +3576,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -4151,12 +4186,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -4174,12 +4209,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -4197,12 +4232,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -4220,12 +4255,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -4243,6 +4278,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -4866,12 +4908,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -4889,12 +4931,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -4912,12 +4954,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -4935,12 +4977,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -4958,6 +5000,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml index 2dd4424cb7..86f16841b5 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml @@ -548,12 +548,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -571,12 +571,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -594,12 +594,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -617,12 +617,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -640,6 +640,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -1215,12 +1222,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1238,12 +1245,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1261,12 +1268,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1284,12 +1291,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1307,6 +1314,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -1863,12 +1877,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1886,12 +1900,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1909,12 +1923,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1932,12 +1946,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 FeedIterator Read Next Async - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1955,6 +1969,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -2531,12 +2552,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2554,12 +2575,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2577,12 +2598,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2600,12 +2621,12 @@ Some Value South Central US - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 Typed FeedIterator ReadNextAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -2623,6 +2644,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml index 362afa7444..42c948a0d9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml @@ -545,12 +545,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 ReadManyItemsStreamAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -568,6 +568,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -1129,12 +1136,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 ReadManyItemsAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -1152,6 +1159,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml index 8816767262..ea5327040a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.StreamPointOperationsAsync.xml @@ -92,12 +92,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemStreamAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -115,6 +115,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 201 + @@ -205,12 +212,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 ReadItemStreamAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -228,6 +235,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -326,12 +340,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 ReplaceItemStreamAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -349,6 +363,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -442,12 +463,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 DeleteItemStreamAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -465,6 +486,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 204 + diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml index f23344b440..25b6e52364 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.TypedPointOperationsAsync.xml @@ -112,12 +112,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 CreateItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -135,6 +135,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 201 + @@ -230,12 +237,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 ReadItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -253,6 +260,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -361,12 +375,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 ReplaceItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -384,6 +398,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 200 + @@ -481,12 +502,12 @@ } ] }]]> - + Microsoft.DocumentDB https://opentelemetry.io/schemas/1.17.0 DeleteItemAsync - Some Value - Some Value + databaseName + containerName cosmosdb Some Value 127.0.0.1 @@ -504,6 +525,13 @@ Some Value South Central US + + Microsoft.DocumentDB + https://opentelemetry.io/schemas/1.17.0 + Some Value + 0 + 204 + diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs index b1223656f1..75153d3b88 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs @@ -20,9 +20,7 @@ public static void IsValidOperationActivity(Activity activity) { if (string.Equals(activity.Source.Name, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", StringComparison.OrdinalIgnoreCase)) { - Assert.IsTrue(activity.OperationName == activity.DisplayName); - - Assert.IsFalse(string.IsNullOrEmpty(activity.GetTagItem("db.cosmosdb.connection_mode").ToString()), $"connection mode is emtpy for {activity.OperationName}"); + Assert.IsFalse(string.IsNullOrEmpty(activity.GetTagItem("db.cosmosdb.connection_mode").ToString()), $"connection mode is empty for {activity.OperationName}"); if (activity.GetTagItem("db.cosmosdb.connection_mode").ToString() == ConnectionMode.Gateway.ToString()) { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs index 44d34abece..cae05fa94d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs @@ -242,9 +242,13 @@ private string GenerateTagForBaselineTest(Activity activity) "db.operation", "db.system", "net.peer.name", + "db.name", + "db.cosmosdb.container", "db.cosmosdb.connection_mode", "db.cosmosdb.operation_type", - "db.cosmosdb.regions_contacted" + "db.cosmosdb.regions_contacted", + "tcp.sub_status_code", + "tcp.status_code" }; StringBuilder builder = new StringBuilder(); @@ -278,18 +282,18 @@ public List GetRecordedAttributes() generatedActivityTagsForBaselineXmls.Add(this.GenerateTagForBaselineTest(activity)); } - /* List collectedNetworkActivities = new List(CustomListener.CollectedNetworkActivities); - collectedNetworkActivities = collectedNetworkActivities + HashSet collectedNetworkActivities = new HashSet(CustomListener.CollectedNetworkActivities, new NetworkActivityComparer()); + List orderedUniqueNetworkActivities = collectedNetworkActivities .OrderBy(act => act.Source.Name + act.OperationName + - act.GetTagItem("rntbd.status_code") + - act.GetTagItem("rntbd.sub_status_code")) + act.GetTagItem("tcp.status_code") + + act.GetTagItem("tcp.sub_status_code")) .ToList(); - foreach (Activity activity in collectedNetworkActivities) + foreach (Activity activity in orderedUniqueNetworkActivities) { generatedActivityTagsForBaselineXmls.Add(this.GenerateTagForBaselineTest(activity)); - }*/ + } List outputList = new List(); if(generatedActivityTagsForBaselineXmls != null && generatedActivityTagsForBaselineXmls.Count > 0) @@ -345,5 +349,22 @@ public ProducedLink(string traceparent, string tracestate) public string Traceparent { get; set; } public string Tracestate { get; set; } } + + public class NetworkActivityComparer : IEqualityComparer + { + public bool Equals(Activity x, Activity y) + { + string xData = x.Source.Name + x.OperationName + x.GetTagItem("tcp.status_code") + x.GetTagItem("tcp.sub_status_code"); + string yData = y.Source.Name + y.OperationName + y.GetTagItem("tcp.status_code") + y.GetTagItem("tcp.sub_status_code"); + + return xData.Equals(yData, StringComparison.OrdinalIgnoreCase); + } + + public int GetHashCode(Activity obj) + { + return (obj.Source.Name + obj.OperationName + obj.GetTagItem("tcp.status_code") + obj.GetTagItem("tcp.sub_status_code")).GetHashCode() ; + } + } + } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs index 9572a298a6..eb46d83e48 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs @@ -7,6 +7,7 @@ namespace Microsoft.Azure.Cosmos.Tracing using System; using System.Collections.Generic; using System.Diagnostics; + using Microsoft.Azure.Cosmos.Telemetry; using OpenTelemetry; using OpenTelemetry.Trace; @@ -34,9 +35,12 @@ public override ExportResult Export(in Batch batch) foreach (Activity activity in batch) { - AssertActivity.IsValidOperationActivity(activity); - - CollectedActivities.Add(activity); + if (string.Equals(activity.Source.Name, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", StringComparison.OrdinalIgnoreCase)) + { + AssertActivity.IsValidOperationActivity(activity); + + CollectedActivities.Add(activity); + } } return ExportResult.Success; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs index 63d883ef21..64bc7c015a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs @@ -71,11 +71,11 @@ public static async Task ClassInitAsync(TestContext context) })); EndToEndTraceWriterBaselineTests.database = await client.CreateDatabaseAsync( - Guid.NewGuid().ToString(), + "databaseName", cancellationToken: default); EndToEndTraceWriterBaselineTests.container = await EndToEndTraceWriterBaselineTests.database.CreateContainerAsync( - id: Guid.NewGuid().ToString(), + id: "containerName", partitionKeyPath: "/id", throughput: 20000); @@ -401,7 +401,7 @@ public async Task ChangeFeedAsync() //---------------------------------------------------------------- { Container leaseContainer = await EndToEndTraceWriterBaselineTests.database.CreateContainerAsync( - id: Guid.NewGuid().ToString(), + id: "changefeedleasecontainer", partitionKeyPath: "/id"); ChangeFeedProcessor processor = container @@ -1347,7 +1347,7 @@ public async Task MiscellanousAsync() { startLineNumber = GetLineNumber(); - DatabaseResponse databaseResponse = await miscCosmosClient.CreateDatabaseAsync(Guid.NewGuid().ToString()); + DatabaseResponse databaseResponse = await miscCosmosClient.CreateDatabaseAsync("miscdbcustonhandler"); EndToEndTraceWriterBaselineTests.AssertCustomHandlerTime( databaseResponse.Diagnostics.ToString(), requestHandler.FullHandlerName, @@ -1370,7 +1370,7 @@ public async Task MiscellanousAsync() startLineNumber = GetLineNumber(); RequestOptions requestOptions = new RequestOptions(); DatabaseResponse databaseResponse = await client.CreateDatabaseAsync( - id: Guid.NewGuid().ToString(), + id: "miscdbdataplane", requestOptions: requestOptions); ITrace trace = ((CosmosTraceDiagnostics)databaseResponse.Diagnostics).Value; await databaseResponse.Database.DeleteAsync(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs index 4773c7de96..366cc68811 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs @@ -548,11 +548,11 @@ internal static CustomListener ConfigureOpenTelemetryAndCustomListeners() // Open Telemetry Listener Util.OTelTracerProvider = Sdk.CreateTracerProviderBuilder() .AddCustomOtelExporter() // use any exporter here - .AddSource($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation") + .AddSource($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.*") .Build(); // Custom Listener - Util.TestListener = new CustomListener($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", "Azure-Cosmos-Operation-Request-Diagnostics"); + Util.TestListener = new CustomListener($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.*", "Azure-Cosmos-Operation-Request-Diagnostics"); return Util.TestListener; From df630928ca7f421177998464fd57b31ce27cd84e Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Sat, 10 Jun 2023 01:52:17 +0530 Subject: [PATCH 134/240] [Internal] Design Docs: Adds Design Document for Client Telemetry (#3590) * sdk design for client telemetry * Otel design * update optel design * added more nformation * updated ct design * remove otel design * Client Telemetry Design * update typos * fix typos * fix typos * added limitation * updated docs * updated doc * updated text * Update docs/observability.md Co-authored-by: Kiran Kumar Kolli * Update docs/observability.md Co-authored-by: Kiran Kumar Kolli * Update docs/observability.md Co-authored-by: Kiran Kumar Kolli * Update docs/observability.md Co-authored-by: Kiran Kumar Kolli * Update docs/observability.md Co-authored-by: Kiran Kumar Kolli * move stuff here and there. --------- Co-authored-by: Kiran Kumar Kolli --- docs/observability.md | 73 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/docs/observability.md b/docs/observability.md index b74b55cd21..184d609f76 100644 --- a/docs/observability.md +++ b/docs/observability.md @@ -33,4 +33,75 @@ flowchart TD OtherLogic --> GetResponse(Get Response for the request) SendResponse --> OperationCall -``` \ No newline at end of file +``` + +## Send telemetry from SDK to service (Private Preview) + +### Introduction +When opted-in CosmosDB SDK collects below aggregated telemetry data every 10 minutes to Azure CosmosDB service. +1. Operation(CRUD APIs) Latencies and Request Units (RUs). +2. Metadata caches (ex: CollectionCache) miss statistics +3. Client System Usage (during an operation) : + * CPU usage + * Memory Usage + * Thread Starvation + * Network Connections Opened (only TCP Connections) +4. TOP 10 slower network interactions + +> Note: We don't collect any PII data as part of this feature. + +### Benefits +Enabling this feature provides numerous benefits. The telemetry data collected will allow us to identify and address potential issues. This results in a superior support experience and ensures that some issues can even be resolved before they impact your application. In short, customers with this feature enabled can expect a smoother and more reliable experience. + +### Impact of this feature enabled +* _Latency_: Customer should not see any impact on latency. +* _Total RPS_: It depends on the infrastructure the application using SDK is hosted on among other factors but the impact should not exceed 10%. +* _Any other impact_: Collector needs around 18MB of in-memory storage to hold the data and this storage is always constant (it means it doesn't grow, no matter how much data we have) +* Benchmark Numbers: https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json + +### Components + +**Telemetry Job:** Background task which collects the data and sends it to a Azure CosmosDB service every 10 minutes. + +**Collectors:** In-memory storage which keeps the telemetry data collected during an operation. There are 3 types of collectors including: +* _Operational Data Collector_: It keeps operation level latencies and request units. +* _Network Data Collector_: It keeps all the metrics related to network or TCP calls. It has its own Sampler which sample-in only slowest TCP calls for a particular replica. +* _Cache Data Collector_: It keeps all the cache call latencies. Right now, only collection cache is covered. + +**Get VM Information**: + +- Azure VM: [Azure Instance Metadata](https://learn.microsoft.com/azure/virtual-machines/instance-metadata-service?tabs=windows) call. +- Non-Azure VM: We don't collect any other information except VMID which will a Guid or Hashed Machine Name. + +**Processor**: Its responsibility is to get all the data and divide it into small chunks (<2MB) and send each chunk to the Azure CosmosDB service. + +```mermaid +flowchart TD + subgraph TelemetryJob[Telemetry Background Job] + subgraph Storage[In Memory Storage or Collectors] + subgraph NetworkDataCollector[Network Data Collector] + TcpDatapoint(Network Request Datapoint) --> NetworkHistogram[(Histogram)] + DataSampler(Sampler) + end + subgraph DataCollector[Operational Data Collector] + OpsDatapoint(Operation Datapoint) --> OperationHistogram[(Histogram)] + end + subgraph CacheCollector[Cache Data Collector] + CacheDatapoint(Cache Request Datapoint) --> CacheHistogram[(Histogram)] + end + end + subgraph TelemetryTask[Telemetry Task Every 10 min] + CacheAccountInfo(Cached Account Properties) --> VMInfo + VMInfo(Get VM Information) --> CollectSystemUsage + CollectSystemUsage(Record System Usage Information) --> GetDataFromCollector + end + subgraph Processor + GetDataFromCollector(Fetch Data from Collectors) --> Serializer + Serializer(Serialize and divide the Payload) --> SendCTOverHTTP(Send Data over HTTP to Service) + end + Storage --> |Get Aggregated data|GetDataFromCollector + end +``` + +### Limitations +1. AAD Support is not available. \ No newline at end of file From d1dbe94ee4e855ef90a6997ab075d7306413ff1e Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Sat, 10 Jun 2023 03:06:17 +0530 Subject: [PATCH 135/240] [Internal] Design Docs: Adds Design Document for Client Telemetry Part 2 (#3903) * updated doc * Update docs/observability.md Co-authored-by: Justine Cocchi * updated text --------- Co-authored-by: Justine Cocchi --- docs/observability.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/observability.md b/docs/observability.md index 184d609f76..50ce14d33c 100644 --- a/docs/observability.md +++ b/docs/observability.md @@ -39,19 +39,19 @@ flowchart TD ### Introduction When opted-in CosmosDB SDK collects below aggregated telemetry data every 10 minutes to Azure CosmosDB service. -1. Operation(CRUD APIs) Latencies and Request Units (RUs). +1. Operation(Point, Stream, Batch and Query APIs) Latencies and Request Units (RUs). 2. Metadata caches (ex: CollectionCache) miss statistics -3. Client System Usage (during an operation) : +3. Host Resource Usage: (during an operation) : * CPU usage * Memory Usage * Thread Starvation * Network Connections Opened (only TCP Connections) -4. TOP 10 slower network interactions +4. TOP 10 slowest network interactions per endpoint > Note: We don't collect any PII data as part of this feature. ### Benefits -Enabling this feature provides numerous benefits. The telemetry data collected will allow us to identify and address potential issues. This results in a superior support experience and ensures that some issues can even be resolved before they impact your application. In short, customers with this feature enabled can expect a smoother and more reliable experience. +Enabling this feature provides numerous benefits. The telemetry data collected will allow us to identify and address potential issues. This results in a superior support experience and ensures that some issues can even be resolved before they impact your application. In short, customers with this feature enabled can expect a smoother and more reliable support experience. ### Impact of this feature enabled * _Latency_: Customer should not see any impact on latency. From 28e03c8bd490a2f3c955dea02eb1bd78b0eda61a Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Fri, 9 Jun 2023 19:07:04 -0700 Subject: [PATCH 136/240] ConnectionPolicy: Refactors Code to Reduce Default Request Timeout to 6 Seconds. (#3902) * Code changes to reduce default request timeout to 6 seconds. * Code changes to update API doc default request timeout to 6 seconds. --- Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs | 2 +- Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs b/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs index 172aac4fbb..7abfd76deb 100644 --- a/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs @@ -19,7 +19,7 @@ namespace Microsoft.Azure.Cosmos /// internal sealed class ConnectionPolicy { - private const int defaultRequestTimeout = 10; + private const int defaultRequestTimeout = 6; // defaultMediaRequestTimeout is based upon the blob client timeout and the retry policy. private const int defaultMediaRequestTimeout = 300; private const int defaultMaxConcurrentFanoutRequests = 32; diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs index c826bb90d1..1fce195915 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs @@ -223,7 +223,7 @@ public int GatewayModeMaxConnectionLimit /// Gets the request timeout in seconds when connecting to the Azure Cosmos DB service. /// The number specifies the time to wait for response to come back from network peer. ///
- /// Default value is 1 minute. + /// Default value is 6 seconds. /// public TimeSpan RequestTimeout { get; set; } From b9242094bada0cb5b05851ff077f068019b57d7b Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Fri, 9 Jun 2023 21:39:37 -0700 Subject: [PATCH 137/240] [Internal] Upgrade Resiliency: Adds Replica Health State Diagnostics. (#3835) * Code changes to add replica health status in diagnostics. * Code changes to fix performance test build failure. * Code changes to add health state capture logic in address cache. * Code changes to fix benchmark test execution. * Code changes to add tests to validate health state cache. * Code changes to reduce default request timeout to 5 seconds. * Revert "Code changes to reduce default request timeout to 5 seconds." This reverts commit 139f37e588fc9dfed608431f4186c567a080e622. --- .../src/Routing/GatewayAddressCache.cs | 23 +++++++ .../Tracing/TraceWriter.TraceJsonWriter.cs | 18 ++++++ .../Contracts/BenchmarkResults.json | 6 +- .../TraceWriterBaselineTests.TraceData.xml | 7 ++ .../GatewayAddressCacheTests.cs | 64 +++++++++++++++++++ .../Tracing/TraceTests.cs | 2 - 6 files changed, 115 insertions(+), 5 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs index 182243ec40..14b641959a 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs @@ -550,10 +550,17 @@ await this.GetServerAddressesViaGatewayAsync(request, collectionRid, new[] { par } this.ValidateReplicaAddresses(transportAddressUris); + this.CaptureTransportAddressUriHealthStates( + partitionAddressInformation: mergedAddresses, + transportAddressUris: transportAddressUris); return mergedAddresses; } + this.CaptureTransportAddressUriHealthStates( + partitionAddressInformation: result.Item2, + transportAddressUris: result.Item2.Get(Protocol.Tcp)?.ReplicaTransportAddressUris); + return result.Item2; } } @@ -936,6 +943,22 @@ TransportAddressHealthState.HealthStatus.Unknown or TransportAddressHealthState.HealthStatus.UnhealthyPending); } + /// + /// The replica health status of the transport address uri will change eventually with the motonically increasing time. + /// However, the purpose of this method is to capture the health status snapshot at this moment. + /// + /// An instance of . + /// A read-only list of . + private void CaptureTransportAddressUriHealthStates( + PartitionAddressInformation partitionAddressInformation, + IReadOnlyList transportAddressUris) + { + partitionAddressInformation + .Get(Protocol.Tcp)? + .SetTransportAddressUrisHealthState( + replicaHealthStates: transportAddressUris.Select(x => x.GetCurrentHealthState().GetHealthStatusDiagnosticString()).ToList()); + } + protected virtual void Dispose(bool disposing) { if (this.disposedValue) diff --git a/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs b/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs index 74363c8ca1..247c9f2587 100644 --- a/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Tracing/TraceWriter.TraceJsonWriter.cs @@ -430,6 +430,8 @@ public void Visit(StoreResult storeResult) this.jsonWriter.WriteFieldName("BELatencyInMs"); this.WriteStringValueOrNull(storeResult.BackendRequestDurationInMs); + this.WriteJsonUriArray("ReplicaHealthStatuses", storeResult.ReplicaHealthStatuses); + this.VisitTransportRequestStats(storeResult.TransportRequestStats); this.jsonWriter.WriteFieldName("TransportException"); @@ -468,6 +470,22 @@ private void WriteJsonUriArray(string propertyName, IEnumerable replicaHealthStatuses) + { + this.jsonWriter.WriteFieldName(propertyName); + this.jsonWriter.WriteArrayStart(); + + if (replicaHealthStatuses != null) + { + foreach (string replicaHealthStatus in replicaHealthStatuses) + { + this.WriteStringValueOrNull(replicaHealthStatus); + } + } + + this.jsonWriter.WriteArrayEnd(); + } + private void WriteRegionsContactedArray(string propertyName, IEnumerable<(string, Uri)> uris) { this.jsonWriter.WriteFieldName(propertyName); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json index c97e0b5b2c..a06dabf09c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json @@ -14,7 +14,7 @@ "MockedItemBenchmark.DeleteItemNotExists;[Type=OfT]": 42172.5, "MockedItemBenchmark.DeleteItemNotExists;[Type=OfTCustom]": 42174.75, "MockedItemBenchmark.DeleteItemNotExists;[Type=OfTWithClientTelemetryEnabled]": 42166.5, - "MockedItemBenchmark.DeleteItemNotExists;[Type=OfTWithDiagnosticsToString]": 56695.5, + "MockedItemBenchmark.DeleteItemNotExists;[Type=OfTWithDiagnosticsToString]": 63338, "MockedItemBenchmark.DeleteItemNotExists;[Type=Stream]": 37610, "MockedItemBenchmark.QuerySinglePartitionMultiplePages;[Type=OfT]": 13342232, "MockedItemBenchmark.QuerySinglePartitionMultiplePages;[Type=OfTCustom]": 13341058, @@ -34,12 +34,12 @@ "MockedItemBenchmark.ReadItemExists;[Type=OfT]": 33630.5, "MockedItemBenchmark.ReadItemExists;[Type=OfTCustom]": 33636.25, "MockedItemBenchmark.ReadItemExists;[Type=OfTWithClientTelemetryEnabled]": 33627.75, - "MockedItemBenchmark.ReadItemExists;[Type=OfTWithDiagnosticsToString]": 47961.25, + "MockedItemBenchmark.ReadItemExists;[Type=OfTWithDiagnosticsToString]": 55044, "MockedItemBenchmark.ReadItemExists;[Type=Stream]": 26018.25, "MockedItemBenchmark.ReadItemNotExists;[Type=OfT]": 43489.25, "MockedItemBenchmark.ReadItemNotExists;[Type=OfTCustom]": 43490, "MockedItemBenchmark.ReadItemNotExists;[Type=OfTWithClientTelemetryEnabled]": 43489.25, - "MockedItemBenchmark.ReadItemNotExists;[Type=OfTWithDiagnosticsToString]": 57420.25, + "MockedItemBenchmark.ReadItemNotExists;[Type=OfTWithDiagnosticsToString]": 58054, "MockedItemBenchmark.ReadItemNotExists;[Type=Stream]": 39044, "MockedItemBenchmark.UpdateItem;[Type=OfT]": 36591, "MockedItemBenchmark.UpdateItem;[Type=OfTCustom]": 36594.25, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml index 8b6adc1c15..885699cb43 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml @@ -340,6 +340,12 @@ "RequestCharge": 3.14, "RetryAfterInMs": "9000", "BELatencyInMs": "4.2", + "ReplicaHealthStatuses": [ + "http://storephysicaladdress-1p.com:Connected", + "http://storephysicaladdress-2s.com:Unknown", + "http://storephysicaladdress-3s.com:Unhealthy", + "http://storephysicaladdress-4s.com:Unknown" + ], "transportRequestTimeline": { "requestTimeline": [ { @@ -529,6 +535,7 @@ "RequestCharge": 0, "RetryAfterInMs": null, "BELatencyInMs": null, + "ReplicaHealthStatuses":[], "transportRequestTimeline": null, "TransportException": null } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs index 2d0d0a5c6a..5116eb22de 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs @@ -971,6 +971,13 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabled_ShouldValidat expected: TransportAddressHealthState.HealthStatus.Connected, actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); + GatewayAddressCacheTests.ValidateHealthStatesInDiagnostics( + addressInfo: addressInfo, + numberOfConnectedReplicas: 0, + numberOfUnknownReplicas: 4, + numberOfUnhealthyPendingReplicas: 0, + numberOfUnhealthyReplicas: 0); + Assert.AreEqual(4, addressInfo.AllAddresses.Count); Assert.AreEqual(1, addressInfo.AllAddresses.Count(x => x.PhysicalUri == oldAddress)); Assert.AreEqual(0, addressInfo.AllAddresses.Count(x => x.PhysicalUri == newAddress)); @@ -1008,6 +1015,14 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabled_ShouldValidat actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); mockHttpHandler.VerifyAll(); + + GatewayAddressCacheTests.ValidateHealthStatesInDiagnostics( + addressInfo: addressInfo, + numberOfConnectedReplicas: 2, + numberOfUnknownReplicas: 1, + numberOfUnhealthyPendingReplicas: 1, + numberOfUnhealthyReplicas: 0); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, expectedTotalFailedAddressesToOpenCount: 0, @@ -1106,6 +1121,13 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr manualResetEvent: manualResetEvent, shouldReset: true); + GatewayAddressCacheTests.ValidateHealthStatesInDiagnostics( + addressInfo: addressInfo, + numberOfConnectedReplicas: 0, + numberOfUnknownReplicas: 4, + numberOfUnhealthyPendingReplicas: 0, + numberOfUnhealthyReplicas: 0); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, expectedTotalFailedAddressesToOpenCount: 0, @@ -1157,6 +1179,13 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr expected: TransportAddressHealthState.HealthStatus.Unhealthy, actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); + GatewayAddressCacheTests.ValidateHealthStatesInDiagnostics( + addressInfo: addressInfo, + numberOfConnectedReplicas: 2, + numberOfUnknownReplicas: 1, + numberOfUnhealthyPendingReplicas: 1, + numberOfUnhealthyReplicas: 0); + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, expectedTotalFailedAddressesToOpenCount: 1, @@ -1356,6 +1385,41 @@ private static void AssertOpenConnectionHandlerAttributes( Assert.AreEqual(expectedTotalSuccessAddressesToOpenCount, fakeOpenConnectionHandler.GetTotalSuccessfulInvocationCount()); } + /// + /// Helper method to validate and assert on the cached health states for diagnostics. + /// + /// An instance of containing the partition address information. + /// An integer containing the number of connected replicas to be validated inthe cached health status list. + /// An integer containing the number of unknown replicas to be validated inthe cached health status list. + /// An integer containing the number of unhealthy pending replicas to be validated inthe cached health status list. + /// An integer containing the number of unhealthy replicas to be validated inthe cached health status list. + private static void ValidateHealthStatesInDiagnostics( + PartitionAddressInformation addressInfo, + int numberOfConnectedReplicas, + int numberOfUnknownReplicas, + int numberOfUnhealthyPendingReplicas, + int numberOfUnhealthyReplicas) + { + IReadOnlyList replicaHealthStatuses = addressInfo.Get(Protocol.Tcp)?.ReplicaTransportAddressUrisHealthState; + + Assert.IsNotNull(replicaHealthStatuses); + Assert.AreEqual( + expected: numberOfConnectedReplicas, + actual: replicaHealthStatuses.Where(x => x.Contains("| status: Connected |")).Count()); + + Assert.AreEqual( + expected: numberOfUnknownReplicas, + actual: replicaHealthStatuses.Where(x => x.Contains("| status: Unknown |")).Count()); + + Assert.AreEqual( + expected: numberOfUnhealthyPendingReplicas, + actual: replicaHealthStatuses.Where(x => x.Contains("| status: UnhealthyPending |")).Count()); + + Assert.AreEqual( + expected: numberOfUnhealthyReplicas, + actual: replicaHealthStatuses.Where(x => x.Contains("| status: Unhealthy |")).Count()); + } + private class FakeMessageHandler : HttpMessageHandler { private bool returnFullReplicaSet; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs index ad21070609..7c0cca1f95 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceTests.cs @@ -125,8 +125,6 @@ public void ValidateStoreResultSerialization() storeResultProperties.Remove(nameof(storeResult.Target.Exception)); storeResultProperties.Add("transportRequestTimeline"); storeResultProperties.Remove(nameof(storeResult.Target.TransportRequestStats)); - storeResultProperties.Add("ReplicaHealthStatuses"); - storeResultProperties.Remove(nameof(storeResult.Target.ReplicaHealthStatuses)); foreach (string key in jsonPropertyNames) { From ea10439d2b3b1658b8dee97186b362d5b60ae537 Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Mon, 12 Jun 2023 10:54:00 -0700 Subject: [PATCH 138/240] Subpartitioning: Fixes handling of split physical partitions (#3879) * Initial Commit DO NOT REVIEW * bug fix, needs Direct Package Changes * fix for change feed and query plus tests * clean up * query + clean up --------- Co-authored-by: Kiran Kumar Kolli --- .../FeedRanges/FeedRangePartitionKey.cs | 11 +- .../Core/QueryPlan/QueryPartitionProvider.cs | 6 +- .../Routing/PartitionRoutingHelperTest.cs | 517 ++++++++++++++++++ 3 files changed, 527 insertions(+), 7 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/FeedRange/FeedRanges/FeedRangePartitionKey.cs b/Microsoft.Azure.Cosmos/src/FeedRange/FeedRanges/FeedRangePartitionKey.cs index 47f84fd280..1a04800b50 100644 --- a/Microsoft.Azure.Cosmos/src/FeedRange/FeedRanges/FeedRangePartitionKey.cs +++ b/Microsoft.Azure.Cosmos/src/FeedRange/FeedRanges/FeedRangePartitionKey.cs @@ -4,11 +4,13 @@ namespace Microsoft.Azure.Cosmos { + using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Routing; using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Documents; /// /// FeedRange that represents an exact Partition Key value. @@ -31,8 +33,13 @@ public FeedRangePartitionKey(PartitionKey partitionKey) return Task.FromResult( new List> { - Documents.Routing.Range.GetPointRange( - this.PartitionKey.InternalKey.GetEffectivePartitionKeyString(partitionKeyDefinition)) + Documents.Routing.PartitionKeyInternal.GetEffectivePartitionKeyRange( + partitionKeyDefinition, + new Documents.Routing.Range( + min: this.PartitionKey.InternalKey, + max: this.PartitionKey.InternalKey, + isMinInclusive: true, + isMaxInclusive: true)) }); } diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPartitionProvider.cs b/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPartitionProvider.cs index 6e7b0b4a8f..c62a65b27a 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPartitionProvider.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPartitionProvider.cs @@ -147,11 +147,7 @@ internal PartitionedQueryExecutionInfo ConvertPartitionedQueryExecutionInfo( List> effectiveRanges = new List>(queryInfoInternal.QueryRanges.Count); foreach (Documents.Routing.Range internalRange in queryInfoInternal.QueryRanges) { - effectiveRanges.Add(new Documents.Routing.Range( - internalRange.Min.GetEffectivePartitionKeyString(partitionKeyDefinition, false), - internalRange.Max.GetEffectivePartitionKeyString(partitionKeyDefinition, false), - internalRange.IsMinInclusive, - internalRange.IsMaxInclusive)); + effectiveRanges.Add(PartitionKeyInternal.GetEffectivePartitionKeyRange(partitionKeyDefinition, internalRange)); } effectiveRanges.Sort(Documents.Routing.Range.MinComparer.Instance); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionRoutingHelperTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionRoutingHelperTest.cs index 35ffaa65bb..792621f54a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionRoutingHelperTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionRoutingHelperTest.cs @@ -19,6 +19,8 @@ namespace Microsoft.Azure.Cosmos.Tests.Routing using Microsoft.Azure.Cosmos.Query.Core.QueryPlan; using System.Collections.ObjectModel; using System.Net; + using Microsoft.Azure.Cosmos.Query.Core; + using Microsoft.Azure.Cosmos.Query.Core.Monads; /// /// Tests for class. @@ -246,6 +248,521 @@ public async Task TestGetPartitionRoutingInfo() } } } + [TestMethod] + public async Task TestRoutingForPrefixedPartitionKeyQueriesAsync() + { + PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition() + { + Kind = PartitionKind.MultiHash, + Paths = new Collection() { "/path1", "/path2", "/path3" }, + Version = PartitionKeyDefinitionVersion.V2 + }; + + // Case 1: Query with 1 prefix path, split at 1st level. Should route to only one partition. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F856" //Seattle + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F856", //Seattle + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"Microsoft\"", + epkRanges => + { + return epkRanges.Count == 1; //Routes to only one pkRange. + }, + partitionKeyRanges); + } + + //Case 2: Query with 1 prefix path value which is split at 2nd level. Should route to two partitions. + //Case 3: Query with 2 prefix path values which is split at 2nd level. Should route to one partition. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963" //[Seattle, Redmond] + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963",//[Seattle, Redmond] + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\" or (r.path1 = \"seattle\" and r.path2 = \"bellevue\")", + epkRanges => + { + return epkRanges.Count == 2; //Since data is split at pkey [seattle, redmond], it should route to two pkRange. + }, + partitionKeyRanges); + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\" and r.path2 =\"redmond\"", + epkRanges => + { + return epkRanges.Count == 1; //Since data is split at pkey [seattle, redmond], this query should route to one pkRange + }, + partitionKeyRanges); + } + + //Case 4: Query with 2 prefix path values split at the 3rd level. Should route to 2 paritions. + //Case 5: Query with 1 prefix path value split at 3rd level. Should route to 2 partitions. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8"//[seattle, redmond, 5.12312419050912359123] + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8",//[seattle, redmond, 5.12312419050912359123] + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\" and r.path2 =\"redmond\"", + epkRanges => + { + return epkRanges.Count == 2; //Since data is split at pkey [seattle, redmond, 5.12312419050912359123], it should route to two pkRange. + }, + partitionKeyRanges); + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\" and r.path2 =\"redmond\" and r.path3=5.12312419050912359123", + epkRanges => + { + return epkRanges.Count == 1; + }, + partitionKeyRanges); + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\"", + epkRanges => + { + return epkRanges.Count == 2; + }, + partitionKeyRanges); + } + + //Case 6: Query with 1 prefix path value split succesively at 2nd and then at the 3rd level. Should route to 3 partitions. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963"//[seattle, redmond] + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963",//[seattle, redmond] + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8"//[seattle, redmond, 5.12312419050912359123] + }, + new PartitionKeyRange() + { + Id = "2", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8",//[seattle, redmond, 5.12312419050912359123] + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\"", + epkRanges => + { + return epkRanges.Count == 3; + }, + partitionKeyRanges); + } + + //Case 7: Query with 1 prefix path value split succesively at 1st, 2nd and then at the 3rd level. Should route to 3 partitions. + //Case 8: Query with 2 prefix path value split succesively at 1st, 2nd and then at the 3rd level. Should route to 2 partitions. + //Case 9: Query with fully specfied pkey, split succesively at 1st, 2nd and then at the 3rd level. Should route to 1 partitions. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F856" //[seattle] + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F856", //[seattle] + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963" //[seattle, redmond] + }, + new PartitionKeyRange() + { + Id = "2", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963", //[seattle, redmond] + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8"//[seattle, redmond, 5.12312419050912359123] + }, + new PartitionKeyRange() + { + Id = "3", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8",//[seattle, redmond, 5.12312419050912359123] + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\"", + epkRanges => + { + return epkRanges.Count == 3; //Routes tp three pkRanges + }, + partitionKeyRanges); + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\" and r.path2 = \"redmond\"", + epkRanges => + { + return epkRanges.Count == 2; //Routes to two pkRanges. + }, + partitionKeyRanges); + await PrefixPartitionKeyTestRunnerAsync( + partitionKeyDefinition, + $"SELECT VALUE r.id from r where r.path1 = \"seattle\" and r.path2 = \"redmond\" and r.path3 = \"98052\"", + epkRanges => + { + Assert.AreEqual(epkRanges.Count, 1); + + return epkRanges.Count == 1; //Routes to only one pkRanges. + }, + partitionKeyRanges); + } + } + + [TestMethod] + public async Task TestRoutingForPrefixedPartitionKeyChangeFeedAsync() + { + PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition() + { + Kind = PartitionKind.MultiHash, + Paths = new Collection() { "/path1", "/path2", "/path3" }, + Version = PartitionKeyDefinitionVersion.V2 + }; + + // Case 1: ChangeFeed with 1 prefix path, split at 1st level. Should route to only one partition. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F856" //Seattle + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F856", //Seattle + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("Microsoft").Build(), + epkRanges => + { + return epkRanges.Count == 1; //Routes to only one pkRange. + }, + partitionKeyRanges); + } + + //Case 2: ChangeFeed with 1 prefix path value which is split at 2nd level. Should route to two partitions. + //Case 3: ChangeFeed with 2 prefix path values which is split at 2nd level. Should route to one partition. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963" //[Seattle, Redmond] + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963", //[Seattle, Redmond] + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Build(), + epkRanges => + { + return epkRanges.Count == 2; //Since data is split at pkey [seattle, redmond], it should route to two pkRange. + }, + partitionKeyRanges); + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Add("redmond").Build(), + epkRanges => + { + return epkRanges.Count == 1; //Since data is split at pkey [seattle, redmond], this query should route to one pkRange + }, + partitionKeyRanges); + } + + //Case 4: ChangeFeed with 2 prefix path values split at the 3rd level. Should route to 2 paritions. + //Case 5: ChangeFeed with 1 prefix path value split at 3rd level. Should route to 2 partitions. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8"//[seattle, redmond, 5.12312419050912359123] + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8", //[seattle, redmond, 5.12312419050912359123] + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Add("redmond").Build(), + epkRanges => + { + return epkRanges.Count == 2; //Since data is split at pkey [seattle, redmond, 5.12312419050912359123], it should route to two pkRange. + }, + partitionKeyRanges); + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Add("redmond").Add(5.12312419050912359123).Build(), + epkRanges => + { + return epkRanges.Count == 1; + }, + partitionKeyRanges); + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Build(), + epkRanges => + { + return epkRanges.Count == 2; + }, + partitionKeyRanges); + } + + //Case 6: ChangeFeed with 1 prefix path value split succesively at 2nd and then at the 3rd level. Should route to 3 partitions. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963" //[seattle, redmond] + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963", //[seattle, redmond] + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8" //[seattle, redmond, 5.12312419050912359123] + }, + new PartitionKeyRange() + { + Id = "2", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8", //[seattle, redmond, 5.12312419050912359123] + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Build(), + epkRanges => + { + return epkRanges.Count == 3; + }, + partitionKeyRanges); + } + + //Case 7: ChangeFeed with 1 prefix path value split succesively at 1st, 2nd and then at the 3rd level. Should route to 3 partitions. + //Case 8: ChangeFeed with 2 prefix path value split succesively at 1st, 2nd and then at the 3rd level. Should route to 2 partitions. + //Case 9: ChangeFeed with fully specfied pkey, split succesively at 1st, 2nd and then at the 3rd level. Should route to 1 partitions. + { + List partitionKeyRanges = new List() + { + new PartitionKeyRange() + { + Id = "0", + MinInclusive = string.Empty, + MaxExclusive = "07E4D14180A45153F00B44907886F856" //[seattle] + }, + new PartitionKeyRange() + { + Id = "1", + MinInclusive = "07E4D14180A45153F00B44907886F856", //[seattle] + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963" //[seattle, redmond] + }, + new PartitionKeyRange() + { + Id = "2", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A5963", //[seattle, redmond] + MaxExclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8"//[seattle, redmond, 5.12312419050912359123] + }, + new PartitionKeyRange() + { + Id = "3", + MinInclusive = "07E4D14180A45153F00B44907886F85622E342F38A486A088463DFF7838A59630EF2E2D82460884AF0F6440BE4F726A8", //[seattle, redmond, 5.12312419050912359123] + MaxExclusive = "FF" + }, + }; + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Build(), + epkRanges => + { + return epkRanges.Count == 3; //Routes tp three pkRanges + }, + partitionKeyRanges); + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Add("redmond").Build(), + epkRanges => + { + return epkRanges.Count == 2; //Routes to two pkRanges. + }, + partitionKeyRanges); + await PrefixPartitionKeyChangeFeedTestRunnerAsync( + partitionKeyDefinition, + new PartitionKeyBuilder().Add("seattle").Add("redmond").Add("98052").Build(), + epkRanges => + { + Assert.AreEqual(epkRanges.Count, 1); + + return epkRanges.Count == 1; //Routes to only one pkRanges. + }, + partitionKeyRanges); + } + } + + private static async Task PrefixPartitionKeyTestRunnerAsync( + PartitionKeyDefinition partitionKeyDefinition, + string queryText, + Predicate> validator, + List partitionKeyRanges) + { + IDictionary DefaultQueryengineConfiguration = new Dictionary() + { + {"maxSqlQueryInputLength", 30720}, + {"maxJoinsPerSqlQuery", 5}, + {"maxLogicalAndPerSqlQuery", 200}, + {"maxLogicalOrPerSqlQuery", 200}, + {"maxUdfRefPerSqlQuery", 2}, + {"maxInExpressionItemsCount", 8000}, + {"queryMaxInMemorySortDocumentCount", 500}, + {"maxQueryRequestTimeoutFraction", 0.90}, + {"sqlAllowNonFiniteNumbers", false}, + {"sqlAllowAggregateFunctions", true}, + {"sqlAllowSubQuery", true}, + {"sqlAllowScalarSubQuery", false}, + {"allowNewKeywords", true}, + {"sqlAllowLike", true}, + {"sqlAllowGroupByClause", false}, + {"queryEnableMongoNativeRegex", true}, + {"maxSpatialQueryCells", 12}, + {"spatialMaxGeometryPointCount", 256}, + {"sqlDisableOptimizationFlags", 0}, + {"sqlEnableParameterExpansionCheck", true} + }; + + QueryPartitionProvider QueryPartitionProvider = new QueryPartitionProvider(DefaultQueryengineConfiguration); + + IEnumerable> rangesAndServiceIdentity = partitionKeyRanges + .Select(range => Tuple.Create(range, (ServiceIdentity)null)); + string collectionRid = string.Empty; + CollectionRoutingMap routingMap = + CollectionRoutingMap.TryCreateCompleteRoutingMap( + rangesAndServiceIdentity, + collectionRid); + + RoutingMapProvider routingMapProvider = new RoutingMapProvider(routingMap); + TryCatch tryGetQueryPlan = + QueryPartitionProvider.TryGetPartitionedQueryExecutionInfo( + querySpecJsonString: JsonConvert.SerializeObject(new SqlQuerySpec(queryText)), + partitionKeyDefinition: partitionKeyDefinition, + requireFormattableOrderByQuery: true, + isContinuationExpected: true, + allowNonValueAggregateQuery: false, + hasLogicalPartitionKey: false, + allowDCount: true, + useSystemPrefix: false, + geospatialType: Cosmos.GeospatialType.Geography); + + HashSet resolvedPKRanges = new HashSet(); + foreach (Range range in tryGetQueryPlan.Result.QueryRanges) + { + resolvedPKRanges.UnionWith(await routingMapProvider.TryGetOverlappingRangesAsync( + collectionRid, + range, + NoOpTrace.Singleton)); + } + + Assert.IsTrue(validator(resolvedPKRanges)); + } + + private static async Task PrefixPartitionKeyChangeFeedTestRunnerAsync( + PartitionKeyDefinition partitionKeyDefinition, + Cosmos.PartitionKey partitionKey, + Predicate> validator, + List partitionKeyRanges) + { + IEnumerable> rangesAndServiceIdentity = partitionKeyRanges + .Select(range => Tuple.Create(range, (ServiceIdentity)null)); + string collectionRid = string.Empty; + CollectionRoutingMap routingMap = + CollectionRoutingMap.TryCreateCompleteRoutingMap( + rangesAndServiceIdentity, + collectionRid); + + RoutingMapProvider routingMapProvider = new RoutingMapProvider(routingMap); + + HashSet resolvedPKRanges = new HashSet(); + FeedRangePartitionKey feedRangePartitionKey = new FeedRangePartitionKey(partitionKey); + List> effectiveRanges = await feedRangePartitionKey.GetEffectiveRangesAsync(routingMapProvider, null, partitionKeyDefinition, null); + foreach (Range range in effectiveRanges) + { + resolvedPKRanges.UnionWith(await routingMapProvider.TryGetOverlappingRangesAsync( + collectionRid, + range, + NoOpTrace.Singleton)); + + } + + Assert.IsTrue(validator(resolvedPKRanges)); + } [TestMethod] public void TestCrossPartitionAggregateQueries() From 8137c7758eac966e75df7ea3aa8109c7170c5dba Mon Sep 17 00:00:00 2001 From: Maya-Painter <130110800+Maya-Painter@users.noreply.github.com> Date: Tue, 13 Jun 2023 18:26:55 -0700 Subject: [PATCH 139/240] [Query] Fixes empty property name parsing exception (#3907) * inital commit * cleanup * test cleanup * PR comments * PR comment --- .../CosmosQueryExecutionContextFactory.cs | 4 +-- .../Core/QueryClient/CosmosQueryClient.cs | 2 +- .../Query/v3Query/CosmosQueryClientCore.cs | 2 +- .../src/SqlObjects/SqlPropertyName.cs | 7 +---- .../CosmosGatewayTimeoutTests.cs | 2 +- .../Query/BypassQueryParsingTests.cs | 28 ++++++++++++++++--- .../Query/MockCosmosQueryClient.cs | 2 +- ...misticDirectExecutionQueryBaselineTests.cs | 2 +- 8 files changed, 32 insertions(+), 17 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs index 8f35ff821a..47aa1c4490 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs @@ -188,7 +188,7 @@ private static async Task> TryCreateCoreContextAsy // If the query would go to gateway, but we have a partition key, // then try seeing if we can execute as a passthrough using client side only logic. // This is to short circuit the need to go to the gateway to get the query plan. - if (cosmosQueryContext.QueryClient.ByPassQueryParsing() + if (cosmosQueryContext.QueryClient.BypassQueryParsing() && inputParameters.PartitionKey.HasValue) { bool parsed; @@ -586,7 +586,7 @@ private static async Task GetPartitionedQueryExec CancellationToken cancellationToken) { PartitionedQueryExecutionInfo partitionedQueryExecutionInfo; - if (cosmosQueryContext.QueryClient.ByPassQueryParsing()) + if (cosmosQueryContext.QueryClient.BypassQueryParsing()) { // For non-Windows platforms(like Linux and OSX) in .NET Core SDK, we cannot use ServiceInterop, so need to bypass in that case. // We are also now bypassing this for 32 bit host process running even on Windows as there are many 32 bit apps that will not work without this diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs b/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs index ac093cadce..3fa4cb90e7 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs @@ -98,7 +98,7 @@ public abstract Task ExecuteQueryPlanRequestAsync bool forceRefresh, ITrace trace); - public abstract bool ByPassQueryParsing(); + public abstract bool BypassQueryParsing(); public abstract Task ForceRefreshCollectionCacheAsync( string collectionLink, diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs index daf47e151c..1c5a9ef21f 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs @@ -285,7 +285,7 @@ public override async Task> GetTargetPartitionKeyRangesA } } - public override bool ByPassQueryParsing() + public override bool BypassQueryParsing() { return CustomTypeExtensions.ByPassQueryParsing(); } diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/SqlPropertyName.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/SqlPropertyName.cs index 059e799d99..e7f859ff18 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/SqlPropertyName.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/SqlPropertyName.cs @@ -68,12 +68,7 @@ sealed class SqlPropertyName : SqlObject private SqlPropertyName(string value) { - if (string.IsNullOrWhiteSpace(value)) - { - throw new ArgumentException($"{nameof(value)} must not be null, empty, or whitespace."); - } - - this.Value = value; + this.Value = value ?? throw new ArgumentNullException(nameof(value)); } public string Value { get; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosGatewayTimeoutTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosGatewayTimeoutTests.cs index 8b4728c122..f50319f65f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosGatewayTimeoutTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosGatewayTimeoutTests.cs @@ -163,7 +163,7 @@ public DisableServiceInterop( { } - public override bool ByPassQueryParsing() + public override bool BypassQueryParsing() { return true; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/BypassQueryParsingTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/BypassQueryParsingTests.cs index a0c821c72d..4db276f4ce 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/BypassQueryParsingTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/BypassQueryParsingTests.cs @@ -1,5 +1,6 @@ namespace Microsoft.Azure.Cosmos.EmulatorTests.Query { + using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -14,9 +15,28 @@ public sealed class BypassQueryParsingTests : QueryTestsBase public async Task TestBypassQueryParsingWithNonePartitionKey() { int documentCount = 400; - QueryRequestOptions feedOptions = new QueryRequestOptions { PartitionKey = PartitionKey.None }; + string query = "SELECT VALUE r.numberField FROM r"; - IReadOnlyList expected = Enumerable.Range(0, documentCount).ToList(); + IReadOnlyList expectedOutput = Enumerable.Range(0, documentCount).Select(i => i.ToString()).ToList(); + + await this.ValidateQueryBypassWithNonePartitionKey(documentCount, query, expectedOutput); + } + + [TestMethod] + [TestCategory("Query")] + public async Task TestBypassQueryParsingWithNonePartitionKeyEmptyPropertyName() + { + int documentCount = 400; + + string query = @"SELECT VALUE { """" : r.numberField } FROM r"; + IReadOnlyList expectedOutput = Enumerable.Range(0, documentCount).Select(i => String.Format("{{\"\":{0}}}", i)).ToList(); + + await this.ValidateQueryBypassWithNonePartitionKey(documentCount, query, expectedOutput); + } + + private async Task ValidateQueryBypassWithNonePartitionKey(int documentCount, string query, IReadOnlyList expectedOutput) + { + QueryRequestOptions feedOptions = new QueryRequestOptions { PartitionKey = PartitionKey.None }; async Task ImplementationAsync(Container container, IReadOnlyList documents) { @@ -34,9 +54,9 @@ async Task ImplementationAsync(Container container, IReadOnlyList cosmosQueryClientCore); List items = await RunQueryAsync(containerWithBypassParsing, query, feedOptions); - int[] actual = items.Cast().Select(x => (int)Number64.ToLong(x.Value)).ToArray(); + string[] actualOutput = items.Select(x => x.ToString()).ToArray(); - Assert.IsTrue(expected.SequenceEqual(actual)); + Assert.IsTrue(expectedOutput.SequenceEqual(actualOutput)); } IReadOnlyList documents = CreateDocuments(documentCount); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/MockCosmosQueryClient.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/MockCosmosQueryClient.cs index 11d51403b1..6dd861ec88 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/MockCosmosQueryClient.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/MockCosmosQueryClient.cs @@ -35,7 +35,7 @@ public MockCosmosQueryClient( public int QueryPlanCalls { get; private set; } - public override bool ByPassQueryParsing() + public override bool BypassQueryParsing() { return this.forceQueryPlanGatewayElseServiceInterop; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs index fad65e80db..1e7d4e1e40 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs @@ -927,7 +927,7 @@ internal class TestCosmosQueryClient : CosmosQueryClient { public override Action OnExecuteScalarQueryCallback => throw new NotImplementedException(); - public override bool ByPassQueryParsing() + public override bool BypassQueryParsing() { return false; } From b200491ec789e81443990069cf2164a3e5e47ef8 Mon Sep 17 00:00:00 2001 From: akotalwar <94020786+akotalwar@users.noreply.github.com> Date: Wed, 14 Jun 2023 11:54:09 -0700 Subject: [PATCH 140/240] [Preview] Query: Refactors EnableOptimisticDirectExecution to true by default in Preview mode (#3909) * Setting EnableODE to true by default in Preview Mode. * Added seperate if block for default value * Updated property * Removed unused Usings * Updated contracts * Updated test * Updated directive indentation --- .../src/RequestOptions/QueryRequestOptions.cs | 10 +++- .../TraceWriterBaselineTests.TraceData.xml | 10 ++-- .../Contracts/DotNetPreviewSDKAPI.json | 53 ++++++++++++++++++- .../Contracts/DotNetSDKAPI.json | 38 ------------- ...misticDirectExecutionQueryBaselineTests.cs | 11 ++-- 5 files changed, 74 insertions(+), 48 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs index 4cca513013..60cea5b48c 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs @@ -49,7 +49,15 @@ public class QueryRequestOptions : RequestOptions /// /// Direct (optimistic) execution offers improved performance for several kinds of queries such as a single partition streaming query. /// - public bool EnableOptimisticDirectExecution { get; set; } +#if PREVIEW + public +#else + internal +#endif + bool EnableOptimisticDirectExecution { get; set; } +#if PREVIEW + = true; +#endif /// /// Gets or sets the maximum number of items that can be buffered client side during diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml index 885699cb43..d1dee72a0f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml @@ -341,10 +341,10 @@ "RetryAfterInMs": "9000", "BELatencyInMs": "4.2", "ReplicaHealthStatuses": [ - "http://storephysicaladdress-1p.com:Connected", - "http://storephysicaladdress-2s.com:Unknown", - "http://storephysicaladdress-3s.com:Unhealthy", - "http://storephysicaladdress-4s.com:Unknown" + "http://storephysicaladdress-1p.com:Connected", + "http://storephysicaladdress-2s.com:Unknown", + "http://storephysicaladdress-3s.com:Unhealthy", + "http://storephysicaladdress-4s.com:Unknown" ], "transportRequestTimeline": { "requestTimeline": [ @@ -535,7 +535,7 @@ "RequestCharge": 0, "RetryAfterInMs": null, "BELatencyInMs": null, - "ReplicaHealthStatuses":[], + "ReplicaHealthStatuses": [], "transportRequestTimeline": null, "TransportException": null } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index de49584da2..8546a93b2f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -496,8 +496,59 @@ }, "NestedTypes": {} }, - "Microsoft.Azure.Cosmos.RequestOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Microsoft.Azure.Cosmos.QueryRequestOptions;Microsoft.Azure.Cosmos.RequestOptions;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, + "Members": { + "Boolean EnableOptimisticDirectExecution": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Boolean EnableOptimisticDirectExecution;CanRead:True;CanWrite:True;Boolean get_EnableOptimisticDirectExecution();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_EnableOptimisticDirectExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean get_EnableOptimisticDirectExecution()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Boolean get_EnableOptimisticDirectExecution();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_EnableOptimisticDirectExecution(Boolean)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_EnableOptimisticDirectExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, + "Microsoft.Azure.Cosmos.RequestOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": { + "Microsoft.Azure.Cosmos.QueryRequestOptions;Microsoft.Azure.Cosmos.RequestOptions;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "Boolean EnableOptimisticDirectExecution": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Boolean EnableOptimisticDirectExecution;CanRead:True;CanWrite:True;Boolean get_EnableOptimisticDirectExecution();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_EnableOptimisticDirectExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean get_EnableOptimisticDirectExecution()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Boolean get_EnableOptimisticDirectExecution();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_EnableOptimisticDirectExecution(Boolean)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_EnableOptimisticDirectExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + } + }, "Members": { "System.Nullable`1[Microsoft.Azure.Cosmos.PriorityLevel] get_PriorityLevel()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 8a3bc7b462..e5b95a7ed9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -6279,18 +6279,6 @@ "Microsoft.Azure.Cosmos.QueryRequestOptions;Microsoft.Azure.Cosmos.RequestOptions;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { - "Boolean EnableOptimisticDirectExecution": { - "Type": "Property", - "Attributes": [], - "MethodInfo": "Boolean EnableOptimisticDirectExecution;CanRead:True;CanWrite:True;Boolean get_EnableOptimisticDirectExecution();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_EnableOptimisticDirectExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Boolean get_EnableOptimisticDirectExecution()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "Boolean get_EnableOptimisticDirectExecution();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, "Microsoft.Azure.Cosmos.DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions": { "Type": "Property", "Attributes": [], @@ -6445,13 +6433,6 @@ ], "MethodInfo": "Void set_EnableLowPrecisionOrderBy(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, - "Void set_EnableOptimisticDirectExecution(Boolean)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "Void set_EnableOptimisticDirectExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, "Void set_EnableScanInQuery(System.Nullable`1[System.Boolean])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ @@ -7320,18 +7301,6 @@ "Microsoft.Azure.Cosmos.QueryRequestOptions;Microsoft.Azure.Cosmos.RequestOptions;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { - "Boolean EnableOptimisticDirectExecution": { - "Type": "Property", - "Attributes": [], - "MethodInfo": "Boolean EnableOptimisticDirectExecution;CanRead:True;CanWrite:True;Boolean get_EnableOptimisticDirectExecution();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_EnableOptimisticDirectExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Boolean get_EnableOptimisticDirectExecution()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "Boolean get_EnableOptimisticDirectExecution();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, "Microsoft.Azure.Cosmos.DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions": { "Type": "Property", "Attributes": [], @@ -7486,13 +7455,6 @@ ], "MethodInfo": "Void set_EnableLowPrecisionOrderBy(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, - "Void set_EnableOptimisticDirectExecution(Boolean)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "Void set_EnableOptimisticDirectExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, "Void set_EnableScanInQuery(System.Nullable`1[System.Boolean])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs index 1e7d4e1e40..81c765adc4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs @@ -144,10 +144,15 @@ public void NegativeOptimisticDirectExecutionOutput() [TestMethod] public async Task TestDefaultQueryRequestOptionsSettings() { - QueryRequestOptions requestOptions = new QueryRequestOptions(); - - Assert.AreEqual(requestOptions.EnableOptimisticDirectExecution, false); + bool odeExpectedValue = +#if PREVIEW + true; +#else + false; +#endif + + Assert.AreEqual(odeExpectedValue, requestOptions.EnableOptimisticDirectExecution); } // test checks that the pipeline can take a query to the backend and returns its associated document(s). From 8684535d233ea6a7147d857fae9a6c69e467c827 Mon Sep 17 00:00:00 2001 From: Rinat Minibaev <132935507+rinatmini@users.noreply.github.com> Date: Thu, 15 Jun 2023 07:53:21 -0700 Subject: [PATCH 141/240] Documentations: Adds links to PatchItems docs (#3910) * Added links to PatchItems docs * Undo changes from internal file --- Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs index 106262a13f..2978d741bf 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs @@ -751,6 +751,7 @@ public abstract Task> ReadManyItemsAsync( /// ]]> /// /// + /// Supported partial document update modes public abstract Task> PatchItemAsync( string id, PartitionKey partitionKey, @@ -783,6 +784,7 @@ public abstract Task> PatchItemAsync( /// /// /// + /// Supported partial document update modes public abstract Task PatchItemStreamAsync( string id, PartitionKey partitionKey, From 69702227d91de27a8257683d4984a750057406c5 Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Fri, 16 Jun 2023 17:29:42 -0700 Subject: [PATCH 142/240] [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. --- Directory.Build.props | 2 +- Microsoft.Azure.Cosmos/src/Regions.cs | 5 +++++ .../ClientCreateAndInitializeTest.cs | 10 +++++++--- .../Contracts/DotNetSDKAPI.json | 5 +++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index c8b86ceed2..6e15dbd850 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,7 +3,7 @@ 3.34.0 3.34.0 preview - 3.31.1 + 3.31.2 2.0.2 2.0.2 preview diff --git a/Microsoft.Azure.Cosmos/src/Regions.cs b/Microsoft.Azure.Cosmos/src/Regions.cs index 666ec0435b..33c258aaf7 100644 --- a/Microsoft.Azure.Cosmos/src/Regions.cs +++ b/Microsoft.Azure.Cosmos/src/Regions.cs @@ -359,5 +359,10 @@ public static class Regions /// Name of the Azure Italy North region in the Azure Cosmos DB service. /// public const string ItalyNorth = "Italy North"; + + /// + /// Name of the Azure Israel Central region in the Azure Cosmos DB service. + /// + public const string IsraelCentral = "Israel Central"; } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs index e977a8b459..e07fe85a7e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs @@ -205,7 +205,7 @@ public async Task InitializeContainersAsync_WhenThrowsException_ShouldDisposeCos 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 @@ public async Task CreateAndInitializeAsync_WithValidDatabaseAndContainer_ShouldO { HttpClientFactory = () => new HttpClient(httpClientHandlerHelper), ConnectionMode = ConnectionMode.Direct, + MaxRequestsPerTcpConnection = maxRequestsPerConnection, }; // Act. @@ -275,8 +276,11 @@ public async Task CreateAndInitializeAsync_WithValidDatabaseAndContainer_ShouldO .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(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index e5b95a7ed9..7fde376d49 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -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": [], From b97906191c98f80e0dc9cba85545dc163b7df9dc Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Mon, 19 Jun 2023 14:34:32 -0400 Subject: [PATCH 143/240] SDK 3.35.0 : Adds version bump and changelog (#3920) * release PR * updated changelog.md * more changelog updates --- Directory.Build.props | 4 +- .../contracts/API_3.35.0-preview.txt | 1563 +++++++++++++++++ .../contracts/API_3.35.0.txt | 1502 ++++++++++++++++ changelog.md | 27 + 4 files changed, 3094 insertions(+), 2 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.35.0-preview.txt create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.35.0.txt diff --git a/Directory.Build.props b/Directory.Build.props index 6e15dbd850..eb4940bf4b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 3.34.0 - 3.34.0 + 3.35.0 + 3.35.0 preview 3.31.2 2.0.2 diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.35.0-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.35.0-preview.txt new file mode 100644 index 0000000000..6c989053fd --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.35.0-preview.txt @@ -0,0 +1,1563 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public sealed class ComputedProperty + { + public ComputedProperty(); + public string Name { get; set; } + public string Query { get; set; } + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public Collection ComputedProperties { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool IsDistributedTracingEnabled { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable BypassIntegratedCache { get; set; } + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public enum PriorityLevel + { + High = 1, + Low = 2, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public bool EnableOptimisticDirectExecution { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public Nullable PriorityLevel { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ComputedPropertiesDefinition + { + public T Attach(); + public ComputedPropertiesDefinition WithComputedProperty(string name, string query); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public ComputedPropertiesDefinition WithComputedProperties(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithDistributedTracing(bool isEnabled=true); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.35.0.txt b/Microsoft.Azure.Cosmos/contracts/API_3.35.0.txt new file mode 100644 index 0000000000..c0dc3e280f --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.35.0.txt @@ -0,0 +1,1502 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/changelog.md b/changelog.md index b1b3139828..01e3703c89 100644 --- a/changelog.md +++ b/changelog.md @@ -12,6 +12,33 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [3.35.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.0-preview) - 2023-06-19 + +### Added +- [3836](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3836) Integrated cache: Adds BypassIntegratedCache to DedicatedGatewayRequestOptions +- [3909](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3909) Query: Adds EnableOptimisticDirectExecution in QueryRequestOptions enabled by default + +### [3.35.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.0) - 2023-06-19 + +#### Fixed +- [3864](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3864) NugetPackage: Removes ThirdPartyNotice.txt from content and contentFiles folders +- [3866](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3866) CosmosClient: Fixes missing Trace when converting HTTP Timeout to 503 +- [3879](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3879) Subpartitioning: Fixes handling of split physical partitions +- [3907](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3907) Query: Fixes empty property name parsing exception + +#### Added +- [3860](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3860) Documentation: Adds see also link to Container.CreateTransactionalBatch +- [3852](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3852) Query: Adds type-markers with count and length for large arrays +- [3838](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3838) Benchmarking: Adds use of ARM Templates for benchmarking +- [3877](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3877) Regions: Adds Malaysia South, Isreal Central, and Italy North +- [3877](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3877) Distributed Tracing: Enables Distributing Tracing for Operations +- [3874](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3874) Client Encryption: Adds Microsoft.Azure.Cosmos compatibility to version 3.34.0 +- [3891](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3891) Documentation: Adds additional remarks to CosmosClient +- [3902](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3902) ConnectionPolicy: Refactors Code to Reduce Default Request Timeout to 6 Seconds +- [3910](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3910) Documentations: Adds links to PatchItems docs +- [3918](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3918) Regions: Adds Israel Central +- [3918](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3918) CosmosClient: Fixes SynchronizationLockException when disposing client with requests in-flight. + ### [3.34.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.34.0-preview) - 2023-05-17 ### Added From b1d313452cdb4318b9239fe9b39668667f6cf034 Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Mon, 19 Jun 2023 15:35:53 -0400 Subject: [PATCH 144/240] [Internal] Last minute fix to changelog for 3.35.0 (#3921) * release PR * updated changelog.md * more changelog updates * changelog fix * Update changelog.md * Update changelog.md --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 01e3703c89..bd5c29c32c 100644 --- a/changelog.md +++ b/changelog.md @@ -31,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [3852](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3852) Query: Adds type-markers with count and length for large arrays - [3838](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3838) Benchmarking: Adds use of ARM Templates for benchmarking - [3877](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3877) Regions: Adds Malaysia South, Isreal Central, and Italy North -- [3877](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3877) Distributed Tracing: Enables Distributing Tracing for Operations +- [3887](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3887) Distributed Tracing: Setting DisplayName for an operation level activity as `` - [3874](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3874) Client Encryption: Adds Microsoft.Azure.Cosmos compatibility to version 3.34.0 - [3891](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3891) Documentation: Adds additional remarks to CosmosClient - [3902](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3902) ConnectionPolicy: Refactors Code to Reduce Default Request Timeout to 6 Seconds From 92319a0528b5e257da71dd6ec0c8bc50375d05c3 Mon Sep 17 00:00:00 2001 From: Maya-Painter <130110800+Maya-Painter@users.noreply.github.com> Date: Thu, 22 Jun 2023 15:19:55 -0700 Subject: [PATCH 145/240] [Internal] Query: Adds new header SupportedSerializationFormats (#3911) * Binary Serilaization Response test * Added new header SupportedSerializationFormats * Modified existing use of CosmosSerializationFormatOptions * Modified tests and removed unused code * Addressed comments * Added more negative cases * Revert changes * Added spaces * Addressed comments * Addressed comments * Removed SupportedSerializationFormats from Headers file * Removed unused JsonSerilazationFormats option * Addressed comments * Addressed comments * Addressed comments * Addressed comments * Added new enum TransportSerializationFormat * Added new enum TransportSerializationFormat * Addressed comments * Removed unused parameter * Addressed comments * updating API * remove tests * Text fixes * fix typo * remove TransportSerializationFormat header * text reverts * revert * test update * PR comments * remove test owner headers HeadersValidationTests.cs * PR comments - remove unsupported tests and scope client --------- Co-authored-by: Heet Co-authored-by: neildsh <35383880+neildsh@users.noreply.github.com> Co-authored-by: Matias Quaranta --- .../Pagination/ChangeFeedPaginationOptions.cs | 5 +- Microsoft.Azure.Cosmos/src/FeedOptions.cs | 37 ++-- .../Headers/CosmosMessageHeadersInternal.cs | 6 + .../src/Headers/StoreRequestHeaders.cs | 6 + .../NetworkAttachedDocumentContainer.cs | 5 - .../src/Pagination/PaginationOptions.cs | 4 - .../Pagination/QueryPaginationOptions.cs | 3 +- .../DocumentQueryExecutionContextBase.cs | 30 +-- .../Query/v3Query/CosmosQueryClientCore.cs | 24 +-- .../Pagination/ReadFeedPaginationOptions.cs | 3 +- .../ReadFeedCrossFeedRangeAsyncEnumerator.cs | 3 +- .../src/RequestOptions/QueryRequestOptions.cs | 11 +- .../CosmosSerializationFormatOptions.cs | 2 +- .../HeadersValidationTests.cs | 192 +++++++++++++++++- .../SupportedSerializationFormatsTest.cs | 102 ++++++++++ .../ContentSerializationPerformanceTests.cs | 4 - .../BinaryEncodingOverTheWireTests.cs | 42 ++-- .../OrderByQueryResultTests.cs | 6 +- .../Query/FeedOptionTests.cs | 25 +++ 19 files changed, 383 insertions(+), 127 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SupportedSerializationFormatsTest.cs diff --git a/Microsoft.Azure.Cosmos/src/ChangeFeed/Pagination/ChangeFeedPaginationOptions.cs b/Microsoft.Azure.Cosmos/src/ChangeFeed/Pagination/ChangeFeedPaginationOptions.cs index 8579c6de42..85a2895774 100644 --- a/Microsoft.Azure.Cosmos/src/ChangeFeed/Pagination/ChangeFeedPaginationOptions.cs +++ b/Microsoft.Azure.Cosmos/src/ChangeFeed/Pagination/ChangeFeedPaginationOptions.cs @@ -33,16 +33,19 @@ public ChangeFeedPaginationOptions( JsonSerializationFormat? jsonSerializationFormat = null, Dictionary additionalHeaders = null, ChangeFeedQuerySpec changeFeedQuerySpec = null) - : base(pageSizeHint, jsonSerializationFormat, additionalHeaders) + : base(pageSizeHint, additionalHeaders) { this.Mode = mode ?? throw new ArgumentNullException(nameof(mode)); this.ChangeFeedQuerySpec = changeFeedQuerySpec; + this.JsonSerializationFormat = jsonSerializationFormat; } public ChangeFeedMode Mode { get; } public ChangeFeedQuerySpec ChangeFeedQuerySpec { get; } + public JsonSerializationFormat? JsonSerializationFormat { get; } + protected override ImmutableHashSet BannedAdditionalHeaders => BannedHeaders; } } diff --git a/Microsoft.Azure.Cosmos/src/FeedOptions.cs b/Microsoft.Azure.Cosmos/src/FeedOptions.cs index 6f4cae7e0d..4d6ce52f41 100644 --- a/Microsoft.Azure.Cosmos/src/FeedOptions.cs +++ b/Microsoft.Azure.Cosmos/src/FeedOptions.cs @@ -24,7 +24,7 @@ public FeedOptions() { } - internal FeedOptions(FeedOptions options) + public FeedOptions(FeedOptions options) { if (options == null) { @@ -65,10 +65,10 @@ internal FeedOptions(FeedOptions options) this.EndId = options.EndId; this.StartEpk = options.StartEpk; this.EndEpk = options.EndEpk; - this.ContentSerializationFormat = options.ContentSerializationFormat; this.EnableGroupBy = options.EnableGroupBy; this.MergeStaticId = options.MergeStaticId; this.Properties = options.Properties; + this.SupportedSerializationFormats = options.SupportedSerializationFormats; } /// @@ -282,7 +282,7 @@ internal FeedOptions(FeedOptions options) /// /// Option is true if query tracing is enabled; otherwise, false. /// - internal bool? EmitVerboseTracesInQuery { get; set; } + public bool? EmitVerboseTracesInQuery { get; set; } /// /// Gets or sets the schema rid which could be used to filter the document feed response @@ -292,7 +292,7 @@ internal FeedOptions(FeedOptions options) /// By default, it is null which means no filtering will be applied. /// Otherwise, it must be a valid resource id of Schema resource. /// - internal string FilterBySchemaResourceId { get; set; } + public string FilterBySchemaResourceId { get; set; } /// /// Gets or sets the request option for document query requests in the Azure Cosmos DB service. @@ -359,65 +359,62 @@ internal FeedOptions(FeedOptions options) /// /// Gets or sets the flag that tells the backend to forces the query to perform a scan (at a request level). /// - internal bool ForceQueryScan { get; set; } + public bool ForceQueryScan { get; set; } /// /// Gets or sets the EnumerationDirection /// To be used along with Read feed operation /// - internal EnumerationDirection? EnumerationDirection { get; set; } + public EnumerationDirection? EnumerationDirection { get; set; } /// /// Gets or sets the ReadFeedKeyType /// To be used along with Read feed operation /// - internal ReadFeedKeyType? ReadFeedKeyType { get; set; } + public ReadFeedKeyType? ReadFeedKeyType { get; set; } /// /// Gets or sets the StartId /// To be used along with Read feed operation /// - internal string StartId { get; set; } + public string StartId { get; set; } /// /// Gets or sets the EndId /// To be used along with Read feed operation /// - internal string EndId { get; set; } + public string EndId { get; set; } /// /// Gets or sets the StartEpk /// To be used along with Read feed operation /// - internal string StartEpk { get; set; } + public string StartEpk { get; set; } /// /// Gets or sets the EndEpk /// To be used along with Read feed operation /// - internal string EndEpk { get; set; } + public string EndEpk { get; set; } /// - /// Gets or sets the ContentSerializationFormat for the feed (query/read feed) operation in the Azure Cosmos DB service. + /// Gets or sets the SupportedSerializationFormats for the query response from the service. /// - /// - /// If the document is stored in a different serialization format then the one requested, then there will be a rewrite over the wire, but the source document will be untouched. - /// - internal ContentSerializationFormat? ContentSerializationFormat { get; set; } + public SupportedSerializationFormats? SupportedSerializationFormats { get; set; } - internal bool EnableGroupBy { get; set; } + public bool EnableGroupBy { get; set; } /// /// Gets or sets the MergeStaticId. /// To be used along with Read feed operation when Static Column merge is desired. /// - internal string MergeStaticId { get; set; } + public string MergeStaticId { get; set; } /// /// Gets or sets the custom serialization options for query /// - internal CosmosSerializationFormatOptions CosmosSerializationFormatOptions { get; set; } + public CosmosSerializationFormatOptions CosmosSerializationFormatOptions { get; set; } - internal IDictionary Properties { get; set; } + public IDictionary Properties { get; set; } } } diff --git a/Microsoft.Azure.Cosmos/src/Headers/CosmosMessageHeadersInternal.cs b/Microsoft.Azure.Cosmos/src/Headers/CosmosMessageHeadersInternal.cs index f12595d832..1cbf9b54e6 100644 --- a/Microsoft.Azure.Cosmos/src/Headers/CosmosMessageHeadersInternal.cs +++ b/Microsoft.Azure.Cosmos/src/Headers/CosmosMessageHeadersInternal.cs @@ -159,6 +159,12 @@ public virtual string ContentSerializationFormat set => this.SetProperty(HttpConstants.HttpHeaders.ContentSerializationFormat, value); } + public virtual string SupportedSerializationFormats + { + get => this.GetValueOrDefault(HttpConstants.HttpHeaders.SupportedSerializationFormats); + set => this.SetProperty(HttpConstants.HttpHeaders.SupportedSerializationFormats, value); + } + public virtual string ReadFeedKeyType { get => this.GetValueOrDefault(HttpConstants.HttpHeaders.ReadFeedKeyType); diff --git a/Microsoft.Azure.Cosmos/src/Headers/StoreRequestHeaders.cs b/Microsoft.Azure.Cosmos/src/Headers/StoreRequestHeaders.cs index 68086095f7..b907363685 100644 --- a/Microsoft.Azure.Cosmos/src/Headers/StoreRequestHeaders.cs +++ b/Microsoft.Azure.Cosmos/src/Headers/StoreRequestHeaders.cs @@ -76,6 +76,12 @@ public override string ContentSerializationFormat set => this.requestNameValueCollection.ContentSerializationFormat = value; } + public override string SupportedSerializationFormats + { + get => this.requestNameValueCollection.SupportedSerializationFormats; + set => this.requestNameValueCollection.SupportedSerializationFormats = value; + } + public override string ReadFeedKeyType { get => this.requestNameValueCollection.ReadFeedKeyType; diff --git a/Microsoft.Azure.Cosmos/src/Pagination/NetworkAttachedDocumentContainer.cs b/Microsoft.Azure.Cosmos/src/Pagination/NetworkAttachedDocumentContainer.cs index 7d8683c3fe..8420cb0540 100644 --- a/Microsoft.Azure.Cosmos/src/Pagination/NetworkAttachedDocumentContainer.cs +++ b/Microsoft.Azure.Cosmos/src/Pagination/NetworkAttachedDocumentContainer.cs @@ -192,11 +192,6 @@ public async Task> MonadicReadFeedAsync( request.Headers.ContinuationToken = ((CosmosString)readFeedContinuationState.ContinuationToken).Value; } - if (readFeedPaginationOptions.JsonSerializationFormat.HasValue) - { - request.Headers.ContentSerializationFormat = readFeedPaginationOptions.JsonSerializationFormat.Value.ToContentSerializationFormatString(); - } - foreach (KeyValuePair kvp in readFeedPaginationOptions.AdditionalHeaders) { request.Headers[kvp.Key] = kvp.Value; diff --git a/Microsoft.Azure.Cosmos/src/Pagination/PaginationOptions.cs b/Microsoft.Azure.Cosmos/src/Pagination/PaginationOptions.cs index 5558f2be24..593d761ec0 100644 --- a/Microsoft.Azure.Cosmos/src/Pagination/PaginationOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Pagination/PaginationOptions.cs @@ -23,11 +23,9 @@ internal abstract class PaginationOptions protected PaginationOptions( int? pageSizeLimit = null, - JsonSerializationFormat? jsonSerializationFormat = null, Dictionary additionalHeaders = null) { this.PageSizeLimit = pageSizeLimit; - this.JsonSerializationFormat = jsonSerializationFormat; this.AdditionalHeaders = additionalHeaders != null ? additionalHeaders.ToImmutableDictionary() : EmptyDictionary; foreach (string key in this.AdditionalHeaders.Keys) @@ -41,8 +39,6 @@ protected PaginationOptions( public int? PageSizeLimit { get; } - public JsonSerializationFormat? JsonSerializationFormat { get; } - public ImmutableDictionary AdditionalHeaders { get; } protected abstract ImmutableHashSet BannedAdditionalHeaders { get; } diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Pagination/QueryPaginationOptions.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Pagination/QueryPaginationOptions.cs index c285135feb..c985158828 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Pagination/QueryPaginationOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/Pagination/QueryPaginationOptions.cs @@ -32,9 +32,8 @@ internal sealed class QueryPaginationOptions : PaginationOptions public QueryPaginationOptions( int? pageSizeHint = null, bool optimisticDirectExecute = false, - JsonSerializationFormat? jsonSerializationFormat = null, Dictionary additionalHeaders = null) - : base(pageSizeHint, jsonSerializationFormat, additionalHeaders) + : base(pageSizeHint, additionalHeaders) { this.OptimisticDirectExecute = optimisticDirectExecute; } diff --git a/Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextBase.cs b/Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextBase.cs index ec4e6d9185..053c951f6c 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextBase.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v2Query/DocumentQueryExecutionContextBase.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos.Query { using System; using System.Collections.Generic; + using System.ComponentModel; using System.Globalization; using System.IO; using System.Linq; @@ -31,6 +32,8 @@ namespace Microsoft.Azure.Cosmos.Query internal abstract class DocumentQueryExecutionContextBase : IDocumentQueryExecutionContext { + public static readonly string DefaultSupportedSerializationFormats = string.Join(",", SupportedSerializationFormats.JsonText, SupportedSerializationFormats.CosmosBinary); + public readonly struct InitParams { public IDocumentQueryClient Client { get; } @@ -326,14 +329,7 @@ await this.Client.EnsureValidOverwriteAsync( requestHeaders.Set(HttpConstants.HttpHeaders.MergeStaticId, this.feedOptions.MergeStaticId); } - if (this.feedOptions.CosmosSerializationFormatOptions != null) - { - requestHeaders[HttpConstants.HttpHeaders.ContentSerializationFormat] = this.feedOptions.CosmosSerializationFormatOptions.ContentSerializationFormat; - } - else if (this.feedOptions.ContentSerializationFormat.HasValue) - { - requestHeaders[HttpConstants.HttpHeaders.ContentSerializationFormat] = this.feedOptions.ContentSerializationFormat.Value.ToString(); - } + requestHeaders[HttpConstants.HttpHeaders.SupportedSerializationFormats] = this.feedOptions.SupportedSerializationFormats?.ToString() ?? DefaultSupportedSerializationFormats; return requestHeaders; } @@ -688,23 +684,7 @@ private DocumentFeedResponse GetFeedResponse( { content = memoryStream.ToArray(); } - - IJsonNavigator jsonNavigator = null; - - // Use the users custom navigator first. If it returns null back try the - // internal navigator. - if (this.feedOptions.CosmosSerializationFormatOptions != null) - { - jsonNavigator = this.feedOptions.CosmosSerializationFormatOptions.CreateCustomNavigatorCallback(content); - if (jsonNavigator == null) - { - throw new InvalidOperationException("The CosmosSerializationOptions did not return a JSON navigator."); - } - } - else - { - jsonNavigator = JsonNavigator.Create(content); - } + IJsonNavigator jsonNavigator = JsonNavigator.Create(content); string resourceName = this.GetRootNodeName(documentServiceRequest.ResourceType); diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs index 1c5a9ef21f..cce1a5268a 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs @@ -155,7 +155,6 @@ public override async Task> ExecuteItemQueryAsync( cancellationToken: cancellationToken); return CosmosQueryClientCore.GetCosmosElementResponse( - requestOptions, resourceType, message, trace); @@ -297,7 +296,6 @@ public override void ClearSessionTokenCache(string collectionFullName) } private static TryCatch GetCosmosElementResponse( - QueryRequestOptions requestOptions, ResourceType resourceType, ResponseMessage cosmosResponseMessage, ITrace trace) @@ -336,8 +334,7 @@ private static TryCatch GetCosmosElementResponse( long responseLengthBytes = memoryStream.Length; CosmosArray documents = CosmosQueryClientCore.ParseElementsFromRestStream( memoryStream, - resourceType, - requestOptions.CosmosSerializationFormatOptions); + resourceType); QueryState queryState; if (cosmosResponseMessage.Headers.ContinuationToken != null) @@ -444,12 +441,10 @@ private Task GetRoutingMapProviderAsync() /// /// The memory stream response for the query REST response Azure Cosmos /// The resource type - /// The custom serialization options. This allows custom serialization types like BSON, JSON, or other formats /// An array of CosmosElements parsed from the response body. public static CosmosArray ParseElementsFromRestStream( Stream stream, - ResourceType resourceType, - CosmosSerializationFormatOptions cosmosSerializationOptions) + ResourceType resourceType) { if (!(stream is MemoryStream memoryStream)) { @@ -478,20 +473,7 @@ public static CosmosArray ParseElementsFromRestStream( // You want to create a CosmosElement for each document in "Documents". ReadOnlyMemory content = memoryStream.TryGetBuffer(out ArraySegment buffer) ? buffer : (ReadOnlyMemory)memoryStream.ToArray(); - IJsonNavigator jsonNavigator; - if (cosmosSerializationOptions != null) - { - // Use the users custom navigator - jsonNavigator = cosmosSerializationOptions.CreateCustomNavigatorCallback(content); - if (jsonNavigator == null) - { - throw new InvalidOperationException("The CosmosSerializationOptions did not return a JSON navigator."); - } - } - else - { - jsonNavigator = JsonNavigator.Create(content); - } + IJsonNavigator jsonNavigator = JsonNavigator.Create(content); string resourceName = resourceType switch { diff --git a/Microsoft.Azure.Cosmos/src/ReadFeed/Pagination/ReadFeedPaginationOptions.cs b/Microsoft.Azure.Cosmos/src/ReadFeed/Pagination/ReadFeedPaginationOptions.cs index 757473c02c..ad219dfd99 100644 --- a/Microsoft.Azure.Cosmos/src/ReadFeed/Pagination/ReadFeedPaginationOptions.cs +++ b/Microsoft.Azure.Cosmos/src/ReadFeed/Pagination/ReadFeedPaginationOptions.cs @@ -27,9 +27,8 @@ internal sealed class ReadFeedPaginationOptions : PaginationOptions public ReadFeedPaginationOptions( PaginationDirection? paginationDirection = null, int? pageSizeHint = null, - JsonSerializationFormat? jsonSerializationFormat = null, Dictionary additionalHeaders = null) - : base(pageSizeHint, jsonSerializationFormat, additionalHeaders) + : base(pageSizeHint, additionalHeaders) { this.Direction = paginationDirection; } diff --git a/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedCrossFeedRangeAsyncEnumerator.cs b/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedCrossFeedRangeAsyncEnumerator.cs index 2f611840f7..95fb8b23cf 100644 --- a/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedCrossFeedRangeAsyncEnumerator.cs +++ b/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedCrossFeedRangeAsyncEnumerator.cs @@ -45,8 +45,7 @@ public async ValueTask MoveNextAsync() CosmosArray documents = CosmosQueryClientCore.ParseElementsFromRestStream( innerReadFeedPage.Page.Content, - Documents.ResourceType.Document, - cosmosSerializationOptions: null); + Documents.ResourceType.Document); ReadFeedPage page = new ReadFeedPage( documents, innerReadFeedPage.Page.RequestCharge, diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs index 60cea5b48c..f723107ede 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs @@ -5,8 +5,10 @@ namespace Microsoft.Azure.Cosmos { using System; + using System.ComponentModel; using System.Text; using Microsoft.Azure.Cosmos.CosmosElements; + using Microsoft.Azure.Cosmos.Query; using Microsoft.Azure.Cosmos.Query.Core; using Microsoft.Azure.Cosmos.Query.Core.Pipeline; using Microsoft.Azure.Documents; @@ -188,6 +190,8 @@ public ConsistencyLevel? ConsistencyLevel internal CosmosSerializationFormatOptions CosmosSerializationFormatOptions { get; set; } + internal SupportedSerializationFormats? SupportedSerializationFormats { get; set; } + internal ExecutionEnvironment? ExecutionEnvironment { get; set; } internal bool? ReturnResultsInDeterministicOrder { get; set; } @@ -240,11 +244,8 @@ internal override void PopulateRequestOptions(RequestMessage request) { request.Headers.Add(HttpConstants.HttpHeaders.ResponseContinuationTokenLimitInKB, this.ResponseContinuationTokenLimitInKb.ToString()); } - - if (this.CosmosSerializationFormatOptions != null) - { - request.Headers.CosmosMessageHeaders.ContentSerializationFormat = this.CosmosSerializationFormatOptions.ContentSerializationFormat; - } + + request.Headers.CosmosMessageHeaders.SupportedSerializationFormats = this.SupportedSerializationFormats?.ToString() ?? DocumentQueryExecutionContextBase.DefaultSupportedSerializationFormats; if (this.StartId != null) { diff --git a/Microsoft.Azure.Cosmos/src/Serializer/CosmosSerializationFormatOptions.cs b/Microsoft.Azure.Cosmos/src/Serializer/CosmosSerializationFormatOptions.cs index 81ab5fd1e4..8ebefa502a 100644 --- a/Microsoft.Azure.Cosmos/src/Serializer/CosmosSerializationFormatOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Serializer/CosmosSerializationFormatOptions.cs @@ -52,4 +52,4 @@ public CosmosSerializationFormatOptions( this.CreateCustomWriterCallback = createCustomWriter; } } -} +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/HeadersValidationTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/HeadersValidationTests.cs index b24ce5f03b..f9ca3f8ecc 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/HeadersValidationTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/HeadersValidationTests.cs @@ -13,6 +13,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Net; using System.Text; using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Json; using Microsoft.Azure.Cosmos.Query.Core; using Microsoft.Azure.Cosmos.Routing; using Microsoft.Azure.Cosmos.Tracing; @@ -164,17 +165,17 @@ private void ValidatePageSize(DocumentClient client) public async Task ValidateConsistencyLevelGateway() { DocumentClient client = TestCommon.CreateClient(true); - await ValidateCosistencyLevel(client); + await ValidateConsistencyLevel(client); } [TestMethod] public async Task ValidateConsistencyLevelRntbd() { DocumentClient client = TestCommon.CreateClient(false, Protocol.Tcp); - await ValidateCosistencyLevel(client); + await ValidateConsistencyLevel(client); } - private async Task ValidateCosistencyLevel(DocumentClient client) + private async Task ValidateConsistencyLevel(DocumentClient client) { DocumentCollection collection = TestCommon.CreateOrGetDocumentCollection(client); @@ -203,17 +204,16 @@ private async Task ValidateCosistencyLevel(DocumentClient client) } [TestMethod] - [Owner("brchon")] public void ValidateJsonSerializationFormatGateway() { - var client = TestCommon.CreateClient(true); + using var client = TestCommon.CreateClient(true); ValidateJsonSerializationFormat(client); } [TestMethod] public void ValidateJsonSerializationFormatRntbd() { - var client = TestCommon.CreateClient(false, Protocol.Tcp); + using var client = TestCommon.CreateClient(false, Protocol.Tcp); ValidateJsonSerializationFormat(client); } @@ -306,6 +306,184 @@ private void ValidateJsonSerializationFormatQuery(DocumentClient client, Documen Assert.IsTrue(response.ResponseBody.ReadByte() == HeadersValidationTests.BinarySerializationByteMarkValue); } + [TestMethod] + public void ValidateSupportedSerializationFormatsGateway() + { + using var client = TestCommon.CreateClient(true); + this.ValidateSupportedSerializationFormats(client, true); + } + + [TestMethod] + public void ValidateSupportedSerializationFormatsRntbd() + { + using var client = TestCommon.CreateClient(false, Protocol.Tcp); + this.ValidateSupportedSerializationFormats(client, false); + } + + private void ValidateSupportedSerializationFormats(DocumentClient client, bool isHttps) + { + DocumentCollection collection = TestCommon.CreateOrGetDocumentCollection(client); + this.ValidateSupportedSerializationFormatsReadFeed(client, collection, isHttps); + + List sqlQueryList = new List() + { + new SqlQuerySpec("SELECT * FROM c"), + new SqlQuerySpec("SELECT c.id FROM c ORDER BY c.partitionKey"), + new SqlQuerySpec("SELECT c.name FROM c GROUP BY c.name") + }; + + foreach(SqlQuerySpec sqlQuery in sqlQueryList) + { + this.ValidateSupportedSerializationFormatsQuery(client, collection, sqlQuery, isHttps); + } + } + + private void SupportedSerializationFormatsNegativeCases( + DocumentClient client, + DocumentCollection collection, + string invalidValue, + bool isHttps, + SqlQuerySpec sqlQuerySpec = null) + { + INameValueCollection headers = new RequestNameValueCollection(); + headers.Add(HttpConstants.HttpHeaders.SupportedSerializationFormats, invalidValue); + + try + { + DocumentServiceResponse response; + if (sqlQuerySpec != null) + { + response = this.QueryRequest(client, collection.ResourceId, sqlQuerySpec, headers); + } + else + { + headers.Set(HttpConstants.HttpHeaders.PartitionKey, "[\"test\"]"); + response = this.ReadDocumentFeedRequestSinglePartition(client, collection.ResourceId, headers); + } + + if (isHttps) + { + // Invalid value is treated as default JsonText if HTTPS + Assert.IsTrue(response.StatusCode == HttpStatusCode.OK, "Invalid status code"); + Assert.IsTrue(this.CheckSerializationFormat(response) == JsonSerializationFormat.Text); + } + else + { + Assert.Fail("Should throw an exception"); + } + } + catch (Exception ex) + { + DocumentClientException innerException = ex.InnerException as DocumentClientException; + Assert.IsTrue(innerException.StatusCode == HttpStatusCode.BadRequest, "invalid status code"); + } + } + + private void SupportedSerializationFormatsPositiveCases( + DocumentClient client, + DocumentCollection collection, + SupportedSerializationFormats expectedFormat, + string supportedSerializationFormats, + SqlQuerySpec sqlQuerySpec = null) + { + INameValueCollection headers = new RequestNameValueCollection(); + + headers.Add(HttpConstants.HttpHeaders.SupportedSerializationFormats, supportedSerializationFormats); + DocumentServiceResponse response; + if(sqlQuerySpec!=null) + { + response = this.QueryRequest(client, collection.ResourceId, sqlQuerySpec, headers); + } + else + { + Assert.IsTrue(expectedFormat == SupportedSerializationFormats.JsonText, "ReadFeed response should be in Text"); + response = this.ReadDocumentFeedRequestAsync(client, collection.ResourceId, headers).Result; + } + + Assert.IsTrue(response.StatusCode == HttpStatusCode.OK, "Invalid status code"); + + if(expectedFormat == SupportedSerializationFormats.JsonText) + { + Assert.IsTrue(this.CheckSerializationFormat(response) == JsonSerializationFormat.Text); + } + else + { + Assert.IsTrue(this.CheckSerializationFormat(response) == JsonSerializationFormat.Binary); + } + } + + private void ValidateSupportedSerializationFormatsReadFeed(DocumentClient client, DocumentCollection collection, bool isHttps) + { + // Value not supported + this.SupportedSerializationFormatsNegativeCases(client, collection, "Invalid value", isHttps); + + // Supported values + this.SupportedSerializationFormatsPositiveCases(client, collection, expectedFormat: SupportedSerializationFormats.JsonText, supportedSerializationFormats: "JSONText"); + this.SupportedSerializationFormatsPositiveCases(client, collection, expectedFormat: SupportedSerializationFormats.JsonText, supportedSerializationFormats: "COSMOSbinary"); + this.SupportedSerializationFormatsPositiveCases(client, collection, expectedFormat: SupportedSerializationFormats.JsonText, supportedSerializationFormats: "JsonText, CosmosBinary"); + } + + private void ValidateSupportedSerializationFormatsQuery(DocumentClient client, DocumentCollection collection, SqlQuerySpec sqlQuerySpec, bool isHttps) + { + // Values not supported + this.SupportedSerializationFormatsNegativeCases(client, collection, "Invalid value", isHttps, sqlQuerySpec: sqlQuerySpec); + this.SupportedSerializationFormatsNegativeCases(client, collection, ", ,", isHttps, sqlQuerySpec: sqlQuerySpec); + this.SupportedSerializationFormatsNegativeCases(client, collection, ",,", isHttps, sqlQuerySpec: sqlQuerySpec); + this.SupportedSerializationFormatsNegativeCases(client, collection, "JsonText CosmosBinary", isHttps, sqlQuerySpec: sqlQuerySpec); + this.SupportedSerializationFormatsNegativeCases(client, collection, ",JsonText|CosmosBinary", isHttps, sqlQuerySpec: sqlQuerySpec); + this.SupportedSerializationFormatsNegativeCases(client, collection, "Json Text", isHttps, sqlQuerySpec: sqlQuerySpec); + this.SupportedSerializationFormatsNegativeCases(client, collection, "Json,Text", isHttps, sqlQuerySpec: sqlQuerySpec); + this.SupportedSerializationFormatsNegativeCases(client, collection, "JsonText, ", isHttps, sqlQuerySpec: sqlQuerySpec); + + // Supported values + this.SupportedSerializationFormatsPositiveCases(client, collection, + expectedFormat: SupportedSerializationFormats.JsonText, + supportedSerializationFormats: "jsontext", + sqlQuerySpec: sqlQuerySpec); + /* + this.SupportedSerializationFormatsPositiveCases(client, collection, + expectedFormat: SupportedSerializationFormats.CosmosBinary, + supportedSerializationFormats: "COSMOSBINARY", + sqlQuerySpec: sqlQuerySpec); + */ + this.SupportedSerializationFormatsPositiveCases(client, collection, + expectedFormat: SupportedSerializationFormats.JsonText, + supportedSerializationFormats: "JsonText, CosmosBinary", + sqlQuerySpec: sqlQuerySpec); + /* + this.SupportedSerializationFormatsPositiveCases(client, collection, + expectedFormat: SupportedSerializationFormats.CosmosBinary, + supportedSerializationFormats: "CosmosBinary, HybridRow", + sqlQuerySpec: sqlQuerySpec); + */ + this.SupportedSerializationFormatsPositiveCases(client, collection, + expectedFormat: SupportedSerializationFormats.JsonText, + supportedSerializationFormats: "JsonText, CosmosBinary, HybridRow", + sqlQuerySpec: sqlQuerySpec); + /* + this.SupportedSerializationFormatsPositiveCases(client, collection, + expectedFormat: SupportedSerializationFormats.CosmosBinary, + supportedSerializationFormats: "JsonText, CosmosBinary, HybridRow", + sqlQuerySpec: sqlQuerySpec); + */ + this.SupportedSerializationFormatsPositiveCases(client, collection, + expectedFormat: SupportedSerializationFormats.JsonText, + supportedSerializationFormats: "JsonText, CosmosBinary, HybridRow", + sqlQuerySpec: sqlQuerySpec); + } + + private JsonSerializationFormat CheckSerializationFormat(DocumentServiceResponse response) + { + if(response.ResponseBody.ReadByte() < BinarySerializationByteMarkValue) + { + return JsonSerializationFormat.Text; + } + else + { + return JsonSerializationFormat.Binary; + } + } + [TestMethod] public void ValidateIndexingDirectiveGateway() { @@ -1105,4 +1283,4 @@ internal override string BaseUserAgent } } } -} \ No newline at end of file +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SupportedSerializationFormatsTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SupportedSerializationFormatsTest.cs new file mode 100644 index 0000000000..f4cdab6e51 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SupportedSerializationFormatsTest.cs @@ -0,0 +1,102 @@ +namespace Microsoft.Azure.Cosmos.Query +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.CosmosElements; + using Microsoft.Azure.Cosmos.EmulatorTests.Query; + using Microsoft.Azure.Cosmos.SDK.EmulatorTests.QueryOracle; + using Microsoft.Azure.Documents; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + [TestClass] + [TestCategory("Query")] + public sealed class SupportedSerializationFormatsTest : QueryTestsBase + { + [TestMethod] + public async Task TestSupportedSerializationFormats() + { + string[] inputDocuments = new[] + { + @"{""id"":""0"",""name"":""document_0""}", + @"{""id"":""1"",""name"":""document_1""}", + @"{""id"":""2"",""name"":""document_2""}", + @"{""id"":""3"",""name"":""document_3""}", + @"{""id"":""4"",""name"":""document_4""}", + @"{""id"":""5"",""name"":""document_5""}", + @"{""id"":""6"",""name"":""document_6""}", + @"{""id"":""7"",""name"":""document_7""}", + @"{""id"":""8"",""name"":""document_8""}", + @"{""id"":""9"",""name"":""document_9""}", + }; + + await this.CreateIngestQueryDeleteAsync( + ConnectionModes.Direct, + CollectionTypes.SinglePartition | CollectionTypes.MultiPartition, + inputDocuments, + this.TestSupportedSerializationFormatsHelper, + "/id"); + } + + private async Task TestSupportedSerializationFormatsHelper(Container container, IReadOnlyList documents) + { + string[] expectedResults = new[] { "document_0", "document_1", "document_2", "document_3", "document_4", "document_5", "document_6", "document_7", "document_8", "document_9" }; + string query = string.Format("SELECT c.name FROM c"); + List queryRequestOptionsList = new List() + { + new QueryRequestOptions() + { + SupportedSerializationFormats = SupportedSerializationFormats.CosmosBinary | SupportedSerializationFormats.HybridRow + }, + new QueryRequestOptions() + { + SupportedSerializationFormats = SupportedSerializationFormats.JsonText | SupportedSerializationFormats.CosmosBinary + }, + new QueryRequestOptions() + { + SupportedSerializationFormats = SupportedSerializationFormats.JsonText | SupportedSerializationFormats.HybridRow + }, + new QueryRequestOptions() + { + SupportedSerializationFormats = SupportedSerializationFormats.JsonText | SupportedSerializationFormats.CosmosBinary | SupportedSerializationFormats.HybridRow + }, + new QueryRequestOptions() + { + SupportedSerializationFormats = SupportedSerializationFormats.JsonText + }, + new QueryRequestOptions() + { + SupportedSerializationFormats = SupportedSerializationFormats.CosmosBinary + }, + new QueryRequestOptions() + { + SupportedSerializationFormats = SupportedSerializationFormats.CosmosBinary + }, + new QueryRequestOptions() + { + SupportedSerializationFormats = SupportedSerializationFormats.JsonText + } + }; + + foreach (QueryRequestOptions requestOptions in queryRequestOptionsList) + { + List results = new List(); + using (FeedIterator feedIterator = container.GetItemQueryIterator(new QueryDefinition(query), requestOptions: requestOptions)) + { + while (feedIterator.HasMoreResults) + { + FeedResponse response = await feedIterator.ReadNextAsync(); + results.AddRange(response.ToList()); + } + } + + string[] actualResults = results + .Select(doc => ((CosmosString)(doc as CosmosObject)["name"]).Value.ToString()) + .ToArray(); + + CollectionAssert.AreEquivalent(expectedResults, actualResults); + } + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/ContentSerializationPerformanceTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/ContentSerializationPerformanceTests.cs index c18ac5e420..759e63b345 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/ContentSerializationPerformanceTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/ContentSerializationPerformanceTests.cs @@ -83,10 +83,6 @@ private async Task RunQueryAsync(Container container) { MaxConcurrency = this.MaxConcurrency, MaxItemCount = this.MaxItemCount, - CosmosSerializationFormatOptions = new CosmosSerializationFormatOptions( - contentSerializationFormat: this.contentSerialization, - createCustomNavigator: (content) => JsonNavigator.Create(content), - createCustomWriter: () => JsonWriter.Create(this.contentSerialization == "JsonText" ? JsonSerializationFormat.Text : JsonSerializationFormat.Binary)) }; if (this.useStronglyTypedIterator) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BinaryEncodingOverTheWireTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BinaryEncodingOverTheWireTests.cs index b55e837844..7d570d65d0 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BinaryEncodingOverTheWireTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BinaryEncodingOverTheWireTests.cs @@ -28,15 +28,11 @@ public class BinaryEncodingOverTheWireTests ConfigurationManager.AppSettings["GatewayEndpoint"], ConfigurationManager.AppSettings["MasterKey"], new CosmosClientOptions() { ConnectionMode = ConnectionMode.Gateway }); - private static readonly CosmosClient DirectHttpsClient = new CosmosClient( - ConfigurationManager.AppSettings["GatewayEndpoint"], - ConfigurationManager.AppSettings["MasterKey"], - new CosmosClientOptions() { ConnectionMode = ConnectionMode.Direct, ConnectionProtocol = Documents.Client.Protocol.Https }); private static readonly CosmosClient RntbdClient = new CosmosClient( ConfigurationManager.AppSettings["GatewayEndpoint"], ConfigurationManager.AppSettings["MasterKey"], new CosmosClientOptions() { ConnectionMode = ConnectionMode.Direct, ConnectionProtocol = Documents.Client.Protocol.Tcp }); - private static readonly CosmosClient[] Clients = new CosmosClient[] { GatewayClient, DirectHttpsClient, RntbdClient }; + private static readonly CosmosClient[] Clients = new CosmosClient[] { GatewayClient, RntbdClient }; private static readonly CosmosClient Client = RntbdClient; private static readonly AsyncLazy Database = new AsyncLazy(async () => { @@ -124,7 +120,7 @@ public void CheckThatAllTestsAreRunning() [TestMethod] public async Task CombinedScriptsDataTest() { - await this.TestCurratedDocs("CombinedScriptsData.json"); + await this.TestCuratedDocs("CombinedScriptsData.json"); } // For now we are skipping this test since the documents are too large to ingest and we get a rate size too large (HTTP 413). @@ -139,96 +135,96 @@ public async Task CountriesTest() [TestMethod] public async Task DevTestCollTest() { - await this.TestCurratedDocs("devtestcoll.json"); + await this.TestCuratedDocs("devtestcoll.json"); } [TestMethod] public async Task LastFMTest() { - await this.TestCurratedDocs("lastfm"); + await this.TestCuratedDocs("lastfm"); } [TestMethod] public async Task LogDataTest() { - await this.TestCurratedDocs("LogData.json"); + await this.TestCuratedDocs("LogData.json"); } [TestMethod] public async Task MillionSong1KDocumentsTest() { - await this.TestCurratedDocs("MillionSong1KDocuments.json"); + await this.TestCuratedDocs("MillionSong1KDocuments.json"); } [TestMethod] public async Task MsnCollectionTest() { - await this.TestCurratedDocs("MsnCollection.json"); + await this.TestCuratedDocs("MsnCollection.json"); } [TestMethod] public async Task NutritionDataTest() { - await this.TestCurratedDocs("NutritionData"); + await this.TestCuratedDocs("NutritionData"); } [TestMethod] public async Task RunsCollectionTest() { - await this.TestCurratedDocs("runsCollection"); + await this.TestCuratedDocs("runsCollection"); } [TestMethod] public async Task StatesCommitteesTest() { - await this.TestCurratedDocs("states_committees.json"); + await this.TestCuratedDocs("states_committees.json"); } [TestMethod] public async Task StatesLegislatorsTest() { - await this.TestCurratedDocs("states_legislators"); + await this.TestCuratedDocs("states_legislators"); } [TestMethod] public async Task Store01Test() { - await this.TestCurratedDocs("store01C.json"); + await this.TestCuratedDocs("store01C.json"); } [TestMethod] public async Task TicinoErrorBucketsTest() { - await this.TestCurratedDocs("TicinoErrorBuckets"); + await this.TestCuratedDocs("TicinoErrorBuckets"); } [TestMethod] public async Task TwitterDataTest() { - await this.TestCurratedDocs("twitter_data"); + await this.TestCuratedDocs("twitter_data"); } [TestMethod] public async Task Ups1Test() { - await this.TestCurratedDocs("ups1"); + await this.TestCuratedDocs("ups1"); } [TestMethod] public async Task XpertEventsTest() { - await this.TestCurratedDocs("XpertEvents"); + await this.TestCuratedDocs("XpertEvents"); } - private async Task TestCurratedDocs(string path) + private async Task TestCuratedDocs(string path) { IEnumerable documents = BinaryEncodingOverTheWireTests.GetDocumentsFromCurratedDoc(path); await BinaryEncodingOverTheWireTests.CreateIngestQueryDelete( documents.Select(x => x.ToString()), - this.TestCurratedDocs); + this.TestCuratedDocs); } - private async Task TestCurratedDocs(CosmosClient cosmosClient, Container container, List items) + private async Task TestCuratedDocs(CosmosClient cosmosClient, Container container, List items) { HashSet inputItems = new HashSet(items, JsonTokenEqualityComparer.Value); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/ContinuationTokens/OrderByQueryResultTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/ContinuationTokens/OrderByQueryResultTests.cs index 86093aa296..7207f897be 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/ContinuationTokens/OrderByQueryResultTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/ContinuationTokens/OrderByQueryResultTests.cs @@ -31,11 +31,7 @@ public void TestOrderByUndefined() CosmosArray documents = CosmosQueryClientCore.ParseElementsFromRestStream( memoryStream, - Documents.ResourceType.Document, - new CosmosSerializationFormatOptions( - "JsonText", - (content) => JsonNavigator.Create(content), - () => JsonWriter.Create(JsonSerializationFormat.Text))); + Documents.ResourceType.Document); List orderByQueryResults = documents.Select(x => new OrderByQueryResult(x)).ToList(); Assert.AreEqual(14, orderByQueryResults.Count); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/FeedOptionTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/FeedOptionTests.cs index 54c965cce8..703636ca81 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/FeedOptionTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/FeedOptionTests.cs @@ -50,6 +50,31 @@ public void TestCopyConstructor() _ = new FeedOptions(fo); } + [TestMethod] + public async Task TestSupportedSerializationFormats() + { + FeedOptions feedOptions = new FeedOptions(); + Mock client = new Mock(MockBehavior.Strict); + client.Setup(x => x.GetDefaultConsistencyLevelAsync()).Returns(Task.FromResult(ConsistencyLevel.BoundedStaleness)); + client.Setup(x => x.GetDesiredConsistencyLevelAsync()).Returns(Task.FromResult(ConsistencyLevel.BoundedStaleness)); + Expression> randomFunc = x => x * 2; + + TestQueryExecutionContext testQueryExecutionContext = new TestQueryExecutionContext( + client.Object, + ResourceType.Document, + typeof(TestQueryExecutionContext), + randomFunc, + feedOptions, + string.Empty, + true, Guid.NewGuid()); + INameValueCollection headers = await testQueryExecutionContext.CreateCommonHeadersAsync(feedOptions); + Assert.AreEqual("JsonText,CosmosBinary", headers[HttpConstants.HttpHeaders.SupportedSerializationFormats]); + + feedOptions.SupportedSerializationFormats = SupportedSerializationFormats.CosmosBinary | SupportedSerializationFormats.HybridRow; + headers = await testQueryExecutionContext.CreateCommonHeadersAsync(feedOptions); + Assert.AreEqual("CosmosBinary, HybridRow", headers[HttpConstants.HttpHeaders.SupportedSerializationFormats]); + } + internal class TestQueryExecutionContext : DocumentQueryExecutionContextBase { public TestQueryExecutionContext( From 3f4b7bd04dd9b456ceca20f269ed585599d9b4ca Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Mon, 26 Jun 2023 07:47:45 -0700 Subject: [PATCH 146/240] Code changes to optimize the rntbd open connection logic to open connections in parallel. (#3939) --- .../src/Routing/GatewayAddressCache.cs | 143 +++++++++++++----- .../GatewayAddressCacheTests.cs | 87 ++++++++++- 2 files changed, 185 insertions(+), 45 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs index 14b641959a..f864256df9 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs @@ -31,6 +31,11 @@ internal class GatewayAddressCache : IAddressCache, IDisposable private const string AddressResolutionBatchSize = "AddressResolutionBatchSize"; private const int DefaultBatchSize = 50; + // This warmup cache and connection timeout is meant to mimic an indefinite timeframe till which + // a delay task will run, until a cancellation token is requested to cancel the task. The default + // value for this timeout is 45 minutes at the moment. + private static readonly TimeSpan WarmupCacheAndOpenConnectionTimeout = TimeSpan.FromMinutes(45); + private readonly Uri serviceEndpoint; private readonly Uri addressEndpoint; @@ -113,7 +118,7 @@ public async Task OpenConnectionsAsync( bool shouldOpenRntbdChannels, CancellationToken cancellationToken) { - List>> tasks = new (); + List tasks = new (); int batchSize = GatewayAddressCache.DefaultBatchSize; #if !(NETSTANDARD15 || NETSTANDARD16) @@ -147,50 +152,33 @@ public async Task OpenConnectionsAsync( { for (int i = 0; i < partitionKeyRangeIdentities.Count; i += batchSize) { - tasks - .Add(this.GetAddressesAsync( - request: request, - collectionRid: collection.ResourceId, - partitionKeyRangeIds: partitionKeyRangeIdentities.Skip(i).Take(batchSize).Select(range => range.PartitionKeyRangeId))); + tasks.Add( + this.WarmupCachesAndOpenConnectionsAsync( + request: request, + collectionRid: collection.ResourceId, + partitionKeyRangeIds: partitionKeyRangeIdentities.Skip(i).Take(batchSize).Select(range => range.PartitionKeyRangeId), + containerProperties: collection, + shouldOpenRntbdChannels: shouldOpenRntbdChannels)); } } - foreach (TryCatch task in await Task.WhenAll(tasks)) - { - if (task.Failed) - { - continue; - } + using CancellationTokenSource linkedTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken); - using (DocumentServiceResponse response = task.Result) - { - FeedResource
addressFeed = response.GetResource>(); - - bool inNetworkRequest = this.IsInNetworkRequest(response); + // The `timeoutTask` is a background task which adds a delay for a period of WarmupCacheAndOpenConnectionTimeout. The task will + // be cancelled either by - a) when `linkedTokenSource` expires, which means the original `cancellationToken` expires or + // b) the the `linkedTokenSource.Cancel()` is called. + Task timeoutTask = Task.Delay(GatewayAddressCache.WarmupCacheAndOpenConnectionTimeout, linkedTokenSource.Token); + Task resultTask = await Task.WhenAny(Task.WhenAll(tasks), timeoutTask); - IEnumerable> addressInfos = - addressFeed.Where(addressInfo => ProtocolFromString(addressInfo.Protocol) == this.protocol) - .GroupBy(address => address.PartitionKeyRangeId, StringComparer.Ordinal) - .Select(group => this.ToPartitionAddressAndRange(collection.ResourceId, @group.ToList(), inNetworkRequest)); - - foreach (Tuple addressInfo in addressInfos) - { - this.serverPartitionAddressCache.Set( - new PartitionKeyRangeIdentity(collection.ResourceId, addressInfo.Item1.PartitionKeyRangeId), - addressInfo.Item2); - - // The `shouldOpenRntbdChannels` boolean flag indicates whether the SDK should establish Rntbd connections to the - // backend replica nodes. For the `CosmosClient.CreateAndInitializeAsync()` flow, the flag should be passed as - // `true` so that the Rntbd connections to the backend replicas could be established deterministically. For any - // other flow, the flag should be passed as `false`. - if (this.openConnectionsHandler != null && shouldOpenRntbdChannels) - { - await this.openConnectionsHandler - .TryOpenRntbdChannelsAsync( - addresses: addressInfo.Item2.Get(Protocol.Tcp)?.ReplicaTransportAddressUris); - } - } - } + if (resultTask == timeoutTask) + { + // Operation has been cancelled. + DefaultTrace.TraceWarning("The open connection task was cancelled because the cancellation token was expired. '{0}'", + System.Diagnostics.Trace.CorrelationManager.ActivityId); + } + else + { + linkedTokenSource.Cancel(); } } @@ -350,6 +338,81 @@ public async Task TryGetAddressesAsync( } } + /// + /// Gets the address information from the gateway using the partition key range ids, and warms up the async non blocking cache + /// by inserting them as a key value pair for later lookup. Additionally attempts to establish Rntbd connections to the backend + /// replicas based on `shouldOpenRntbdChannels` boolean flag. + /// + /// An instance of containing the request payload. + /// A string containing the collection ids. + /// An instance of containing the list of partition key range ids. + /// An instance of containing the collection properties. + /// A boolean flag indicating whether Rntbd connections are required to be established to the backend replica nodes. + private async Task WarmupCachesAndOpenConnectionsAsync( + DocumentServiceRequest request, + string collectionRid, + IEnumerable partitionKeyRangeIds, + ContainerProperties containerProperties, + bool shouldOpenRntbdChannels) + { + TryCatch documentServiceResponseWrapper = await this.GetAddressesAsync( + request: request, + collectionRid: collectionRid, + partitionKeyRangeIds: partitionKeyRangeIds); + + if (documentServiceResponseWrapper.Failed) + { + return; + } + + try + { + using (DocumentServiceResponse response = documentServiceResponseWrapper.Result) + { + FeedResource
addressFeed = response.GetResource>(); + + bool inNetworkRequest = this.IsInNetworkRequest(response); + + IEnumerable> addressInfos = + addressFeed.Where(addressInfo => ProtocolFromString(addressInfo.Protocol) == this.protocol) + .GroupBy(address => address.PartitionKeyRangeId, StringComparer.Ordinal) + .Select(group => this.ToPartitionAddressAndRange(containerProperties.ResourceId, @group.ToList(), inNetworkRequest)); + + List openConnectionTasks = new (); + foreach (Tuple addressInfo in addressInfos) + { + this.serverPartitionAddressCache.Set( + new PartitionKeyRangeIdentity(containerProperties.ResourceId, addressInfo.Item1.PartitionKeyRangeId), + addressInfo.Item2); + + // The `shouldOpenRntbdChannels` boolean flag indicates whether the SDK should establish Rntbd connections to the + // backend replica nodes. For the `CosmosClient.CreateAndInitializeAsync()` flow, the flag should be passed as + // `true` so that the Rntbd connections to the backend replicas could be established deterministically. For any + // other flow, the flag should be passed as `false`. + if (this.openConnectionsHandler != null && shouldOpenRntbdChannels) + { + openConnectionTasks + .Add(this.openConnectionsHandler + .TryOpenRntbdChannelsAsync( + addresses: addressInfo.Item2.Get(Protocol.Tcp)?.ReplicaTransportAddressUris)); + } + } + + if (openConnectionTasks.Any()) + { + await Task.WhenAll(openConnectionTasks); + } + } + } + catch (Exception ex) + { + DefaultTrace.TraceWarning("Failed to warm-up caches and open connections for the server addresses: {0} with exception: {1}. '{2}'", + collectionRid, + ex, + System.Diagnostics.Trace.CorrelationManager.ActivityId); + } + } + private static void SetTransportAddressUrisToUnhealthy( PartitionAddressInformation stalePartitionAddressInformation, Lazy> failedEndpoints) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs index 5116eb22de..296c131fbf 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs @@ -480,6 +480,75 @@ await cache.OpenConnectionsAsync( expectedTotalSuccessAddressesToOpenCount: 0); } + /// + /// Test to validate that when is called with a valid open connection handler + /// and a cancellation token that will expire with a pre-configured time, the handler method is indeed invoked and the open connection + /// operation gets cancelled successfully, if the cancellation token expires. The open connection operation succeeds if the operation + /// is finished before the cancellation token expiry time. + /// + [TestMethod] + [Owner("dkunda")] + [DataRow(1, 2, 1, 0, 3, 0, true, DisplayName = "Validate that when the cancellation token expiry time (i.e. 1 sec) is smaller than the open connection opperation duration (i.e. 2 sec)," + + "the open connection operation gets cancelled and the cancellation token is indeed respected and eventually cancelled.")] + [DataRow(3, 1, 1, 0, 3, 3, false, DisplayName = "Validate that when the cancellation token expiry time (i.e. 3 sec) is larger than the open connection opperation duration (i.e. 1 sec)," + + "the open connection operation completes successfully and the cancellation token is not cancelled.")] + public async Task OpenConnectionsAsync_WithValidOpenConnectionHandlerAndCancellationTokenExpires_ShouldInvokeHandlerMethodAndCancelToken( + int cancellationTokenTimeoutInSeconds, + int openConnectionDelayInSeconds, + int expectedTotalHandlerInvocationCount, + int expectedTotalFailedAddressesToOpenCount, + int expectedTotalReceivedAddressesCount, + int expectedTotalSuccessAddressesToOpenCount, + bool shouldCancelToken) + { + // Arrange. + FakeMessageHandler messageHandler = new (); + FakeOpenConnectionHandler fakeOpenConnectionHandler = new ( + failingIndexes: new HashSet(), + openConnectionDelayInSeconds: openConnectionDelayInSeconds); + + ContainerProperties containerProperties = ContainerProperties.CreateWithResourceId("ccZ1ANCszwk="); + containerProperties.Id = "TestId"; + containerProperties.PartitionKeyPath = "/pk"; + HttpClient httpClient = new(messageHandler) + { + Timeout = TimeSpan.FromSeconds(120) + }; + + CancellationTokenSource cts = new (TimeSpan.FromSeconds(cancellationTokenTimeoutInSeconds)); + CancellationToken token = cts.Token; + + GatewayAddressCache cache = new ( + new Uri(GatewayAddressCacheTests.DatabaseAccountApiEndpoint), + Protocol.Tcp, + this.mockTokenProvider.Object, + this.mockServiceConfigReader.Object, + MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), + openConnectionsHandler: fakeOpenConnectionHandler, + suboptimalPartitionForceRefreshIntervalInSeconds: 2); + + // Act. + await cache.OpenConnectionsAsync( + databaseName: "test-database", + collection: containerProperties, + partitionKeyRangeIdentities: new List() + { + this.testPartitionKeyRangeIdentity + }, + shouldOpenRntbdChannels: true, + cancellationToken: token); + + // Assert. + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedTotalFailedAddressesToOpenCount: expectedTotalFailedAddressesToOpenCount, + expectedTotalHandlerInvocationCount: expectedTotalHandlerInvocationCount, + expectedTotalReceivedAddressesCount: expectedTotalReceivedAddressesCount, + expectedTotalSuccessAddressesToOpenCount: expectedTotalSuccessAddressesToOpenCount); + + Assert.AreEqual(shouldCancelToken, token.IsCancellationRequested); + } + /// /// Test to validate that when is called with a /// valid open connection handler, the handler method is indeed invoked and an attempt is made to open @@ -1074,7 +1143,7 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr FakeOpenConnectionHandler fakeOpenConnectionHandler = new ( failIndexesByAttempts: new Dictionary>() { - { 0, new HashSet() { 1 } } + { 0, new HashSet() { 2 } } }, manualResetEvent: manualResetEvent); @@ -1513,16 +1582,19 @@ public class FakeOpenConnectionHandler : IOpenConnectionsHandler private int successInvocationCounter = 0; private int totalReceivedAddressesCounter = 0; private readonly HashSet failingIndexes; + private readonly int openConnectionDelayInSeconds; private readonly bool useAttemptBasedFailingIndexs; private readonly ManualResetEvent manualResetEvent; private readonly Dictionary> failIndexesByAttempts; public FakeOpenConnectionHandler( HashSet failingIndexes, - ManualResetEvent manualResetEvent = null) + ManualResetEvent manualResetEvent = null, + int openConnectionDelayInSeconds = 0) { this.failingIndexes = failingIndexes; this.manualResetEvent = manualResetEvent; + this.openConnectionDelayInSeconds = openConnectionDelayInSeconds; } public FakeOpenConnectionHandler( @@ -1554,11 +1626,18 @@ public int GetTotalMethodInvocationCount() return this.methodInvocationCounter; } - Task IOpenConnectionsHandler.TryOpenRntbdChannelsAsync( + async Task IOpenConnectionsHandler.TryOpenRntbdChannelsAsync( IEnumerable addresses) { int idx = 0; + this.methodInvocationCounter++; this.totalReceivedAddressesCounter += addresses.Count(); + + if (this.openConnectionDelayInSeconds > 0) + { + await Task.Delay(TimeSpan.FromSeconds(this.openConnectionDelayInSeconds)); + } + foreach (TransportAddressUri transportAddress in addresses) { if (this.useAttemptBasedFailingIndexs) @@ -1587,9 +1666,7 @@ Task IOpenConnectionsHandler.TryOpenRntbdChannelsAsync( idx++; } - this.methodInvocationCounter++; this.manualResetEvent?.Set(); - return Task.CompletedTask; } private void ExecuteSuccessCondition( From abab80e23858961a0f67db576ee51aac9255c094 Mon Sep 17 00:00:00 2001 From: Erik O'Leary <969938+onionhammer@users.noreply.github.com> Date: Mon, 26 Jun 2023 17:52:44 -0500 Subject: [PATCH 147/240] Query : Adds support for newtonsoft member access via ExtensionData (#3834) * Support newtonsoft member access via ExtensionData * Return null instead of empty string * Added tests for select & where * Updated baseline with note --------- Co-authored-by: leminh98 --- .../src/Linq/ExpressionToSQL.cs | 6 ++++ Microsoft.Azure.Cosmos/src/Linq/TypeSystem.cs | 8 +++++ ...ionBaselineTest.ValidateSQLTranslation.xml | 11 ++++++ ...Test.ValidateSQLTranslationComplexData.xml | 34 +++++++++++++++++++ .../LinqSQLTranslationBaselineTests.cs | 30 +++++++++++++++- .../Linq/CosmosLinqJsonConverterTests.cs | 30 ++++++++++++++++ 6 files changed, 118 insertions(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs b/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs index 476774e137..b259234336 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs @@ -742,6 +742,12 @@ private static SqlScalarExpression VisitMemberAccess(MemberExpression inputExpre SqlScalarExpression memberExpression = ExpressionToSql.VisitScalarExpression(inputExpression.Expression, context); string memberName = inputExpression.Member.GetMemberName(context.linqSerializerOptions); + // If the resulting memberName is null, then the indexer should be on the root of the object. + if (memberName == null) + { + return memberExpression; + } + // if expression is nullable if (inputExpression.Expression.Type.IsNullable()) { diff --git a/Microsoft.Azure.Cosmos/src/Linq/TypeSystem.cs b/Microsoft.Azure.Cosmos/src/Linq/TypeSystem.cs index 34d771bf56..7c8e62d69c 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/TypeSystem.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/TypeSystem.cs @@ -25,6 +25,14 @@ public static Type GetElementType(Type type) public static string GetMemberName(this MemberInfo memberInfo, CosmosLinqSerializerOptions linqSerializerOptions = null) { string memberName = null; + + // Check if Newtonsoft JsonExtensionDataAttribute is present on the member, if so, return empty member name. + JsonExtensionDataAttribute jsonExtensionDataAttribute = memberInfo.GetCustomAttribute(true); + if (jsonExtensionDataAttribute != null && jsonExtensionDataAttribute.ReadData) + { + return null; + } + // Json.Net honors JsonPropertyAttribute more than DataMemberAttribute // So we check for JsonPropertyAttribute first. JsonPropertyAttribute jsonPropertyAttribute = memberInfo.GetCustomAttribute(true); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqSQLTranslationBaselineTest.ValidateSQLTranslation.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqSQLTranslationBaselineTest.ValidateSQLTranslation.xml index 877754ac74..d22afb37f9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqSQLTranslationBaselineTest.ValidateSQLTranslation.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqSQLTranslationBaselineTest.ValidateSQLTranslation.xml @@ -268,6 +268,17 @@ FROM root]]> + + + + + + new complex() {NewtonsoftExtensionData = new Dictionary`2() {Void Add(System.String, System.Object)("test", Convert(1.5, Object))}, NetExtensionData = new Dictionary`2() {Void Add(System.String, System.Object)("OtherTest", Convert(1.5, Object))}})]]> + + + diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqSQLTranslationBaselineTest.ValidateSQLTranslationComplexData.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqSQLTranslationBaselineTest.ValidateSQLTranslationComplexData.xml index 04e8ab30fe..a557298543 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqSQLTranslationBaselineTest.ValidateSQLTranslationComplexData.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqSQLTranslationBaselineTest.ValidateSQLTranslationComplexData.xml @@ -166,4 +166,38 @@ FROM root JOIN x0 IN root["dblArray"]]]> + + + + (Convert(p.NewtonsoftExtensionData.get_Item("age"), Int32) > 18)).Select(x => new AnonymousType(Age = Convert(x.NewtonsoftExtensionData.get_Item("age"), Int32)))]]> + + + 18)]]> + + + + + + Convert(p.NewtonsoftExtensionData.get_Item("tags"), String[]).Contains("item-1")).Select(x => Convert(x.NewtonsoftExtensionData.get_Item("tags"), String[]))]]> + + + + + + + + + Convert(p.NewtonsoftExtensionData.get_Item("tags"), String[]).Contains("item-1")).SelectMany(x => Convert(x.NewtonsoftExtensionData.get_Item("tags"), Object[]))]]> + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqSQLTranslationBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqSQLTranslationBaselineTests.cs index f3c27a2230..230e2599a3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqSQLTranslationBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqSQLTranslationBaselineTests.cs @@ -103,6 +103,12 @@ struct complex public string id; public string pk; + [Newtonsoft.Json.JsonExtensionData(ReadData = true, WriteData = true)] + public Dictionary NewtonsoftExtensionData { get; set; } + + [System.Text.Json.Serialization.JsonExtensionData()] + public Dictionary NetExtensionData { get; set; } + public complex(double d, string str, bool b, double[] da, simple s) { this.dbl = d; @@ -113,6 +119,8 @@ public complex(double d, string str, bool b, double[] da, simple s) this.json = null; this.id = Guid.NewGuid().ToString(); this.pk = "Test"; + this.NetExtensionData = new Dictionary(); + this.NewtonsoftExtensionData = new Dictionary(); } public override string ToString() @@ -236,7 +244,15 @@ public void ValidateSQLTranslation() inputs.Add(new LinqTestInput("Select new constructor", b => dataQuery(b).Select(x => new TimeSpan(x.x)))); inputs.Add(new LinqTestInput("Select method id", b => dataQuery(b).Select(x => id(x)))); inputs.Add(new LinqTestInput("Select identity", b => dataQuery(b).Select(x => x))); - inputs.Add(new LinqTestInput("Select simple property", b => dataQuery(b).Select(x => x.x))); + inputs.Add(new LinqTestInput("Select simple property", b => dataQuery(b).Select(x => x.x))); + inputs.Add(new LinqTestInput("Select extension data", b => dataQuery(b).Select(x => new complex() { + NewtonsoftExtensionData = new() { + { "test", 1.5 } + }, + NetExtensionData = new() { + { "OtherTest", 1.5 } + } + } ))); this.ExecuteTestSuite(inputs); } @@ -264,6 +280,10 @@ public void ValidateSQLTranslationComplexData() obj.str = random.NextDouble() < 0.1 ? "5" : LinqTestsCommon.RandomString(random, random.Next(MaxStringLength)); obj.id = Guid.NewGuid().ToString(); obj.pk = "Test"; + obj.NewtonsoftExtensionData = new Dictionary() { + ["age"] = 32, + ["tags"] = new [] { "item-1", "item-2" } + }; return obj; }; Func> getQuery = LinqTestsCommon.GenerateTestCosmosData(createDataObj, Records, testContainer); @@ -285,6 +305,14 @@ public void ValidateSQLTranslationComplexData() inputs.Add(new LinqTestInput("SelectMany x -> Select y", b => getQuery(b).SelectMany(x => x.dblArray.Select(y => y)))); inputs.Add(new LinqTestInput("SelectMany x -> Select x.y", b => getQuery(b).SelectMany(x => x.dblArray.Select(y => y)))); inputs.Add(new LinqTestInput("SelectMany array", b => getQuery(b).SelectMany(x => x.dblArray))); + + inputs.Add(new LinqTestInput("Select where extensiondata", b => getQuery(b).Where(p => (int)p.NewtonsoftExtensionData["age"] > 18).Select(x => new { Age = (int)x.NewtonsoftExtensionData["age"] }))); + inputs.Add(new LinqTestInput("Select where extensiondata contains", b => getQuery(b).Where(p => ((string[])p.NewtonsoftExtensionData["tags"]).Contains("item-1")).Select(x => (string[])x.NewtonsoftExtensionData["tags"] ))); + + // TODO: SelectMany does not currently work with Dictionary objects, the snapshot represents + // the current (broken) behavior + inputs.Add(new LinqTestInput("SelectMany where extensiondata contains", b => getQuery(b).Where(p => ((string[])p.NewtonsoftExtensionData["tags"]).Contains("item-1")).SelectMany(x => (object[])x.NewtonsoftExtensionData["tags"] ))); + this.ExecuteTestSuite(inputs); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Linq/CosmosLinqJsonConverterTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Linq/CosmosLinqJsonConverterTests.cs index ca2e12c8da..8e50a21dd0 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Linq/CosmosLinqJsonConverterTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Linq/CosmosLinqJsonConverterTests.cs @@ -5,6 +5,7 @@ namespace Microsoft.Azure.Cosmos.Linq { using System; + using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; @@ -152,6 +153,35 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s } } + [TestMethod] + public void TestNewtonsoftExtensionDataQuery() + { + Expression> expr = a => (string)a.NewtonsoftExtensionData["foo"] == "bar"; + string sql = SqlTranslator.TranslateExpression(expr.Body); + + Assert.AreEqual("(a[\"foo\"] = \"bar\")", sql); + } + + [TestMethod] + public void TestSystemTextJsonExtensionDataQuery() + { + Expression> expr = a => ((object)a.NetExtensionData["foo"]) == "bar"; + string sql = SqlTranslator.TranslateExpression(expr.Body); + + // TODO: This is a limitation in the translator. It should be able to handle STJ extension data, if a custom + // JSON serializer is specified. + Assert.AreEqual("(a[\"NetExtensionData\"][\"foo\"] = \"bar\")", sql); + } + + class DocumentWithExtensionData + { + [Newtonsoft.Json.JsonExtensionData(ReadData = true, WriteData = true)] + public Dictionary NewtonsoftExtensionData { get; set; } + + [System.Text.Json.Serialization.JsonExtensionData()] + public Dictionary NetExtensionData { get; set; } + } + /// // See: https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos.Samples/Usage/SystemTextJson/CosmosSystemTextJsonSerializer.cs /// From 3a1f46ba42ed08a65c1fc7eb47cea4020c469975 Mon Sep 17 00:00:00 2001 From: Fabian Meiswinkel Date: Tue, 27 Jun 2023 17:47:49 +0200 Subject: [PATCH 148/240] HttpTransport: Fixes HttpTimeoutPolicies to not accidentally suppress retries (#3944) * Fix HttpTimeoutPolicies to not accidentally suppress retries * Removing HttpTimeoutPolicy.MaxRetryTimeLimit altogether --- Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs | 3 +-- Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs | 1 - .../src/HttpClient/HttpTimeoutPolicyControlPlaneRead.cs | 2 -- .../HttpTimeoutPolicyControlPlaneRetriableHotPath.cs | 2 -- .../src/HttpClient/HttpTimeoutPolicyDefault.cs | 2 -- .../src/HttpClient/HttpTimeoutPolicyNoRetry.cs | 2 -- 6 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs b/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs index c29c3a5b94..0e7cc30c9e 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs @@ -438,8 +438,7 @@ private static bool IsOutOfRetries( DateTime startDateTimeUtc, IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> timeoutEnumerator) { - return (DateTime.UtcNow - startDateTimeUtc) > timeoutPolicy.MaximumRetryTimeLimit || // Maximum of time for all retries - !timeoutEnumerator.MoveNext(); // No more retries are configured + return !timeoutEnumerator.MoveNext(); // No more retries are configured } private async Task ExecuteHttpHelperAsync( diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs index fa2fc25bf7..42742f86c1 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicy.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Cosmos internal abstract class HttpTimeoutPolicy { public abstract string TimeoutPolicyName { get; } - public abstract TimeSpan MaximumRetryTimeLimit { get; } public abstract int TotalRetryCount { get; } public abstract IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> GetTimeoutEnumerator(); public abstract bool IsSafeToRetry(HttpMethod httpMethod); diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRead.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRead.cs index 757134a576..9f85ba33ab 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRead.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRead.cs @@ -25,8 +25,6 @@ private HttpTimeoutPolicyControlPlaneRead() public override string TimeoutPolicyName => HttpTimeoutPolicyControlPlaneRead.Name; - public override TimeSpan MaximumRetryTimeLimit => CosmosHttpClient.GatewayRequestTimeout; - public override int TotalRetryCount => this.TimeoutsAndDelays.Count; public override IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> GetTimeoutEnumerator() diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRetriableHotPath.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRetriableHotPath.cs index 8dbb8a2a44..53a7c78e9e 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRetriableHotPath.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyControlPlaneRetriableHotPath.cs @@ -29,8 +29,6 @@ private HttpTimeoutPolicyControlPlaneRetriableHotPath(bool shouldThrow503OnTimeo public override string TimeoutPolicyName => HttpTimeoutPolicyControlPlaneRetriableHotPath.Name; - public override TimeSpan MaximumRetryTimeLimit => CosmosHttpClient.GatewayRequestTimeout; - public override int TotalRetryCount => this.TimeoutsAndDelays.Count; public override IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> GetTimeoutEnumerator() diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyDefault.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyDefault.cs index 974509c70c..69a83707a1 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyDefault.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyDefault.cs @@ -29,8 +29,6 @@ private HttpTimeoutPolicyDefault(bool shouldThrow503OnTimeout) public override string TimeoutPolicyName => HttpTimeoutPolicyDefault.Name; - public override TimeSpan MaximumRetryTimeLimit => CosmosHttpClient.GatewayRequestTimeout; - public override int TotalRetryCount => this.TimeoutsAndDelays.Count; public override IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> GetTimeoutEnumerator() diff --git a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyNoRetry.cs b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyNoRetry.cs index 595498aec2..65ea12144b 100644 --- a/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyNoRetry.cs +++ b/Microsoft.Azure.Cosmos/src/HttpClient/HttpTimeoutPolicyNoRetry.cs @@ -24,8 +24,6 @@ private HttpTimeoutPolicyNoRetry() public override string TimeoutPolicyName => HttpTimeoutPolicyNoRetry.Name; - public override TimeSpan MaximumRetryTimeLimit => TimeSpan.Zero; - public override int TotalRetryCount => 0; public override IEnumerator<(TimeSpan requestTimeout, TimeSpan delayForNextRequest)> GetTimeoutEnumerator() From cf71ddd9103e2a375e46c93c5a3f1b35144e2038 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Tue, 27 Jun 2023 09:56:29 -0700 Subject: [PATCH 149/240] SDK 3.35.1 : Adds version bump and changelog (#3945) * version bump * changelog * contract --- Directory.Build.props | 4 +- .../contracts/API_3.35.1-preview.txt | 1563 +++++++++++++++++ .../contracts/API_3.35.1.txt | 1502 ++++++++++++++++ changelog.md | 9 +- 4 files changed, 3075 insertions(+), 3 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.35.1-preview.txt create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.35.1.txt diff --git a/Directory.Build.props b/Directory.Build.props index eb4940bf4b..55a67ffec4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 3.35.0 - 3.35.0 + 3.35.1 + 3.35.1 preview 3.31.2 2.0.2 diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.35.1-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.35.1-preview.txt new file mode 100644 index 0000000000..6c989053fd --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.35.1-preview.txt @@ -0,0 +1,1563 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public sealed class ComputedProperty + { + public ComputedProperty(); + public string Name { get; set; } + public string Query { get; set; } + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public Collection ComputedProperties { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool IsDistributedTracingEnabled { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable BypassIntegratedCache { get; set; } + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public enum PriorityLevel + { + High = 1, + Low = 2, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public bool EnableOptimisticDirectExecution { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public Nullable PriorityLevel { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ComputedPropertiesDefinition + { + public T Attach(); + public ComputedPropertiesDefinition WithComputedProperty(string name, string query); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public ComputedPropertiesDefinition WithComputedProperties(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithDistributedTracing(bool isEnabled=true); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.35.1.txt b/Microsoft.Azure.Cosmos/contracts/API_3.35.1.txt new file mode 100644 index 0000000000..c0dc3e280f --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.35.1.txt @@ -0,0 +1,1502 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/changelog.md b/changelog.md index bd5c29c32c..80a2d967c2 100644 --- a/changelog.md +++ b/changelog.md @@ -12,7 +12,14 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -### [3.35.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.0-preview) - 2023-06-19 + +### [3.35.1-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.1-preview) - 2023-06-27 +### [3.35.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.1) - 2023-06-27 + +#### Fixed +- [3944](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3944) Availability: Fixes HttpTimeoutPolicies to not accidentally suppress retries + +### [3.35.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.0-preview) - 2023-06-19 ### Added - [3836](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3836) Integrated cache: Adds BypassIntegratedCache to DedicatedGatewayRequestOptions From c2bf6409c923831171afc1c8790a18e66b8e2df0 Mon Sep 17 00:00:00 2001 From: Fabian Meiswinkel Date: Tue, 27 Jun 2023 19:11:01 +0200 Subject: [PATCH 150/240] [Internal] Changelog: Fixes recommended version and title (#3948) * SDK 3.35.1: Adds version bump and changelog * Update changelog.md * Update changelog.md * Update changelog.md * Update changelog.md * Update changelog.md --- changelog.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 80a2d967c2..f72c7fd59f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,6 @@ ## Recommended version -The **minimum recommended version is [3.33.0](#3.33.0)**. +The **minimum recommended version is [3.33.0](#3.33.0) when using Direct mode and [3.35.1](#3.35.1) for Gateway mode**. Make sure that your applications, when using the .NET V3 SDK, are using at least the version described here to have all the critical fixes. @@ -21,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### [3.35.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.0-preview) - 2023-06-19 -### Added +#### Added - [3836](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3836) Integrated cache: Adds BypassIntegratedCache to DedicatedGatewayRequestOptions - [3909](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3909) Query: Adds EnableOptimisticDirectExecution in QueryRequestOptions enabled by default From a25730a77ab43a8e460ddc292f1a6d8eb193395a Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Wed, 28 Jun 2023 09:45:30 -0700 Subject: [PATCH 151/240] [Internal] Dependencies: Fixes dependabot alert for System.Linq.Dynamic.Core (#3957) * Removing 1 * Removing 2 * Removing 3 --- ...Microsoft.Azure.Cosmos.Encryption.Custom.EmulatorTests.csproj | 1 - .../Microsoft.Azure.Cosmos.Encryption.EmulatorTests.csproj | 1 - .../Microsoft.Azure.Cosmos.EmulatorTests.csproj | 1 - 3 files changed, 3 deletions(-) diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.Custom.EmulatorTests.csproj b/Microsoft.Azure.Cosmos.Encryption.Custom/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.Custom.EmulatorTests.csproj index d8dc8fb6a7..c5dfa8db0c 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.Custom.EmulatorTests.csproj +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.Custom.EmulatorTests.csproj @@ -26,7 +26,6 @@ - diff --git a/Microsoft.Azure.Cosmos.Encryption/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.EmulatorTests.csproj b/Microsoft.Azure.Cosmos.Encryption/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.EmulatorTests.csproj index 458cfb6849..0b7c24dbdd 100644 --- a/Microsoft.Azure.Cosmos.Encryption/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.EmulatorTests.csproj +++ b/Microsoft.Azure.Cosmos.Encryption/tests/EmulatorTests/Microsoft.Azure.Cosmos.Encryption.EmulatorTests.csproj @@ -26,7 +26,6 @@ - diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj index 51891d7e3f..8b1aa3b149 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj @@ -54,7 +54,6 @@ - From 17f1b4eef8d6776b40a14fd3acf22c4ca64fb6a2 Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Thu, 29 Jun 2023 19:06:53 -0700 Subject: [PATCH 152/240] [Internal] Upgrade Resiliency: Adds Code to Enable Replica Validation Feature for Preview (#3951) * Code changes to add replica validation feature in cosmos client options. * Code changes to upgrade the cosmos direct version to 3.31.3. * Adding emulator test to cover replica validation. * Code changes to address cosmetic clean ups. * Code changes to address review comments. Fixed preview build failures. * Code changes to enable replica validation for preview package by default. * Code changes to address review comments. * Code changes to fix preview unit tests. * Code changes to disable environment variable at the end of the test. --- Directory.Build.props | 2 +- Microsoft.Azure.Cosmos/src/DocumentClient.cs | 7 +- .../src/Routing/GatewayAddressCache.cs | 24 +- .../src/Routing/GlobalAddressResolver.cs | 7 +- .../src/Util/ConfigurationManager.cs | 30 +- .../ClientRetryPolicyTests.cs | 3 +- .../CosmosBadReplicaTests.cs | 291 ++++++++++-------- .../GatewayAddressCacheTests.cs | 30 +- .../RequestEventHandlerTests.cs | 2 +- .../StoreReaderTest.cs | 24 +- 10 files changed, 231 insertions(+), 189 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 55a67ffec4..71b854a5c7 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,7 +3,7 @@ 3.35.1 3.35.1 preview - 3.31.2 + 3.31.3 2.0.2 2.0.2 preview diff --git a/Microsoft.Azure.Cosmos/src/DocumentClient.cs b/Microsoft.Azure.Cosmos/src/DocumentClient.cs index 068bb5b857..752ec8f5a5 100644 --- a/Microsoft.Azure.Cosmos/src/DocumentClient.cs +++ b/Microsoft.Azure.Cosmos/src/DocumentClient.cs @@ -113,6 +113,8 @@ internal partial class DocumentClient : IDisposable, IAuthorizationTokenProvider private const string DefaultInitTaskKey = "InitTaskKey"; private readonly bool IsLocalQuorumConsistency = false; + private readonly bool isReplicaAddressValidationEnabled; + //Auth internal readonly AuthorizationTokenProvider cosmosAuthorization; @@ -231,7 +233,7 @@ public DocumentClient(Uri serviceEndpoint, this.Initialize(serviceEndpoint, connectionPolicy, desiredConsistencyLevel); this.initTaskCache = new AsyncCacheNonBlocking(cancellationToken: this.cancellationTokenSource.Token); - + this.isReplicaAddressValidationEnabled = ConfigurationManager.IsReplicaAddressValidationEnabled(); } /// @@ -6700,7 +6702,8 @@ private void CreateStoreModel(bool subscribeRntbdStatus) this.ConnectionPolicy.EnableReadRequestsFallback ?? (this.accountServiceConfiguration.DefaultConsistencyLevel != Documents.ConsistencyLevel.BoundedStaleness), !this.enableRntbdChannel, this.UseMultipleWriteLocations && (this.accountServiceConfiguration.DefaultConsistencyLevel != Documents.ConsistencyLevel.Strong), - true); + true, + enableReplicaValidation: this.isReplicaAddressValidationEnabled); if (subscribeRntbdStatus) { diff --git a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs index f864256df9..a4dbb1d8a3 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs @@ -66,7 +66,8 @@ public GatewayAddressCache( CosmosHttpClient httpClient, IOpenConnectionsHandler openConnectionsHandler, long suboptimalPartitionForceRefreshIntervalInSeconds = 600, - bool enableTcpConnectionEndpointRediscovery = false) + bool enableTcpConnectionEndpointRediscovery = false, + bool replicaAddressValidationEnabled = false) { this.addressEndpoint = new Uri(serviceEndpoint + "/" + Paths.AddressPathSegment); this.protocol = protocol; @@ -90,9 +91,7 @@ public GatewayAddressCache( GatewayAddressCache.ProtocolString(this.protocol)); this.openConnectionsHandler = openConnectionsHandler; - this.isReplicaAddressValidationEnabled = Helpers.GetEnvironmentVariable( - name: Constants.EnvironmentVariables.ReplicaConnectivityValidationEnabled, - defaultValue: false); + this.isReplicaAddressValidationEnabled = replicaAddressValidationEnabled; } public Uri ServiceEndpoint => this.serviceEndpoint; @@ -158,7 +157,8 @@ public async Task OpenConnectionsAsync( collectionRid: collection.ResourceId, partitionKeyRangeIds: partitionKeyRangeIdentities.Skip(i).Take(batchSize).Select(range => range.PartitionKeyRangeId), containerProperties: collection, - shouldOpenRntbdChannels: shouldOpenRntbdChannels)); + shouldOpenRntbdChannels: shouldOpenRntbdChannels, + cancellationToken: cancellationToken)); } } @@ -348,12 +348,14 @@ public async Task TryGetAddressesAsync( /// An instance of containing the list of partition key range ids. /// An instance of containing the collection properties. /// A boolean flag indicating whether Rntbd connections are required to be established to the backend replica nodes. + /// An instance of . private async Task WarmupCachesAndOpenConnectionsAsync( DocumentServiceRequest request, string collectionRid, IEnumerable partitionKeyRangeIds, ContainerProperties containerProperties, - bool shouldOpenRntbdChannels) + bool shouldOpenRntbdChannels, + CancellationToken cancellationToken) { TryCatch documentServiceResponseWrapper = await this.GetAddressesAsync( request: request, @@ -381,6 +383,11 @@ private async Task WarmupCachesAndOpenConnectionsAsync( List openConnectionTasks = new (); foreach (Tuple addressInfo in addressInfos) { + if (cancellationToken.IsCancellationRequested) + { + break; + } + this.serverPartitionAddressCache.Set( new PartitionKeyRangeIdentity(containerProperties.ResourceId, addressInfo.Item1.PartitionKeyRangeId), addressInfo.Item2); @@ -398,10 +405,7 @@ private async Task WarmupCachesAndOpenConnectionsAsync( } } - if (openConnectionTasks.Any()) - { - await Task.WhenAll(openConnectionTasks); - } + await Task.WhenAll(openConnectionTasks); } } catch (Exception ex) diff --git a/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs b/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs index 344f994395..8ac0719dcd 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs @@ -27,7 +27,6 @@ namespace Microsoft.Azure.Cosmos.Routing internal sealed class GlobalAddressResolver : IAddressResolverExtension, IDisposable { private const int MaxBackupReadRegions = 3; - private readonly GlobalEndpointManager endpointManager; private readonly GlobalPartitionEndpointManager partitionKeyRangeLocationCache; private readonly Protocol protocol; @@ -39,6 +38,7 @@ internal sealed class GlobalAddressResolver : IAddressResolverExtension, IDispos private readonly CosmosHttpClient httpClient; private readonly ConcurrentDictionary addressCacheByEndpoint; private readonly bool enableTcpConnectionEndpointRediscovery; + private readonly bool isReplicaAddressValidationEnabled; private IOpenConnectionsHandler openConnectionsHandler; public GlobalAddressResolver( @@ -67,6 +67,8 @@ public GlobalAddressResolver( this.enableTcpConnectionEndpointRediscovery = connectionPolicy.EnableTcpConnectionEndpointRediscovery; + this.isReplicaAddressValidationEnabled = ConfigurationManager.IsReplicaAddressValidationEnabled(); + this.maxEndpoints = maxBackupReadEndpoints + 2; // for write and alternate write endpoint (during failover) this.addressCacheByEndpoint = new ConcurrentDictionary(); @@ -281,7 +283,8 @@ private EndpointCache GetOrAddEndpoint(Uri endpoint) this.serviceConfigReader, this.httpClient, this.openConnectionsHandler, - enableTcpConnectionEndpointRediscovery: this.enableTcpConnectionEndpointRediscovery); + enableTcpConnectionEndpointRediscovery: this.enableTcpConnectionEndpointRediscovery, + replicaAddressValidationEnabled: this.isReplicaAddressValidationEnabled); string location = this.endpointManager.GetLocation(endpoint); AddressResolver addressResolver = new AddressResolver(null, new NullRequestSigner(), location); diff --git a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs index 4e9e8fde84..ed0f5a47a6 100644 --- a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs +++ b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs @@ -7,7 +7,14 @@ namespace Microsoft.Azure.Cosmos using System; internal static class ConfigurationManager - { + { + /// + /// A read-only string containing the environment variablename for enabling replica validation. + /// This will eventually be removed oncereplica valdiatin is enabled by default for both preview + /// and GA. + /// + internal static readonly string ReplicaConnectivityValidationEnabled = "AZURE_COSMOS_REPLICA_VALIDATION_ENABLED"; + public static T GetEnvironmentVariable(string variable, T defaultValue) { string value = Environment.GetEnvironmentVariable(variable); @@ -17,5 +24,26 @@ public static T GetEnvironmentVariable(string variable, T defaultValue) } return (T)Convert.ChangeType(value, typeof(T)); } + + /// + /// Gets the boolean value of the replica validation environment variable. Note that, replica validation + /// is enabled by default for the preview package and disabled for GA at the moment. The user can set the + /// respective environment variable 'AZURE_COSMOS_REPLICA_VALIDATION_ENABLED' to override the value for + /// both preview and GA. The method will eventually be removed, once replica valdiatin is enabled by default + /// for both preview and GA. + /// + /// A boolean flag indicating if replica validation is enabled. + public static bool IsReplicaAddressValidationEnabled() + { + bool replicaValidationDefaultValue = false; +#if PREVIEW + replicaValidationDefaultValue = true; +#endif + + return ConfigurationManager + .GetEnvironmentVariable( + variable: ConfigurationManager.ReplicaConnectivityValidationEnabled, + defaultValue: replicaValidationDefaultValue); + } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientRetryPolicyTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientRetryPolicyTests.cs index a41f08afa1..0851952f40 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientRetryPolicyTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientRetryPolicyTests.cs @@ -209,7 +209,8 @@ private async Task ValidateConnectTimeoutTriggersClientRetryPolicy( enableReadRequestsFallback: false, useMultipleWriteLocations: useMultipleWriteLocations, detectClientConnectivityIssues: true, - disableRetryWithRetryPolicy: false); + disableRetryWithRetryPolicy: false, + enableReplicaValidation: false); // Reducing retry timeout to avoid long-running tests replicatedResourceClient.GoneAndRetryWithRetryTimeoutInSecondsOverride = 1; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosBadReplicaTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosBadReplicaTests.cs index 3ef86568b8..7a5b387e8e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosBadReplicaTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosBadReplicaTests.cs @@ -6,7 +6,6 @@ namespace Microsoft.Azure.Cosmos.Tests { using System; using System.Collections.Generic; - using System.Globalization; using System.IO; using System.Linq; using System.Net; @@ -14,44 +13,50 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Text; using System.Threading; using System.Threading.Tasks; - using global::Azure.Core; - using Microsoft.Azure.Cosmos.Fluent; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; - using Newtonsoft.Json.Linq; [TestClass] public class CosmosBadReplicaTests { [TestMethod] [Timeout(30000)] - public async Task TestGoneFromServiceScenarioAsync() + [DataRow(true, DisplayName = "Validate when replica validation is enabled.")] + [DataRow(false, DisplayName = "Validate when replica validation is disabled.")] + public async Task TestGoneFromServiceScenarioAsync( + bool enableReplicaValidation) { - Mock mockHttpHandler = new Mock(MockBehavior.Strict); - Uri endpoint = MockSetupsHelper.SetupSingleRegionAccount( - "mockAccountInfo", - consistencyLevel: ConsistencyLevel.Session, - mockHttpHandler, - out string primaryRegionEndpoint); - - string databaseName = "mockDbName"; - string containerName = "mockContainerName"; - string containerRid = "ccZ1ANCszwk="; - Documents.ResourceId cRid = Documents.ResourceId.Parse(containerRid); - MockSetupsHelper.SetupContainerProperties( - mockHttpHandler: mockHttpHandler, - regionEndpoint: primaryRegionEndpoint, - databaseName: databaseName, - containerName: containerName, - containerRid: containerRid); - - MockSetupsHelper.SetupSinglePartitionKeyRange( - mockHttpHandler, - primaryRegionEndpoint, - cRid, - out IReadOnlyList partitionKeyRanges); - - List replicaIds1 = new List() + try + { + Environment.SetEnvironmentVariable( + variable: ConfigurationManager.ReplicaConnectivityValidationEnabled, + value: enableReplicaValidation.ToString()); + + Mock mockHttpHandler = new Mock(MockBehavior.Strict); + Uri endpoint = MockSetupsHelper.SetupSingleRegionAccount( + "mockAccountInfo", + consistencyLevel: ConsistencyLevel.Session, + mockHttpHandler, + out string primaryRegionEndpoint); + + string databaseName = "mockDbName"; + string containerName = "mockContainerName"; + string containerRid = "ccZ1ANCszwk="; + Documents.ResourceId cRid = Documents.ResourceId.Parse(containerRid); + MockSetupsHelper.SetupContainerProperties( + mockHttpHandler: mockHttpHandler, + regionEndpoint: primaryRegionEndpoint, + databaseName: databaseName, + containerName: containerName, + containerRid: containerRid); + + MockSetupsHelper.SetupSinglePartitionKeyRange( + mockHttpHandler, + primaryRegionEndpoint, + cRid, + out IReadOnlyList partitionKeyRanges); + + List replicaIds1 = new List() { "11111111111111111", "22222222222222222", @@ -59,14 +64,14 @@ public async Task TestGoneFromServiceScenarioAsync() "44444444444444444", }; - HttpResponseMessage replicaSet1 = MockSetupsHelper.CreateAddresses( - replicaIds1, - partitionKeyRanges.First(), - "eastus", - cRid); + HttpResponseMessage replicaSet1 = MockSetupsHelper.CreateAddresses( + replicaIds1, + partitionKeyRanges.First(), + "eastus", + cRid); - // One replica changed on the refresh - List replicaIds2 = new List() + // One replica changed on the refresh + List replicaIds2 = new List() { "11111111111111111", "22222222222222222", @@ -74,118 +79,134 @@ public async Task TestGoneFromServiceScenarioAsync() "55555555555555555", }; - HttpResponseMessage replicaSet2 = MockSetupsHelper.CreateAddresses( - replicaIds2, - partitionKeyRanges.First(), - "eastus", - cRid); - - bool delayCacheRefresh = true; - bool delayRefreshUnblocked = false; - mockHttpHandler.SetupSequence(x => x.SendAsync( - It.Is(r => r.RequestUri.ToString().Contains("addresses")), It.IsAny())) - .Returns(Task.FromResult(replicaSet1)) - .Returns(async ()=> + HttpResponseMessage replicaSet2 = MockSetupsHelper.CreateAddresses( + replicaIds2, + partitionKeyRanges.First(), + "eastus", + cRid); + + bool delayCacheRefresh = true; + bool delayRefreshUnblocked = false; + mockHttpHandler.SetupSequence(x => x.SendAsync( + It.Is(r => r.RequestUri.ToString().Contains("addresses")), It.IsAny())) + .Returns(Task.FromResult(replicaSet1)) + .Returns(async ()=> + { + //block cache refresh to verify bad replica is not visited during refresh + while (delayCacheRefresh) + { + await Task.Delay(TimeSpan.FromMilliseconds(20)); + } + + delayRefreshUnblocked = true; + return replicaSet2; + }); + + int callBack = 0; + List urisVisited = new List(); + Mock mockTransportClient = new Mock(MockBehavior.Strict); + mockTransportClient.Setup(x => x.InvokeResourceOperationAsync(It.IsAny(), It.IsAny())) + .Callback((t, _) => urisVisited.Add(t)) + .Returns(() => { - //block cache refresh to verify bad replica is not visited during refresh - while (delayCacheRefresh) + callBack++; + if (callBack == 1) { - await Task.Delay(TimeSpan.FromMilliseconds(20)); + throw Documents.Rntbd.TransportExceptions.GetGoneException( + new Uri("https://localhost:8081"), + Guid.NewGuid(), + new Documents.TransportException(Documents.TransportErrorCode.ConnectionBroken, + null, + Guid.NewGuid(), + new Uri("https://localhost:8081"), + "Mock", + userPayload: true, + payloadSent: false)); } - delayRefreshUnblocked = true; - return replicaSet2; - }); - - int callBack = 0; - List urisVisited = new List(); - Mock mockTransportClient = new Mock(MockBehavior.Strict); - mockTransportClient.Setup(x => x.InvokeResourceOperationAsync(It.IsAny(), It.IsAny())) - .Callback((t, _) => urisVisited.Add(t)) - .Returns(() => - { - callBack++; - if (callBack == 1) - { - throw Documents.Rntbd.TransportExceptions.GetGoneException( - new Uri("https://localhost:8081"), - Guid.NewGuid(), - new Documents.TransportException(Documents.TransportErrorCode.ConnectionBroken, - null, - Guid.NewGuid(), - new Uri("https://localhost:8081"), - "Mock", - userPayload: true, - payloadSent: false)); - } - - return Task.FromResult(new Documents.StoreResponse() - { - Status = 200, - Headers = new Documents.Collections.StoreResponseNameValueCollection() + return Task.FromResult(new Documents.StoreResponse() { - ActivityId = Guid.NewGuid().ToString(), - LSN = "12345", - PartitionKeyRangeId = "0", - GlobalCommittedLSN = "12345", - SessionToken = "1#12345#1=12345" - }, - ResponseBody = new MemoryStream() + Status = 200, + Headers = new Documents.Collections.StoreResponseNameValueCollection() + { + ActivityId = Guid.NewGuid().ToString(), + LSN = "12345", + PartitionKeyRangeId = "0", + GlobalCommittedLSN = "12345", + SessionToken = "1#12345#1=12345" + }, + ResponseBody = new MemoryStream() + }); }); - }); - - CosmosClientOptions cosmosClientOptions = new CosmosClientOptions() - { - ConsistencyLevel = Cosmos.ConsistencyLevel.Session, - HttpClientFactory = () => new HttpClient(new HttpHandlerHelper(mockHttpHandler.Object)), - TransportClientHandlerFactory = (original) => mockTransportClient.Object, - }; - using (CosmosClient customClient = new CosmosClient( - endpoint.ToString(), - Convert.ToBase64String(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())), - cosmosClientOptions)) - { - try + CosmosClientOptions cosmosClientOptions = new CosmosClientOptions() { - Container container = customClient.GetContainer(databaseName, containerName); - - for (int i = 0; i < 20; i++) + ConsistencyLevel = Cosmos.ConsistencyLevel.Session, + HttpClientFactory = () => new HttpClient(new HttpHandlerHelper(mockHttpHandler.Object)), + TransportClientHandlerFactory = (original) => mockTransportClient.Object, + }; + + using (CosmosClient customClient = new CosmosClient( + endpoint.ToString(), + Convert.ToBase64String(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())), + cosmosClientOptions)) + { + try { - ResponseMessage response = await container.ReadItemStreamAsync(Guid.NewGuid().ToString(), new Cosmos.PartitionKey(Guid.NewGuid().ToString())); - Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Container container = customClient.GetContainer(databaseName, containerName); + + for (int i = 0; i < 20; i++) + { + ResponseMessage response = await container.ReadItemStreamAsync(Guid.NewGuid().ToString(), new Cosmos.PartitionKey(Guid.NewGuid().ToString())); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + } + + mockTransportClient.VerifyAll(); + mockHttpHandler.VerifyAll(); + + Documents.TransportAddressUri failedReplica = urisVisited.First(); + + // With replica validation enabled in preview mode, the failed replica will be validated as a part of the flow, + // and because any subsequent validation/ connection will be successful, the failed replica will now be marked + // as connected, thus it will be visited more than once. However, note that when replice validation is disabled, + // no validation is done thus the URI will be marked as unhealthy as expected. Therefore the uri will be visited + // just once. + Assert.IsTrue( + enableReplicaValidation + ? urisVisited.Any(x => x.Equals(failedReplica)) + : urisVisited.Count(x => x.Equals(failedReplica)) == 1); + + urisVisited.Clear(); + delayCacheRefresh = false; + do + { + await Task.Delay(TimeSpan.FromMilliseconds(100)); + }while (!delayRefreshUnblocked); + + for (int i = 0; i < 20; i++) + { + ResponseMessage response = await container.ReadItemStreamAsync(Guid.NewGuid().ToString(), new Cosmos.PartitionKey(Guid.NewGuid().ToString())); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + } + + Assert.AreEqual(4, urisVisited.ToHashSet().Count()); + + // Clears all the setups. No network calls should be done on the next operation. + mockHttpHandler.Reset(); + mockTransportClient.Reset(); } - - mockTransportClient.VerifyAll(); - mockHttpHandler.VerifyAll(); - - Documents.TransportAddressUri failedReplica = urisVisited.First(); - Assert.AreEqual(1, urisVisited.Count(x => x.Equals(failedReplica))); - - urisVisited.Clear(); - delayCacheRefresh = false; - do - { - await Task.Delay(TimeSpan.FromMilliseconds(100)); - }while (!delayRefreshUnblocked); - - for (int i = 0; i < 20; i++) + finally { - ResponseMessage response = await container.ReadItemStreamAsync(Guid.NewGuid().ToString(), new Cosmos.PartitionKey(Guid.NewGuid().ToString())); - Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + mockTransportClient.Setup(x => x.Dispose()); } - - Assert.AreEqual(4, urisVisited.ToHashSet().Count()); - - // Clears all the setups. No network calls should be done on the next operation. - mockHttpHandler.Reset(); - mockTransportClient.Reset(); - } - finally - { - mockTransportClient.Setup(x => x.Dispose()); } } + finally + { + Environment.SetEnvironmentVariable( + variable: ConfigurationManager.ReplicaConnectivityValidationEnabled, + value: null); + } } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs index 296c131fbf..c855599465 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs @@ -1000,19 +1000,8 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabled_ShouldValidat MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), openConnectionsHandler: fakeOpenConnectionHandler, suboptimalPartitionForceRefreshIntervalInSeconds: 2, - enableTcpConnectionEndpointRediscovery: true); - - // By default, the replica validation feature is disabled in GatewayAddressCache. Reflection is used to enable the feature - // for the purpose of this test. - FieldInfo fieldInfo = cache - .GetType() - .GetField( - name: "isReplicaAddressValidationEnabled", - bindingAttr: BindingFlags.Instance | BindingFlags.NonPublic); - - fieldInfo.SetValue( - obj: cache, - value: true); + enableTcpConnectionEndpointRediscovery: true, + replicaAddressValidationEnabled: true); DocumentServiceRequest request = DocumentServiceRequest.Create(OperationType.Invalid, ResourceType.Address, AuthorizationTokenType.Invalid); @@ -1156,19 +1145,8 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), openConnectionsHandler: fakeOpenConnectionHandler, suboptimalPartitionForceRefreshIntervalInSeconds: 2, - enableTcpConnectionEndpointRediscovery: true); - - // By default, the replica validation feature is disabled in GatewayAddressCache. Reflection is used to enable the feature - // for the purpose of this test. - FieldInfo fieldInfo = cache - .GetType() - .GetField( - name: "isReplicaAddressValidationEnabled", - bindingAttr: BindingFlags.Instance | BindingFlags.NonPublic); - - fieldInfo.SetValue( - obj: cache, - value: true); + enableTcpConnectionEndpointRediscovery: true, + replicaAddressValidationEnabled: true); DocumentServiceRequest request = DocumentServiceRequest.Create(OperationType.Invalid, ResourceType.Address, AuthorizationTokenType.Invalid); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/RequestEventHandlerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/RequestEventHandlerTests.cs index f5602a1f29..9a19fb4a90 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/RequestEventHandlerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/RequestEventHandlerTests.cs @@ -82,7 +82,7 @@ private StoreClient GetMockStoreClient() TransportClient mockTransportClient = this.GetMockTransportClient(); ISessionContainer sessionContainer = new SessionContainer(string.Empty); - StoreReader storeReader = new StoreReader(mockTransportClient, addressSelector, new AddressEnumerator(), sessionContainer); + StoreReader storeReader = new StoreReader(mockTransportClient, addressSelector, new AddressEnumerator(), sessionContainer, false); Mock mockAuthorizationTokenProvider = new Mock(); mockAuthorizationTokenProvider.Setup(provider => provider.AddSystemAuthorizationHeaderAsync( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/StoreReaderTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/StoreReaderTest.cs index b92ca3c804..831e32041a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/StoreReaderTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/StoreReaderTest.cs @@ -536,7 +536,8 @@ public void StoreReaderBarrierTest() new StoreReader(mockTransportClient, addressSelector, new AddressEnumerator(), - sessionContainer); + sessionContainer, + enableReplicaValidation: false); // reads always go to read quorum (2) replicas int replicaCountToRead = 2; @@ -611,14 +612,14 @@ public void GlobalStrongConsistentWriteMockTest() for (int i = 0; i < addressInformation.Length; i++) { TransportClient mockTransportClient = this.GetMockTransportClientForGlobalStrongWrites(addressInformation, i, false, false, false); - StoreReader storeReader = new StoreReader(mockTransportClient, addressSelector, new AddressEnumerator(), sessionContainer); - ConsistencyWriter consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false); + StoreReader storeReader = new StoreReader(mockTransportClient, addressSelector, new AddressEnumerator(), sessionContainer, false); + ConsistencyWriter consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false, false); StoreResponse response = consistencyWriter.WriteAsync(entity, new TimeoutHelper(TimeSpan.FromSeconds(30)), false).Result; Assert.AreEqual(100, response.LSN); //globalCommittedLsn never catches up in this case mockTransportClient = this.GetMockTransportClientForGlobalStrongWrites(addressInformation, i, true, false, false); - consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false); + consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false, false); try { response = consistencyWriter.WriteAsync(entity, new TimeoutHelper(TimeSpan.FromSeconds(30)), false).Result; @@ -629,17 +630,17 @@ public void GlobalStrongConsistentWriteMockTest() } mockTransportClient = this.GetMockTransportClientForGlobalStrongWrites(addressInformation, i, false, true, false); - consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false); + consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false, false); response = consistencyWriter.WriteAsync(entity, new TimeoutHelper(TimeSpan.FromSeconds(30)), false).Result; Assert.AreEqual(100, response.LSN); mockTransportClient = this.GetMockTransportClientForGlobalStrongWrites(addressInformation, i, false, true, true); - consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false); + consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false, false); response = consistencyWriter.WriteAsync(entity, new TimeoutHelper(TimeSpan.FromSeconds(30)), false).Result; Assert.AreEqual(100, response.LSN); mockTransportClient = this.GetMockTransportClientForGlobalStrongWrites(addressInformation, i, false, false, true); - consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false); + consistencyWriter = new ConsistencyWriter(addressSelector, sessionContainer, mockTransportClient, mockServiceConfigReader.Object, mockAuthorizationTokenProvider.Object, false, false); response = consistencyWriter.WriteAsync(entity, new TimeoutHelper(TimeSpan.FromSeconds(30)), false).Result; Assert.AreEqual(100, response.LSN); } @@ -703,7 +704,8 @@ public void GlobalStrongConsistencyMockTest() new StoreReader(mockTransportClient, addressSelector, new AddressEnumerator(), - sessionContainer); + sessionContainer, + false); Mock mockAuthorizationTokenProvider = new Mock(); mockAuthorizationTokenProvider.Setup(provider => provider.AddSystemAuthorizationHeaderAsync( @@ -746,7 +748,8 @@ public void GlobalStrongConsistencyMockTest() new StoreReader(mockTransportClient, addressSelector, new AddressEnumerator(), - sessionContainer); + sessionContainer, + false); Mock mockAuthorizationTokenProvider = new Mock(); mockAuthorizationTokenProvider.Setup(provider => provider.AddSystemAuthorizationHeaderAsync( @@ -798,7 +801,8 @@ public void GlobalStrongConsistencyMockTest() new StoreReader(mockTransportClient, addressSelector, new AddressEnumerator(), - sessionContainer); + sessionContainer, + false); Mock mockAuthorizationTokenProvider = new Mock(); mockAuthorizationTokenProvider.Setup(provider => provider.AddSystemAuthorizationHeaderAsync( From 077acf3e1a172406fb660af6dea6372e0f5a54c0 Mon Sep 17 00:00:00 2001 From: vipulvishal-ms <110802706+vipulvishal-ms@users.noreply.github.com> Date: Tue, 4 Jul 2023 15:31:20 +0530 Subject: [PATCH 153/240] Client Encryption: Adds package reference Microsoft.Azure.Cosmos version 3.35.1-preview (#3956) * changing cosmos preview version * updating build file --------- Co-authored-by: Matias Quaranta --- Directory.Build.props | 2 +- Microsoft.Azure.Cosmos.Encryption.Custom/changelog.md | 5 +++++ .../src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 71b854a5c7..51d6237854 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,7 +7,7 @@ 2.0.2 2.0.2 preview - 1.0.0-preview05 + 1.0.0-preview06 1.1.0-preview3 10.0 $([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../')) diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/changelog.md b/Microsoft.Azure.Cosmos.Encryption.Custom/changelog.md index 58fcf1d790..a96c9c325b 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/changelog.md +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/changelog.md @@ -3,6 +3,11 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [1.0.0-preview06](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption.Custom/1.0.0-preview06) - 2023-06-28 + +#### Fixes +- [#3956](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3956) Updates package reference Microsoft.Azure.Cosmos to version 3.35.1-preview. + ### [1.0.0-preview05](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption.Custom/1.0.0-preview05) - 2023-04-27 #### Fixes diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj b/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj index 09b92aa37e..a9f729c9ab 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj @@ -27,7 +27,7 @@ - + From 0d4e93f932064b1287e64b091687eabb615f7eec Mon Sep 17 00:00:00 2001 From: "microsoft-github-policy-service[bot]" <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com> Date: Thu, 6 Jul 2023 09:36:56 -0700 Subject: [PATCH 154/240] [Internal] FabricBot: Adds GitOps.ResourceManagement because of FabricBot decommissioning (#3966) * Add prIssueManagement.yml to onboard repo to GitOps.ResourceManagement as FabricBot replacement Owners of the FabricBot configuration should have received email notification. The same information contained in the email is published internally at: https://aka.ms/gim/fabricbot. Details on the replacement service and the syntax of the new yaml configuration file is available publicly at: https://microsoft.github.io/GitOps/policies/resource-management.html Please review and merge this PR to complete the process of onboarding to the new service. * Deleting fabricbot.json --------- Co-authored-by: microsoft-github-policy-service[bot] <77245923+microsoft-github-policy-service[bot]@users.noreply.github.com> --- .github/fabricbot.json | 183 ------------------------ .github/policies/resourceManagement.yml | 57 ++++++++ 2 files changed, 57 insertions(+), 183 deletions(-) delete mode 100644 .github/fabricbot.json create mode 100644 .github/policies/resourceManagement.yml diff --git a/.github/fabricbot.json b/.github/fabricbot.json deleted file mode 100644 index e400139553..0000000000 --- a/.github/fabricbot.json +++ /dev/null @@ -1,183 +0,0 @@ -{ - "version": "1.0", - "tasks": [ - { - "taskType": "scheduled", - "capabilityId": "ScheduledSearch", - "subCapability": "ScheduledSearch", - "version": "1.1", - "config": { - "frequency": [ - { - "weekDay": 0, - "hours": [], - "timezoneOffset": -8 - } - ], - "searchTerms": [ - { - "name": "noActivitySince", - "parameters": { - "days": 180 - } - }, - { - "name": "noLabel", - "parameters": { - "label": "VNext" - } - }, - { - "name": "noLabel", - "parameters": { - "label": "feature-request" - } - } - ], - "taskName": "CosmosV3-InactivePruge", - "actions": [ - { - "name": "addReply", - "parameters": { - "comment": "Closing due to in-activity, pease feel free to re-open." - } - }, - { - "name": "closeIssue", - "parameters": {} - } - ] - }, - "disabled": true - }, - { - "taskType": "trigger", - "capabilityId": "IssueResponder", - "subCapability": "IssuesOnlyResponder", - "version": "1.0", - "config": { - "conditions": { - "operator": "and", - "operands": [ - { - "operator": "not", - "operands": [ - { - "name": "isAssignedToSomeone", - "parameters": {} - } - ] - }, - { - "name": "isAction", - "parameters": { - "action": "opened" - } - }, - { - "operator": "not", - "operands": [ - { - "name": "hasLabel", - "parameters": { - "label": "needs-investigation" - } - } - ] - } - ] - }, - "eventType": "issue", - "eventNames": [ - "issues", - "project_card" - ], - "taskName": "Add needs-investigation", - "actions": [ - { - "name": "addLabel", - "parameters": { - "label": "needs-investigation" - } - } - ] - } - }, - { - "taskType": "trigger", - "capabilityId": "AutoMerge", - "subCapability": "AutoMerge", - "version": "1.0", - "config": { - "taskName": "PR Automerge", - "allowAutoMergeInstructionsWithoutLabel": false, - "mergeType": "squash", - "deleteBranches": true, - "removeLabelOnPush": true, - "label": "auto-merge", - "requireAllStatuses": false, - "requireSpecificCheckRuns": false, - "usePrDescriptionAsCommitMessage": false, - "minMinutesOpen": "60", - "enforceDMPAsStatus": true - } - }, - { - "taskType": "scheduled", - "capabilityId": "ScheduledSearch", - "subCapability": "ScheduledSearch", - "version": "1.1", - "config": { - "frequency": [ - { - "weekDay": 1, - "hours": [ - 9 - ], - "timezoneOffset": -7 - } - ], - "searchTerms": [ - { - "name": "isOpen", - "parameters": {} - }, - { - "name": "isIssue", - "parameters": {} - }, - { - "name": "hasLabel", - "parameters": { - "label": "needs-more-information" - } - }, - { - "name": "noActivitySince", - "parameters": { - "days": 14 - } - }, - { - "name": "noAssignees", - "parameters": {} - } - ], - "taskName": "Close inactive needs-information", - "actions": [ - { - "name": "addReply", - "parameters": { - "comment": "@${issueAuthor} this issue requires more information for the team to be able to help. In case this information is available, please add it and re-open the Issue." - } - }, - { - "name": "closeIssue", - "parameters": {} - } - ] - } - } - ], - "userGroups": [] -} diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml new file mode 100644 index 0000000000..8207a0708a --- /dev/null +++ b/.github/policies/resourceManagement.yml @@ -0,0 +1,57 @@ +id: +name: GitOps.PullRequestIssueManagement +description: GitOps.PullRequestIssueManagement primitive +owner: +resource: repository +disabled: false +where: +configuration: + resourceManagementConfiguration: + scheduledSearches: + - description: + frequencies: + - weekday: + day: Monday + time: 9:0 + filters: + - isOpen + - isIssue + - hasLabel: + label: needs-more-information + - noActivitySince: + days: 14 + - isNotAssigned + actions: + - addReply: + reply: '@${issueAuthor} this issue requires more information for the team to be able to help. In case this information is available, please add it and re-open the Issue.' + - closeIssue + eventResponderTasks: + - if: + - payloadType: Issues + - not: isAssignedToSomeone + - isAction: + action: Opened + - not: + hasLabel: + label: needs-investigation + then: + - addLabel: + label: needs-investigation + description: + - if: + - payloadType: Pull_Request + - hasLabel: + label: auto-merge + then: + - enableAutoMerge: + mergeMethod: Squash + description: + - if: + - payloadType: Pull_Request + - labelRemoved: + label: auto-merge + then: + - disableAutoMerge + description: +onFailure: +onSuccess: From 1981fc121408deff3204d50e941dbf4825e035f6 Mon Sep 17 00:00:00 2001 From: akotalwar <94020786+akotalwar@users.noreply.github.com> Date: Fri, 7 Jul 2023 13:59:49 -0700 Subject: [PATCH 155/240] [Internal] Query: Refactors certain tests to not fail when EnableOptimisticDirectExecution is set to true in 3.35.0-preview package (#3955) * Updated emulator and baseline tests to not fail when ODE is set to default true in PREVIEW mode * Fixed QueryAsync() test * Fixed QueryAsync() in EndToEndTraceBaselineTests * Undid changes to IndexMetrics baseline file * Updated EndToEndTraceWriterBaselineTests.QueryAsync xml * Updated xml * Updated xml to have request options tag --- ...EndTraceWriterBaselineTests.QueryAsync.xml | 21 +++++++++----- .../CosmosBasicQueryTests.cs | 10 +++++-- .../CosmosGatewayTimeoutTests.cs | 9 +++++- .../CosmosItemSessionTokenTests.cs | 5 +++- .../CosmosJsonSerializerTests.cs | 12 ++++++-- .../FeedToken/QueryFeedTokenTests.cs | 7 ++++- .../LinqTestsCommon.cs | 18 ++++++++++-- .../LinqTranslationBaselineTests.cs | 8 ++++- .../Query/AggregateQueryTests.cs | 3 ++ .../Query/SanityQueryTests.cs | 6 ++++ .../EndToEndTraceWriterBaselineTests.cs | 29 ++++++++++++++----- 11 files changed, 103 insertions(+), 25 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml index 8b737a419e..d6d638fd47 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.QueryAsync.xml @@ -4,7 +4,8 @@ Query traces = new List(); while (feedIterator.HasMoreResults) @@ -696,7 +697,8 @@ Query Typed feedIterator = (FeedIteratorInternal)container.GetItemQueryIterator( - queryText: "SELECT * FROM c"); + queryText: "SELECT * FROM c", + requestOptions: requestOptions); List traces = new List(); while (feedIterator.HasMoreResults) @@ -1408,7 +1410,8 @@ Query Public API traces = new List(); @@ -2101,7 +2104,8 @@ Query Public API Typed feedIterator = container.GetItemQueryIterator( - queryText: "SELECT * FROM c"); + queryText: "SELECT * FROM c", + requestOptions: requestOptions); List traces = new List(); @@ -2816,7 +2820,8 @@ Lazy currentLazy = Documents.ServiceInteropWrapper.AssembliesExist; Documents.ServiceInteropWrapper.AssembliesExist = new Lazy(() => false); FeedIterator feedIterator = container.GetItemQueryIterator( - queryText: "SELECT * FROM c"); + queryText: "SELECT * FROM c", + requestOptions: requestOptions); List traces = new List(); @@ -3596,7 +3601,8 @@ FeedIterator feedIterator = container.GetItemQueryStreamIterator( feedRange: FeedRangeEpk.FullRange, queryDefinition: new QueryDefinition("SELECT * FROM c"), - continuationToken: null); + continuationToken: null, + requestOptions: requestOptions); List traces = new List(); @@ -4298,7 +4304,8 @@ FeedIterator feedIterator = container.GetItemQueryIterator( feedRange: FeedRangeEpk.FullRange, queryDefinition: new QueryDefinition("SELECT * FROM c"), - continuationToken: null); + continuationToken: null, + requestOptions: requestOptions); List traces = new List(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosBasicQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosBasicQueryTests.cs index 7ae2b28cc6..25ac9a705f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosBasicQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosBasicQueryTests.cs @@ -240,7 +240,10 @@ public async Task QueryRequestRateTest(bool directMode) requestOptions: new QueryRequestOptions() { MaxItemCount = 1, - MaxConcurrency = 1 + MaxConcurrency = 1, +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif })) { while (feedIterator.HasMoreResults) @@ -268,7 +271,10 @@ public async Task QueryRequestRateTest(bool directMode) requestOptions: new QueryRequestOptions() { MaxItemCount = 1, - MaxConcurrency = 1 + MaxConcurrency = 1, +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif }); // First request should be a success diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosGatewayTimeoutTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosGatewayTimeoutTests.cs index f50319f65f..241b60fb7f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosGatewayTimeoutTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosGatewayTimeoutTests.cs @@ -81,7 +81,14 @@ public async Task QueryPlanRetryTimeoutTestAsync() } }; - using FeedIterator iterator = gatewayQueryPlanContainer.GetItemQueryIterator("select * From T order by T.status"); + QueryRequestOptions requestOptions = new QueryRequestOptions() + { +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif + }; + + using FeedIterator iterator = gatewayQueryPlanContainer.GetItemQueryIterator("select * From T order by T.status", requestOptions: requestOptions); FeedResponse response = await iterator.ReadNextAsync(); Assert.IsTrue(isQueryRequestFound, "Query plan call back was not called."); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemSessionTokenTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemSessionTokenTests.cs index f815eba08e..c76110f1fb 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemSessionTokenTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemSessionTokenTests.cs @@ -366,7 +366,10 @@ public async Task InvalidSessionTokenAfterContainerRecreationAndCollectionCacheR new QueryRequestOptions { ConsistencyLevel = Cosmos.ConsistencyLevel.Session, - PartitionKey = new Cosmos.PartitionKey(pk) + PartitionKey = new Cosmos.PartitionKey(pk), +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif }); int itemCountOldContainer = 0; while (queryIteratorOldContainer.HasMoreResults) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosJsonSerializerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosJsonSerializerTests.cs index 0be44fbc1c..eadb62da7c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosJsonSerializerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosJsonSerializerTests.cs @@ -98,7 +98,11 @@ public async Task TestQueryWithCustomJsonSerializer() fromStreamCount = 0; FeedIterator itemIterator = container.GetItemQueryIterator( - query); + query +#if PREVIEW + , requestOptions: new QueryRequestOptions() { EnableOptimisticDirectExecution = false } +#endif + ); List items = new List(); while (itemIterator.HasMoreResults) { @@ -113,7 +117,11 @@ public async Task TestQueryWithCustomJsonSerializer() // Verify that the custom serializer is actually being used via stream FeedIterator itemStreamIterator = container.GetItemQueryStreamIterator( - query); + query +#if PREVIEW + , requestOptions: new QueryRequestOptions() { EnableOptimisticDirectExecution = false } +#endif + ); while (itemStreamIterator.HasMoreResults) { ResponseMessage response = await itemStreamIterator.ReadNextAsync(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/QueryFeedTokenTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/QueryFeedTokenTests.cs index df61615fe6..ce9723e7ee 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/QueryFeedTokenTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/FeedToken/QueryFeedTokenTests.cs @@ -101,7 +101,12 @@ public async Task InexistentPKRangeId() FeedIterator feedIterator = container.GetItemQueryIterator( queryDefinition: new QueryDefinition("select * from T where STARTSWITH(T.id, \"BasicItem\")"), feedRange: feedRange, - continuationToken: null); + continuationToken: null + +#if PREVIEW + , requestOptions: new QueryRequestOptions() { EnableOptimisticDirectExecution = false } +#endif + ); CosmosException exception = await Assert.ThrowsExceptionAsync(() => feedIterator.ReadNextAsync()); Assert.AreEqual(HttpStatusCode.Gone, exception.StatusCode); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestsCommon.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestsCommon.cs index 5907d861fc..87b33110e2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestsCommon.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestsCommon.cs @@ -296,7 +296,14 @@ public static Func> GenerateTestCosmosData(Func query = container.GetItemLinqQueryable(allowSynchronousQueryExecution: true); + QueryRequestOptions requestOptions = new QueryRequestOptions() + { +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif + }; + + IOrderedQueryable query = container.GetItemLinqQueryable(allowSynchronousQueryExecution: true, requestOptions: requestOptions); // To cover both query against backend and queries on the original data using LINQ nicely, // the LINQ expression should be written once and they should be compiled and executed against the two sources. @@ -483,7 +490,14 @@ Cosmos.Database cosmosDatabase } FeedOptions feedOptions = new FeedOptions() { EnableScanInQuery = true, EnableCrossPartitionQuery = true }; - IOrderedQueryable query = container.GetItemLinqQueryable(allowSynchronousQueryExecution: true); + QueryRequestOptions requestOptions = new QueryRequestOptions() + { +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif + }; + + IOrderedQueryable query = container.GetItemLinqQueryable(allowSynchronousQueryExecution: true, requestOptions: requestOptions); // To cover both query against backend and queries on the original data using LINQ nicely, // the LINQ expression should be written once and they should be compiled and executed against the two sources. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs index 5a46a2d118..51da69c98f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs @@ -1136,8 +1136,14 @@ public void TestSelectTop() Tuple> generatedData = this.CreateDataTestSelectTop(); int seed = generatedData.Item1; List data = generatedData.Item2; + QueryRequestOptions requestOptions = new QueryRequestOptions() + { +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif + }; - IOrderedQueryable query = testContainer.GetItemLinqQueryable(allowSynchronousQueryExecution: true); + IOrderedQueryable query = testContainer.GetItemLinqQueryable(allowSynchronousQueryExecution: true, requestOptions: requestOptions); Func> getQuery = useQuery => useQuery ? query : data.AsQueryable(); List inputs = new List diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/AggregateQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/AggregateQueryTests.cs index 0bcfcea030..d60f76f92c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/AggregateQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/AggregateQueryTests.cs @@ -152,6 +152,9 @@ async Task ImplementationAsync( new QueryRequestOptions() { MaxConcurrency = maxDoP, +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif }); if (argument.ExpectedValue == null) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SanityQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SanityQueryTests.cs index 60ab6f9fe4..9eecd81e30 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SanityQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SanityQueryTests.cs @@ -538,6 +538,9 @@ static async Task ImplementationAsync(Container container, IReadOnlyList MaxBufferedItemCount = 7000, MaxConcurrency = maxDegreeOfParallelism, MaxItemCount = maxItemCount, +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif }; async Task> AssertPassthroughAsync(string query, Cosmos.PartitionKey? pk = default) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs index 64bc7c015a..79e947d41b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs @@ -25,7 +25,7 @@ namespace Microsoft.Azure.Cosmos.EmulatorTests.Tracing using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json.Linq; using static Microsoft.Azure.Cosmos.SDK.EmulatorTests.TransportClientHelper; - + [VisualStudio.TestTools.UnitTesting.TestClass] [TestCategory("UpdateContract")] public sealed class EndToEndTraceWriterBaselineTests : BaselineTests @@ -464,6 +464,12 @@ public async Task ChangeFeedAsync() public async Task QueryAsync() { List inputs = new List(); + QueryRequestOptions requestOptions = new QueryRequestOptions() + { +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif + }; int startLineNumber; int endLineNumber; @@ -474,7 +480,8 @@ public async Task QueryAsync() { startLineNumber = GetLineNumber(); FeedIteratorInternal feedIterator = (FeedIteratorInternal)container.GetItemQueryStreamIterator( - queryText: "SELECT * FROM c"); + queryText: "SELECT * FROM c", + requestOptions: requestOptions); List traces = new List(); while (feedIterator.HasMoreResults) @@ -499,7 +506,8 @@ public async Task QueryAsync() { startLineNumber = GetLineNumber(); FeedIteratorInternal feedIterator = (FeedIteratorInternal)container.GetItemQueryIterator( - queryText: "SELECT * FROM c"); + queryText: "SELECT * FROM c", + requestOptions: requestOptions); List traces = new List(); while (feedIterator.HasMoreResults) @@ -524,7 +532,8 @@ public async Task QueryAsync() { startLineNumber = GetLineNumber(); FeedIterator feedIterator = container.GetItemQueryStreamIterator( - queryText: "SELECT * FROM c"); + queryText: "SELECT * FROM c", + requestOptions: requestOptions); List traces = new List(); @@ -550,7 +559,8 @@ public async Task QueryAsync() { startLineNumber = GetLineNumber(); FeedIterator feedIterator = container.GetItemQueryIterator( - queryText: "SELECT * FROM c"); + queryText: "SELECT * FROM c", + requestOptions: requestOptions); List traces = new List(); @@ -578,7 +588,8 @@ public async Task QueryAsync() Lazy currentLazy = Documents.ServiceInteropWrapper.AssembliesExist; Documents.ServiceInteropWrapper.AssembliesExist = new Lazy(() => false); FeedIterator feedIterator = container.GetItemQueryIterator( - queryText: "SELECT * FROM c"); + queryText: "SELECT * FROM c", + requestOptions: requestOptions); List traces = new List(); @@ -607,7 +618,8 @@ public async Task QueryAsync() FeedIterator feedIterator = container.GetItemQueryStreamIterator( feedRange: FeedRangeEpk.FullRange, queryDefinition: new QueryDefinition("SELECT * FROM c"), - continuationToken: null); + continuationToken: null, + requestOptions: requestOptions); List traces = new List(); @@ -635,7 +647,8 @@ public async Task QueryAsync() FeedIterator feedIterator = container.GetItemQueryIterator( feedRange: FeedRangeEpk.FullRange, queryDefinition: new QueryDefinition("SELECT * FROM c"), - continuationToken: null); + continuationToken: null, + requestOptions: requestOptions); List traces = new List(); From d3fa6a88142d7373c8ee9f96e1a54e08f63a6027 Mon Sep 17 00:00:00 2001 From: Rinat Minibaev <132935507+rinatmini@users.noreply.github.com> Date: Mon, 10 Jul 2023 08:07:18 -0700 Subject: [PATCH 156/240] Diagnostics: Fixes verbose levels for "Operation will NOT be retried" (#3969) --- Microsoft.Azure.Cosmos/src/ResourceThrottleRetryPolicy.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ResourceThrottleRetryPolicy.cs b/Microsoft.Azure.Cosmos/src/ResourceThrottleRetryPolicy.cs index c6187f3e51..a99bc594f7 100644 --- a/Microsoft.Azure.Cosmos/src/ResourceThrottleRetryPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/ResourceThrottleRetryPolicy.cs @@ -52,7 +52,7 @@ public Task ShouldRetryAsync( { if (!this.IsValidThrottleStatusCode(dce.StatusCode)) { - DefaultTrace.TraceError( + DefaultTrace.TraceVerbose( "Operation will NOT be retried. Current attempt {0}, Status Code: {1} ", this.currentAttemptCount, dce.StatusCode); @@ -81,7 +81,7 @@ public Task ShouldRetryAsync( { if (!this.IsValidThrottleStatusCode(cosmosResponseMessage?.StatusCode)) { - DefaultTrace.TraceError( + DefaultTrace.TraceVerbose( "Operation will NOT be retried. Current attempt {0}, Status Code: {1} ", this.currentAttemptCount, cosmosResponseMessage?.StatusCode); From 51c9d9c6fda1656cb1d3a28d2bb23df3e1ce43ad Mon Sep 17 00:00:00 2001 From: akotalwar <94020786+akotalwar@users.noreply.github.com> Date: Mon, 10 Jul 2023 12:37:50 -0700 Subject: [PATCH 157/240] Query: Fixes malformed continuation token exception type and message (#3917) * Fixed malformed continuation token issue where Exception was not CosmosExceptionan and did not have the correct Status and Sub Status codes. * Fixed incorrect indentation * Added type check for incoming exception * Replaced if/else with extra catch block * Moved fix to a higher point in the call stack * Removed unused Usings * Updated test code --------- Co-authored-by: Matias Quaranta --- .../src/ReadFeed/ReadFeedIteratorCore.cs | 25 ++++++++++++++++-- .../CosmosItemLinqTests.cs | 26 +++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedIteratorCore.cs b/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedIteratorCore.cs index d9b935e758..8a46196a56 100644 --- a/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedIteratorCore.cs +++ b/Microsoft.Azure.Cosmos/src/ReadFeed/ReadFeedIteratorCore.cs @@ -9,13 +9,16 @@ namespace Microsoft.Azure.Cosmos.ReadFeed using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.CosmosElements; - using Microsoft.Azure.Cosmos.Diagnostics; + using Microsoft.Azure.Cosmos.Json; using Microsoft.Azure.Cosmos.Pagination; using Microsoft.Azure.Cosmos.Query.Core; + using Microsoft.Azure.Cosmos.Query.Core.Exceptions; using Microsoft.Azure.Cosmos.Query.Core.Monads; using Microsoft.Azure.Cosmos.ReadFeed.Pagination; + using Microsoft.Azure.Cosmos.Resource.CosmosExceptions; using Microsoft.Azure.Cosmos.Routing; using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Documents; /// /// Cosmos feed stream iterator. This is used to get the query responses with a Stream content @@ -113,7 +116,25 @@ public ReadFeedIteratorCore( else { CosmosString tokenAsString = (CosmosString)token; - state = ReadFeedState.Continuation(CosmosElement.Parse(tokenAsString.Value)); + try + { + state = ReadFeedState.Continuation(CosmosElement.Parse(tokenAsString.Value)); + } + catch (Exception exception) when (exception.InnerException is JsonParseException) + { + MalformedContinuationTokenException malformedContinuationTokenException = new MalformedContinuationTokenException(exception.Message); + throw CosmosExceptionFactory.CreateBadRequestException( + message: $"Malformed Continuation Token: {tokenAsString}.", + headers: CosmosQueryResponseMessageHeaders.ConvertToQueryHeaders( + new Headers(), + default, + default, + (int)SubStatusCodes.MalformedContinuationToken, + default), + stackTrace: exception.StackTrace, + innerException: malformedContinuationTokenException, + trace: null); + } } FeedRangeState feedRangeState = new FeedRangeState(feedRange, state); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemLinqTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemLinqTests.cs index 28fc3ec61c..b3dc7afa41 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemLinqTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemLinqTests.cs @@ -211,6 +211,32 @@ public async Task ItemLINQQueryTest() Assert.AreEqual(itemList[1].id, queriable.ToList()[0].id); } + [TestMethod] + public void ItemLINQQueryWithInvalidContinuationTokenTest() + { + string malformedString = "Malformed String"; + FeedIterator feedIterator = this.Container.GetItemLinqQueryable().ToFeedIterator(); + + while (feedIterator.HasMoreResults) + { + IOrderedQueryable querable = this.Container.GetItemLinqQueryable( + continuationToken: malformedString); + try + { + FeedIterator iterator = querable.ToFeedIterator(); + } + catch (CosmosException exception) + { + Assert.IsTrue(exception.StatusCode == System.Net.HttpStatusCode.BadRequest); + Assert.IsTrue(exception.SubStatusCode == (int)Documents.SubStatusCodes.MalformedContinuationToken); + Assert.IsTrue(exception.Message.Contains(malformedString)); + return; + } + + Assert.Fail("Should never reach till here, hence ensuring that an exception is always recieved"); + } + } + [TestMethod] public async Task ItemLINQQueryWithContinuationTokenTest() { From 4bb62d378c2960088efa44c76f96ca4bdac8fae6 Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Mon, 10 Jul 2023 17:38:22 -0700 Subject: [PATCH 158/240] [Internal] Upgrade Resiliency: Refactors Code to Enable Replica Validation Feature Through `CosmosClientOptions` And Environment Variable (#3974) * Code changes to use client options to enable or disable replica validation. * Code changes to fix preview build failures. --- .../src/ConnectionPolicy.cs | 12 +++ .../src/CosmosClientOptions.cs | 12 +++ Microsoft.Azure.Cosmos/src/DocumentClient.cs | 2 +- .../src/Routing/GlobalAddressResolver.cs | 2 +- .../src/Util/ConfigurationManager.cs | 9 ++- .../CosmosReadManyItemsTests.cs | 61 +++++++++++---- .../CosmosBadReplicaTests.cs | 75 +++++++++++-------- .../CosmosClientOptionsUnitTests.cs | 7 +- 8 files changed, 131 insertions(+), 49 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs b/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs index 7abfd76deb..9193abedef 100644 --- a/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs @@ -459,6 +459,18 @@ public Func HttpClientFactory set; } + /// + /// Gets or sets the boolean flag to enable replica validation. + /// + /// + /// The default value for this parameter is false. + /// + public bool? EnableAdvancedReplicaSelectionForTcp + { + get; + set; + } + /// /// (Direct/TCP) This is an advanced setting that controls the number of TCP connections that will be opened eagerly to each Cosmos DB back-end. /// diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs index 1fce195915..330738c00b 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs @@ -346,6 +346,17 @@ public ConnectionMode ConnectionMode /// public bool? EnableContentResponseOnWrite { get; set; } + /// + /// Gets or sets the advanced replica selection flag. The advanced replica selection logic keeps track of the replica connection + /// status, and based on status, it prioritizes the replicas which show healthy stable connections, so that the requests can be sent + /// confidently to the particular replica. This helps the cosmos client to become more resilient and effective to any connectivity issues. + /// The default value for this parameter is 'false'. + /// + /// + /// This is optimal for latency-sensitive workloads. Does not apply if is used. + /// + internal bool? EnableAdvancedReplicaSelectionForTcp { get; set; } + /// /// (Direct/TCP) Controls the amount of idle time after which unused connections are closed. /// @@ -758,6 +769,7 @@ internal virtual ConnectionPolicy GetConnectionPolicy(int clientId) EnablePartitionLevelFailover = this.EnablePartitionLevelFailover, PortReuseMode = this.portReuseMode, EnableTcpConnectionEndpointRediscovery = this.EnableTcpConnectionEndpointRediscovery, + EnableAdvancedReplicaSelectionForTcp = this.EnableAdvancedReplicaSelectionForTcp, HttpClientFactory = this.httpClientFactory, ServerCertificateCustomValidationCallback = this.ServerCertificateCustomValidationCallback }; diff --git a/Microsoft.Azure.Cosmos/src/DocumentClient.cs b/Microsoft.Azure.Cosmos/src/DocumentClient.cs index 752ec8f5a5..c7aeb07a6f 100644 --- a/Microsoft.Azure.Cosmos/src/DocumentClient.cs +++ b/Microsoft.Azure.Cosmos/src/DocumentClient.cs @@ -233,7 +233,7 @@ public DocumentClient(Uri serviceEndpoint, this.Initialize(serviceEndpoint, connectionPolicy, desiredConsistencyLevel); this.initTaskCache = new AsyncCacheNonBlocking(cancellationToken: this.cancellationTokenSource.Token); - this.isReplicaAddressValidationEnabled = ConfigurationManager.IsReplicaAddressValidationEnabled(); + this.isReplicaAddressValidationEnabled = ConfigurationManager.IsReplicaAddressValidationEnabled(connectionPolicy); } /// diff --git a/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs b/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs index 8ac0719dcd..058e9c3ce4 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GlobalAddressResolver.cs @@ -67,7 +67,7 @@ public GlobalAddressResolver( this.enableTcpConnectionEndpointRediscovery = connectionPolicy.EnableTcpConnectionEndpointRediscovery; - this.isReplicaAddressValidationEnabled = ConfigurationManager.IsReplicaAddressValidationEnabled(); + this.isReplicaAddressValidationEnabled = ConfigurationManager.IsReplicaAddressValidationEnabled(connectionPolicy); this.maxEndpoints = maxBackupReadEndpoints + 2; // for write and alternate write endpoint (during failover) diff --git a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs index ed0f5a47a6..216e1295b5 100644 --- a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs +++ b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs @@ -32,13 +32,20 @@ public static T GetEnvironmentVariable(string variable, T defaultValue) /// both preview and GA. The method will eventually be removed, once replica valdiatin is enabled by default /// for both preview and GA. /// + /// An instance of containing the client options. /// A boolean flag indicating if replica validation is enabled. - public static bool IsReplicaAddressValidationEnabled() + public static bool IsReplicaAddressValidationEnabled( + ConnectionPolicy connectionPolicy) { bool replicaValidationDefaultValue = false; #if PREVIEW replicaValidationDefaultValue = true; #endif + if (connectionPolicy != null + && connectionPolicy.EnableAdvancedReplicaSelectionForTcp.HasValue) + { + return connectionPolicy.EnableAdvancedReplicaSelectionForTcp.Value; + } return ConfigurationManager .GetEnvironmentVariable( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs index d215b6b18b..05184d7826 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs @@ -51,27 +51,58 @@ public async Task Cleanup() } [TestMethod] - public async Task ReadManyTypedTest() + [DataRow(true, DisplayName = "Validates Read Many scenario with advanced replica selection enabled.")] + [DataRow(false, DisplayName = "Validates Read Many scenario with advanced replica selection disabled.")] + public async Task ReadManyTypedTestWithAdvancedReplicaSelection( + bool advancedReplicaSelectionEnabled) { - List<(string, PartitionKey)> itemList = new List<(string, PartitionKey)>(); - for (int i=0; i<10; i++) + CosmosClientOptions clientOptions = new () { - itemList.Add((i.ToString(), new PartitionKey("pk" + i.ToString()))); - } + EnableAdvancedReplicaSelectionForTcp = advancedReplicaSelectionEnabled, + }; - FeedResponse feedResponse= await this.Container.ReadManyItemsAsync(itemList); - Assert.IsNotNull(feedResponse); - Assert.AreEqual(feedResponse.Count, 10); - Assert.IsTrue(feedResponse.Headers.RequestCharge > 0); - Assert.IsNotNull(feedResponse.Diagnostics); + Database database = null; + CosmosClient cosmosClient = TestCommon.CreateCosmosClient(clientOptions); + try + { + database = await cosmosClient.CreateDatabaseAsync("ReadManyTypedTestScenarioDb"); + Container container = await database.CreateContainerAsync("ReadManyTypedTestContainer", "/pk"); - int count = 0; - foreach (ToDoActivity item in feedResponse) + // Create items with different pk values + for (int i = 0; i < 500; i++) + { + ToDoActivity item = ToDoActivity.CreateRandomToDoActivity(); + item.pk = "pk" + i.ToString(); + item.id = i.ToString(); + ItemResponse itemResponse = await container.CreateItemAsync(item); + Assert.AreEqual(HttpStatusCode.Created, itemResponse.StatusCode); + } + + List<(string, PartitionKey)> itemList = new List<(string, PartitionKey)>(); + for (int i = 0; i < 20; i++) + { + itemList.Add((i.ToString(), new PartitionKey("pk" + i.ToString()))); + } + + FeedResponse feedResponse = await container.ReadManyItemsAsync(itemList); + Assert.IsNotNull(feedResponse); + Assert.AreEqual(20, feedResponse.Count); + Assert.IsTrue(feedResponse.Headers.RequestCharge > 0); + Assert.IsNotNull(feedResponse.Diagnostics); + + int count = 0; + foreach (ToDoActivity item in feedResponse) + { + count++; + Assert.IsNotNull(item); + } + Assert.AreEqual(20, count); + } + finally { - count++; - Assert.IsNotNull(item); + await database.DeleteAsync(); + cosmosClient.Dispose(); } - Assert.AreEqual(count, 10); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosBadReplicaTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosBadReplicaTests.cs index 7a5b387e8e..151e0690a8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosBadReplicaTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosBadReplicaTests.cs @@ -21,16 +21,23 @@ public class CosmosBadReplicaTests { [TestMethod] [Timeout(30000)] - [DataRow(true, DisplayName = "Validate when replica validation is enabled.")] - [DataRow(false, DisplayName = "Validate when replica validation is disabled.")] + [DataRow(true, true, false, DisplayName = "Validate when replica validation is enabled using environment variable.")] + [DataRow(false, true, false, DisplayName = "Validate when replica validation is disabled using environment variable.")] + [DataRow(true, false, true, DisplayName = "Validate when replica validation is enabled using cosmos client options.")] + [DataRow(false, false, true, DisplayName = "Validate when replica validation is disabled using cosmos client options.")] public async Task TestGoneFromServiceScenarioAsync( - bool enableReplicaValidation) + bool enableReplicaValidation, + bool useEnvironmentVariable, + bool useCosmosClientOptions) { try { - Environment.SetEnvironmentVariable( - variable: ConfigurationManager.ReplicaConnectivityValidationEnabled, - value: enableReplicaValidation.ToString()); + if (useEnvironmentVariable) + { + Environment.SetEnvironmentVariable( + variable: ConfigurationManager.ReplicaConnectivityValidationEnabled, + value: enableReplicaValidation.ToString()); + } Mock mockHttpHandler = new Mock(MockBehavior.Strict); Uri endpoint = MockSetupsHelper.SetupSingleRegionAccount( @@ -56,28 +63,28 @@ public async Task TestGoneFromServiceScenarioAsync( cRid, out IReadOnlyList partitionKeyRanges); - List replicaIds1 = new List() - { - "11111111111111111", - "22222222222222222", - "33333333333333333", - "44444444444444444", - }; - - HttpResponseMessage replicaSet1 = MockSetupsHelper.CreateAddresses( - replicaIds1, - partitionKeyRanges.First(), - "eastus", - cRid); + List replicaIds1 = new List() + { + "11111111111111111", + "22222222222222222", + "33333333333333333", + "44444444444444444", + }; - // One replica changed on the refresh - List replicaIds2 = new List() - { - "11111111111111111", - "22222222222222222", - "33333333333333333", - "55555555555555555", - }; + HttpResponseMessage replicaSet1 = MockSetupsHelper.CreateAddresses( + replicaIds1, + partitionKeyRanges.First(), + "eastus", + cRid); + + // One replica changed on the refresh + List replicaIds2 = new List() + { + "11111111111111111", + "22222222222222222", + "33333333333333333", + "55555555555555555", + }; HttpResponseMessage replicaSet2 = MockSetupsHelper.CreateAddresses( replicaIds2, @@ -146,6 +153,11 @@ public async Task TestGoneFromServiceScenarioAsync( TransportClientHandlerFactory = (original) => mockTransportClient.Object, }; + if (useCosmosClientOptions) + { + cosmosClientOptions.EnableAdvancedReplicaSelectionForTcp = enableReplicaValidation; + } + using (CosmosClient customClient = new CosmosClient( endpoint.ToString(), Convert.ToBase64String(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())), @@ -203,9 +215,12 @@ public async Task TestGoneFromServiceScenarioAsync( } finally { - Environment.SetEnvironmentVariable( - variable: ConfigurationManager.ReplicaConnectivityValidationEnabled, - value: null); + if (useEnvironmentVariable) + { + Environment.SetEnvironmentVariable( + variable: ConfigurationManager.ReplicaConnectivityValidationEnabled, + value: null); + } } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs index efb06d7cc5..37d89c389a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs @@ -81,6 +81,7 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() Assert.IsNull(clientOptions.HttpClientFactory); Assert.AreNotEqual(consistencyLevel, clientOptions.ConsistencyLevel); Assert.IsFalse(clientOptions.EnablePartitionLevelFailover); + Assert.IsFalse(clientOptions.EnableAdvancedReplicaSelectionForTcp.HasValue); //Verify GetConnectionPolicy returns the correct values for default ConnectionPolicy policy = clientOptions.GetConnectionPolicy(clientId: 0); @@ -97,6 +98,7 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() Assert.IsNull(policy.HttpClientFactory); Assert.AreNotEqual(Cosmos.ConsistencyLevel.Session, clientOptions.ConsistencyLevel); Assert.IsFalse(policy.EnablePartitionLevelFailover); + Assert.IsFalse(clientOptions.EnableAdvancedReplicaSelectionForTcp.HasValue); cosmosClientBuilder.WithApplicationRegion(region) .WithConnectionModeGateway(maxConnections, webProxy) @@ -112,6 +114,7 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() cosmosClient = cosmosClientBuilder.Build(new MockDocumentClient()); clientOptions = cosmosClient.ClientOptions; + clientOptions.EnableAdvancedReplicaSelectionForTcp = true; //Verify all the values are updated Assert.AreEqual(region, clientOptions.ApplicationRegion); @@ -131,6 +134,7 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() Assert.IsTrue(clientOptions.AllowBulkExecution); Assert.AreEqual(consistencyLevel, clientOptions.ConsistencyLevel); Assert.IsTrue(clientOptions.EnablePartitionLevelFailover); + Assert.IsTrue(clientOptions.EnableAdvancedReplicaSelectionForTcp.HasValue && clientOptions.EnableAdvancedReplicaSelectionForTcp.Value); //Verify GetConnectionPolicy returns the correct values policy = clientOptions.GetConnectionPolicy(clientId: 0); @@ -145,7 +149,8 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() Assert.AreEqual((int)maxRetryWaitTime.TotalSeconds, policy.RetryOptions.MaxRetryWaitTimeInSeconds); Assert.AreEqual((Documents.ConsistencyLevel)consistencyLevel, clientOptions.GetDocumentsConsistencyLevel()); Assert.IsTrue(policy.EnablePartitionLevelFailover); - + Assert.IsTrue(clientOptions.EnableAdvancedReplicaSelectionForTcp.Value); + IReadOnlyList preferredLocations = new List() { Regions.AustraliaCentral, Regions.AustraliaCentral2 }; //Verify Direct Mode settings cosmosClientBuilder = new CosmosClientBuilder( From d0aac27bfdd5fb90a7ab0523491897454f69ba6b Mon Sep 17 00:00:00 2001 From: ernesto1596 Date: Tue, 11 Jul 2023 11:43:55 -0700 Subject: [PATCH 159/240] Query : Adds string comparison alternative when converting LINQ to SQL (#3668) * string.Compare supported with LINQ to SQL * Update tests * Update test name * Update tests * Add test * Create helper ReverseExpressionTypeForStrings * PR feedback * Update tests * Update base line --------- Co-authored-by: Aditya Co-authored-by: Matias Quaranta --- .../src/ClientResources.Designer.cs | 18 ++ .../src/ClientResources.resx | 8 +- .../src/Linq/ExpressionToSQL.cs | 87 +++++- ...slationBaselineTests.TestStringCompare.xml | 267 ++++++++++++++++++ ...ationBaselineTests.TestStringCompareTo.xml | 6 +- .../LinqTranslationBaselineTests.cs | 52 ++++ ...icrosoft.Azure.Cosmos.EmulatorTests.csproj | 8 +- 7 files changed, 429 insertions(+), 17 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompare.xml diff --git a/Microsoft.Azure.Cosmos/src/ClientResources.Designer.cs b/Microsoft.Azure.Cosmos/src/ClientResources.Designer.cs index 7ea2672d6c..3736d0fbbd 100644 --- a/Microsoft.Azure.Cosmos/src/ClientResources.Designer.cs +++ b/Microsoft.Azure.Cosmos/src/ClientResources.Designer.cs @@ -582,6 +582,24 @@ internal static string StringCompareToInvalidOperator { } } + /// + /// Looks up a localized string similar to Invalid operator for string.Compare(). Valid operators are ('==', '<', '<=', '>' or '>='). + /// + internal static string StringCompareInvalidOperator { + get { + return ResourceManager.GetString("StringCompareInvalidOperator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The right hand side of string.Compare() comparison must be constant '0'. + /// + internal static string StringCompareInvalidConstant { + get { + return ResourceManager.GetString("StringCompareInvalidConstant", resourceCulture); + } + } + /// /// Looks up a localized string similar to Token refresh in progress.. /// diff --git a/Microsoft.Azure.Cosmos/src/ClientResources.resx b/Microsoft.Azure.Cosmos/src/ClientResources.resx index ae00e80a78..7a3e336e2a 100644 --- a/Microsoft.Azure.Cosmos/src/ClientResources.resx +++ b/Microsoft.Azure.Cosmos/src/ClientResources.resx @@ -268,11 +268,17 @@ Failed to deserialize response returned by server. - The right hand side of string.CompareTo() comparison must be constant '0' + The right-hand side of String.CompareTo() comparison must be constant '0'. + + + The right-hand side of String.Compare() comparison must be constant '0'. Invalid operator for string.CompareTo(). Vaid operators are ('==', '<', '<=', '>' or '>=') + + Invalid operator for string.Compare(). Vaid operators are ('==', '<', '<=', '>' or '>=') + Token refresh in progress. diff --git a/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs b/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs index b259234336..2ada0738da 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs @@ -457,6 +457,11 @@ private static SqlScalarExpression VisitBinary(BinaryExpression inputExpression, { return ExpressionToSql.VisitStringCompareTo(methodCallExpression, constantExpression, inputExpression.NodeType, reverseNodeType, context); } + + if (TryMatchStringCompare(methodCallExpression, constantExpression, inputExpression.NodeType)) + { + return ExpressionToSql.VisitStringCompare(methodCallExpression, constantExpression, inputExpression.NodeType, reverseNodeType, context); + } } SqlScalarExpression left = ExpressionToSql.VisitScalarExpression(inputExpression.Left, context); @@ -615,32 +620,90 @@ private static SqlScalarExpression VisitStringCompareTo( { if (reverseNodeType) { + compareOperator = ReverseExpressionTypeForStrings(compareOperator, ClientResources.StringCompareToInvalidOperator); + } + + SqlBinaryScalarOperatorKind op = GetBinaryOperatorKind(compareOperator, null); + + SqlScalarExpression leftExpression = ExpressionToSql.VisitNonSubqueryScalarExpression(left.Object, context); + SqlScalarExpression rightExpression = ExpressionToSql.VisitNonSubqueryScalarExpression(left.Arguments[0], context); + + return SqlBinaryScalarExpression.Create(op, leftExpression, rightExpression); + } + + private static ExpressionType ReverseExpressionTypeForStrings(ExpressionType compareOperator, string errorMessage) + { + switch (compareOperator) + { + case ExpressionType.Equal: + // do nothing + break; + case ExpressionType.GreaterThan: + compareOperator = ExpressionType.LessThan; + break; + case ExpressionType.GreaterThanOrEqual: + compareOperator = ExpressionType.LessThanOrEqual; + break; + case ExpressionType.LessThan: + compareOperator = ExpressionType.GreaterThan; + break; + case ExpressionType.LessThanOrEqual: + compareOperator = ExpressionType.GreaterThanOrEqual; + break; + default: + throw new DocumentQueryException(string.Format(CultureInfo.CurrentCulture, errorMessage)); + } + + return compareOperator; + } + + private static bool TryMatchStringCompare(MethodCallExpression left, ConstantExpression right, ExpressionType compareOperator) + { + if (left.Method.Equals(typeof(string).GetMethod("Compare", new Type[] { typeof(string), typeof(string) })) && left.Arguments.Count == 2) + { + // operator can only be =, >, >=, <, <= switch (compareOperator) { case ExpressionType.Equal: - // do nothing - break; case ExpressionType.GreaterThan: - compareOperator = ExpressionType.LessThan; - break; case ExpressionType.GreaterThanOrEqual: - compareOperator = ExpressionType.LessThanOrEqual; - break; case ExpressionType.LessThan: - compareOperator = ExpressionType.GreaterThan; - break; case ExpressionType.LessThanOrEqual: - compareOperator = ExpressionType.GreaterThanOrEqual; break; default: - throw new DocumentQueryException(string.Format(CultureInfo.CurrentCulture, ClientResources.StringCompareToInvalidOperator)); + throw new DocumentQueryException(string.Format(CultureInfo.CurrentCulture, ClientResources.StringCompareInvalidOperator)); + } + + // the constant value should be zero, otherwise we can't determine how to translate the expression + // it could be either integer or nullable integer + if (!(right.Type == typeof(int) && (int)right.Value == 0) && + !(right.Type == typeof(int?) && ((int?)right.Value).HasValue && ((int?)right.Value).Value == 0)) + { + throw new DocumentQueryException(string.Format(CultureInfo.CurrentCulture, ClientResources.StringCompareInvalidConstant)); } + + return true; + } + + return false; + } + + private static SqlScalarExpression VisitStringCompare( + MethodCallExpression left, + ConstantExpression right, + ExpressionType compareOperator, + bool reverseNodeType, + TranslationContext context) + { + if (reverseNodeType) + { + compareOperator = ReverseExpressionTypeForStrings(compareOperator, ClientResources.StringCompareInvalidOperator); } SqlBinaryScalarOperatorKind op = GetBinaryOperatorKind(compareOperator, null); - SqlScalarExpression leftExpression = ExpressionToSql.VisitNonSubqueryScalarExpression(left.Object, context); - SqlScalarExpression rightExpression = ExpressionToSql.VisitNonSubqueryScalarExpression(left.Arguments[0], context); + SqlScalarExpression leftExpression = ExpressionToSql.VisitNonSubqueryScalarExpression(left.Arguments[0], context); + SqlScalarExpression rightExpression = ExpressionToSql.VisitNonSubqueryScalarExpression(left.Arguments[1], context); return SqlBinaryScalarExpression.Create(op, leftExpression, rightExpression); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompare.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompare.xml new file mode 100644 index 0000000000..17538ff1d8 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompare.xml @@ -0,0 +1,267 @@ + + + + + (Compare(doc.StringField, doc.StringField2) == 0))]]> + + + + + + + + + + ]]> + (Compare(doc.StringField, doc.StringField2) > 0))]]> + + + + root["StringField2"]) +FROM root]]> + + + + + + =]]> + (Compare(doc.StringField, doc.StringField2) >= 0))]]> + + + + = root["StringField2"]) +FROM root]]> + + + + + + + (Compare(doc.StringField, doc.StringField2) < 0))]]> + + + + + + + + + + + (Compare(doc.StringField, doc.StringField2) <= 0))]]> + + + + + + + + + + + (Compare(doc.StringField, "str") == 0))]]> + + + + + + + + + + ]]> + (Compare(doc.StringField, "str") > 0))]]> + + + + "str") +FROM root]]> + + + + + + =]]> + (Compare(doc.StringField, "str") >= 0))]]> + + + + = "str") +FROM root]]> + + + + + + + (Compare(doc.StringField, "str") < 0))]]> + + + + + + + + + + + (Compare(doc.StringField, "str") <= 0))]]> + + + + + + + + + + + (0 == Compare(doc.StringField, doc.StringField2)))]]> + + + + + + + + + + + (0 < Compare(doc.StringField, doc.StringField2)))]]> + + + + root["StringField2"]) +FROM root]]> + + + + + + + (0 <= Compare(doc.StringField, doc.StringField2)))]]> + + + + = root["StringField2"]) +FROM root]]> + + + + + + reverse operands]]> + (0 > Compare(doc.StringField, doc.StringField2)))]]> + + + + + + + + + + = reverse operands]]> + (0 >= Compare(doc.StringField, doc.StringField2)))]]> + + + + + + + + + + 1]]> + (Compare(doc.StringField, "str") > 1))]]> + + + + + + + + + + (Compare(doc.StringField, "str") == 1))]]> + + + + + + + + + + (Compare(doc.StringField, "str") == -1))]]> + + + + + + + + + + (Compare(doc.StringField, "str") | 0))]]> + + + + ' or '>=')]]> + + + + + + (Compare(doc.StringField, "str") & 0))]]> + + + + ' or '>=')]]> + + + + + + (Compare(doc.StringField, "str") ^ 0))]]> + + + + ' or '>=')]]> + + + + + + (Compare(doc.StringField, 0, "str", 0, 3) == 0))]]> + + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompareTo.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompareTo.xml index 979d6f6191..c730415fb6 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompareTo.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompareTo.xml @@ -171,7 +171,7 @@ FROM root]]> - + @@ -181,7 +181,7 @@ FROM root]]> - + @@ -191,7 +191,7 @@ FROM root]]> - + diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs index 51da69c98f..4c8d6c423f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs @@ -1044,6 +1044,58 @@ public void TestStringCompareTo() this.ExecuteTestSuite(inputs); } + [TestMethod] + public void TestStringCompare() + { + IOrderedQueryable testQuery = testContainer.GetItemLinqQueryable(allowSynchronousQueryExecution: true); + + const int Records = 100; + const int MaxStringLength = 20; + Func createDataObj = (random) => + { + DataObject obj = new DataObject(); + obj.StringField = LinqTestsCommon.RandomString(random, random.Next(MaxStringLength)); + obj.StringField2 = random.NextDouble() < 0.5 ? obj.StringField : LinqTestsCommon.RandomString(random, random.Next(MaxStringLength)); + obj.Id = Guid.NewGuid().ToString(); + obj.Pk = "Test"; + return obj; + }; + Func> getQuery = LinqTestsCommon.GenerateTestCosmosData(createDataObj, Records, testContainer); + + List inputs = new List + { + // projected compare + new LinqTestInput("Projected Compare ==", b => getQuery(b).Select(doc => String.Compare(doc.StringField, doc.StringField2) == 0)), + new LinqTestInput("Projected Compare >", b => getQuery(b).Select(doc => String.Compare(doc.StringField, doc.StringField2) > 0)), + new LinqTestInput("Projected Compare >=", b => getQuery(b).Select(doc => String.Compare(doc.StringField, doc.StringField2) >= 0)), + new LinqTestInput("Projected Compare <", b => getQuery(b).Select(doc => String.Compare(doc.StringField, doc.StringField2) < 0)), + new LinqTestInput("Projected Compare <=", b => getQuery(b).Select(doc => String.Compare(doc.StringField, doc.StringField2) <= 0)), + // static strings + new LinqTestInput("String.Compare static string ==", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") == 0)), + new LinqTestInput("String.Compare static string >", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") > 0)), + new LinqTestInput("String.Compare static string >=", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") >= 0)), + new LinqTestInput("String.Compare static string <", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") < 0)), + new LinqTestInput("String.Compare static string <=", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") <= 0)), + // reverse operands + new LinqTestInput("Projected Compare == reverse operands", b => getQuery(b).Select(doc => 0 == String.Compare(doc.StringField, doc.StringField2))), + new LinqTestInput("Projected Compare < reverse operands", b => getQuery(b).Select(doc => 0 < String.Compare(doc.StringField, doc.StringField2))), + new LinqTestInput("Projected Compare <= reverse operands", b => getQuery(b).Select(doc => 0 <= String.Compare(doc.StringField, doc.StringField2))), + new LinqTestInput("Projected Compare > reverse operands", b => getQuery(b).Select(doc => 0 > String.Compare(doc.StringField, doc.StringField2))), + new LinqTestInput("Projected Compare >= reverse operands", b => getQuery(b).Select(doc => 0 >= String.Compare(doc.StringField, doc.StringField2))), + // errors Invalid compare value + new LinqTestInput("String.Compare > 1", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") > 1)), + new LinqTestInput("String.Compare == 1", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") == 1)), + new LinqTestInput("String.Compare == -1", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") == -1)), + // errors Invalid operator + new LinqTestInput("String.Compare | 0", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") | 0)), + new LinqTestInput("String.Compare & 0", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") & 0)), + new LinqTestInput("String.Compare ^ 0", b => getQuery(b).Select(doc => String.Compare(doc.StringField, "str") ^ 0)), + // errors Unexpected number of arguments to string.Compare + new LinqTestInput("Unexpected number of arguments to string.Compare", b => getQuery(b).Select(doc => String.Compare(doc.StringField, 0, "str", 0, 3) == 0)) + }; + this.ExecuteTestSuite(inputs); + } + [TestMethod] public void TestUDFs() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj index 8b1aa3b149..8011b07351 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj @@ -1,4 +1,4 @@ - + true true @@ -214,6 +214,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest @@ -300,6 +303,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest From d7fc28225057ac402a7c862daf7707d08a2f70d3 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Thu, 13 Jul 2023 00:41:10 +0530 Subject: [PATCH 160/240] AI Integration: Fixes event generation for failed requests (#3973) * first draft * fix code * included feedback * flip condition * updated docs * Update docs/observability.md Co-authored-by: Matias Quaranta * Update observability.md * updated contract --------- Co-authored-by: Matias Quaranta --- .../OpenTelemetry/CosmosDbEventSource.cs | 13 +++++++++++- .../Filters/DiagnosticsFilterHelper.cs | 21 ++++++++++++++----- ...iterBaselineTests.BatchOperationsAsync.xml | 2 +- .../Telemetry/DiagnosticsFilterHelperTest.cs | 6 +++--- docs/observability.md | 7 ++++++- 5 files changed, 38 insertions(+), 11 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs index 091373b0de..9e8028c0d8 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs @@ -35,7 +35,12 @@ public static void RecordDiagnosticsForRequests( Documents.OperationType operationType, OpenTelemetryAttributes response) { - if (DiagnosticsFilterHelper.IsTracingNeeded( + if (!DiagnosticsFilterHelper.IsSuccessfulResponse( + response: response) && CosmosDbEventSource.IsEnabled(EventLevel.Warning)) + { + CosmosDbEventSource.Singleton.FailedRequest(response.Diagnostics.ToString()); + } + else if (DiagnosticsFilterHelper.IsLatencyThresholdCrossed( config: config, operationType: operationType, response: response) && CosmosDbEventSource.IsEnabled(EventLevel.Warning)) @@ -64,5 +69,11 @@ private void LatencyOverThreshold(string message) { this.WriteEvent(2, message); } + + [Event(3, Level = EventLevel.Error)] + private void FailedRequest(string message) + { + this.WriteEvent(3, message); + } } } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs index 7649977fa0..60fb86fa5c 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs @@ -10,12 +10,10 @@ namespace Microsoft.Azure.Cosmos.Telemetry.Diagnostics internal static class DiagnosticsFilterHelper { /// - /// Allow only when either of below is True

- /// 1) Latency is not more than 100/250 (query) ms

- /// 3) HTTP status code is not Success

+ /// Allow only when Latency is not more than 100 (non-query) /250 (query) ms ///
/// true or false - public static bool IsTracingNeeded( + public static bool IsLatencyThresholdCrossed( DistributedTracingOptions config, OperationType operationType, OpenTelemetryAttributes response) @@ -31,7 +29,20 @@ public static bool IsTracingNeeded( latencyThreshold = operationType == OperationType.Query ? DistributedTracingOptions.DefaultQueryTimeoutThreshold : DistributedTracingOptions.DefaultCrudLatencyThreshold; } - return response.Diagnostics.GetClientElapsedTime() > latencyThreshold || !response.StatusCode.IsSuccess(); + return response.Diagnostics.GetClientElapsedTime() > latencyThreshold; + } + + /// + /// Check if response HTTP status code is returning successful + /// + /// true or false + public static bool IsSuccessfulResponse(OpenTelemetryAttributes response) + { + return response.StatusCode.IsSuccess() + || (response.StatusCode == System.Net.HttpStatusCode.NotFound && response.SubStatusCode == 0) + || (response.StatusCode == System.Net.HttpStatusCode.NotModified && response.SubStatusCode == 0) + || (response.StatusCode == System.Net.HttpStatusCode.Conflict && response.SubStatusCode == 0) + || (response.StatusCode == System.Net.HttpStatusCode.PreconditionFailed && response.SubStatusCode == 0); } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index 66edf29c06..fd097032d9 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -162,7 +162,7 @@ 1001 207 - +
\ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs index c04c0d6faf..e345394265 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs @@ -46,7 +46,7 @@ public void CheckReturnFalseOnSuccessAndLowerLatencyThanConfiguredConfig() Assert.IsFalse( DiagnosticsFilterHelper - .IsTracingNeeded(distributedTracingOptions, OperationType.Read, response), + .IsLatencyThresholdCrossed(distributedTracingOptions, OperationType.Read, response), $" Response time is {response.Diagnostics.GetClientElapsedTime().Milliseconds}ms " + $"and Configured threshold value is {distributedTracingOptions.LatencyThresholdForDiagnosticEvent.Value.Milliseconds}ms " + $"and Is response Success : {response.StatusCode.IsSuccess()}" ); @@ -70,8 +70,8 @@ public void CheckReturnTrueOnFailedStatusCode() }; Assert.IsTrue( - DiagnosticsFilterHelper - .IsTracingNeeded(distributedTracingOptions, OperationType.Read, response), + !DiagnosticsFilterHelper + .IsSuccessfulResponse(response), $" Response time is {response.Diagnostics.GetClientElapsedTime().Milliseconds}ms " + $"and Configured threshold value is {distributedTracingOptions.LatencyThresholdForDiagnosticEvent.Value.Milliseconds}ms " + $"and Is response Success : {response.StatusCode.IsSuccess()}"); diff --git a/docs/observability.md b/docs/observability.md index 50ce14d33c..1da6f02e44 100644 --- a/docs/observability.md +++ b/docs/observability.md @@ -5,6 +5,11 @@ **Source to capture operation level activities**: _Azure.Cosmos.Operation_\ **Source to capture event with request diagnostics** : _Azure-Cosmos-Operation-Request-Diagnostics_ +There are 3 kind of events generated: +1. LatencyOverThrehold: If particular operation latency is more than threshold. +2. FailedRequest: If particular reequest failed. Status codes not considered as failed, are anything below 300, 404/0, 304/0, 409/0, and 412/0 +3. Exception: If any exception occured. + For detail about usage of this feature, please see the [Azure Cosmos DB SDK observability](https://learn.microsoft.com/azure/cosmos-db/nosql/sdk-observability?tabs=dotnet) ```mermaid @@ -104,4 +109,4 @@ flowchart TD ``` ### Limitations -1. AAD Support is not available. \ No newline at end of file +1. AAD Support is not available. From 8d2691b984dac9a1c668d37f74cbfe306dd03671 Mon Sep 17 00:00:00 2001 From: Mikhail Lipin Date: Fri, 14 Jul 2023 22:10:39 +0300 Subject: [PATCH 161/240] [Internal] Category: Refactors Cosmos benchmark operations (#3961) * Refactoring: base classes for operations. * Updating comments. * Adding new line at the end of the file. * Fixing code review points. * Restore PrepareAsync to be virtual. --- .../Tools/Benchmark/BenchmarkOperationType.cs | 16 ++++++++++++++++ .../Benchmark/Fx/CosmosDiagnosticsLogger.cs | 3 --- .../Tools/Benchmark/IBenchmarkOperation.cs | 18 +++++++++++++++++- .../Benchmark/v2/InsertV2BenchmarkOperation.cs | 2 ++ .../QueryStreamSinglePkV2BenchmarkOperation.cs | 2 ++ .../v2/QueryTSinglePkV2BenchmarkOperation.cs | 4 +++- .../v2/ReadFeedStreamV2BenchmarkOperation.cs | 4 +++- .../v2/ReadNotExistsV2BenchmarkOperation.cs | 4 +++- .../v2/ReadStreamExistsV2BenchmarkOperation.cs | 4 +++- .../v2/ReadTExistsV2BenchmarkOperation.cs | 4 +++- .../Benchmark/v3/InsertV3BenchmarkOperation.cs | 2 ++ .../Benchmark/v3/QueryTV3BenchmarkOperation.cs | 4 +++- .../v3/ReadFeedStreamV3BenchmarkOperation.cs | 6 ++++-- .../v3/ReadNotExistsV3BenchmarkOperation.cs | 4 +++- .../v3/ReadStreamExistsV3BenchmarkOperation.cs | 2 ++ ...xistsWithDiagnosticsV3BenchmarkOperation.cs | 4 +++- .../v3/ReadTExistsV3BenchmarkOperation.cs | 7 ++++--- 17 files changed, 73 insertions(+), 17 deletions(-) create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkOperationType.cs diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkOperationType.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkOperationType.cs new file mode 100644 index 0000000000..b18fb1c318 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkOperationType.cs @@ -0,0 +1,16 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace CosmosBenchmark +{ + /// + /// Benchmark operation type. + /// + public enum BenchmarkOperationType + { + Read, + Insert, + Query + } +} diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/CosmosDiagnosticsLogger.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/CosmosDiagnosticsLogger.cs index 9a399c5dc8..e08b2dd6da 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/CosmosDiagnosticsLogger.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/CosmosDiagnosticsLogger.cs @@ -6,11 +6,8 @@ namespace CosmosBenchmark { using System; using System.Collections.Concurrent; - using System.Collections.Generic; using System.Diagnostics; using System.Linq; - using System.Runtime.CompilerServices; - using System.Text; using Microsoft.Azure.Cosmos; using Newtonsoft.Json.Linq; diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/IBenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/IBenchmarkOperation.cs index d6933fcce5..3580a8a6fc 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/IBenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/IBenchmarkOperation.cs @@ -6,10 +6,26 @@ namespace CosmosBenchmark { using System.Threading.Tasks; + /// + /// Represents the Benchmark operation. + /// internal interface IBenchmarkOperation { - Task PrepareAsync(); + /// + /// Benchmark operation type. + /// + BenchmarkOperationType OperationType { get; } + /// + /// Executes Benchmark operation once asynchronously. + /// + /// The operation result wrapped by task. Task ExecuteOnceAsync(); + + /// + /// Prepares Benchmark operation asynchronously. + /// + /// The task related to method's work. + Task PrepareAsync(); } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/InsertV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/InsertV2BenchmarkOperation.cs index 744bb9f577..124c841085 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/InsertV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/InsertV2BenchmarkOperation.cs @@ -38,6 +38,8 @@ public InsertV2BenchmarkOperation( this.sampleJObject = JsonHelper.Deserialize>(sampleJson); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Insert; + public async Task ExecuteOnceAsync() { ResourceResponse itemResponse = await this.documentClient.CreateDocumentAsync( diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryStreamSinglePkV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryStreamSinglePkV2BenchmarkOperation.cs index 1bf3bf245e..b0f071f6de 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryStreamSinglePkV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryStreamSinglePkV2BenchmarkOperation.cs @@ -47,6 +47,8 @@ public QueryStreamSinglePkV2BenchmarkOperation( this.containerUri = UriFactory.CreateDocumentCollectionUri(this.databsaeName, this.containerName); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Query; + public async Task ExecuteOnceAsync() { IDocumentQuery query = this.documentClient.CreateDocumentQuery( diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryTSinglePkV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryTSinglePkV2BenchmarkOperation.cs index 7d58447859..cd50a789b8 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryTSinglePkV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryTSinglePkV2BenchmarkOperation.cs @@ -46,6 +46,8 @@ public QueryTSinglePkV2BenchmarkOperation( this.sampleJObject[this.partitionKeyPath] = this.executionItemPartitionKey; } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Query; + public async Task ExecuteOnceAsync() { IDocumentQuery> query = this.documentClient.CreateDocumentQuery>( @@ -107,7 +109,7 @@ public async Task PrepareAsync() new RequestOptions() { PartitionKey = new PartitionKey(this.executionItemPartitionKey) }); if (itemResponse.StatusCode != HttpStatusCode.Created) { - throw new Exception($"Create failed with statuscode: {itemResponse.StatusCode}"); + throw new Exception($"Create failed with status code: {itemResponse.StatusCode}"); } this.initialized = true; diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadFeedStreamV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadFeedStreamV2BenchmarkOperation.cs index 379cd363e6..0a9b9e3d7f 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadFeedStreamV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadFeedStreamV2BenchmarkOperation.cs @@ -40,6 +40,8 @@ public ReadFeedStreamV2BenchmarkOperation( this.sampleJObject = JsonHelper.Deserialize>(sampleJson); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public async Task ExecuteOnceAsync() { Uri containerUri = UriFactory.CreateDocumentCollectionUri(this.databsaeName, this.containerName); @@ -75,7 +77,7 @@ public async Task PrepareAsync() new RequestOptions() { PartitionKey = new PartitionKey(this.nextExecutionItemPartitionKey) }); if (itemResponse.StatusCode != HttpStatusCode.Created) { - throw new Exception($"Create failed with statuscode: {itemResponse.StatusCode}"); + throw new Exception($"Create failed with status code: {itemResponse.StatusCode}"); } } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadNotExistsV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadNotExistsV2BenchmarkOperation.cs index f5e8f94c68..1d8b99449e 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadNotExistsV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadNotExistsV2BenchmarkOperation.cs @@ -22,6 +22,8 @@ internal class ReadNotExistsV2BenchmarkOperation : IBenchmarkOperation private readonly DocumentClient documentClient; + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public ReadNotExistsV2BenchmarkOperation( DocumentClient documentClient, string dbName, @@ -52,7 +54,7 @@ public async Task ExecuteOnceAsync() { if (dce.StatusCode != HttpStatusCode.NotFound) { - throw new Exception($"ReadItem failed wth {dce?.StatusCode} {dce?.ToString()}"); + throw new Exception($"ReadItem failed with {dce?.StatusCode} {dce?.ToString()}"); } return new OperationResult() diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadStreamExistsV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadStreamExistsV2BenchmarkOperation.cs index 7afd4cdf71..c7419db811 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadStreamExistsV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadStreamExistsV2BenchmarkOperation.cs @@ -25,6 +25,8 @@ internal class ReadStreamExistsV2BenchmarkOperation : IBenchmarkOperation private readonly DocumentClient documentClient; + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public ReadStreamExistsV2BenchmarkOperation( DocumentClient documentClient, string dbName, @@ -84,7 +86,7 @@ public async Task PrepareAsync() if (itemResponse.StatusCode != HttpStatusCode.Created) { - throw new Exception($"Create failed with statuscode: {itemResponse.StatusCode}"); + throw new Exception($"Create failed with status code: {itemResponse.StatusCode}"); } } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadTExistsV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadTExistsV2BenchmarkOperation.cs index 061183c575..7e161f8ffc 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadTExistsV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadTExistsV2BenchmarkOperation.cs @@ -26,6 +26,8 @@ internal class ReadTExistsV2BenchmarkOperation : IBenchmarkOperation private readonly DocumentClient documentClient; + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public ReadTExistsV2BenchmarkOperation( DocumentClient documentClient, string dbName, @@ -85,7 +87,7 @@ public async Task PrepareAsync() if (itemResponse.StatusCode != HttpStatusCode.Created) { - throw new Exception($"Create failed with statuscode: {itemResponse.StatusCode}"); + throw new Exception($"Create failed with status code: {itemResponse.StatusCode}"); } } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/InsertV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/InsertV3BenchmarkOperation.cs index 1ab5861242..504148bfda 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/InsertV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/InsertV3BenchmarkOperation.cs @@ -37,6 +37,8 @@ public InsertV3BenchmarkOperation( this.sampleJObject = JsonHelper.Deserialize>(sampleJson); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Insert; + public async Task ExecuteOnceAsync() { using (MemoryStream input = JsonHelper.ToStream(this.sampleJObject)) diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/QueryTV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/QueryTV3BenchmarkOperation.cs index bdb0b38cf8..f78153034b 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/QueryTV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/QueryTV3BenchmarkOperation.cs @@ -31,6 +31,8 @@ internal abstract class QueryTV3BenchmarkOperation : IBenchmarkOperation public abstract bool IsPaginationEnabled { get; } public abstract bool IsQueryStream { get; } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Query; + protected string executionItemId = null; protected string executionPartitionKey = null; @@ -291,7 +293,7 @@ public virtual async Task PrepareAsync() if (itemResponse.StatusCode != HttpStatusCode.Created) { - throw new Exception($"Create failed with statuscode: {itemResponse.StatusCode}"); + throw new Exception($"Create failed with status code: {itemResponse.StatusCode}"); } } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadFeedStreamV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadFeedStreamV3BenchmarkOperation.cs index 99789040b0..3b9c5cd800 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadFeedStreamV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadFeedStreamV3BenchmarkOperation.cs @@ -39,6 +39,8 @@ public ReadFeedStreamV3BenchmarkOperation( this.sampleJObject = JsonHelper.Deserialize>(sampleJson); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public async Task ExecuteOnceAsync() { FeedIterator feedIterator = this.container @@ -50,7 +52,7 @@ public async Task ExecuteOnceAsync() ResponseMessage feedResponse = await feedIterator.ReadNextAsync(); if (feedResponse.StatusCode != HttpStatusCode.OK) { - throw new Exception($"ReadItem failed wth {feedResponse.StatusCode}"); + throw new Exception($"ReadItem failed with {feedResponse.StatusCode}"); } return new OperationResult() @@ -84,7 +86,7 @@ public async Task PrepareAsync() if (itemResponse.StatusCode != HttpStatusCode.Created) { - throw new Exception($"Create failed with statuscode: {itemResponse.StatusCode}"); + throw new Exception($"Create failed with status code: {itemResponse.StatusCode}"); } } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadNotExistsV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadNotExistsV3BenchmarkOperation.cs index c97d1af4b7..1804ea9852 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadNotExistsV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadNotExistsV3BenchmarkOperation.cs @@ -32,6 +32,8 @@ public ReadNotExistsV3BenchmarkOperation( this.container = cosmosClient.GetContainer(this.databsaeName, this.containerName); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public async Task ExecuteOnceAsync() { using (ResponseMessage itemResponse = await this.container.ReadItemStreamAsync( @@ -40,7 +42,7 @@ public async Task ExecuteOnceAsync() { if (itemResponse.StatusCode != HttpStatusCode.NotFound) { - throw new Exception($"ReadItem failed wth {itemResponse.StatusCode}"); + throw new Exception($"ReadItem failed with {itemResponse.StatusCode}"); } return new OperationResult() diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsV3BenchmarkOperation.cs index aba0a4ea7a..fabe8f20bd 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsV3BenchmarkOperation.cs @@ -39,6 +39,8 @@ public ReadStreamExistsV3BenchmarkOperation( this.sampleJObject = JsonHelper.Deserialize>(sampleJson); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public async Task ExecuteOnceAsync() { using (ResponseMessage itemResponse = await this.container.ReadItemStreamAsync( diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsWithDiagnosticsV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsWithDiagnosticsV3BenchmarkOperation.cs index ebdc14924b..74f2ac67f7 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsWithDiagnosticsV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsWithDiagnosticsV3BenchmarkOperation.cs @@ -39,6 +39,8 @@ public ReadStreamExistsWithDiagnosticsV3BenchmarkOperation( this.sampleJObject = JsonHelper.Deserialize>(sampleJson); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public async Task ExecuteOnceAsync() { using (ResponseMessage itemResponse = await this.container.ReadItemStreamAsync( @@ -47,7 +49,7 @@ public async Task ExecuteOnceAsync() { if (itemResponse.StatusCode != HttpStatusCode.OK) { - throw new Exception($"ReadItem failed wth {itemResponse.StatusCode}"); + throw new Exception($"ReadItem failed with {itemResponse.StatusCode}"); } string diagnostics = itemResponse.Diagnostics.ToString(); diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadTExistsV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadTExistsV3BenchmarkOperation.cs index 7fd40397be..bb6295356e 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadTExistsV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadTExistsV3BenchmarkOperation.cs @@ -10,7 +10,6 @@ namespace CosmosBenchmark using System.Net; using System.Threading.Tasks; using Microsoft.Azure.Cosmos; - using Newtonsoft.Json.Linq; internal class ReadTExistsV3BenchmarkOperation : IBenchmarkOperation { @@ -40,6 +39,8 @@ public ReadTExistsV3BenchmarkOperation( this.sampleJObject = JsonHelper.Deserialize>(sampleJson); } + public BenchmarkOperationType OperationType => BenchmarkOperationType.Read; + public async Task ExecuteOnceAsync() { ItemResponse> itemResponse = await this.container.ReadItemAsync>( @@ -47,7 +48,7 @@ public async Task ExecuteOnceAsync() new PartitionKey(this.nextExecutionItemPartitionKey)); if (itemResponse.StatusCode != HttpStatusCode.OK) { - throw new Exception($"ReadItem failed wth {itemResponse.StatusCode}"); + throw new Exception($"ReadItem failed with {itemResponse.StatusCode}"); } return new OperationResult() @@ -81,7 +82,7 @@ public async Task PrepareAsync() if (itemResponse.StatusCode != HttpStatusCode.Created) { - throw new Exception($"Create failed with statuscode: {itemResponse.StatusCode}"); + throw new Exception($"Create failed with status code: {itemResponse.StatusCode}"); } } } From 38b556b60ed921c74bb6fdc44361cf5ec6c503d8 Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Mon, 17 Jul 2023 12:07:24 -0700 Subject: [PATCH 162/240] 3.35.2: Adds new SDK versions and contract files (#3985) * Updated change log and bumped up the version. * Changing the version to 3.35.2 * Code changes to address review comments. * Code changes to make minor fixes. * Code changes to move some fixes into preview. --- Directory.Build.props | 4 +- .../contracts/API_3.35.2-preview.txt | 1563 +++++++++++++++++ .../contracts/API_3.35.2.txt | 1502 ++++++++++++++++ changelog.md | 18 + 4 files changed, 3085 insertions(+), 2 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.35.2-preview.txt create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.35.2.txt diff --git a/Directory.Build.props b/Directory.Build.props index 51d6237854..b9171d6307 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 3.35.1 - 3.35.1 + 3.35.2 + 3.35.2 preview 3.31.3 2.0.2 diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.35.2-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.35.2-preview.txt new file mode 100644 index 0000000000..6c989053fd --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.35.2-preview.txt @@ -0,0 +1,1563 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public sealed class ComputedProperty + { + public ComputedProperty(); + public string Name { get; set; } + public string Query { get; set; } + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public Collection ComputedProperties { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool IsDistributedTracingEnabled { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable BypassIntegratedCache { get; set; } + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public enum PriorityLevel + { + High = 1, + Low = 2, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public bool EnableOptimisticDirectExecution { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public Nullable PriorityLevel { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ComputedPropertiesDefinition + { + public T Attach(); + public ComputedPropertiesDefinition WithComputedProperty(string name, string query); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public ComputedPropertiesDefinition WithComputedProperties(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithDistributedTracing(bool isEnabled=true); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.35.2.txt b/Microsoft.Azure.Cosmos/contracts/API_3.35.2.txt new file mode 100644 index 0000000000..c0dc3e280f --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.35.2.txt @@ -0,0 +1,1502 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/changelog.md b/changelog.md index f72c7fd59f..481cde52db 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,24 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +###
[3.35.2-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.2-preview) - 2023-07-17 + +#### Fixed +- [3973](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3973) Application Insights Integration: Fixes event generation for failed requests + +#### Added +- [3951](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3951) Upgrade Resiliency: Adds Code to Enable Replica Validation Feature By Default for Preview + +### [3.35.2](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.2) - 2023-07-17 + +#### Fixed +- [3917](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3917) Query: Fixes malformed continuation token exception type and message +- [3969](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3969) Diagnostics: Fixes verbose levels for "Operation will NOT be retried" + +#### Added +- [3668](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3668) Query : Adds string comparison alternative when converting LINQ to SQL (Thanks [@ernesto1596](https://github.com/ernesto1596)) +- [3834](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3834) Query : Adds support for newtonsoft member access via ExtensionData (Thanks [@onionhammer](https://github.com/onionhammer)) + ### [3.35.1-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.1-preview) - 2023-06-27 ### [3.35.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.1) - 2023-06-27 From d71dcb2def59cfd07ad84eadc0a5793f8ae5b5a4 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Kolli Date: Wed, 19 Jul 2023 14:02:05 -0700 Subject: [PATCH 163/240] [INTERNAL] LocalQuorum: Adds documentation for LocalQuorum (#3993) * Draft of local-quorum documentation * Adding experimental to header * Adding cross-region read guarantees * Reads Bounded clarification * Adding account consistency step also * Non-Prod usage note at top * Addressing review comments * Some more refinement --- docs/LocalQuorum.md | 59 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 docs/LocalQuorum.md diff --git a/docs/LocalQuorum.md b/docs/LocalQuorum.md new file mode 100644 index 0000000000..5ca45e9055 --- /dev/null +++ b/docs/LocalQuorum.md @@ -0,0 +1,59 @@ +> # NOT SUPPORTED FOR PRODUCTION USAGE +> # ONLY INTERNAL, DEVELOPMENT OR EXPERIMENTAL USAGE ONLY + + +## Context +Distributed databases that rely on replication for high availability, low latency, or both, must make a fundamental tradeoff between the read consistency, availability, latency, and throughput. + +The linearizability of the strong consistency model is the gold standard of data programmability. But it adds a steep price from higher write latencies due to data having to replicate and commit across large distances. Strong consistency may also suffer from reduced availability (during failures) because data can't replicate and commit in every region. Eventual consistency offers higher availability and better performance, but it's more difficult to program applications because data may not be consistent across all regions (eventual reads are not guaranteed to be monotonic). + + +Please refer to [public documentation](https://learn.microsoft.com/en-us/azure/cosmos-db/consistency-levels) for more details. + + +Many applications can benefit from having a read-write model like below + +| Operation | Write-Region | Replicated-Regions | +|---|---|---| +|Write | Write high availabillity in write region
vs BoundedStaleness: write un-availability when bounds are violated | Eventual replication: Asynchronous non-blocking, possibly unbounded staleness
vs BoundedStaleness: staleness limited by bounds | +|Read |**Single write region**: Read my writes
**Multiple write regions**: read-my-writes from the region of writes, otherwise eventual
Monotonic reads
No sessionToken management| **Single write region**: Eventual read
**Multiple write regions**: read-my-writes from the region of writes, otherwise eventual
Monotonic reads
No sessionToken management | + +> ### NOTE: cross-region reads will violate the monotonic reads guarantee + + +## How-TO +It involves three stages + +#### Create CosmosDB account with Eventual/ConsistentPrefix/Session consistency + +#### Enabling/opt-in ability to upgrade consistency level +SDK version: MA [3.35.1](https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/changelog.md#-3351---2023-06-27) or [minimum recommended version](https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/changelog.md#-recommended-version) + +```C# +CosmosClientOptions clientOptions = new CosmosClientOptions(); +var upgradeConsistencyProperty = clientOptions.GetType().GetProperty("EnableUpgradeConsistencyToLocalQuorum", BindingFlags.NonPublic | BindingFlags.Instance); +upgradeConsistencyProperty.SetValue(clientOptions, true); + +CosmosClient cosmosClient = new CosmosClient(..., clientOptions); +``` + +#### Per request upgrade consistency to Bounded +> ###### Please note that Bounded here is only used as HINT for SDK to do quorum reads +> ###### It will not impact CosmosDB account or write consistency levels + +```C# +ItemRequestOptions requestOption = new ItemRequestOptions(); +requestOption.ConsistencyLevel = ConsistencyLevel.Bounded; + +T item = await container.ReadItemAsync(docId, new PartitionKey(docPartitionKey), requestOption); +``` + +```C# +QueryRequestOptions requestOption = new QueryRequestOptions(); +requestOption.ConsistencyLevel = ConsistencyLevel.Bounded; + +await container.GetItemQueryIterator(queryText, continuationToken, requestOption); +``` + +> #### Please use Bounded only for per request options as pattern +> #### Single master account possibly Strong == Bounded (**TBD**) \ No newline at end of file From 5ec7b4bcd7e2e0698736cd374f2196682227c913 Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Wed, 19 Jul 2023 16:26:04 -0700 Subject: [PATCH 164/240] Code changes to update release note. (#3996) --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 481cde52db..ab733a4137 100644 --- a/changelog.md +++ b/changelog.md @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Added - [3668](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3668) Query : Adds string comparison alternative when converting LINQ to SQL (Thanks [@ernesto1596](https://github.com/ernesto1596)) - [3834](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3834) Query : Adds support for newtonsoft member access via ExtensionData (Thanks [@onionhammer](https://github.com/onionhammer)) +- [3939](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3939) CreateAndInitializeAsync: Adds Code to Optimize Rntbd Open Connection Logic to Open Connections in Parallel ###
[3.35.1-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.1-preview) - 2023-06-27 ### [3.35.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.1) - 2023-06-27 From 08981bf2fd87f110ca4a1e2af5f82974857c1aaf Mon Sep 17 00:00:00 2001 From: vipulvishal-ms <110802706+vipulvishal-ms@users.noreply.github.com> Date: Sat, 29 Jul 2023 02:33:38 +0530 Subject: [PATCH 165/240] Client Encryption: Adds fix for supporting Prefix Partition Key (Hierarchical partitioning) (#3979) * Hirarchical pk bug fix * Hirarchical pk bug fix * Hirarchical pk bug fix * Hirarchical pk bug fix * Hirarchical pk bug fix * testing new version * adding more tests * adding more tests * adding more tests * code review changes * test fix * test fix * test fix * test fix --------- Co-authored-by: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> --- Directory.Build.props | 4 +- .../changelog.md | 10 + .../src/EncryptionContainer.cs | 17 +- .../Microsoft.Azure.Cosmos.Encryption.csproj | 4 +- .../tests/EmulatorTests/MdeEncryptionTests.cs | 388 +++++++++++++++++- 5 files changed, 413 insertions(+), 10 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index b9171d6307..9daa1e7e9f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,8 +4,8 @@ 3.35.2 preview 3.31.3 - 2.0.2 - 2.0.2 + 2.0.3 + 2.0.3 preview 1.0.0-preview06 1.1.0-preview3 diff --git a/Microsoft.Azure.Cosmos.Encryption/changelog.md b/Microsoft.Azure.Cosmos.Encryption/changelog.md index a8edf3441d..2f50fcbdf3 100644 --- a/Microsoft.Azure.Cosmos.Encryption/changelog.md +++ b/Microsoft.Azure.Cosmos.Encryption/changelog.md @@ -3,6 +3,16 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [2.0.3](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.3) - 2023-07-12 + +#### Added +- [#3979](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3979) Adds fix for supporting Prefix Partition Key (Hierarchical partitioning). + +### [2.0.3-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.3-preview) - 2023-07-12 + +#### Added +- [#3979](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3979) Adds fix for supporting Prefix Partition Key (Hierarchical partitioning). + ### [2.0.2](https://www.nuget.org/packages/Microsoft.Azure.Cosmos.Encryption/2.0.2) - 2023-06-01 #### Added diff --git a/Microsoft.Azure.Cosmos.Encryption/src/EncryptionContainer.cs b/Microsoft.Azure.Cosmos.Encryption/src/EncryptionContainer.cs index d32bfa1c94..0bd342f0ef 100644 --- a/Microsoft.Azure.Cosmos.Encryption/src/EncryptionContainer.cs +++ b/Microsoft.Azure.Cosmos.Encryption/src/EncryptionContainer.cs @@ -957,15 +957,22 @@ internal async Task CheckIfIdIsEncryptedAndGetEncryptedIdAsync( JArray jArray = JArray.Parse(partitionKey.ToString()); #if ENCRYPTIONPREVIEW - if (jArray.Count > 1) + if (encryptionSettings.PartitionKeyPaths.Count > 1) { - int i = 0; + int counter = 0; PartitionKeyBuilder partitionKeyBuilder = new PartitionKeyBuilder(); + if (jArray.Count() > encryptionSettings.PartitionKeyPaths.Count()) + { + throw new NotSupportedException($"The number of partition keys passed in the query exceeds the number of keys initialized on the container. Container Id : {this.Id}"); + } bool isPkEncrypted = false; + // partitionKeyBuilder expects the paths and values to be in same order. - foreach (string path in encryptionSettings.PartitionKeyPaths) + for(counter = 0; counter < jArray.Count(); counter++) { + string path = encryptionSettings.PartitionKeyPaths[counter]; + // case: partition key path is /a/b/c and the client encryption policy has /a in path. // hence encrypt the partition key value with using its top level path /a since /c would have been encrypted in the document using /a's policy. string partitionKeyPath = path.Split('/')[1]; @@ -975,12 +982,12 @@ internal async Task CheckIfIdIsEncryptedAndGetEncryptedIdAsync( if (encryptionSettingForProperty == null) { - partitionKeyBuilder.Add(jArray[i++].ToString()); + partitionKeyBuilder.Add(jArray[counter].ToString()); continue; } isPkEncrypted = true; - Stream valueStream = EncryptionProcessor.BaseSerializer.ToStream(jArray[i++]); + Stream valueStream = EncryptionProcessor.BaseSerializer.ToStream(jArray[counter]); Stream encryptedPartitionKey = await EncryptionProcessor.EncryptValueStreamAsync( valueStreamToEncrypt: valueStream, diff --git a/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj b/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj index 94e93aa6fe..f7baa75f60 100644 --- a/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj +++ b/Microsoft.Azure.Cosmos.Encryption/src/Microsoft.Azure.Cosmos.Encryption.csproj @@ -28,11 +28,11 @@ - + - + diff --git a/Microsoft.Azure.Cosmos.Encryption/tests/EmulatorTests/MdeEncryptionTests.cs b/Microsoft.Azure.Cosmos.Encryption/tests/EmulatorTests/MdeEncryptionTests.cs index 65efd425aa..3489cdf02e 100644 --- a/Microsoft.Azure.Cosmos.Encryption/tests/EmulatorTests/MdeEncryptionTests.cs +++ b/Microsoft.Azure.Cosmos.Encryption/tests/EmulatorTests/MdeEncryptionTests.cs @@ -189,6 +189,9 @@ public void TestInitialize() { // Reset static cache TTL Microsoft.Data.Encryption.Cryptography.ProtectedDataEncryptionKey.TimeToLive = TimeSpan.FromHours(2); + // flag to disable https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3951 + // need to be removed after the fix + Environment.SetEnvironmentVariable("AZURE_COSMOS_REPLICA_VALIDATION_ENABLED", "False"); } private static async Task CreateClientEncryptionKeyAsync(string cekId, Cosmos.EncryptionKeyWrapMetadata encryptionKeyWrapMetadata) @@ -2303,7 +2306,7 @@ public async Task ValidatePkAndIdEncryptionSupport() VerifyExpectedDocResponse(testDoc, readResponse.Resource); #if ENCRYPTIONTESTPREVIEW - // hierarchical + // hierarchical pk container test cepWithPKIdPath1 = new ClientEncryptionIncludedPath() { Path = "/Sensitive_LongFormat", @@ -2352,9 +2355,320 @@ public async Task ValidatePkAndIdEncryptionSupport() Assert.AreEqual(HttpStatusCode.OK, readResponse.StatusCode); VerifyExpectedDocResponse(testDoc, readResponse.Resource); + + // test to validate query with one partition key (topmost) in hierarchical pk container of 3 keys + QueryRequestOptions queryRequestOptions = new QueryRequestOptions + { + PartitionKey = new PartitionKeyBuilder().Add(testDoc.Sensitive_StringFormat).Build() + }; + + using FeedIterator setIterator = encryptionContainer.GetItemQueryIterator("select * from c", requestOptions: queryRequestOptions); + + while (setIterator.HasMoreResults) + { + FeedResponse response = await setIterator.ReadNextAsync().ConfigureAwait(false); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + VerifyExpectedDocResponse(testDoc, response.First()); + } + + // test to validate query with one partition key (topmost) in hierarchical pk container of 3 keys with where clause on topmost pk + QueryDefinition queryDefinition = encryptionContainer.CreateQueryDefinition("SELECT * FROM c WHERE c.Sensitive_StringFormat = @Sensitive_StringFormat"); + + await queryDefinition.AddParameterAsync("@Sensitive_StringFormat", testDoc.Sensitive_StringFormat, "/Sensitive_StringFormat"); + + FeedIterator setIteratorWithFilter = encryptionContainer.GetItemQueryIterator(queryDefinition, requestOptions: queryRequestOptions); + + while (setIteratorWithFilter.HasMoreResults) + { + FeedResponse response = await setIteratorWithFilter.ReadNextAsync().ConfigureAwait(false); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + VerifyExpectedDocResponse(testDoc, response.First()); + } + + // test to validate query with one partition key (2nd topmost) in hierarchical pk container of 3 keys with where clause on topmost pk + // this shold give 0 items as PK is set wrongly + queryRequestOptions = new QueryRequestOptions + { + PartitionKey = new PartitionKeyBuilder().Add(testDoc.Sensitive_NestedObjectFormatL1.Sensitive_NestedObjectFormatL2.Sensitive_StringFormatL2).Build() + }; + + setIteratorWithFilter = encryptionContainer.GetItemQueryIterator(queryDefinition, requestOptions: queryRequestOptions); + + while (setIteratorWithFilter.HasMoreResults) + { + FeedResponse response = await setIteratorWithFilter.ReadNextAsync().ConfigureAwait(false); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual(0, response.Count()); + } #endif } +#if ENCRYPTIONTESTPREVIEW + [TestMethod] + public async Task TestHirarchicalPkWithFullAndPartialKey() + { + HirarchicalPkTestDoc testDoc = HirarchicalPkTestDoc.Create(); + + ClientEncryptionIncludedPath cepWithPKIdPath1 = new ClientEncryptionIncludedPath() + { + Path = "/State", + ClientEncryptionKeyId = "key1", + EncryptionType = "Deterministic", + EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256", + }; + + ClientEncryptionIncludedPath cepWithPKIdPath2 = new ClientEncryptionIncludedPath() + { + Path = "/City", + ClientEncryptionKeyId = "key1", + EncryptionType = "Deterministic", + EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256", + }; + + ClientEncryptionIncludedPath cepWithPKIdPath3 = new ClientEncryptionIncludedPath() + { + Path = "/ZipCode", + ClientEncryptionKeyId = "key1", + EncryptionType = "Deterministic", + EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256", + }; + + Collection paths = new Collection { cepWithPKIdPath1, cepWithPKIdPath2, cepWithPKIdPath3 }; + + ClientEncryptionPolicy clientEncryptionPolicy= new ClientEncryptionPolicy(paths, 2); + + ContainerProperties containerProperties = new ContainerProperties() + { + Id = "HierarchicalPkContainerWith3Pk", + PartitionKeyPaths = new List { "/State", "/City", "/ZipCode" }, + ClientEncryptionPolicy = clientEncryptionPolicy + }; + + Container encryptionContainer = await database.CreateContainerAsync(containerProperties, 400); + await encryptionContainer.InitializeEncryptionAsync(); + + PartitionKey hirarchicalPk = new PartitionKeyBuilder() + .Add(testDoc.State) + .Add(testDoc.City) + .Add(testDoc.ZipCode) + .Build(); + + ItemResponse createResponse = await encryptionContainer.CreateItemAsync( + testDoc, + partitionKey: hirarchicalPk); + Assert.AreEqual(HttpStatusCode.Created, createResponse.StatusCode); + VerifyExpectedDocResponse(testDoc, createResponse.Resource); + + // read back + ItemResponse readResponse = await encryptionContainer.ReadItemAsync( + testDoc.Id, + hirarchicalPk); + + Assert.AreEqual(HttpStatusCode.OK, readResponse.StatusCode); + VerifyExpectedDocResponse(testDoc, readResponse.Resource); + + PartitionKey partialHirarchicalPk = new PartitionKeyBuilder() + .Add(testDoc.State) + .Add(testDoc.City) + .Build(); + + QueryRequestOptions queryRequestOptions = new QueryRequestOptions + { + PartitionKey = partialHirarchicalPk + }; + + using FeedIterator setIterator = encryptionContainer.GetItemQueryIterator("select * from c", requestOptions: queryRequestOptions); + + while (setIterator.HasMoreResults) + { + FeedResponse response = await setIterator.ReadNextAsync().ConfigureAwait(false); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + VerifyExpectedDocResponse(testDoc, response.First()); + } + + QueryDefinition withEncryptedParameter = encryptionContainer.CreateQueryDefinition( + "SELECT * FROM c WHERE c.City = @cityInput AND c.State = @stateInput"); + + await withEncryptedParameter.AddParameterAsync( + "@cityInput", + testDoc.City, + "/City"); + + await withEncryptedParameter.AddParameterAsync( + "@stateInput", + testDoc.State, + "/State"); + + // query with partial HirarchicalPk state and city + FeedIterator queryResponseIterator; + queryResponseIterator = encryptionContainer.GetItemQueryIterator(withEncryptedParameter, requestOptions: queryRequestOptions); + + while (queryResponseIterator.HasMoreResults) + { + FeedResponse response = await queryResponseIterator.ReadNextAsync().ConfigureAwait(false); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + VerifyExpectedDocResponse(testDoc, response.First()); + } + + partialHirarchicalPk = new PartitionKeyBuilder() + .Add(testDoc.State) + .Build(); + + queryRequestOptions = new QueryRequestOptions + { + PartitionKey = partialHirarchicalPk + }; + + // query with partial HirarchicalPk state + queryResponseIterator = encryptionContainer.GetItemQueryIterator(withEncryptedParameter, requestOptions: queryRequestOptions); + + while (queryResponseIterator.HasMoreResults) + { + FeedResponse response = await queryResponseIterator.ReadNextAsync().ConfigureAwait(false); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + VerifyExpectedDocResponse(testDoc, response.First()); + } + + partialHirarchicalPk = new PartitionKeyBuilder() + .Add(testDoc.ZipCode) + .Build(); + + queryRequestOptions = new QueryRequestOptions + { + PartitionKey = partialHirarchicalPk + }; + + // query with partial HirarchicalPk zipCode. + // Since zipCode is 3rd in HirarchicalPk set. Query will get 0 response. + queryResponseIterator = encryptionContainer.GetItemQueryIterator(withEncryptedParameter, requestOptions: queryRequestOptions); + + while (queryResponseIterator.HasMoreResults) + { + FeedResponse response = await queryResponseIterator.ReadNextAsync().ConfigureAwait(false); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual(0, response.Count()); + } + + // query with no HirarchicalPk set. + queryResponseIterator = encryptionContainer.GetItemQueryIterator(withEncryptedParameter); + + while (queryResponseIterator.HasMoreResults) + { + FeedResponse response = await queryResponseIterator.ReadNextAsync().ConfigureAwait(false); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + VerifyExpectedDocResponse(testDoc, response.First()); + } + + partialHirarchicalPk = new PartitionKeyBuilder() + .Add(testDoc.State) + .Add(testDoc.City) + .Add(testDoc.ZipCode) + .Add("Extra Value") + .Build(); + + queryRequestOptions = new QueryRequestOptions + { + PartitionKey = partialHirarchicalPk + }; + // query with more PKs greater than number of PK feilds set in the container settings. + try + { + queryResponseIterator = encryptionContainer.GetItemQueryIterator(withEncryptedParameter, requestOptions: queryRequestOptions); + while (queryResponseIterator.HasMoreResults) + { + FeedResponse response = await queryResponseIterator.ReadNextAsync().ConfigureAwait(false); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + Assert.AreEqual(0, response.Count()); + } + } + catch (Exception ex) + { + Assert.IsTrue(ex is NotSupportedException); + if (ex is NotSupportedException notSupportedException) + Assert.IsTrue(notSupportedException.Message.Contains("The number of partition keys passed in the query exceeds the number of keys initialized on the container")); + } + } + + [TestMethod] + public async Task TestHirarchicalPkWithOnlyOneKey() + { + HirarchicalPkTestDoc testDoc = HirarchicalPkTestDoc.Create(); + + ClientEncryptionIncludedPath cepWithPKIdPath1 = new ClientEncryptionIncludedPath() + { + Path = "/State", + ClientEncryptionKeyId = "key1", + EncryptionType = "Deterministic", + EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256", + }; + + ClientEncryptionIncludedPath cepWithPKIdPath2 = new ClientEncryptionIncludedPath() + { + Path = "/City", + ClientEncryptionKeyId = "key1", + EncryptionType = "Deterministic", + EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256", + }; + + ClientEncryptionIncludedPath cepWithPKIdPath3 = new ClientEncryptionIncludedPath() + { + Path = "/ZipCode", + ClientEncryptionKeyId = "key1", + EncryptionType = "Deterministic", + EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256", + }; + + Collection paths = new Collection { cepWithPKIdPath1, cepWithPKIdPath2, cepWithPKIdPath3 }; + + ClientEncryptionPolicy clientEncryptionPolicy = new ClientEncryptionPolicy(paths, 2); + + ContainerProperties containerProperties = new ContainerProperties() + { + Id = "HierarchicalPkContainerWithOnePk", + PartitionKeyPaths = new List { "/State" }, + ClientEncryptionPolicy = clientEncryptionPolicy + }; + + Container encryptionContainer = await database.CreateContainerAsync(containerProperties, 400); + await encryptionContainer.InitializeEncryptionAsync(); + + PartitionKey hirarchicalPk = new PartitionKeyBuilder() + .Add(testDoc.State) + .Build(); + + ItemResponse createResponse = await encryptionContainer.CreateItemAsync( + testDoc, + partitionKey: hirarchicalPk); + Assert.AreEqual(HttpStatusCode.Created, createResponse.StatusCode); + VerifyExpectedDocResponse(testDoc, createResponse.Resource); + + // read back + ItemResponse readResponse = await encryptionContainer.ReadItemAsync( + testDoc.Id, + hirarchicalPk); + + Assert.AreEqual(HttpStatusCode.OK, readResponse.StatusCode); + VerifyExpectedDocResponse(testDoc, readResponse.Resource); + + PartitionKey fullHirarchicalPk = new PartitionKeyBuilder() + .Add(testDoc.State) + .Build(); + + QueryRequestOptions queryRequestOptions = new QueryRequestOptions + { + PartitionKey = fullHirarchicalPk + }; + + using FeedIterator setIterator = encryptionContainer.GetItemQueryIterator("select * from c", requestOptions: queryRequestOptions); + + while (setIterator.HasMoreResults) + { + FeedResponse response = await setIterator.ReadNextAsync().ConfigureAwait(false); + Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); + VerifyExpectedDocResponse(testDoc, response.First()); + } + } +#endif [TestMethod] public async Task EncryptionStreamIteratorValidation() { @@ -3204,6 +3518,14 @@ private static async Task> MdeDeleteItemAsync( return deleteResponse; } + private static void VerifyExpectedDocResponse(HirarchicalPkTestDoc expectedDoc, HirarchicalPkTestDoc verifyDoc) + { + Assert.AreEqual(expectedDoc.Id, verifyDoc.Id); + Assert.AreEqual(expectedDoc.State, verifyDoc.State); + Assert.AreEqual(expectedDoc.City, verifyDoc.City); + Assert.AreEqual(expectedDoc.ZipCode, verifyDoc.ZipCode); + } + private static void VerifyExpectedDocResponse(TestDoc expectedDoc, TestDoc verifyDoc) { Assert.AreEqual(expectedDoc.Id, verifyDoc.Id); @@ -3716,6 +4038,70 @@ public Stream ToStream() } } + public class HirarchicalPkTestDoc + { + [JsonProperty("id")] + public string Id { get; set; } + + public string PK { get; set; } + + public string State { get; set; } + + public string City { get; set; } + + public string ZipCode { get; set; } + + public HirarchicalPkTestDoc() + { + } + public HirarchicalPkTestDoc(HirarchicalPkTestDoc other) + { + this.Id = other.Id; + this.PK = other.PK; + this.State = other.State; + this.City = other.City; + this.ZipCode = other.ZipCode; + } + + public override bool Equals(object obj) + { + return obj is HirarchicalPkTestDoc doc + && this.Id == doc.Id + && this.PK == doc.PK + && this.State == doc.State + && this.City == doc.City + && this.ZipCode == doc.ZipCode; + } + + public override int GetHashCode() + { + int hashCode = 1652434776; + hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(this.Id); + hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(this.PK); + hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(this.State); + hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(this.City); + hashCode = (hashCode * -1521134295) + EqualityComparer.Default.GetHashCode(this.ZipCode); + return hashCode; + } + + public static HirarchicalPkTestDoc Create(string partitionKey = null) + { + return new HirarchicalPkTestDoc() + { + Id = Guid.NewGuid().ToString(), + PK = partitionKey ?? Guid.NewGuid().ToString(), + State = Guid.NewGuid().ToString(), + City = Guid.NewGuid().ToString(), + ZipCode = Guid.NewGuid().ToString() + }; + } + + public Stream ToStream() + { + return TestCommon.ToStream(this); + } + } + internal class TestKeyEncryptionKey : IKeyEncryptionKey { private static readonly Dictionary keyinfo = new Dictionary From ebd1b91a26547721ef232ef597d878144889b80b Mon Sep 17 00:00:00 2001 From: akotalwar <94020786+akotalwar@users.noreply.github.com> Date: Tue, 1 Aug 2023 08:28:49 -0700 Subject: [PATCH 166/240] Query: Refactors changelog.md with Optimistic Direct Execution recommendation (#4004) * Update changelog.md This is a recommendation for customers if they would like to use the ODE features. * Updated release notes for ODE --- changelog.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/changelog.md b/changelog.md index ab733a4137..a6f9e65864 100644 --- a/changelog.md +++ b/changelog.md @@ -44,6 +44,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [3836](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3836) Integrated cache: Adds BypassIntegratedCache to DedicatedGatewayRequestOptions - [3909](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3909) Query: Adds EnableOptimisticDirectExecution in QueryRequestOptions enabled by default +Recommendation for customers regarding Optimistic Direct Execution: + +Starting Version 3.35.0, the Preview SDK enables the ODE feature by default. This can potentially cause a new type of continuation token to be generated. Such a token is not recognized by the older SDKs by design and this could result in a Malformed Continuation Token Exception. +If you have a scenario where tokens generated from the newer SDKs are used by an older SDK, we recommend a 2 step approach to upgrade: + +- Upgrade to the new SDK and disable ODE, both together as part of a single deployment. Wait for all nodes to upgrade. + - In order to disable ODE, set EnableOptimisticDirectExecution to false in the QueryRequestOptions. +- Enable ODE as part of second deployment for all nodes. + ### [3.35.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.0) - 2023-06-19 #### Fixed From 8c4f99f35e326b61ecca210988334d00629b6ee7 Mon Sep 17 00:00:00 2001 From: akotalwar <94020786+akotalwar@users.noreply.github.com> Date: Sat, 5 Aug 2023 13:01:59 -0700 Subject: [PATCH 167/240] [Internal] Query: Adds performance testing for OptimisticDirectExecution pipeline (#3839) * Infrastructure for performance testing with ODE pipeline. * Resolve comments * Removed randomization from data creation process * Fixed comments * Removed Query and EnableODE from QueryStatisticsMetrics, as they do not relate to query statistics. * Removed try catch to make CreateItemAsync call always succeed * Removed one liner functions * Removed code from MetricsSerializer and QueryStatisticsDatumVisitor files * Fixed comments * Removed request Charge check * Bug in Debug Assert * Test * Bug in debug assert fix * Fixed second bug in Metrics Accumalator class * Added ignore flag to ode perf tests so that they do not run on every loop build * Added comment explaining the Ignore flag. --- .../ContentSerializationPerformanceTests.cs | 18 +- .../QueryPerfTest/MetricsAccumulator.cs | 8 +- ...timisticDirectExecutionPerformanceTests.cs | 469 ++++++++++++++++++ .../QueryPerfTest/QueryStatisticsMetrics.cs | 6 + .../settings.json | 18 +- 5 files changed, 496 insertions(+), 23 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/OptimisticDirectExecutionPerformanceTests.cs diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/ContentSerializationPerformanceTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/ContentSerializationPerformanceTests.cs index 759e63b345..8ff5660c6f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/ContentSerializationPerformanceTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/ContentSerializationPerformanceTests.cs @@ -33,15 +33,15 @@ public ContentSerializationPerformanceTests() this.queryStatisticsDatumVisitor = new(); this.endpoint = Utils.ConfigurationManager.AppSettings["GatewayEndpoint"]; this.authKey = Utils.ConfigurationManager.AppSettings["MasterKey"]; - this.cosmosDatabaseId = Utils.ConfigurationManager.AppSettings["ContentSerializationPerformanceTests.CosmosDatabaseId"]; - this.containerId = Utils.ConfigurationManager.AppSettings["ContentSerializationPerformanceTests.ContainerId"]; - this.contentSerialization = Utils.ConfigurationManager.AppSettings["ContentSerializationPerformanceTests.ContentSerialization"]; - this.query = Utils.ConfigurationManager.AppSettings["ContentSerializationPerformanceTests.Query"]; - this.numberOfIterations = int.Parse(Utils.ConfigurationManager.AppSettings["ContentSerializationPerformanceTests.NumberOfIterations"]); - this.warmupIterations = int.Parse(Utils.ConfigurationManager.AppSettings["ContentSerializationPerformanceTests.WarmupIterations"]); - this.MaxConcurrency = int.Parse(Utils.ConfigurationManager.AppSettings["ContentSerializationPerformanceTests.MaxConcurrency"]); - this.MaxItemCount = int.Parse(Utils.ConfigurationManager.AppSettings["ContentSerializationPerformanceTests.MaxItemCount"]); - this.useStronglyTypedIterator = bool.Parse(Utils.ConfigurationManager.AppSettings["ContentSerializationPerformanceTests.UseStronglyTypedIterator"]); + this.cosmosDatabaseId = Utils.ConfigurationManager.AppSettings["QueryPerformanceTests.CosmosDatabaseId"]; + this.containerId = Utils.ConfigurationManager.AppSettings["QueryPerformanceTests.ContainerId"]; + this.contentSerialization = Utils.ConfigurationManager.AppSettings["QueryPerformanceTests.ContentSerialization"]; + this.query = Utils.ConfigurationManager.AppSettings["QueryPerformanceTests.Query"]; + this.numberOfIterations = int.Parse(Utils.ConfigurationManager.AppSettings["QueryPerformanceTests.NumberOfIterations"]); + this.warmupIterations = int.Parse(Utils.ConfigurationManager.AppSettings["QueryPerformanceTests.WarmupIterations"]); + this.MaxConcurrency = int.Parse(Utils.ConfigurationManager.AppSettings["QueryPerformanceTests.MaxConcurrency"]); + this.MaxItemCount = int.Parse(Utils.ConfigurationManager.AppSettings["QueryPerformanceTests.MaxItemCount"]); + this.useStronglyTypedIterator = bool.Parse(Utils.ConfigurationManager.AppSettings["QueryPerformanceTests.UseStronglyTypedIterator"]); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/MetricsAccumulator.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/MetricsAccumulator.cs index 56fc16b683..a7e6032001 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/MetricsAccumulator.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/MetricsAccumulator.cs @@ -53,18 +53,16 @@ public void ReadFromTrace(FeedResponse Response, QueryStatisticsDatumVisit { if (storeResponse.StoreResult.StatusCode == StatusCodes.Ok) { - backendAndClientMetrics.Add(Tuple.Create(retrieveCosmosElementTraces[k], backendMetrics[j], transitMetrics[i])); + backendAndClientMetrics.Add(Tuple.Create(retrieveCosmosElementTraces[k], backendMetrics[j], node)); j++; k++; } else { //We add null values to the tuple since status codes other than Ok will not have data for 'Query Metrics' and 'Get Cosmos Element Response' - backendAndClientMetrics.Add(Tuple.Create(null, null, transitMetrics[i])); + backendAndClientMetrics.Add(Tuple.Create(null, null, node)); } } - - i++; } Debug.Assert(i == transitMetrics.Count, "All 'transit metrics' must be grouped."); @@ -76,7 +74,7 @@ public void ReadFromTrace(FeedResponse Response, QueryStatisticsDatumVisit { if (metrics.Item2 != null) { - Debug.Assert(metrics.Item1 == null, "'Get Cosmos Element Response' is null"); + Debug.Assert(metrics.Item1 != null, "'Get Cosmos Element Response' is null"); queryStatisticsDatumVisitor.AddGetCosmosElementResponseTime(metrics.Item1.Duration.TotalMilliseconds); foreach (KeyValuePair kvp in metrics.Item2.Data) { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/OptimisticDirectExecutionPerformanceTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/OptimisticDirectExecutionPerformanceTests.cs new file mode 100644 index 0000000000..756357e611 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/OptimisticDirectExecutionPerformanceTests.cs @@ -0,0 +1,469 @@ +namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using Microsoft.Azure.Cosmos; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + [TestClass] + public class OptimisticDirectExecutionPerformanceTests + { + private Container Container; + private const string RawDataFileName = "OptimisticDirectExecutionPerformanceTestsRawData.csv"; + private const string AggregateDataFileName = "OptimisticDirectExecutionPerformanceTestsAggregatedData.csv"; + private const string PrintQueryMetrics = "QueryMetrics"; + private static readonly string RawDataPath = Path.GetFullPath(RawDataFileName); + private static readonly string AggregateDataPath = Path.GetFullPath(AggregateDataFileName); + private static readonly string Endpoint = Utils.ConfigurationManager.AppSettings["GatewayEndpoint"]; + private static readonly string AuthKey = Utils.ConfigurationManager.AppSettings["MasterKey"]; + private static readonly string CosmosDatabaseId = Utils.ConfigurationManager.AppSettings["QueryPerformanceTests.CosmosDatabaseId"]; + private static readonly string ContainerId = Utils.ConfigurationManager.AppSettings["QueryPerformanceTests.ContainerId"]; + private static readonly PartitionKey PartitionKeyValue = new PartitionKey("Andersen"); + private static readonly int NumberOfIterations = int.Parse(Utils.ConfigurationManager.AppSettings["QueryPerformanceTests.NumberOfIterations"]); + private static readonly int WarmupIterations = int.Parse(Utils.ConfigurationManager.AppSettings["QueryPerformanceTests.WarmupIterations"]); + + [TestInitialize] + public async Task InitializeTest() + { + CosmosClientOptions clientOptions = new CosmosClientOptions() + { + ConnectionMode = ConnectionMode.Direct, + }; + + CosmosClient cosmosClient = new CosmosClient(Endpoint, AuthKey, clientOptions); + Database database = await cosmosClient.CreateDatabaseAsync(CosmosDatabaseId); + this.Container = await database.CreateContainerAsync(ContainerId, partitionKeyPath: "/name"); + await this.AddItemsToContainerAsync(this.Container); + + if (File.Exists(RawDataPath)) + { + File.Delete(RawDataPath); + } + + if (File.Exists(AggregateDataPath)) + { + File.Delete(AggregateDataPath); + } + } + + [TestCleanup] + public async Task CleanupAsync() + { + if (this.Container != null) + { + await this.Container.Database.DeleteAsync(); + this.Container = null; + } + } + + private async Task AddItemsToContainerAsync(Container container) + { + int totalItems = 5000; + string[] cityOptions = new string[] { "Seattle", "Chicago", "NYC", "SF" }; + int numberOfRecipeints = cityOptions.Length; + List recipientList = new List(numberOfRecipeints); + + for (int j = 0; j < numberOfRecipeints; j++) + { + RecipientList recipient = new RecipientList() + { + Name = "John", + City = cityOptions[j], + }; + + recipientList.Add(recipient); + } + + // Create a family object for the Andersen family + foreach (int i in Enumerable.Range(0, totalItems)) + { + States andersenFamily = new States + { + Id = i.ToString(), + Name = i < (totalItems/2) ? "Andersen" : "Smith", + City = cityOptions[i%cityOptions.Length], + PostalCode = (i * 10).ToString(), + Region = "Northwest", + UserDefinedID = i % 10, + RecipientList = recipientList + }; + + ItemResponse andersenFamilyResponse = await container.CreateItemAsync(andersenFamily, new PartitionKey(andersenFamily.Name)); + Console.WriteLine("Created item in database with id: {0} Operation consumed {1} RUs.\n", andersenFamilyResponse.Resource.Id, andersenFamilyResponse.RequestCharge); + } + } + + //Set Ode perf tests to ignore so that they dont run on every loop build. + //Ignore flag can be removed when checking for Ode performance. + [Ignore] + [TestMethod] + [Owner("akotalwar")] + public async Task RunAsync() + { + string highPrepTimeSumQuery = CreateHighPrepTimeSumQuery(); + string highPrepTimeConditionalQuery = CreateHighPrepTimeConditionalQuery(); + List> globalCustomOdeStatisticsList = new List>(); + + List odeTestCases = new List() + { + //Simple Query + CreateInput("SELECT * FROM c", PartitionKeyValue, false, -1, 2500), + CreateInput("SELECT * FROM c", PartitionKeyValue, true, -1, 2500), + + //TOP + CreateInput("SELECT TOP 1000 c.id FROM c", PartitionKeyValue, false, -1, 1000), + CreateInput("SELECT TOP 1000 c.id FROM c", PartitionKeyValue, true, -1, 1000), + + //Filter + CreateInput("SELECT c.id FROM c WHERE c.city IN ('Seattle', 'NYC')", PartitionKeyValue, false, -1, 1250), + CreateInput("SELECT c.id FROM c WHERE c.city IN ('Seattle', 'NYC')", PartitionKeyValue, true, -1, 1250), + + //DISTINCT + Filter + CreateInput("SELECT DISTINCT c.userDefinedId FROM c WHERE c.userDefinedId BETWEEN 0 AND 5 OFFSET 1 LIMIT 3", PartitionKeyValue, false, -1, 3), + CreateInput("SELECT DISTINCT c.userDefinedId FROM c WHERE c.userDefinedId BETWEEN 0 AND 5 OFFSET 1 LIMIT 3", PartitionKeyValue, true, -1, 3), + + CreateInput("SELECT DISTINCT c.city FROM c WHERE STARTSWITH(c.city, 'S')", PartitionKeyValue, false, -1, 2), + CreateInput("SELECT DISTINCT c.city FROM c WHERE STARTSWITH(c.city, 'S')", PartitionKeyValue, true, -1, 2), + + //JOIN + CreateInput("SELECT root.id " + + "FROM root " + + "JOIN root.id a " + + "JOIN root.id b " + + "JOIN root.id c " + + "WHERE root.id = '1' OR a.id in (1,2,3,4,5,6,7,8,9,10) " + + "OR b.id in (1,2,3,4,5,6,7,8,9,10) " + + "OR c.id in (1,2,3,4,5,6,7,8,9,10)", PartitionKeyValue, false, -1, 1), + CreateInput("SELECT root.id " + + "FROM root " + + "JOIN root.id a " + + "JOIN root.id b " + + "JOIN root.id c " + + "WHERE root.id = '1' OR a.id in (1,2,3,4,5,6,7,8,9,10) " + + "OR b.id in (1,2,3,4,5,6,7,8,9,10) " + + "OR c.id in (1,2,3,4,5,6,7,8,9,10)", PartitionKeyValue, true, -1, 1), + + //High Prep Time + CreateInput(highPrepTimeSumQuery, PartitionKeyValue, false, -1, 2500), + CreateInput(highPrepTimeSumQuery, PartitionKeyValue, true, -1, 2500), + + CreateInput(highPrepTimeConditionalQuery, PartitionKeyValue, false, -1, 1750), + CreateInput(highPrepTimeConditionalQuery, PartitionKeyValue, true, -1, 1750), + + //Order By + CreateInput("SELECT * FROM c ORDER BY c.userDefinedId DESC", PartitionKeyValue, false, -1, 2500), + CreateInput("SELECT * FROM c ORDER BY c.userDefinedId DESC", PartitionKeyValue, true, -1, 2500), + + CreateInput("SELECT c.id FROM c ORDER BY c.postalcode DESC", PartitionKeyValue, false, -1, 2500), + CreateInput("SELECT c.id FROM c ORDER BY c.postalcode DESC", PartitionKeyValue, true, -1, 2500), + + //Order By + TOP + CreateInput("SELECT TOP 5 c.id FROM c ORDER BY c.userDefinedId", PartitionKeyValue, false, -1, 5), + CreateInput("SELECT TOP 5 c.id FROM c ORDER BY c.userDefinedId", PartitionKeyValue, true, -1, 5), + + //Order By + DISTINCT + CreateInput("SELECT DISTINCT c.id FROM c ORDER BY c.city DESC", PartitionKeyValue, false, -1, 2500), + CreateInput("SELECT DISTINCT c.id FROM c ORDER BY c.city DESC", PartitionKeyValue, true, -1, 2500), + + //Order By + DISTINCT + Filter + CreateInput("SELECT DISTINCT c.userDefinedId FROM c WHERE c.userDefinedId > 5 ORDER BY c.userDefinedId", PartitionKeyValue, false, -1, 4), + CreateInput("SELECT DISTINCT c.userDefinedId FROM c WHERE c.userDefinedId > 5 ORDER BY c.userDefinedId", PartitionKeyValue, true, -1, 4), + + CreateInput("SELECT DISTINCT c.userDefinedId FROM c WHERE c.userDefinedId BETWEEN 0 AND 5 ORDER BY c.id DESC", PartitionKeyValue, false, -1, 6), + CreateInput("SELECT DISTINCT c.userDefinedId FROM c WHERE c.userDefinedId BETWEEN 0 AND 5 ORDER BY c.id DESC", PartitionKeyValue, true, -1, 6), + + //Group By + CreateInput("SELECT c.postalcode FROM c GROUP BY c.postalcode", PartitionKeyValue, false, -1, 2500), + CreateInput("SELECT c.postalcode FROM c GROUP BY c.postalcode", PartitionKeyValue, true, -1, 2500), + + CreateInput("SELECT Count(1) AS count, Sum(ARRAY_LENGTH(c.recipientList)) AS sum FROM c WHERE c.city IN ('Seattle', 'SF') GROUP BY c.city", PartitionKeyValue, false, -1, 2), + CreateInput("SELECT Count(1) AS count, Sum(ARRAY_LENGTH(c.recipientList)) AS sum FROM c WHERE c.city IN ('Seattle', 'SF') GROUP BY c.city", PartitionKeyValue, true, -1, 2), + + CreateInput("SELECT c.city, AVG(ARRAY_LENGTH(c.recipientList)) FROM c GROUP BY c.city", PartitionKeyValue, false, -1, 4), + CreateInput("SELECT c.city, AVG(ARRAY_LENGTH(c.recipientList)) FROM c GROUP BY c.city", PartitionKeyValue, true, -1, 4), + + //Group By + OFFSET + CreateInput("SELECT c.id FROM c GROUP BY c.id OFFSET 5 LIMIT 3", PartitionKeyValue, false, -1, 3), + CreateInput("SELECT c.id FROM c GROUP BY c.id OFFSET 5 LIMIT 3", PartitionKeyValue, true, -1, 3), + + //Group By + TOP + CreateInput("SELECT TOP 25 c.id FROM c GROUP BY c.id", PartitionKeyValue, false, -1, 25), + CreateInput("SELECT TOP 25 c.id FROM c GROUP BY c.id", PartitionKeyValue, true, -1, 25), + + //Group By + DISTINCT + CreateInput("SELECT DISTINCT c.id FROM c GROUP BY c.id", PartitionKeyValue, false, -1, 2500), + CreateInput("SELECT DISTINCT c.id FROM c GROUP BY c.id", PartitionKeyValue, true, -1, 2500), + + CreateInput("SELECT DISTINCT c.postalcode FROM c GROUP BY c.postalcode", PartitionKeyValue, false, -1, 2500), + CreateInput("SELECT DISTINCT c.postalcode FROM c GROUP BY c.postalcode", PartitionKeyValue, true, -1, 2500), + }; + + foreach (DirectExecutionTestCase testCase in odeTestCases) + { + globalCustomOdeStatisticsList.AddRange(await this.RunQueryAsync(testCase)); + } + + using (StreamWriter writer = new StreamWriter(new FileStream(RawDataPath, FileMode.Append, FileAccess.Write))) + { + SerializeODEQueryMetrics(writer, globalCustomOdeStatisticsList, NumberOfIterations, rawData: true); + } + + using (StreamWriter writer = new StreamWriter(new FileStream(AggregateDataPath, FileMode.Append, FileAccess.Write))) + { + SerializeODEQueryMetrics(writer, globalCustomOdeStatisticsList, NumberOfIterations, rawData: false); + } + } + + private async Task>> RunQueryAsync(DirectExecutionTestCase queryInput) + { + List> odeQueryStatisticsList = new List>(); + QueryRequestOptions requestOptions = new QueryRequestOptions() + { + MaxItemCount = queryInput.PageSizeOption, + EnableOptimisticDirectExecution = queryInput.EnableOptimisticDirectExecution, + PartitionKey = queryInput.PartitionKey, + }; + + for (int i = 0; i < NumberOfIterations + WarmupIterations; i++) + { + bool isWarmUpIteration = i < WarmupIterations; + using (FeedIterator iterator = this.Container.GetItemQueryIterator( + queryText: queryInput.Query, + requestOptions: requestOptions)) + { + if (isWarmUpIteration) + { + while (iterator.HasMoreResults) + { + await iterator.ReadNextAsync(); + } + } + else + { + odeQueryStatisticsList.Add(await this.GetIteratorStatistics(iterator, queryInput)); + } + } + } + + return odeQueryStatisticsList; + } + + private async Task> GetIteratorStatistics(FeedIterator feedIterator, DirectExecutionTestCase queryInput) + { + MetricsAccumulator metricsAccumulator = new MetricsAccumulator(); + Guid correlatedActivityId = Guid.NewGuid(); + FeedResponse response; + int totalDocumentCount = 0; + string query; + bool enableOde; + List odeQueryStatisticsList = new List(); + + while (feedIterator.HasMoreResults) + { + QueryStatisticsDatumVisitor queryStatisticsDatumVisitor = new QueryStatisticsDatumVisitor(); + System.Diagnostics.Stopwatch totalTime = new System.Diagnostics.Stopwatch(); + System.Diagnostics.Stopwatch traceTime = new System.Diagnostics.Stopwatch(); + + totalTime.Start(); + response = await feedIterator.ReadNextAsync(); + traceTime.Start(); + if (response.RequestCharge != 0) + { + metricsAccumulator.ReadFromTrace(response, queryStatisticsDatumVisitor); + } + + traceTime.Stop(); + totalTime.Stop(); + + query = queryInput.Query; + enableOde = queryInput.EnableOptimisticDirectExecution; + queryStatisticsDatumVisitor.AddEndToEndTime(totalTime.ElapsedMilliseconds - traceTime.ElapsedMilliseconds); + queryStatisticsDatumVisitor.PopulateMetrics(); + + QueryStatisticsMetrics queryStatistics = queryStatisticsDatumVisitor.QueryMetricsList[0]; + queryStatistics.RUCharge = response.RequestCharge; + queryStatistics.CorrelatedActivityId = correlatedActivityId; + + // Each roundtrip is a new item in the list + odeQueryStatisticsList.Add(new OdeQueryStatistics + { + Query = query, + EnableOde = enableOde, + QueryStatisticsMetrics = queryStatistics + }); + + totalDocumentCount += response.Count; + } + + Assert.AreEqual(queryInput.ExpectedResultCount, totalDocumentCount); + + return odeQueryStatisticsList; + } + + private static string CreateHighPrepTimeSumQuery() + { + int exprCount = 9999; + StringBuilder sb = new StringBuilder(); + sb.Append("SELECT r.id FROM root r WHERE "); + for (int i = 0; i < exprCount; i++) + { + sb.Append(i == 0 ? "1" : "+1"); + } + + return sb.Append(" = " + exprCount + " ORDER BY r.id ASC").ToString(); + } + + private static string CreateHighPrepTimeConditionalQuery() + { + int exprCount = 999; + StringBuilder sb = new StringBuilder(); + string[] cityOptions = new string[] { "Seattle", "Chicago", "NYC", "SF" }; + + sb.Append("SELECT * FROM root r WHERE "); + for (int nIdx = 0; nIdx < exprCount; nIdx++) + { + if (nIdx > 0) + { + sb.Append(" OR "); + } + + sb.Append($"r.userDefinedId > {nIdx} AND r.city = '{cityOptions[nIdx % cityOptions.Length]}'"); + } + + return sb.ToString(); + } + + private static void SerializeODEQueryMetrics(TextWriter textWriter, List> customOdeStatisticsList, int numberOfIterations, bool rawData) + { + if (rawData) + { + SerializeODERawDataQueryMetrics(textWriter, customOdeStatisticsList); + } + else + { + SerializeODEProcessedDataQueryMetrics(textWriter, customOdeStatisticsList, numberOfIterations); + } + } + + private static void SerializeODERawDataQueryMetrics(TextWriter textWriter, List> globalOdeQueryStatisticsList) + { + textWriter.WriteLine(); + textWriter.WriteLine(PrintQueryMetrics); + textWriter.Write("\"{0}\",\"{1}\",\"{2}\",\"{3}\",\"{4}\",\"{5}\",\"{6}\"", "Query", "ODE", "RUCharge", "BackendTime", "TransitTime", "ClientTime", "EndToEndTime"); + textWriter.WriteLine(); + + foreach (List queryStatisticsList in globalOdeQueryStatisticsList) + { + double totalClientTime = 0; + double totalBackendTime = 0; + double totalEndToEndTime = 0; + double totalTransitTime = 0; + double totalRU = 0; + string query = ""; + bool ode = false; + + foreach (OdeQueryStatistics queryStatistics in queryStatisticsList) + { + QueryStatisticsMetrics metrics = queryStatistics.QueryStatisticsMetrics; + double transitTime = metrics.Created + metrics.ChannelAcquisitionStarted + metrics.Pipelined + metrics.Received + metrics.Completed; + double backendTime = metrics.TotalQueryExecutionTime; + + totalClientTime += metrics.EndToEndTime - (backendTime + transitTime); + totalBackendTime += backendTime; + totalEndToEndTime += metrics.EndToEndTime; + totalTransitTime += transitTime; + totalRU += metrics.RUCharge; + query = queryStatistics.Query; + ode = queryStatistics.EnableOde; + } + + textWriter.WriteLine($"{query},{ode},{totalRU},{totalBackendTime},{totalTransitTime},{totalClientTime},{totalEndToEndTime}"); + } + } + + private static void SerializeODEProcessedDataQueryMetrics(TextWriter textWriter, List> globalOdeQueryStatisticsList, int numberOfIterations) + { + textWriter.WriteLine(); + textWriter.WriteLine(PrintQueryMetrics); + textWriter.Write("\"{0}\",\"{1}\",\"{2}\",\"{3}\"", "Query", "ODE", "RUCharge", "EndToEndTime"); + textWriter.WriteLine(); + + string prevQuery = globalOdeQueryStatisticsList[0][0].Query; + bool prevOde = globalOdeQueryStatisticsList[0][0].EnableOde; + double totalEndToEndTime = 0; + double totalRU = 0; + + foreach (List odeQueryStatisticsList in globalOdeQueryStatisticsList) + { + if (odeQueryStatisticsList[0].Query == prevQuery && odeQueryStatisticsList[0].EnableOde == prevOde) + { + foreach (OdeQueryStatistics odeQueryStatistics in odeQueryStatisticsList) + { + QueryStatisticsMetrics metrics = odeQueryStatistics.QueryStatisticsMetrics; + totalEndToEndTime += metrics.EndToEndTime; + totalRU += metrics.RUCharge; + } + } + else + { + textWriter.WriteLine($"{prevQuery},{prevOde},{totalRU / numberOfIterations},{totalEndToEndTime / numberOfIterations}"); + + foreach (OdeQueryStatistics odeQueryStatistics in odeQueryStatisticsList) + { + QueryStatisticsMetrics metrics = odeQueryStatistics.QueryStatisticsMetrics; + totalEndToEndTime = metrics.EndToEndTime; + totalRU = metrics.RUCharge; + prevQuery = odeQueryStatistics.Query; + prevOde = odeQueryStatistics.EnableOde; + } + } + } + + textWriter.WriteLine($"{prevQuery},{prevOde},{totalRU / numberOfIterations},{totalEndToEndTime / numberOfIterations}"); + } + + private class OdeQueryStatistics + { + public string Query { get; set; } + public bool EnableOde { get; set; } + public QueryStatisticsMetrics QueryStatisticsMetrics { get; set; } + } + + private static DirectExecutionTestCase CreateInput( + string query, + PartitionKey? partitionKey, + bool enableOptimisticDirectExecution, + int pageSizeOption, + int expectedResultCount) + { + return new DirectExecutionTestCase(query, partitionKey, enableOptimisticDirectExecution, pageSizeOption, expectedResultCount); + } + + private readonly struct DirectExecutionTestCase + { + public string Query { get; } + public PartitionKey? PartitionKey { get; } + public bool EnableOptimisticDirectExecution { get; } + public int PageSizeOption { get; } + public int ExpectedResultCount { get; } + + public DirectExecutionTestCase( + string query, + PartitionKey? partitionKey, + bool enableOptimisticDirectExecution, + int pageSizeOption, + int expectedResultCount) + { + this.Query = query; + this.PartitionKey = partitionKey; + this.EnableOptimisticDirectExecution = enableOptimisticDirectExecution; + this.PageSizeOption = pageSizeOption; + this.ExpectedResultCount = expectedResultCount; + } + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/QueryStatisticsMetrics.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/QueryStatisticsMetrics.cs index 70ed146f4c..d72193fc43 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/QueryStatisticsMetrics.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/QueryStatisticsMetrics.cs @@ -1,7 +1,11 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests { + using System; + internal class QueryStatisticsMetrics { + public Guid CorrelatedActivityId { get; set; } + public double EndToEndTime { get; set; } public double PocoTime { get; set; } @@ -32,6 +36,8 @@ internal class QueryStatisticsMetrics public double Received { get; set; } + public double RUCharge { get; set; } + public double Completed { get; set; } public double BadRequestCreated { get; set; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/settings.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/settings.json index 51ecc8a707..611ba8c677 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/settings.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/settings.json @@ -11,14 +11,14 @@ "MasterKey": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==", "ServerStalenessIntervalInSeconds": "5", "MasterStalenessIntervalInSeconds": "1", - "ContentSerializationPerformanceTests.CosmosDatabaseId": "db", - "ContentSerializationPerformanceTests.ContainerId": "container", - "ContentSerializationPerformanceTests.ContentSerialization": "JsonText", - "ContentSerializationPerformanceTests.Query": "SELECT TOP 1 c.region FROM c", - "ContentSerializationPerformanceTests.MaxConcurrency": "-1", - "ContentSerializationPerformanceTests.MaxItemCount": "-1", - "ContentSerializationPerformanceTests.NumberOfIterations": "1", - "ContentSerializationPerformanceTests.WarmupIterations": "0", - "ContentSerializationPerformanceTests.UseStronglyTypedIterator": "true" + "QueryPerformanceTests.CosmosDatabaseId": "db", + "QueryPerformanceTests.ContainerId": "container", + "QueryPerformanceTests.ContentSerialization": "JsonText", + "QueryPerformanceTests.Query": "SELECT TOP 1 c.region FROM c", + "QueryPerformanceTests.MaxConcurrency": "-1", + "QueryPerformanceTests.MaxItemCount": "-1", + "QueryPerformanceTests.NumberOfIterations": "1", + "QueryPerformanceTests.WarmupIterations": "0", + "QueryPerformanceTests.UseStronglyTypedIterator": "true" } } \ No newline at end of file From c46614b9311365f203d489394cf475e212ca202f Mon Sep 17 00:00:00 2001 From: akotalwar <94020786+akotalwar@users.noreply.github.com> Date: Sat, 5 Aug 2023 13:44:45 -0700 Subject: [PATCH 168/240] Query: Adds ODE continuation token support for non-ODE pipelines (#4009) * Added code to throw exception if ODE continuation token goes into non ODE pipeline * Removed count variable * Updated test name * Removed ODE continuation token logic from caller class * Simplified code * Fixed comments * Updated continuation token cast * Removed const string for continuation token * Added Ignore flag for test * Added baseline test * Updated baseline test --- .../CosmosQueryExecutionContextFactory.cs | 12 ++++- ...imisticDirectExecutionContinuationToken.cs | 16 +++--- .../CosmosBasicQueryTests.cs | 53 ++++++++++++++++++- ...misticDirectExecutionQueryBaselineTests.cs | 44 +++++++++++++++ 4 files changed, 117 insertions(+), 8 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs index 47aa1c4490..43ebf6a2d8 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs @@ -752,7 +752,17 @@ private static Documents.PartitionKeyDefinition GetPartitionKeyDefinition(InputP ContainerQueryProperties containerQueryProperties, ITrace trace) { - if (!inputParameters.EnableOptimisticDirectExecution) return null; + if (!inputParameters.EnableOptimisticDirectExecution) + { + if (inputParameters.InitialUserContinuationToken != null + && OptimisticDirectExecutionContinuationToken.IsOptimisticDirectExecutionContinuationToken(inputParameters.InitialUserContinuationToken)) + { + throw new MalformedContinuationTokenException($"The continuation token supplied requires the Optimistic Direct Execution flag to be enabled in QueryRequestOptions for the query execution to resume. " + + $"{inputParameters.InitialUserContinuationToken}"); + } + + return null; + } Debug.Assert(containerQueryProperties.ResourceId != null, "CosmosQueryExecutionContextFactory Assert!", "Container ResourceId cannot be null!"); diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionContinuationToken.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionContinuationToken.cs index 59f87295f3..76b2531f01 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionContinuationToken.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/OptimisticDirectExecution/OptimisticDirectExecutionContinuationToken.cs @@ -4,9 +4,7 @@ namespace Microsoft.Azure.Cosmos.Query.Core.Pipeline.OptimisticDirectExecutionQuery { - using System; using System.Collections.Generic; - using Microsoft.Azure.Cosmos.ChangeFeed; using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.Query.Core.Exceptions; using Microsoft.Azure.Cosmos.Query.Core.Monads; @@ -30,6 +28,12 @@ public OptimisticDirectExecutionContinuationToken(ParallelContinuationToken toke public Range Range => this.Token.Range; + public static bool IsOptimisticDirectExecutionContinuationToken(CosmosElement continuationToken) + { + CosmosObject cosmosObjectContinuationToken = continuationToken as CosmosObject; + return !(cosmosObjectContinuationToken == null || !cosmosObjectContinuationToken.ContainsKey(OptimisticDirectExecutionToken)); + } + public static CosmosElement ToCosmosElement(OptimisticDirectExecutionContinuationToken continuationToken) { CosmosElement inner = ParallelContinuationToken.ToCosmosElement(continuationToken.Token); @@ -42,14 +46,14 @@ public static CosmosElement ToCosmosElement(OptimisticDirectExecutionContinuatio public static TryCatch TryCreateFromCosmosElement(CosmosElement cosmosElement) { - CosmosObject cosmosObjectContinuationToken = cosmosElement as CosmosObject; - if (cosmosObjectContinuationToken == null || !cosmosObjectContinuationToken.ContainsKey(OptimisticDirectExecutionToken)) + if (!IsOptimisticDirectExecutionContinuationToken(cosmosElement)) { return TryCatch.FromException( - new MalformedContinuationTokenException( - message: $"Malformed Continuation Token: Expected OptimisticDirectExecutionToken\r\n")); + new MalformedContinuationTokenException( + message: $"Malformed Continuation Token: Expected OptimisticDirectExecutionToken\r\n")); } + CosmosObject cosmosObjectContinuationToken = (CosmosObject)cosmosElement; TryCatch inner = ParallelContinuationToken.TryCreateFromCosmosElement(cosmosObjectContinuationToken[OptimisticDirectExecutionToken]); return inner.Succeeded ? diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosBasicQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosBasicQueryTests.cs index 25ac9a705f..bfd6366104 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosBasicQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosBasicQueryTests.cs @@ -15,7 +15,6 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using Cosmos.Scripts; using Microsoft.Azure.Cosmos.Fluent; using Microsoft.Azure.Cosmos.Linq; - using Microsoft.Azure.Cosmos.Query.Core; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents.Collections; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -786,6 +785,58 @@ public async Task QueryActivityIdWithContinuationTokenAndTraceTest() } + //TODO: Remove Ignore flag once emulator is updated to 0415 + [Ignore] + [TestMethod] + public async Task TesOdeTokenCompatibilityWithNonOdePipeline() + { + string query = "select top 200 * from c"; + CosmosClient client = DirectCosmosClient; + Container container = client.GetContainer(DatabaseId, ContainerId); + + // Create items + for (int i = 0; i < 500; i++) + { + await container.CreateItemAsync(ToDoActivity.CreateRandomToDoActivity()); + } + + QueryRequestOptions queryRequestOptions = new QueryRequestOptions + { + MaxItemCount = 50, + EnableOptimisticDirectExecution = true + }; + + FeedIteratorInternal feedIterator = + (FeedIteratorInternal)container.GetItemQueryStreamIterator( + query, + null, + queryRequestOptions); + + ResponseMessage responseMessage = await feedIterator.ReadNextAsync(CancellationToken.None); + string continuationToken = responseMessage.ContinuationToken; + + QueryRequestOptions newQueryRequestOptions = new QueryRequestOptions + { + MaxItemCount = 50, + EnableOptimisticDirectExecution = false + }; + + // use Continuation Token to create new iterator and use same trace + FeedIterator feedIteratorNew = + container.GetItemQueryStreamIterator( + query, + continuationToken, + newQueryRequestOptions); + + while (feedIteratorNew.HasMoreResults) + { + responseMessage = await feedIteratorNew.ReadNextAsync(CancellationToken.None); + } + + string expectedErrorMessage = "The continuation token supplied requires the Optimistic Direct Execution flag to be enabled in QueryRequestOptions for the query execution to resume. "; + Assert.IsTrue(responseMessage.CosmosException.ToString().Contains(expectedErrorMessage)); + } + private class CustomHandler : RequestHandler { string correlatedActivityId; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs index 81c765adc4..5c0e66f1a6 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs @@ -19,6 +19,7 @@ using Microsoft.Azure.Cosmos.Query.Core.Pipeline; using Microsoft.Azure.Cosmos.Query.Core.Pipeline.CrossPartition.OrderBy; using Microsoft.Azure.Cosmos.Query.Core.Pipeline.CrossPartition.Parallel; + using Microsoft.Azure.Cosmos.Query.Core.Pipeline.OptimisticDirectExecutionQuery; using Microsoft.Azure.Cosmos.Query.Core.Pipeline.Pagination; using Microsoft.Azure.Cosmos.Query.Core.QueryClient; using Microsoft.Azure.Cosmos.Query.Core.QueryPlan; @@ -190,6 +191,49 @@ public async Task TestPipelineForBackendDocumentsOnSinglePartitionAsync() Assert.AreEqual(100, documentCountInSinglePartition); } + [TestMethod] + public async Task TestOdeTokenWithSpecializedPipeline() + { + int numItems = 100; + ParallelContinuationToken parallelContinuationToken = new ParallelContinuationToken( + token: Guid.NewGuid().ToString(), + range: new Documents.Routing.Range("A", "B", true, false)); + + OptimisticDirectExecutionContinuationToken optimisticDirectExecutionContinuationToken = new OptimisticDirectExecutionContinuationToken(parallelContinuationToken); + CosmosElement cosmosElementContinuationToken = OptimisticDirectExecutionContinuationToken.ToCosmosElement(optimisticDirectExecutionContinuationToken); + + OptimisticDirectExecutionTestInput input = CreateInput( + description: @"Single Partition Key and Value Field", + query: "SELECT VALUE COUNT(1) FROM c", + expectedOptimisticDirectExecution: false, + partitionKeyPath: @"/pk", + partitionKeyValue: "a", + continuationToken: cosmosElementContinuationToken); + + DocumentContainer documentContainer = await CreateDocumentContainerAsync(numItems, multiPartition: false); + QueryRequestOptions queryRequestOptions = GetQueryRequestOptions(enableOptimisticDirectExecution: input.ExpectedOptimisticDirectExecution); + (CosmosQueryExecutionContextFactory.InputParameters inputParameters, CosmosQueryContextCore cosmosQueryContextCore) = CreateInputParamsAndQueryContext(input, queryRequestOptions); + IQueryPipelineStage queryPipelineStage = CosmosQueryExecutionContextFactory.Create( + documentContainer, + cosmosQueryContextCore, + inputParameters, + NoOpTrace.Singleton); + + string expectedErrorMessage = "The continuation token supplied requires the Optimistic Direct Execution flag to be enabled in QueryRequestOptions for the query execution to resume. "; + + while (await queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton)) + { + if (queryPipelineStage.Current.Failed) + { + Assert.IsTrue(queryPipelineStage.Current.InnerMostException.ToString().Contains(expectedErrorMessage)); + return; + } + + Assert.IsFalse(true); + break; + } + } + [TestMethod] public async Task TestQueriesWhichNeverRequireDistribution() { From e05e3eb23c4afd241dc24f3a8872f3ab5b9f431f Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Tue, 8 Aug 2023 14:39:37 -0700 Subject: [PATCH 169/240] Code changes to disable replica validation in preview package. (#4019) --- Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs index 216e1295b5..748f81833a 100644 --- a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs +++ b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs @@ -38,9 +38,7 @@ public static bool IsReplicaAddressValidationEnabled( ConnectionPolicy connectionPolicy) { bool replicaValidationDefaultValue = false; -#if PREVIEW - replicaValidationDefaultValue = true; -#endif + if (connectionPolicy != null && connectionPolicy.EnableAdvancedReplicaSelectionForTcp.HasValue) { From 27b935072764a901b3eed4b038aff7956f2d297e Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Tue, 8 Aug 2023 21:08:02 -0700 Subject: [PATCH 170/240] 3.35.3: Adds new SDK versions and contract files (#4024) * Updated change log and bumped up the patch version. * Code changes to update the change log message. --- Directory.Build.props | 4 +- .../contracts/API_3.35.3-preview.txt | 1563 +++++++++++++++++ .../contracts/API_3.35.3.txt | 1502 ++++++++++++++++ changelog.md | 9 + 4 files changed, 3076 insertions(+), 2 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.35.3-preview.txt create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.35.3.txt diff --git a/Directory.Build.props b/Directory.Build.props index 9daa1e7e9f..d3ceab0046 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 3.35.2 - 3.35.2 + 3.35.3 + 3.35.3 preview 3.31.3 2.0.3 diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.35.3-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.35.3-preview.txt new file mode 100644 index 0000000000..6c989053fd --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.35.3-preview.txt @@ -0,0 +1,1563 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public sealed class ComputedProperty + { + public ComputedProperty(); + public string Name { get; set; } + public string Query { get; set; } + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public Collection ComputedProperties { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool IsDistributedTracingEnabled { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable BypassIntegratedCache { get; set; } + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public enum PriorityLevel + { + High = 1, + Low = 2, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public bool EnableOptimisticDirectExecution { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public Nullable PriorityLevel { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ComputedPropertiesDefinition + { + public T Attach(); + public ComputedPropertiesDefinition WithComputedProperty(string name, string query); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public ComputedPropertiesDefinition WithComputedProperties(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithDistributedTracing(bool isEnabled=true); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.35.3.txt b/Microsoft.Azure.Cosmos/contracts/API_3.35.3.txt new file mode 100644 index 0000000000..c0dc3e280f --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.35.3.txt @@ -0,0 +1,1502 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/changelog.md b/changelog.md index a6f9e65864..f7a46f39a3 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,15 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [3.35.3-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.3-preview) - 2023-08-09 +### [3.35.3](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.3) - 2023-08-09 + +#### Fixed +- [3979](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3979) Client Encryption: Adds fix for supporting Prefix Partition Key (Hierarchical partitioning) + +#### Added +- [4019](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4019) Upgrade Resiliency: Disables Replica Validation Feature By Default in Preview (The feature was previously enabled by default in the [`3.35.2-preview`](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.2-preview) release) + ### [3.35.2-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.2-preview) - 2023-07-17 #### Fixed From f8f38017f091bf9691db52724f153e3f338d72d5 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Thu, 10 Aug 2023 03:05:06 +0530 Subject: [PATCH 171/240] [Internal] Distributed tracing: Adds a sample to collect activities and events using custom listener (#4021) * custom listener example * removed unwanted code * add comments * fix appsettings * revert changes --- .../Usage/Cosmos.Samples.Usage.sln | 8 +- .../CustomDiagnosticAndEventListener.cs | 167 ++++++++++++++++++ .../CustomDiagnosticAndEventListener.csproj | 20 +++ .../Program.cs | 90 ++++++++++ 4 files changed, 284 insertions(+), 1 deletion(-) create mode 100644 Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/CustomDiagnosticAndEventListener.cs create mode 100644 Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/CustomDiagnosticAndEventListener.csproj create mode 100644 Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/Program.cs diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/Cosmos.Samples.Usage.sln b/Microsoft.Azure.Cosmos.Samples/Usage/Cosmos.Samples.Usage.sln index 999b48d928..5e23b5c075 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/Cosmos.Samples.Usage.sln +++ b/Microsoft.Azure.Cosmos.Samples/Usage/Cosmos.Samples.Usage.sln @@ -53,7 +53,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CFPullModelLatestVersionMod EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry", "OpenTelemetry\OpenTelemetry.csproj", "{C6EF6948-C085-4013-A21F-99303ECBA7A9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ApplicationInsights", "ApplicationInsights\ApplicationInsights.csproj", "{55149A3C-A263-4EE5-AD2D-02FE9AC4D291}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationInsights", "ApplicationInsights\ApplicationInsights.csproj", "{55149A3C-A263-4EE5-AD2D-02FE9AC4D291}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomDiagnosticAndEventListener", "CustomDiagnosticAndEventListener\CustomDiagnosticAndEventListener.csproj", "{9BE3551E-31A1-4186-9D2F-DC325411A39D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -165,6 +167,10 @@ Global {55149A3C-A263-4EE5-AD2D-02FE9AC4D291}.Debug|Any CPU.Build.0 = Debug|Any CPU {55149A3C-A263-4EE5-AD2D-02FE9AC4D291}.Release|Any CPU.ActiveCfg = Release|Any CPU {55149A3C-A263-4EE5-AD2D-02FE9AC4D291}.Release|Any CPU.Build.0 = Release|Any CPU + {9BE3551E-31A1-4186-9D2F-DC325411A39D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9BE3551E-31A1-4186-9D2F-DC325411A39D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9BE3551E-31A1-4186-9D2F-DC325411A39D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9BE3551E-31A1-4186-9D2F-DC325411A39D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/CustomDiagnosticAndEventListener.cs b/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/CustomDiagnosticAndEventListener.cs new file mode 100644 index 0000000000..17348d9a22 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/CustomDiagnosticAndEventListener.cs @@ -0,0 +1,167 @@ +namespace Sample.Listeners +{ + using System.Diagnostics.Tracing; + using System.Diagnostics; + using System.Collections.Concurrent; + + /// + /// This listener can cover following aspects: + /// 1. Write its own monitoring library with the custom implementation of aggregation or whatever you want to do with this data. + /// 2. Support an APM tool which is not open telemetry compliant. + /// + /// It is a simple sample. Anybody can get as creative as they want to make it better in terms of usability and performance. + internal class CustomDiagnosticAndEventListener : + EventListener, // Override Event Listener to capture Event source events + IObserver>, // Override IObserver to capture Activity events + IObserver, + IDisposable + { + private readonly string diagnosticSourceName; + private readonly string eventSourceName; + + private ConcurrentBag? Subscriptions = new(); + private ConcurrentBag Activities { get; } = new(); + + public CustomDiagnosticAndEventListener(string diagnosticSourceName, string eventSourceName) + { + this.diagnosticSourceName = diagnosticSourceName; + this.eventSourceName = eventSourceName; + + DiagnosticListener.AllListeners.Subscribe(this); + } + + /// + /// IObserver Override + /// + public void OnCompleted() { + Console.WriteLine("OnCompleted"); + } + + /// + /// IObserver Override + /// + public void OnError(Exception error) { + Console.WriteLine($"OnError : {error}"); + } + + /// + /// IObserver Override + /// + public void OnNext(KeyValuePair value) + { + lock (this.Activities) + { + // Check for disposal + if (this.Subscriptions == null) return; + + string startSuffix = ".Start"; + string stopSuffix = ".Stop"; + string exceptionSuffix = ".Exception"; + + if (Activity.Current == null) + { + return; + } + + if (value.Key.EndsWith(startSuffix)) + { + this.Activities.Add(Activity.Current); + } + else if (value.Key.EndsWith(stopSuffix) || value.Key.EndsWith(exceptionSuffix)) + { + foreach (Activity activity in this.Activities) + { + if (activity.Id == Activity.Current.Id) + { + Console.WriteLine($" Activity Name: {activity.DisplayName}"); + Console.WriteLine($" Activity Operation Name: {activity.OperationName}"); + foreach (KeyValuePair actualTag in activity.Tags) + { + Console.WriteLine($" {actualTag.Key} ==> {actualTag.Value}"); + } + Console.WriteLine(); + return; + } + } + } + } + } + + /// + /// IObserver Override + /// + public void OnNext(DiagnosticListener value) + { + if (value.Name == this.diagnosticSourceName && this.Subscriptions != null) + { + Console.WriteLine($"CustomDiagnosticAndEventListener : OnNext : {value.Name}"); + lock (this.Activities) + { + this.Subscriptions?.Add(value.Subscribe(this)); + } + } + } + + /// + /// EventListener Override + /// + protected override void OnEventSourceCreated(EventSource eventSource) + { + if (eventSource != null && eventSource.Name.Equals(this.eventSourceName)) + { + Console.WriteLine($"CustomDiagnosticAndEventListener : OnEventSourceCreated : {eventSource.Name}"); + this.EnableEvents(eventSource, EventLevel.Informational); // Enable information level events + } + } + + /// + /// EventListener Override + /// + protected override void OnEventWritten(EventWrittenEventArgs eventData) + { + Console.WriteLine($" Event Name: {eventData.EventName}"); + Console.WriteLine($" Event Level: {eventData.Level}"); + if(eventData.Payload != null) + { + int counter = 0; + foreach (object? payload in eventData.Payload) + { + Console.WriteLine($" Event Payload {counter++}: {payload}"); + } + } + else + { + Console.WriteLine($" Event Payload: NULL"); + } + Console.WriteLine(); + } + + public override void Dispose() + { + Console.WriteLine("CustomDiagnosticAndEventListener : Dispose"); + base.Dispose(); + + if (this.Subscriptions == null) + { + return; + } + + ConcurrentBag subscriptions; + lock (this.Activities) + { + subscriptions = this.Subscriptions; + this.Subscriptions = null; + } + + foreach (IDisposable subscription in subscriptions) + { + subscription.Dispose(); // Dispose of DiagnosticListener subscription + } + + foreach (Activity activity in this.Activities) + { + activity.Dispose(); // Dispose of Activity + } + } + } +} diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/CustomDiagnosticAndEventListener.csproj b/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/CustomDiagnosticAndEventListener.csproj new file mode 100644 index 0000000000..eeb17eb145 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/CustomDiagnosticAndEventListener.csproj @@ -0,0 +1,20 @@ + + + + Exe + net6.0 + enable + enable + + + + + + + + + + PreserveNewest + + + diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/Program.cs b/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/Program.cs new file mode 100644 index 0000000000..77580936f7 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/Program.cs @@ -0,0 +1,90 @@ +namespace Cosmos.Samples.ApplicationInsights +{ + using Microsoft.Azure.Cosmos; + using Microsoft.Extensions.Configuration; + using Newtonsoft.Json; + using Sample.Listeners; + + internal class Program + { + private static readonly string databaseName = "samples"; + private static readonly string containerName = "custom-listener-sample"; + + static async Task Main() + { + IConfigurationRoot configuration = new ConfigurationBuilder() + .AddJsonFile("AppSettings.json") + .Build(); + + string endpoint = configuration["EndPointUrl"]; + if (string.IsNullOrEmpty(endpoint)) + { + throw new ArgumentNullException("Please specify a valid CosmosDBEndPointUrl in the appSettings.json"); + } + + string authKey = configuration["AuthorizationKey"]; + if (string.IsNullOrEmpty(authKey) || string.Equals(authKey, "Super secret key")) + { + throw new ArgumentException("Please specify a valid CosmosDBAuthorizationKey in the appSettings.json"); + } + + using CustomDiagnosticAndEventListener listener + = new CustomDiagnosticAndEventListener( + diagnosticSourceName: "Azure.Cosmos.Operation", + eventSourceName: "Azure-Cosmos-Operation-Request-Diagnostics"); + + CosmosClientOptions options = new CosmosClientOptions() + { + IsDistributedTracingEnabled = true // Defaults to true, set to false to disable + }; + using (CosmosClient client = new CosmosClient(endpoint, authKey, options)) + { + Console.WriteLine($"Getting container reference for {containerName}."); + + ContainerProperties properties = new ContainerProperties(containerName, partitionKeyPath: "/id"); + + await client.CreateDatabaseIfNotExistsAsync(databaseName); + Container container = await client.GetDatabase(databaseName).CreateContainerIfNotExistsAsync(properties); + + await Program.RunCrudDemo(container); + } + } + + public static async Task RunCrudDemo(Container container) + { + // Any operations will automatically generate telemetry + + for (int i = 1; i <= 5; i++) + { + await container.CreateItemAsync(new Item { Id = $"{i}", Status = "new" }, new PartitionKey($"{i}")); + Console.WriteLine($"Created document with id: {i}"); + } + + for (int i = 1; i <= 5; i++) + { + await container.ReadItemAsync($"{i}", new PartitionKey($"{i}")); + Console.WriteLine($"Read document with id: {i}"); + } + + for (int i = 1; i <= 5; i++) + { + await container.ReplaceItemAsync(new Item { Id = $"{i}", Status = "updated" }, $"{i}", new PartitionKey($"{i}")); + Console.WriteLine($"Updated document with id: {i}"); + } + + for (int i = 1; i <= 5; i++) + { + await container.DeleteItemAsync($"{i}", new PartitionKey($"{i}")); + Console.WriteLine($"Deleted document with id: {i}"); + } + } + } + + internal class Item + { + [JsonProperty("id")] + public string Id { get; set; } + + public string Status { get; set; } + } +} \ No newline at end of file From 32827f7846efdfa58be1a72cfe5e0e13cc3fe485 Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Thu, 10 Aug 2023 12:59:38 -0700 Subject: [PATCH 172/240] Code changes to fix race condition by calling dispose too early. (#4030) --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index d3ceab0046..044a7ec7d9 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,7 +3,7 @@ 3.35.3 3.35.3 preview - 3.31.3 + 3.31.4 2.0.3 2.0.3 preview From efb90f094166ab1c9ab8cd8ef84b556ec6c887e0 Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Thu, 10 Aug 2023 13:25:15 -0700 Subject: [PATCH 173/240] Code changes to update change log for release 3.35.3 (#4032) --- changelog.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index f7a46f39a3..27ec98fae0 100644 --- a/changelog.md +++ b/changelog.md @@ -13,11 +13,11 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -### [3.35.3-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.3-preview) - 2023-08-09 -### [3.35.3](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.3) - 2023-08-09 +### [3.35.3-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.3-preview) - 2023-08-10 +### [3.35.3](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.3) - 2023-08-10 #### Fixed -- [3979](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3979) Client Encryption: Adds fix for supporting Prefix Partition Key (Hierarchical partitioning) +- [4030](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4030) Upgrade Resiliency: Fixes Race Condition by Calling Dispose Too Early #### Added - [4019](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4019) Upgrade Resiliency: Disables Replica Validation Feature By Default in Preview (The feature was previously enabled by default in the [`3.35.2-preview`](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.2-preview) release) From e708ec9025626121ef9e07cf9146a71daefc296e Mon Sep 17 00:00:00 2001 From: Rinat Minibaev <132935507+rinatmini@users.noreply.github.com> Date: Thu, 10 Aug 2023 18:14:47 -0700 Subject: [PATCH 174/240] Documentation: Fixes article links (replaced links V2 to V3 SDK version) + Azure Cosmos DB typo (#4031) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Documentation link fix * Fixed Typo "Azure CosmosDB"→"Azure Cosmos DB" --- .../src/ConnectionPolicy.cs | 6 ++--- Microsoft.Azure.Cosmos/src/CosmosClient.cs | 26 +++++++++---------- .../src/CosmosClientOptions.cs | 6 ++--- .../src/Diagnostics/CosmosDiagnostics.cs | 4 +-- .../src/Fluent/CosmosClientBuilder.cs | 8 +++--- .../DedicatedGatewayRequestOptions.cs | 4 +-- Microsoft.Azure.Cosmos/src/RetryOptions.cs | 4 +-- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs b/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs index 9193abedef..c8c1d9db93 100644 --- a/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs @@ -131,7 +131,7 @@ public TimeSpan MediaRequestTimeout /// Default value is /// /// - /// For more information, see Connection policy: Use direct connection mode. + /// For more information, see Connection policy: Use direct connection mode. /// public ConnectionMode ConnectionMode { @@ -160,7 +160,7 @@ public MediaReadMode MediaReadMode /// /// This setting is not used when is set to . /// Gateway mode only supports HTTPS. - /// For more information, see Connection policy: Use the TCP protocol. + /// For more information, see Connection policy: Use the HTTPS protocol. /// public Protocol ConnectionProtocol { @@ -369,7 +369,7 @@ public int MaxConnectionLimit /// set to 9 and set to 30 seconds. /// /// - /// For more information, see Handle rate limiting/request rate too large. + /// For more information, see Handle rate limiting/request rate too large. /// public RetryOptions RetryOptions { diff --git a/Microsoft.Azure.Cosmos/src/CosmosClient.cs b/Microsoft.Azure.Cosmos/src/CosmosClient.cs index d622e9ddcb..7b143196fe 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClient.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClient.cs @@ -28,7 +28,7 @@ namespace Microsoft.Azure.Cosmos /// /// CosmosClient is thread-safe. Its recommended to maintain a single instance of CosmosClient per lifetime /// of the application which enables efficient connection management and performance. Please refer to the - /// performance guide. + /// performance guide. ///
/// /// This example create a , , and a . @@ -97,7 +97,7 @@ namespace Microsoft.Azure.Cosmos /// /// /// - /// Performance Tips + /// Performance Tips /// Diagnose and troubleshoot issues /// Global data distribution /// Partitioning and horizontal scaling @@ -160,7 +160,7 @@ protected CosmosClient() /// /// CosmosClient is thread-safe. Its recommended to maintain a single instance of CosmosClient per lifetime /// of the application which enables efficient connection management and performance. Please refer to the - /// performance guide. + /// performance guide. ///
/// The connection string to the cosmos account. ex: AccountEndpoint=https://XXXXX.documents.azure.com:443/;AccountKey=SuperSecretKey; /// (Optional) client options @@ -187,7 +187,7 @@ protected CosmosClient() /// /// /// - /// Performance Tips + /// Performance Tips /// Diagnose and troubleshoot issues public CosmosClient( string connectionString, @@ -204,7 +204,7 @@ public CosmosClient( /// /// CosmosClient is thread-safe. Its recommended to maintain a single instance of CosmosClient per lifetime /// of the application which enables efficient connection management and performance. Please refer to the - /// performance guide. + /// performance guide. ///
/// The cosmos service endpoint to use /// The cosmos account key or resource token to use to create the client. @@ -232,7 +232,7 @@ public CosmosClient( /// /// /// - /// Performance Tips + /// Performance Tips /// Diagnose and troubleshoot issues public CosmosClient( string accountEndpoint, @@ -250,7 +250,7 @@ public CosmosClient( /// /// CosmosClient is thread-safe. Its recommended to maintain a single instance of CosmosClient per lifetime /// of the application which enables efficient connection management and performance. Please refer to the - /// performance guide. + /// performance guide. /// /// The cosmos service endpoint to use /// AzureKeyCredential with master-key or resource token.. @@ -281,7 +281,7 @@ public CosmosClient( /// /// /// - /// Performance Tips + /// Performance Tips /// Diagnose and troubleshoot issues /// /// AzureKeyCredential enables changing/updating master-key/ResourceToken whle CosmosClient is still in use. @@ -302,7 +302,7 @@ public CosmosClient( /// /// CosmosClient is thread-safe. Its recommended to maintain a single instance of CosmosClient per lifetime /// of the application which enables efficient connection management and performance. Please refer to the - /// performance guide. + /// performance guide. /// /// /// The returned reference doesn't guarantee credentials or connectivity validations because creation doesn't make any network calls. @@ -357,7 +357,7 @@ internal CosmosClient( /// connections before the first call to the service is made. Use this to obtain lower latency while startup of your application. /// CosmosClient is thread-safe. Its recommended to maintain a single instance of CosmosClient per lifetime /// of the application which enables efficient connection management and performance. Please refer to the - /// performance guide. + /// performance guide. /// /// The cosmos service endpoint to use /// The cosmos account key or resource token to use to create the client. @@ -413,7 +413,7 @@ public static async Task CreateAndInitializeAsync(string accountEn /// connections before the first call to the service is made. Use this to obtain lower latency while startup of your application. /// CosmosClient is thread-safe. Its recommended to maintain a single instance of CosmosClient per lifetime /// of the application which enables efficient connection management and performance. Please refer to the - /// performance guide. + /// performance guide. /// /// The cosmos service endpoint to use /// AzureKeyCredential with master-key or resource token. @@ -471,7 +471,7 @@ public static async Task CreateAndInitializeAsync(string accountEn /// connections before the first call to the service is made. Use this to obtain lower latency while startup of your application. /// CosmosClient is thread-safe. Its recommended to maintain a single instance of CosmosClient per lifetime /// of the application which enables efficient connection management and performance. Please refer to the - /// performance guide. + /// performance guide. /// /// The connection string to the cosmos account. ex: AccountEndpoint=https://XXXXX.documents.azure.com:443/;AccountKey=SuperSecretKey; /// Containers to be initialized identified by it's database name and container name. @@ -518,7 +518,7 @@ public static async Task CreateAndInitializeAsync(string connectio /// connections before the first call to the service is made. Use this to obtain lower latency while startup of your application. /// CosmosClient is thread-safe. Its recommended to maintain a single instance of CosmosClient per lifetime /// of the application which enables efficient connection management and performance. Please refer to the - /// performance guide. + /// performance guide. /// /// The cosmos service endpoint to use. /// The token to provide AAD token for authorization. diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs index 330738c00b..2c07f060f8 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs @@ -250,7 +250,7 @@ public int GatewayModeMaxConnectionLimit /// Default value is /// /// - /// For more information, see Connection policy: Use direct connection mode. + /// For more information, see Connection policy: Use direct connection mode. /// /// /// @@ -614,7 +614,7 @@ public Func HttpClientFactory /// Quorum Read allowed with eventual consistency account or consistent prefix account. /// internal bool EnableUpgradeConsistencyToLocalQuorum { get; set; } = false; - + /// /// Gets or sets the connection protocol when connecting to the Azure Cosmos service. /// @@ -624,7 +624,7 @@ public Func HttpClientFactory /// /// This setting is not used when is set to . /// Gateway mode only supports HTTPS. - /// For more information, see Connection policy: Use the TCP protocol. + /// For more information, see Connection policy: Use the HTTPS protocol. /// internal Protocol ConnectionProtocol { diff --git a/Microsoft.Azure.Cosmos/src/Diagnostics/CosmosDiagnostics.cs b/Microsoft.Azure.Cosmos/src/Diagnostics/CosmosDiagnostics.cs index cb3ffe6c04..ad568475df 100644 --- a/Microsoft.Azure.Cosmos/src/Diagnostics/CosmosDiagnostics.cs +++ b/Microsoft.Azure.Cosmos/src/Diagnostics/CosmosDiagnostics.cs @@ -44,9 +44,9 @@ public virtual int GetFailedRequestCount() } /// - /// Gets the string field instance in the Azure CosmosDB database service. + /// Gets the string field instance in the Azure Cosmos DB database service. /// - /// The string field instance in the Azure CosmosDB database service. + /// The string field instance in the Azure Cosmos DB database service. /// /// implements lazy materialization and is only materialized when is called. /// diff --git a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs index 8b72bfffa4..9c8c2fbb4e 100644 --- a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs +++ b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs @@ -349,7 +349,7 @@ public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout) /// Sets the connection mode to Direct. This is used by the client when connecting to the Azure Cosmos DB service. /// /// - /// For more information, see Connection policy: Use direct connection mode. + /// For more information, see Connection policy: Use direct connection mode. /// /// The current . /// @@ -396,7 +396,7 @@ public CosmosClientBuilder WithConnectionModeDirect() /// The default value is false. /// /// - /// For more information, see Connection policy: Use direct connection mode. + /// For more information, see Connection policy: Use direct connection mode. /// /// The current . /// @@ -472,7 +472,7 @@ internal CosmosClientBuilder WithDistributedTracingOptions(DistributedTracingOpt /// The number specifies the number of connections that may be opened simultaneously. Default is 50 connections /// Get or set the proxy information used for web requests. /// - /// For more information, see Connection policy: Use direct connection mode. + /// For more information, see Connection policy: Use direct connection mode. /// /// The current . /// @@ -529,7 +529,7 @@ public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandl /// If the cumulative wait time exceeds the this value, the client will stop retrying and return the error to the application. /// /// - /// For more information, see Handle rate limiting/request rate too large. + /// For more information, see Handle rate limiting/request rate too large. /// /// The current . /// diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/DedicatedGatewayRequestOptions.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/DedicatedGatewayRequestOptions.cs index 9ca854388c..31f82644a9 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Settings/DedicatedGatewayRequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/DedicatedGatewayRequestOptions.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Cosmos public class DedicatedGatewayRequestOptions { /// - /// Gets or sets the staleness value associated with the request in the Azure CosmosDB service. + /// Gets or sets the staleness value associated with the request in the Azure Cosmos DB service. /// /// Default value is null. /// @@ -24,7 +24,7 @@ public class DedicatedGatewayRequestOptions public TimeSpan? MaxIntegratedCacheStaleness { get; set; } /// - /// Gets or sets if bypass the integrated cache or not associated with the request in the Azure CosmosDB service. + /// Gets or sets if bypass the integrated cache or not associated with the request in the Azure Cosmos DB service. /// When set this value to true, the request will not be served from the integrated cache, and the response will not be cached either. /// /// Default value is false. diff --git a/Microsoft.Azure.Cosmos/src/RetryOptions.cs b/Microsoft.Azure.Cosmos/src/RetryOptions.cs index 8384df8105..5577b4b0d6 100644 --- a/Microsoft.Azure.Cosmos/src/RetryOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RetryOptions.cs @@ -56,7 +56,7 @@ public RetryOptions() /// retry after the time has elapsed. /// /// - /// For more information, see Handle rate limiting/request rate too large. + /// For more information, see Handle rate limiting/request rate too large. /// /// public int MaxRetryAttemptsOnThrottledRequests @@ -91,7 +91,7 @@ public int MaxRetryAttemptsOnThrottledRequests /// If the cumulative wait time exceeds the this value, the client will stop retrying and return the error to the application. /// /// - /// For more information, see Handle rate limiting/request rate too large. + /// For more information, see Handle rate limiting/request rate too large. /// /// public int MaxRetryWaitTimeInSeconds From 946dd4a95f27da4bc82ead3558d67afcd423c8c0 Mon Sep 17 00:00:00 2001 From: Mikhail Lipin Date: Wed, 16 Aug 2023 01:06:04 +0300 Subject: [PATCH 175/240] [Internal] Benchmark tool: Adds Cosmos Benchmark Metrics (#3950) * Adding metrics for Benchmark tool. * Adding OpenTelemetry. * Revert "Adding OpenTelemetry." This reverts commit c7da0884697064103145099e284892365f4ebb68. * Telemetry for windowed percentiles. * OpenTelemetry, AppInsights and Dashboard. * Removing DiagnosticDataListener. * Code styling, comments and clean-up. * Fixing issues with dashboard. * Fixing positions of charts on the dashboard. * Fixing the dashboard. * Updating titles and subtitles. * Removing ILogger and other not required references. * Fixing code review points. * Fixing issues after rebase. * Removing unnecessary changes. * Fixing code review points. * Adding metrics for Benchmark tool. * Adding OpenTelemetry. * Revert "Adding OpenTelemetry." This reverts commit c7da0884697064103145099e284892365f4ebb68. * Telemetry for windowed percentiles. * OpenTelemetry, AppInsights and Dashboard. * Removing DiagnosticDataListener. * Code styling, comments and clean-up. * Fixing issues with dashboard. * Fixing positions of charts on the dashboard. * Fixing the dashboard. * Updating titles and subtitles. * Removing ILogger and other not required references. * Fixing code review points. * Fixing issues after rebase. * Removing unnecessary changes. * Fixing code review points. * Fixing code review points. * make MetrcisCollectorProvider non static and remove locks * fix * fixes * use static class name TelemetrySpan.IncludePercentile * use app insights connection string * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs * rename AppInsightsConnectionString * fix * fix comments * fix if AppInsights c string is not set * summary * fix * remove unnecessary collector types * remove unnecesary metere provicer * add event source * remove folder * fix * split success and failed latencies * fix * fix --------- Co-authored-by: David Chaava Co-authored-by: David Chaava --- .../Tools/Benchmark/BenchmarkConfig.cs | 14 +- .../Tools/Benchmark/CosmosBenchmark.csproj | 1 + .../Tools/Benchmark/Fx/IExecutionStrategy.cs | 5 +- .../Tools/Benchmark/Fx/IExecutor.cs | 4 +- .../Tools/Benchmark/Fx/IMetricsCollector.cs | 36 ++++ .../Tools/Benchmark/Fx/MetricsCollector.cs | 166 ++++++++++++++++++ .../Benchmark/Fx/MetricsCollectorProvider.cs | 68 +++++++ .../Benchmark/Fx/ParallelExecutionStrategy.cs | 16 +- .../Benchmark/Fx/SerialOperationExecutor.cs | 31 +++- .../Tools/Benchmark/Fx/TelemetrySpan.cs | 53 +++++- .../Tools/Benchmark/MetricCollectionWindow.cs | 48 +++++ .../Tools/Benchmark/Program.cs | 67 +++++-- 12 files changed, 475 insertions(+), 34 deletions(-) create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IMetricsCollector.cs create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollector.cs create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollectorProvider.cs create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/MetricCollectionWindow.cs diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs index 6f89776370..f5ff091b28 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs @@ -6,12 +6,16 @@ namespace CosmosBenchmark { using System; using System.Collections.Generic; + using System.Diagnostics; using System.Linq; using System.Runtime; using CommandLine; using Microsoft.Azure.Documents.Client; using Newtonsoft.Json; + /// + /// Represents Benchmark Configuration + /// public class BenchmarkConfig { private static readonly string UserAgentSuffix = "cosmosdbdotnetbenchmark"; @@ -123,6 +127,12 @@ public class BenchmarkConfig [Option(Required = false, HelpText = "Container to publish results to")] public string ResultsContainer { get; set; } = "runsummary"; + [Option(Required = false, HelpText = "Metrics reporting interval in seconds")] + public int MetricsReportingIntervalInSec { get; set; } = 5; + + [Option(Required = false, HelpText = "Application Insights connection string")] + public string AppInsightsConnectionString { get; set; } + internal int GetTaskCount(int containerThroughput) { int taskCount = this.DegreeOfParallelism; @@ -263,11 +273,11 @@ private static void HandleParseError(IEnumerable errors) { foreach (Error e in errors) { - Console.WriteLine(e.ToString()); + Trace.TraceInformation(e.ToString()); } } Environment.Exit(errors.Count()); } } -} +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmark.csproj b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmark.csproj index c8ac26f5aa..2506e48102 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmark.csproj +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmark.csproj @@ -17,6 +17,7 @@ + diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IExecutionStrategy.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IExecutionStrategy.cs index b18fc34dc7..ed1400026b 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IExecutionStrategy.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IExecutionStrategy.cs @@ -6,6 +6,7 @@ namespace CosmosBenchmark { using System; using System.Threading.Tasks; + using OpenTelemetry.Metrics; internal interface IExecutionStrategy { @@ -19,7 +20,7 @@ public Task ExecuteAsync( BenchmarkConfig benchmarkConfig, int serialExecutorConcurrency, int serialExecutorIterationCount, - double warmupFraction); - + double warmupFraction, + MetricsCollectorProvider metricsCollectorProvider); } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IExecutor.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IExecutor.cs index be2ee2e761..235a54199b 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IExecutor.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IExecutor.cs @@ -17,6 +17,8 @@ public Task ExecuteAsync( int iterationCount, bool isWarmup, bool traceFailures, - Action completionCallback); + Action completionCallback, + BenchmarkConfig benchmarkConfig, + MetricsCollectorProvider metricsCollectorProvider); } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IMetricsCollector.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IMetricsCollector.cs new file mode 100644 index 0000000000..58af9d0b19 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IMetricsCollector.cs @@ -0,0 +1,36 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace CosmosBenchmark +{ + using System; + + /// + /// Represents the metrics collector. + /// + public interface IMetricsCollector + { + /// + /// Collects the number of successful operations. + /// + void CollectMetricsOnSuccess(); + + /// + /// Collects the number of failed operations. + /// + void CollectMetricsOnFailure(); + + /// + /// Records latency for success operations in milliseconda. + /// + /// The number of milliseconds to record. + void RecordSuccessOpLatencyAndRps(TimeSpan timeSpan); + + /// + /// Records latency for failed operations in milliseconda. + /// + /// The number of milliseconds to record. + void RecordFailedOpLatencyAndRps(TimeSpan timeSpan); + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollector.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollector.cs new file mode 100644 index 0000000000..866e400870 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollector.cs @@ -0,0 +1,166 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace CosmosBenchmark +{ + using System; + using System.Diagnostics.Metrics; + + /// + /// Represents the metrics collector. + /// + internal class MetricsCollector : IMetricsCollector + { + /// + /// Represents the meter to collect metrics. + /// + private readonly Meter meter; + + /// + /// Represents the histogram for operation latency. + /// + private readonly Histogram operationLatencyHistogram; + + /// + /// Represents the histogram for records per second metric. + /// + private readonly Histogram rpsMetricNameHistogram; + + /// + /// Represents the histogram for failed operation latency. + /// + private readonly Histogram operationFailedLatencyHistogram; + + /// + /// Represents the histogram failed operations for records per second metric. + /// + private readonly Histogram rpsFailedMetricNameHistogram; + + /// + /// Represents the success operation counter. + /// + private readonly Counter successOperationCounter; + + /// + /// Represents the failure operation counter. + /// + private readonly Counter failureOperationCounter; + + /// + /// Represents latency in milliseconds metric gauge. + /// + /// Please do not remove this as it used when collecting metrics.. + private readonly ObservableGauge latencyInMsMetricNameGauge; + + /// + /// Represents records per second metric gauge. + /// + /// Please do not remove this as it used when collecting metrics.. + private readonly ObservableGauge rpsNameGauge; + + + /// + /// Represents latency in milliseconds metric gauge for failed operations. + /// + /// Please do not remove this as it used when collecting metrics.. + private readonly ObservableGauge latencyInMsFailedMetricNameGauge; + + /// + /// Represents records per second metric gauge for failed operations. + /// + /// Please do not remove this as it used when collecting metrics.. + private readonly ObservableGauge rpsFailedNameGauge; + + /// + /// Latency in milliseconds. + /// + private double latencyInMs; + + /// + /// Records per second. + /// + private double rps; + + /// + /// Latency in milliseconds. + /// + private double latencyFailedInMs; + + /// + /// Records per second. + /// + private double rpsFailed; + + /// + /// Initialize new instance of . + /// + /// OpenTelemetry meter. + public MetricsCollector(Meter meter, string prefix) + { + this.meter = meter; + this.rpsMetricNameHistogram = meter.CreateHistogram($"{prefix}OperationRpsHistogram"); + this.operationLatencyHistogram = meter.CreateHistogram($"{prefix}OperationLatencyInMsHistogram"); + + this.rpsFailedMetricNameHistogram = meter.CreateHistogram($"{prefix}FailedOperationRpsHistogram"); + this.operationFailedLatencyHistogram = meter.CreateHistogram($"{prefix}FailedOperationLatencyInMsHistogram"); + + this.successOperationCounter = meter.CreateCounter($"{prefix}OperationSuccess"); + this.failureOperationCounter = meter.CreateCounter($"{prefix}OperationFailure"); + + this.latencyInMsMetricNameGauge = this.meter.CreateObservableGauge($"{prefix}OperationLatencyInMs", + () => new Measurement(this.latencyInMs)); + + this.rpsNameGauge = this.meter.CreateObservableGauge($"{prefix}OperationRps", + () => new Measurement(this.rps)); + + this.latencyInMsFailedMetricNameGauge = this.meter.CreateObservableGauge($"{prefix}FailedOperationLatencyInMs", + () => new Measurement(this.latencyInMs)); + + this.rpsFailedNameGauge = this.meter.CreateObservableGauge($"{prefix}FailedOperationRps", + () => new Measurement(this.rps)); + } + + /// + /// Collects the number of successful operations. + /// + public void CollectMetricsOnSuccess() + { + this.successOperationCounter.Add(1); + } + + /// + /// Collects the number of failed operations. + /// + public void CollectMetricsOnFailure() + { + this.failureOperationCounter.Add(1); + } + + /// + /// Records success operation latency in milliseconds. + /// + /// The number of milliseconds to record. + public void RecordSuccessOpLatencyAndRps( + TimeSpan timeSpan) + { + this.rps = 1000 / timeSpan.Milliseconds; + this.latencyInMs = timeSpan.Milliseconds; + this.rpsMetricNameHistogram.Record(this.rps); + this.operationLatencyHistogram.Record(this.latencyInMs); + } + + /// + /// Records failed operation latency in milliseconds. + /// + /// The number of milliseconds to record. + public void RecordFailedOpLatencyAndRps( + TimeSpan timeSpan) + { + this.rpsFailed = 1000 / timeSpan.Milliseconds; + this.latencyFailedInMs = timeSpan.Milliseconds; + this.rpsFailedMetricNameHistogram.Record(this.rpsFailed); + this.operationFailedLatencyHistogram.Record(this.latencyFailedInMs); + } + } +} diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollectorProvider.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollectorProvider.cs new file mode 100644 index 0000000000..4de7009be1 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollectorProvider.cs @@ -0,0 +1,68 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace CosmosBenchmark +{ + using System; + using System.Diagnostics.Metrics; + using OpenTelemetry.Metrics; + + /// + /// Represents the metrics collector provider. + /// + internal class MetricsCollectorProvider + { + private readonly MetricCollectionWindow metricCollectionWindow; + + private readonly MetricsCollector insertOperationMetricsCollector; + + private readonly MetricsCollector queryOperationMetricsCollector; + + private readonly MetricsCollector readOperationMetricsCollector; + + private readonly Meter insertOperationMeter = new("CosmosBenchmarkInsertOperationMeter"); + + private readonly Meter queryOperationMeter = new("CosmosBenchmarkQueryOperationMeter"); + + private readonly Meter readOperationMeter = new("CosmosBenchmarkReadOperationMeter"); + + private readonly MeterProvider meterProvider; + + public MetricsCollectorProvider(BenchmarkConfig config, MeterProvider meterProvider) + { + this.meterProvider = meterProvider; + this.insertOperationMetricsCollector ??= new MetricsCollector(this.insertOperationMeter, "Insert"); + this.queryOperationMetricsCollector ??= new MetricsCollector(this.queryOperationMeter, "Query"); + this.readOperationMetricsCollector ??= new MetricsCollector(this.readOperationMeter, "Read"); + this.metricCollectionWindow ??= new MetricCollectionWindow(config); + } + + /// + /// Gets the metric collector. + /// + /// Benchmark operation. + /// Benchmark configuration. + /// Metrics collector. + /// Thrown if provided benchmark operation is not covered supported to collect metrics. + public IMetricsCollector GetMetricsCollector(IBenchmarkOperation benchmarkOperation, BenchmarkConfig config) + { + MetricCollectionWindow metricCollectionWindow = this.metricCollectionWindow; + + // Reset metricCollectionWindow and flush. + if (!metricCollectionWindow.IsValid) + { + this.meterProvider.ForceFlush(); + metricCollectionWindow.Reset(config); + } + + return benchmarkOperation.OperationType switch + { + BenchmarkOperationType.Insert => this.insertOperationMetricsCollector, + BenchmarkOperationType.Query => this.queryOperationMetricsCollector, + BenchmarkOperationType.Read => this.readOperationMetricsCollector, + _ => throw new NotSupportedException($"The type of {nameof(benchmarkOperation)} is not supported for collecting metrics."), + }; + } + } +} diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/ParallelExecutionStrategy.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/ParallelExecutionStrategy.cs index e5dc7bb58d..2348d4a995 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/ParallelExecutionStrategy.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/ParallelExecutionStrategy.cs @@ -11,6 +11,7 @@ namespace CosmosBenchmark using System.Threading; using System.Threading.Tasks; using Newtonsoft.Json; + using OpenTelemetry.Metrics; internal class ParallelExecutionStrategy : IExecutionStrategy { @@ -28,7 +29,8 @@ public async Task ExecuteAsync( BenchmarkConfig benchmarkConfig, int serialExecutorConcurrency, int serialExecutorIterationCount, - double warmupFraction) + double warmupFraction, + MetricsCollectorProvider metricsCollectorProvider) { IExecutor warmupExecutor = new SerialOperationExecutor( executorId: "Warmup", @@ -37,7 +39,9 @@ await warmupExecutor.ExecuteAsync( (int)(serialExecutorIterationCount * warmupFraction), isWarmup: true, traceFailures: benchmarkConfig.TraceFailures, - completionCallback: () => { }); + completionCallback: () => { }, + benchmarkConfig, + metricsCollectorProvider); IExecutor[] executors = new IExecutor[serialExecutorConcurrency]; for (int i = 0; i < serialExecutorConcurrency; i++) @@ -54,11 +58,13 @@ await warmupExecutor.ExecuteAsync( iterationCount: serialExecutorIterationCount, isWarmup: false, traceFailures: benchmarkConfig.TraceFailures, - completionCallback: () => Interlocked.Decrement(ref this.pendingExecutorCount)); + completionCallback: () => Interlocked.Decrement(ref this.pendingExecutorCount), + benchmarkConfig, + metricsCollectorProvider); } return await this.LogOutputStats( - benchmarkConfig, + benchmarkConfig, executors); } @@ -160,4 +166,4 @@ private async Task LogOutputStats( } } } -} +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/SerialOperationExecutor.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/SerialOperationExecutor.cs index 1086c31bd5..b33218f65b 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/SerialOperationExecutor.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/SerialOperationExecutor.cs @@ -8,10 +8,12 @@ namespace CosmosBenchmark using System.Diagnostics; using System.Threading.Tasks; using Microsoft.Azure.Cosmos; + using static CosmosBenchmark.TelemetrySpan; internal class SerialOperationExecutor : IExecutor { private readonly IBenchmarkOperation operation; + private readonly string executorId; public SerialOperationExecutor( @@ -26,6 +28,7 @@ public SerialOperationExecutor( } public int SuccessOperationCount { get; private set; } + public int FailedOperationCount { get; private set; } public double TotalRuCharges { get; private set; } @@ -34,27 +37,38 @@ public async Task ExecuteAsync( int iterationCount, bool isWarmup, bool traceFailures, - Action completionCallback) + Action completionCallback, + BenchmarkConfig benchmarkConfig, + MetricsCollectorProvider metricsCollectorProvider) { Trace.TraceInformation($"Executor {this.executorId} started"); + Trace.TraceInformation("Initializing counters and metrics."); + try { int currentIterationCount = 0; do { + IMetricsCollector metricsCollector = metricsCollectorProvider.GetMetricsCollector(this.operation, benchmarkConfig); + OperationResult? operationResult = null; await this.operation.PrepareAsync(); - using (IDisposable telemetrySpan = TelemetrySpan.StartNew( + using (ITelemetrySpan telemetrySpan = TelemetrySpan.StartNew( + benchmarkConfig, () => operationResult.Value, - disableTelemetry: isWarmup)) + disableTelemetry: isWarmup, + metricsCollector.RecordSuccessOpLatencyAndRps, + metricsCollector.RecordFailedOpLatencyAndRps)) { try { operationResult = await this.operation.ExecuteOnceAsync(); + metricsCollector.CollectMetricsOnSuccess(); + // Success case this.SuccessOperationCount++; this.TotalRuCharges += operationResult.Value.RuCharges; @@ -68,8 +82,11 @@ public async Task ExecuteAsync( { if (traceFailures) { - Console.WriteLine(ex.ToString()); + Trace.TraceInformation(ex.ToString()); } + telemetrySpan.MarkFailed(); + + metricsCollector.CollectMetricsOnFailure(); // failure case this.FailedOperationCount++; @@ -96,10 +113,14 @@ public async Task ExecuteAsync( Trace.TraceInformation($"Executor {this.executorId} completed"); } + catch (Exception e) + { + Trace.TraceInformation($"Error: {e.Message}"); + } finally { completionCallback(); } } } -} +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/TelemetrySpan.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/TelemetrySpan.cs index 13d971aa2a..fff2acac3e 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/TelemetrySpan.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/TelemetrySpan.cs @@ -8,8 +8,9 @@ namespace CosmosBenchmark using System.Diagnostics; using System.Linq; using System.Threading; + using static CosmosBenchmark.TelemetrySpan; - internal struct TelemetrySpan : IDisposable + internal class TelemetrySpan : ITelemetrySpan { private static double[] latencyHistogram; private static int latencyIndex = -1; @@ -18,11 +19,18 @@ internal struct TelemetrySpan : IDisposable private Stopwatch stopwatch; private Func lazyOperationResult; + private Action recordFailedOpLatencyAction; + private Action recordSuccessOpLatencyAction; private bool disableTelemetry; + private bool isFailed = false; + private BenchmarkConfig benchmarkConfig; - public static IDisposable StartNew( + public static ITelemetrySpan StartNew( + BenchmarkConfig benchmarkConfig, Func lazyOperationResult, - bool disableTelemetry) + bool disableTelemetry, + Action recordSuccessOpLatencyAction, + Action recordFailedOpLatencyAction) { if (disableTelemetry || !TelemetrySpan.IncludePercentile) { @@ -31,12 +39,17 @@ public static IDisposable StartNew( return new TelemetrySpan { + benchmarkConfig = benchmarkConfig, stopwatch = Stopwatch.StartNew(), lazyOperationResult = lazyOperationResult, + recordSuccessOpLatencyAction = recordSuccessOpLatencyAction, + recordFailedOpLatencyAction = recordFailedOpLatencyAction, disableTelemetry = disableTelemetry }; } + public void MarkFailed() { this.isFailed = true; } + public void Dispose() { this.stopwatch.Stop(); @@ -47,6 +60,16 @@ public void Dispose() if (TelemetrySpan.IncludePercentile) { RecordLatency(this.stopwatch.Elapsed.TotalMilliseconds); + + if(this.isFailed) + { + this.recordSuccessOpLatencyAction?.Invoke(TimeSpan.FromMilliseconds(this.stopwatch.Elapsed.TotalMilliseconds)); + } + else + { + this.recordSuccessOpLatencyAction?.Invoke(TimeSpan.FromMilliseconds(this.stopwatch.Elapsed.TotalMilliseconds)); + + } } BenchmarkLatencyEventSource.Instance.LatencyDiagnostics( @@ -65,13 +88,13 @@ private static void RecordLatency(double elapsedMilliseoncds) internal static void ResetLatencyHistogram(int totalNumberOfIterations) { - latencyHistogram = new double[totalNumberOfIterations]; + TelemetrySpan.latencyHistogram = new double[totalNumberOfIterations]; latencyIndex = -1; } internal static double? GetLatencyPercentile(int percentile) { - if (latencyHistogram == null) + if (TelemetrySpan.latencyHistogram == null) { return null; } @@ -79,13 +102,31 @@ internal static void ResetLatencyHistogram(int totalNumberOfIterations) return MathNet.Numerics.Statistics.Statistics.Percentile(latencyHistogram.Take(latencyIndex + 1), percentile); } - private class NoOpDisposable : IDisposable + internal static double? GetLatencyQuantile(double quantile) + { + if (TelemetrySpan.latencyHistogram == null) + { + return null; + } + + return MathNet.Numerics.Statistics.Statistics.Quantile(latencyHistogram.Take(latencyIndex + 1), quantile); + } + + private class NoOpDisposable : ITelemetrySpan { public static readonly NoOpDisposable Instance = new NoOpDisposable(); public void Dispose() { } + + public void MarkFailed() + { + } + } + + public interface ITelemetrySpan : IDisposable { + void MarkFailed(); } } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/MetricCollectionWindow.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/MetricCollectionWindow.cs new file mode 100644 index 0000000000..948ade075e --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/MetricCollectionWindow.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace CosmosBenchmark +{ + using System; + + /// + /// Represents the metric collection window (time span while accumulating and granulating the data) + /// + internal class MetricCollectionWindow + { + /// + /// The timestamp when window span is started. + /// + public DateTime Started { get; private set; } + + /// + /// The timestamp until which the current window span is not elapsed. + /// + public DateTime ValidTill { get; private set; } + + /// + /// Creates the instance of . + /// + /// Cosmos Benchmark configuration. + public MetricCollectionWindow(BenchmarkConfig config) + { + this.Reset(config); + } + + /// + /// Indicates whether the current window is valid. + /// + public bool IsValid => DateTime.UtcNow > this.ValidTill; + + /// + /// Resets the started timestamp and valid till timespan. + /// + /// + public void Reset(BenchmarkConfig config) + { + this.Started = DateTime.UtcNow; + this.ValidTill = this.Started.AddSeconds(config.MetricsReportingIntervalInSec); + } + } +} diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs index 99131262d7..2e7687932f 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs @@ -14,8 +14,13 @@ namespace CosmosBenchmark using System.Reflection; using System.Threading; using System.Threading.Tasks; + using Azure.Monitor.OpenTelemetry.Exporter; using Microsoft.Azure.Cosmos; + using Microsoft.Extensions.Logging; using Newtonsoft.Json.Linq; + using OpenTelemetry; + using OpenTelemetry.Metrics; + using Container = Microsoft.Azure.Cosmos.Container; /// /// This sample demonstrates how to achieve high performance writes using Azure Comsos DB. @@ -31,8 +36,12 @@ public static async Task Main(string[] args) try { BenchmarkConfig config = BenchmarkConfig.From(args); - await Program.AddAzureInfoToRunSummary(); - + await AddAzureInfoToRunSummary(); + + MeterProvider meterProvider = BuildMeterProvider(config); + + MetricsCollectorProvider metricsCollectorProvider = new MetricsCollectorProvider(config, meterProvider); + ThreadPool.SetMinThreads(config.MinThreadPoolSize, config.MinThreadPoolSize); if (config.EnableLatencyPercentiles) @@ -45,7 +54,7 @@ public static async Task Main(string[] args) Program program = new Program(); - RunSummary runSummary = await program.ExecuteAsync(config); + RunSummary runSummary = await program.ExecuteAsync(config, metricsCollectorProvider); } finally { @@ -58,6 +67,37 @@ public static async Task Main(string[] args) } } + /// + /// Create a MeterProvider. If the App Insights connection string is not set, do not create an AppInsights Exporter. + /// + /// + private static MeterProvider BuildMeterProvider(BenchmarkConfig config) + { + if (string.IsNullOrWhiteSpace(config.AppInsightsConnectionString)) + { + return Sdk.CreateMeterProviderBuilder() + .AddMeter("CosmosBenchmarkInsertOperationMeter") + .AddMeter("CosmosBenchmarkQueryOperationMeter") + .AddMeter("CosmosBenchmarkReadOperationMeter") + .Build(); + } + + OpenTelemetry.Trace.TracerProviderBuilder tracerProviderBuilder = Sdk.CreateTracerProviderBuilder() + .AddAzureMonitorTraceExporter(); + + return Sdk.CreateMeterProviderBuilder() + .AddAzureMonitorMetricExporter(configure: new Action( + (options) => options.ConnectionString = config.AppInsightsConnectionString)) + .AddMeter("CosmosBenchmarkInsertOperationMeter") + .AddMeter("CosmosBenchmarkQueryOperationMeter") + .AddMeter("CosmosBenchmarkReadOperationMeter") + .Build(); + } + + /// + /// Adds Azure VM information to run summary. + /// + /// private static async Task AddAzureInfoToRunSummary() { using HttpClient httpClient = new HttpClient(); @@ -81,11 +121,13 @@ private static async Task AddAzureInfoToRunSummary() } } + /// /// Executing benchmarks for V2/V3 cosmosdb SDK. /// /// a Task object. - private async Task ExecuteAsync(BenchmarkConfig config) + private async Task ExecuteAsync(BenchmarkConfig config, + MetricsCollectorProvider metricsCollectorProvider) { // V3 SDK client initialization using (CosmosClient cosmosClient = config.CreateCosmosClient(config.Key)) @@ -137,7 +179,7 @@ private async Task ExecuteAsync(BenchmarkConfig config) } IExecutionStrategy execution = IExecutionStrategy.StartNew(benchmarkOperationFactory); - runSummary = await execution.ExecuteAsync(config, taskCount, opsPerTask, 0.01); + runSummary = await execution.ExecuteAsync(config, taskCount, opsPerTask, 0.01, metricsCollectorProvider); } if (config.CleanupOnFinish) @@ -154,13 +196,12 @@ private async Task ExecuteAsync(BenchmarkConfig config) } runSummary.ConsistencyLevel = consistencyLevel; - if (config.PublishResults) { runSummary.Diagnostics = CosmosDiagnosticsLogger.GetDiagnostics(); await this.PublishResults( - config, - runSummary, + config, + runSummary, cosmosClient); } @@ -169,8 +210,8 @@ await this.PublishResults( } private async Task PublishResults( - BenchmarkConfig config, - RunSummary runSummary, + BenchmarkConfig config, + RunSummary runSummary, CosmosClient benchmarkClient) { if (string.IsNullOrEmpty(config.ResultsEndpoint)) @@ -266,8 +307,8 @@ private static async Task CreatePartitionedContainerAsync(Ben { return await container.ReadContainerAsync(); } - catch(CosmosException ex) when (ex.StatusCode == HttpStatusCode.NotFound) - { + catch (CosmosException ex) when (ex.StatusCode == HttpStatusCode.NotFound) + { // Show user cost of running this test double estimatedCostPerMonth = 0.06 * options.Throughput; double estimatedCostPerHour = estimatedCostPerMonth / (24 * 30); @@ -288,4 +329,4 @@ private static void ClearCoreSdkListeners() traceSource.Listeners.Clear(); } } -} +} \ No newline at end of file From 48af69ecab18066a6b4faef924cdc8fe7c828401 Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Wed, 16 Aug 2023 16:24:03 -0700 Subject: [PATCH 176/240] GatewayAddressCache: Fixes Unobserved Exception During Background Address Refresh (#4039) * Code changes to fix unobserved exception during background address refresh. * Code changes to add exception handler in task. * Code changes to fix null ref exception. * Revert "Code changes to fix null ref exception." This reverts commit 83f90d578bd301339f6fa13981a0fe2fc3d65fa6. * Revert "Code changes to add exception handler in task." This reverts commit c49ed8162758217a09df28417a6f76649eab6a26. * Code changes to address review comments. * Revert "Code changes to address review comments." This reverts commit d2b9f6b501f64f1a50b8a49de3ea76fbb9b5c853. --- .../src/Routing/GatewayAddressCache.cs | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs index a4dbb1d8a3..8bc429070e 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs @@ -302,14 +302,27 @@ public async Task TryGetAddressesAsync( .ReplicaTransportAddressUris .Any(x => x.ShouldRefreshHealthStatus())) { - Task refreshAddressesInBackgroundTask = Task.Run(async () => await this.serverPartitionAddressCache.RefreshAsync( - key: partitionKeyRangeIdentity, - singleValueInitFunc: (currentCachedValue) => this.GetAddressesForRangeIdAsync( - request, - cachedAddresses: currentCachedValue, + Task refreshAddressesInBackgroundTask = Task.Run(async () => + { + try + { + await this.serverPartitionAddressCache.RefreshAsync( + key: partitionKeyRangeIdentity, + singleValueInitFunc: (currentCachedValue) => this.GetAddressesForRangeIdAsync( + request, + cachedAddresses: currentCachedValue, + partitionKeyRangeIdentity.CollectionRid, + partitionKeyRangeIdentity.PartitionKeyRangeId, + forceRefresh: true)); + } + catch (Exception ex) + { + DefaultTrace.TraceWarning("Failed to refresh addresses in the background for the collection rid: {0} with exception: {1}. '{2}'", partitionKeyRangeIdentity.CollectionRid, - partitionKeyRangeIdentity.PartitionKeyRangeId, - forceRefresh: true))); + ex, + System.Diagnostics.Trace.CorrelationManager.ActivityId); + } + }); } return addresses; From ce38cc1b2213cb04972f3c64dea9bb19e14d5334 Mon Sep 17 00:00:00 2001 From: Rinat Minibaev <132935507+rinatmini@users.noreply.github.com> Date: Fri, 18 Aug 2023 10:12:46 -0700 Subject: [PATCH 177/240] Documentation: Adds additional note for GetContactedRegions method (#4042) * Added small remark for GetContactedRegions method documentation * Moved to remarks --- Microsoft.Azure.Cosmos/src/Diagnostics/CosmosDiagnostics.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Microsoft.Azure.Cosmos/src/Diagnostics/CosmosDiagnostics.cs b/Microsoft.Azure.Cosmos/src/Diagnostics/CosmosDiagnostics.cs index ad568475df..a82ef2ecc2 100644 --- a/Microsoft.Azure.Cosmos/src/Diagnostics/CosmosDiagnostics.cs +++ b/Microsoft.Azure.Cosmos/src/Diagnostics/CosmosDiagnostics.cs @@ -80,6 +80,9 @@ public virtual int GetFailedRequestCount() /// Gets the list of all regions that were contacted for a request /// /// The list of tuples containing the Region name and the URI + /// + /// The returned list contains unique regions and doesn't guarantee ordering of the regions contacted from the first to the last + /// public abstract IReadOnlyList<(string regionName, Uri uri)> GetContactedRegions(); } } From 2257ca2fbe1f3bb5b4ca87ce9c93955c1ab480a1 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 22 Aug 2023 16:26:27 +0530 Subject: [PATCH 178/240] [Internal] Client Telemetry: Adds Client Telemetry pipeline sending data to service (#3900) * first draft * comment other pipelines * pint variables * commnet other pipelines * added env variable * minor changes * update env variable * print env variable * add space in end * fix test * fix tests * fix test * fix tests * remove response interceptor * logs * debuug mode * 3failing test to print llgs * minor refactoring * 2nd windows-2019 * fix ct tests * 2remove debugging * fix tests * revert * ncomment pipelines * fix test * minor changes * release and emulator pipeline * update pipelines * ignore abstract class test * fixing pipeline * refactor code * change it to class name to run tests * added emulator setup * 1 temp commit * env variable * renames env variable * fix tests * add condition * fix tests * reorder env variable * revert pipeline * did some clean up * change to revert * Revert "change to revert" This reverts commit 03db3c104505dc7b8f3cea267835c92ca530f8f4. * fix typos * throw if exception intercepter is null * remove modelling changes * removed virtaul * Update Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/HttpHandlerHelper.cs Co-authored-by: Matias Quaranta * added condition for pipelines * Revert "added condition for pipelines" This reverts commit f9a208cd28e01badee97a2eb770a486cea67c1f0. * changed cond * fix codn * more enhancement * testing for release pipeline * refactore code and using test category * added comments on test * refactor pipeline code * fix variables * fix pipeline --------- Co-authored-by: Matias Quaranta --- .../ClientTelemetryReleaseTests.cs | 164 +++ .../ClientTelemetryTests.cs | 1078 +--------------- .../ClientTelemetryTestsBase.cs | 1087 +++++++++++++++++ .../Utils/HttpHandlerHelper.cs | 16 +- azure-pipelines-official.yml | 37 +- templates/build-test.yml | 6 +- 6 files changed, 1360 insertions(+), 1028 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryReleaseTests.cs create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryReleaseTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryReleaseTests.cs new file mode 100644 index 0000000000..d31c95bfe8 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryReleaseTests.cs @@ -0,0 +1,164 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests +{ + using System; + using System.Net.Http; + using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Fluent; + using Microsoft.Azure.Cosmos.Telemetry; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + /// + /// In Release pipeline, no need to mock Client Telemetry Service Call and Test will talk to the real database account. + /// If you are making changes in this file please make sure you are adding similar test in also. + /// + [TestClass] + [TestCategory("ClientTelemetryRelease")] + public class ClientTelemetryReleaseTests : ClientTelemetryTestsBase + { + public override CosmosClientBuilder GetBuilder() + { + string connectionString = ConfigurationManager.GetEnvironmentVariable("COSMOSDB_ACCOUNT_CONNECTION_STRING", null); + return new CosmosClientBuilder(connectionString: connectionString); + } + + /// + /// Returing null means do not return any hard codd response for any HTTP call. + /// + /// + /// + public override Task HttpHandlerRequestCallbackChecks(HttpRequestMessage request) + { + return null; + } + + [ClassInitialize] + public static new void ClassInitialize(TestContext context) + { + ClientTelemetryTestsBase.ClassInitialize(context); + + // It will go away in next PR + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, "true"); + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, "1"); + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, "https://tools.cosmos.azure.com/api/clienttelemetry/trace"); + } + + [ClassCleanup] + public static new void FinalCleanup() + { + ClientTelemetryTestsBase.FinalCleanup(); + } + + [TestInitialize] + public override void TestInitialize() + { + base.TestInitialize(); + } + + [TestCleanup] + public override async Task Cleanup() + { + await base.Cleanup(); + } + + [TestMethod] + [DataRow(ConnectionMode.Direct, true)] + [DataRow(ConnectionMode.Gateway, true)] + [DataRow(ConnectionMode.Direct, false)] + [DataRow(ConnectionMode.Gateway, false)] + public override async Task PointSuccessOperationsTest(ConnectionMode mode, bool isAzureInstance) + { + await base.PointSuccessOperationsTest(mode, isAzureInstance); + } + + [TestMethod] + [DataRow(ConnectionMode.Direct)] + [DataRow(ConnectionMode.Gateway)] + public override async Task PointReadFailureOperationsTest(ConnectionMode mode) + { + await base.PointReadFailureOperationsTest(mode); + } + + [TestMethod] + [DataRow(ConnectionMode.Direct)] + [DataRow(ConnectionMode.Gateway)] + public override async Task StreamReadFailureOperationsTest(ConnectionMode mode) + { + await base.StreamReadFailureOperationsTest(mode); + } + + [TestMethod] + [DataRow(ConnectionMode.Direct)] + [DataRow(ConnectionMode.Gateway)] + public override async Task StreamOperationsTest(ConnectionMode mode) + { + await base.StreamOperationsTest(mode); + } + + [TestMethod] + [DataRow(ConnectionMode.Direct)] + [DataRow(ConnectionMode.Gateway)] + public override async Task BatchOperationsTest(ConnectionMode mode) + { + await base.BatchOperationsTest(mode); + } + + [TestMethod] + [DataRow(ConnectionMode.Direct)] + [DataRow(ConnectionMode.Gateway)] + public override async Task SingleOperationMultipleTimesTest(ConnectionMode mode) + { + await base.SingleOperationMultipleTimesTest(mode); + } + + [TestMethod] + [DataRow(ConnectionMode.Direct)] + [DataRow(ConnectionMode.Gateway)] + public override async Task QueryOperationSinglePartitionTest(ConnectionMode mode) + { + await base.QueryOperationSinglePartitionTest(mode); + } + + [TestMethod] + [DataRow(ConnectionMode.Direct)] + [DataRow(ConnectionMode.Gateway)] + public override async Task QueryMultiPageSinglePartitionOperationTest(ConnectionMode mode) + { + await base.QueryMultiPageSinglePartitionOperationTest(mode); + } + + [TestMethod] + [DataRow(ConnectionMode.Direct)] + [DataRow(ConnectionMode.Gateway)] + public override async Task QueryOperationCrossPartitionTest(ConnectionMode mode) + { + await base.QueryOperationCrossPartitionTest(mode); + } + + [TestMethod] + [DataRow(ConnectionMode.Direct)] + [DataRow(ConnectionMode.Gateway)] + public override async Task QueryOperationMutiplePageCrossPartitionTest(ConnectionMode mode) + { + await base.QueryOperationMutiplePageCrossPartitionTest(mode); + } + + [TestMethod] + [DataRow(ConnectionMode.Direct)] + [DataRow(ConnectionMode.Gateway)] + public override async Task QueryOperationInvalidContinuationTokenTest(ConnectionMode mode) + { + await base.QueryOperationInvalidContinuationTokenTest(mode); + } + + [TestMethod] + [DataRow(ConnectionMode.Direct)] + public override async Task CreateItemWithSubStatusCodeTest(ConnectionMode mode) + { + await base.CreateItemWithSubStatusCodeTest(mode); + } + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs index 30edc7ebf7..2ffc60f5f4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs @@ -4,1121 +4,155 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests { - using System; - using System.Collections.Generic; - using System.Text; - using System.Threading.Tasks; - using System.Net; - using System.Net.Http; - using System.Reflection; using Microsoft.Azure.Cosmos.Fluent; - using Microsoft.VisualStudio.TestTools.UnitTesting; - using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Telemetry; - using Microsoft.Azure.Cosmos.Handler; - using Microsoft.Azure.Documents; - using Newtonsoft.Json.Linq; - using Newtonsoft.Json; - using Documents.Rntbd; - using System.Globalization; - using System.Linq; - using Cosmos.Util; - using Microsoft.Azure.Cosmos.Telemetry.Models; + using System.Net.Http; + using System.Net; + using System.Threading.Tasks; + using Microsoft.VisualStudio.TestTools.UnitTesting; + /// + /// In Emulator Mode, Run test against emulator and mock client telemetry service calls. + /// If you are making changes in this file please make sure you are adding similar test in also. + /// [TestClass] - public class ClientTelemetryTests : BaseCosmosClientHelper + [TestCategory("ClientTelemetryEmulator")] + public class ClientTelemetryTests : ClientTelemetryTestsBase { - private const int scheduledInSeconds = 1; - private static readonly object jsonObject = JsonConvert.DeserializeObject("{\"compute\":{\"azEnvironment\":\"AzurePublicCloud\",\"customData\":\"\",\"isHostCompatibilityLayerVm\":\"false\",\"licenseType\":\"\",\"location\":\"eastus\",\"name\":\"sourabh-testing\",\"offer\":\"UbuntuServer\",\"osProfile\":{\"adminUsername\":\"azureuser\",\"computerName\":\"sourabh-testing\"},\"osType\":\"Linux\",\"placementGroupId\":\"\",\"plan\":{\"name\":\"\",\"product\":\"\",\"publisher\":\"\"},\"platformFaultDomain\":\"0\",\"platformUpdateDomain\":\"0\",\"provider\":\"Microsoft.Compute\",\"publicKeys\":[{\"keyData\":\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC5uCeOAm3ehmhI+2PbMoMl17Eo\r\nqfHKCycSaBJsv9qxlmBOuFheSJc1XknJleXUSsuTO016/d1PyWpevnqOZNRksWoa\r\nJvQ23sDTxcK+X2OP3QlCUeX4cMjPXqlL8z1UYzU4Bx3fFvf8fs67G3N72sxWBw5P\r\nZyuXyhBm0NCe/2NYMKgEDT4ma8XszO0ikbhoPKbMbgHAQk/ktWQHNcqYOPQKEWqp\r\nEK1R0rjS2nmtovfScP/ZGXcvOpJ1/NDBo4dh1K+OxOGM/4PSH/F448J5Zy4eAyEk\r\nscys+IpeIOTOlRUy/703SNIX0LEWlnYqbyL9c1ypcYLQqF76fKkDfzzFI/OWVlGw\r\nhj/S9uP8iMsR+fhGIbn6MAa7O4DWPWLuedSp7KDYyjY09gqNJsfuaAJN4LiC6bPy\r\nhknm0PVLK3ux7EUOt+cZrHCdIFWbdOtxiPNIl1tkv9kV5aE5Aj2gJm4MeB9uXYhS\r\nOuksboBc0wyUGrl9+XZJ1+NlZOf7IjVi86CieK8= generated-by-azure\r\n\",\"path\":\"/home/azureuser/.ssh/authorized_keys\"}],\"publisher\":\"Canonical\",\"resourceGroupName\":\"sourabh-telemetry-sdk\",\"resourceId\":\"/subscriptions/8fba6d4f-7c37-4d13-9063-fd58ad2b86e2/resourceGroups/sourabh-telemetry-sdk/providers/Microsoft.Compute/virtualMachines/sourabh-testing\",\"securityProfile\":{\"secureBootEnabled\":\"false\",\"virtualTpmEnabled\":\"false\"},\"sku\":\"18.04-LTS\",\"storageProfile\":{\"dataDisks\":[],\"imageReference\":{\"id\":\"\",\"offer\":\"UbuntuServer\",\"publisher\":\"Canonical\",\"sku\":\"18.04-LTS\",\"version\":\"latest\"},\"osDisk\":{\"caching\":\"ReadWrite\",\"createOption\":\"FromImage\",\"diffDiskSettings\":{\"option\":\"\"},\"diskSizeGB\":\"30\",\"encryptionSettings\":{\"enabled\":\"false\"},\"image\":{\"uri\":\"\"},\"managedDisk\":{\"id\":\"/subscriptions/8fba6d4f-7c37-4d13-9063-fd58ad2b86e2/resourceGroups/sourabh-telemetry-sdk/providers/Microsoft.Compute/disks/sourabh-testing_OsDisk_1_9a54abfc5ba149c6a106bd9e5b558c2a\",\"storageAccountType\":\"Premium_LRS\"},\"name\":\"sourabh-testing_OsDisk_1_9a54abfc5ba149c6a106bd9e5b558c2a\",\"osType\":\"Linux\",\"vhd\":{\"uri\":\"\"},\"writeAcceleratorEnabled\":\"false\"}},\"subscriptionId\":\"8fba6d4f-7c37-4d13-9063-fd58ad2b86e2\",\"tags\":\"azsecpack:nonprod;platformsettings.host_environment.service.platform_optedin_for_rootcerts:true\",\"tagsList\":[{\"name\":\"azsecpack\",\"value\":\"nonprod\"},{\"name\":\"platformsettings.host_environment.service.platform_optedin_for_rootcerts\",\"value\":\"true\"}],\"version\":\"18.04.202103250\",\"vmId\":\"d0cb93eb-214b-4c2b-bd3d-cc93e90d9efd\",\"vmScaleSetName\":\"\",\"vmSize\":\"Standard_D2s_v3\",\"zone\":\"1\"},\"network\":{\"interface\":[{\"ipv4\":{\"ipAddress\":[{\"privateIpAddress\":\"10.0.7.5\",\"publicIpAddress\":\"\"}],\"subnet\":[{\"address\":\"10.0.7.0\",\"prefix\":\"24\"}]},\"ipv6\":{\"ipAddress\":[]},\"macAddress\":\"000D3A8F8BA0\"}]}}"); - - private CosmosClientBuilder cosmosClientBuilder; - private static SystemUsageMonitor systemUsageMonitor; - - private List actualInfo; - private List preferredRegionList; + public override Task HttpHandlerRequestCallbackChecks(HttpRequestMessage request) + { + if (request.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) + { + return Task.FromResult(new HttpResponseMessage(HttpStatusCode.NoContent)); // In Emulator test, send hardcoded response status code as there is no real communication happens with client telemetry service + } - private IDictionary expectedMetricNameUnitMap; + return null; + } - private HttpClientHandlerHelper httpHandler; - private HttpClientHandlerHelper httpHandlerForNonAzureInstance; + public override CosmosClientBuilder GetBuilder() + { + return TestCommon.GetDefaultConfiguration(); + } [ClassInitialize] - public static void ClassInitialize(TestContext _) + public static new void ClassInitialize(TestContext context) { - SystemUsageMonitor oldSystemUsageMonitor = (SystemUsageMonitor)typeof(DiagnosticsHandlerHelper) - .GetField("systemUsageMonitor", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(DiagnosticsHandlerHelper.Instance); - oldSystemUsageMonitor.Stop(); - - ClientTelemetryTests.ResetSystemUsageMonitor(true); + ClientTelemetryTestsBase.ClassInitialize(context); } - [TestInitialize] - public void TestInitialize() + [ClassCleanup] + public static new void FinalCleanup() { - Util.EnableClientTelemetryEnvironmentVariables(); - - this.actualInfo = new List(); - - this.httpHandler = new HttpClientHandlerHelper - { - RequestCallBack = (request, cancellation) => - { - if (request.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) - { - HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK); - - string jsonObject = request.Content.ReadAsStringAsync().GetAwaiter().GetResult(); - - lock (this.actualInfo) - { - this.actualInfo.Add(JsonConvert.DeserializeObject(jsonObject)); - } - - return Task.FromResult(result); - } - else if (request.RequestUri.AbsoluteUri.Equals(VmMetadataApiHandler.vmMetadataEndpointUrl.AbsoluteUri)) - { - HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK); - - string payload = JsonConvert.SerializeObject(ClientTelemetryTests.jsonObject); - result.Content = new StringContent(payload, Encoding.UTF8, "application/json"); - - return Task.FromResult(result); - } - return null; - } - }; - - this.httpHandlerForNonAzureInstance = new HttpClientHandlerHelper - { - RequestCallBack = (request, cancellation) => - { - if (request.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) - { - HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK); - - string jsonObject = request.Content.ReadAsStringAsync().GetAwaiter().GetResult(); - - lock (this.actualInfo) - { - this.actualInfo.Add(JsonConvert.DeserializeObject(jsonObject)); - } - - return Task.FromResult(result); - } - return null; - } - }; - - this.preferredRegionList = new List - { - "region1", - "region2" - }; - - this.expectedMetricNameUnitMap = new Dictionary() - { - { ClientTelemetryOptions.CpuName, ClientTelemetryOptions.CpuUnit }, - { ClientTelemetryOptions.MemoryName, ClientTelemetryOptions.MemoryUnit }, - { ClientTelemetryOptions.AvailableThreadsName, ClientTelemetryOptions.AvailableThreadsUnit }, - { ClientTelemetryOptions.IsThreadStarvingName, ClientTelemetryOptions.IsThreadStarvingUnit }, - { ClientTelemetryOptions.ThreadWaitIntervalInMsName, ClientTelemetryOptions.ThreadWaitIntervalInMsUnit } - }; - - this.cosmosClientBuilder = TestCommon.GetDefaultConfiguration() - .WithApplicationPreferredRegions(this.preferredRegionList); + ClientTelemetryTestsBase.FinalCleanup(); } - private static void ResetSystemUsageMonitor(bool isTelemetryEnabled) + [TestInitialize] + public override void TestInitialize() { - ClientTelemetryTests.systemUsageMonitor?.Stop(); - - FieldInfo diagnosticsHandlerHelperInstance = typeof(DiagnosticsHandlerHelper) - .GetField("isTelemetryMonitoringEnabled", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); - diagnosticsHandlerHelperInstance.SetValue(null, isTelemetryEnabled); - - List recorders = new List() - { - (SystemUsageRecorder)typeof(DiagnosticsHandlerHelper) - .GetField("diagnosticSystemUsageRecorder", - BindingFlags.Instance | BindingFlags.NonPublic) - .GetValue(DiagnosticsHandlerHelper.Instance) - }; - - if (isTelemetryEnabled) - { - recorders.Add( - (SystemUsageRecorder)typeof(DiagnosticsHandlerHelper) - .GetField("telemetrySystemUsageRecorder", - BindingFlags.Instance | BindingFlags.NonPublic) - .GetValue(DiagnosticsHandlerHelper.Instance)); - } - - ClientTelemetryTests.systemUsageMonitor = SystemUsageMonitor.CreateAndStart(recorders); + base.TestInitialize(); } [TestCleanup] - public async Task Cleanup() + public override async Task Cleanup() { - FieldInfo isInitializedField = typeof(VmMetadataApiHandler).GetField("isInitialized", - BindingFlags.Static | - BindingFlags.NonPublic); - isInitializedField.SetValue(null, false); - - FieldInfo azMetadataField = typeof(VmMetadataApiHandler).GetField("azMetadata", - BindingFlags.Static | - BindingFlags.NonPublic); - azMetadataField.SetValue(null, null); - - await base.TestCleanup(); - - Util.DisableClientTelemetryEnvironmentVariables(); + await base.Cleanup(); } - [ClassCleanup] - public static void FinalCleanup() - { - ClientTelemetryTests.ResetSystemUsageMonitor(false); - } - [TestMethod] [DataRow(ConnectionMode.Direct, true)] [DataRow(ConnectionMode.Gateway, true)] [DataRow(ConnectionMode.Direct, false)] [DataRow(ConnectionMode.Gateway, false)] - public async Task PointSuccessOperationsTest(ConnectionMode mode, bool isAzureInstance) + public override async Task PointSuccessOperationsTest(ConnectionMode mode, bool isAzureInstance) { - Container container = await this.CreateClientAndContainer( - mode: mode, - isAzureInstance: isAzureInstance); - - // Create an item - ToDoActivity testItem = ToDoActivity.CreateRandomToDoActivity("MyTestPkValue"); - ItemResponse createResponse = await container.CreateItemAsync(testItem); - ToDoActivity testItemCreated = createResponse.Resource; - - // Read an Item - await container.ReadItemAsync(testItem.id, new Cosmos.PartitionKey(testItem.id)); - - // Upsert an Item - await container.UpsertItemAsync(testItem); - - // Replace an Item - await container.ReplaceItemAsync(testItemCreated, testItemCreated.id.ToString()); - - // Patch an Item - List patch = new List() - { - PatchOperation.Add("/new", "patched") - }; - await ((ContainerInternal)container).PatchItemAsync( - testItem.id, - new Cosmos.PartitionKey(testItem.id), - patch); - - // Delete an Item - await container.DeleteItemAsync(testItem.id, new Cosmos.PartitionKey(testItem.id)); - - IDictionary expectedRecordCountInOperation = new Dictionary - { - { Documents.OperationType.Create.ToString(), 1}, - { Documents.OperationType.Upsert.ToString(), 1}, - { Documents.OperationType.Read.ToString(), 1}, - { Documents.OperationType.Replace.ToString(), 1}, - { Documents.OperationType.Patch.ToString(), 1}, - { Documents.OperationType.Delete.ToString(), 1} - }; - - await this.WaitAndAssert(expectedOperationCount: 12, - expectedOperationRecordCountMap: expectedRecordCountInOperation, - isAzureInstance: isAzureInstance); + await base.PointSuccessOperationsTest(mode, isAzureInstance); } [TestMethod] [DataRow(ConnectionMode.Direct)] [DataRow(ConnectionMode.Gateway)] - public async Task PointReadFailureOperationsTest(ConnectionMode mode) + public override async Task PointReadFailureOperationsTest(ConnectionMode mode) { - // Fail Read - try - { - Container container = await this.CreateClientAndContainer(mode, Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix); - - await container.ReadItemAsync( - new Guid().ToString(), - new Cosmos.PartitionKey(new Guid().ToString()), - new ItemRequestOptions() - { - BaseConsistencyLevel = Microsoft.Azure.Cosmos.ConsistencyLevel.Eventual // overriding client level consistency - }); - } - catch (CosmosException ce) when (ce.StatusCode == HttpStatusCode.NotFound) - { - string message = ce.ToString(); - Assert.IsNotNull(message); - } - - IDictionary expectedRecordCountInOperation = new Dictionary - { - { Documents.OperationType.Read.ToString(), 1} - }; - - await this.WaitAndAssert(expectedOperationCount: 2, - expectedConsistencyLevel: Microsoft.Azure.Cosmos.ConsistencyLevel.Eventual, - expectedOperationRecordCountMap: expectedRecordCountInOperation, - expectedCacheSource: null, - isExpectedNetworkTelemetry: false); + await base.PointReadFailureOperationsTest(mode); } [TestMethod] [DataRow(ConnectionMode.Direct)] [DataRow(ConnectionMode.Gateway)] - public async Task StreamReadFailureOperationsTest(ConnectionMode mode) + public override async Task StreamReadFailureOperationsTest(ConnectionMode mode) { - Container container = await this.CreateClientAndContainer(mode); - - // Fail Read - try - { - await container.ReadItemStreamAsync( - new Guid().ToString(), - new Cosmos.PartitionKey(new Guid().ToString()), - new ItemRequestOptions() - { - BaseConsistencyLevel = Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix // Request level consistency - }); - } - catch (CosmosException ce) when (ce.StatusCode == HttpStatusCode.NotFound) - { - string message = ce.ToString(); - Assert.IsNotNull(message); - } - - IDictionary expectedRecordCountInOperation = new Dictionary - { - { Documents.OperationType.Read.ToString(), 1} - }; - - await this.WaitAndAssert(expectedOperationCount: 2, - expectedConsistencyLevel: Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix, - expectedOperationRecordCountMap: expectedRecordCountInOperation, - expectedCacheSource: null, - isExpectedNetworkTelemetry: false); + await base.StreamReadFailureOperationsTest(mode); } [TestMethod] [DataRow(ConnectionMode.Direct)] [DataRow(ConnectionMode.Gateway)] - public async Task StreamOperationsTest(ConnectionMode mode) + public override async Task StreamOperationsTest(ConnectionMode mode) { - Container container = await this.CreateClientAndContainer(mode); - - // Create an item - var testItem = new { id = "MyTestItemId", partitionKeyPath = "MyTestPkValue", details = "it's working", status = "done" }; - await container - .CreateItemStreamAsync(TestCommon.SerializerCore.ToStream(testItem), - new Cosmos.PartitionKey(testItem.id)); - - //Upsert an Item - await container.UpsertItemStreamAsync(TestCommon.SerializerCore.ToStream(testItem), new Cosmos.PartitionKey(testItem.id)); - - //Read an Item - await container.ReadItemStreamAsync(testItem.id, new Cosmos.PartitionKey(testItem.id)); - - //Replace an Item - await container.ReplaceItemStreamAsync(TestCommon.SerializerCore.ToStream(testItem), testItem.id, new Cosmos.PartitionKey(testItem.id)); - - // Patch an Item - List patch = new List() - { - PatchOperation.Add("/new", "patched") - }; - await ((ContainerInternal)container).PatchItemStreamAsync( - partitionKey: new Cosmos.PartitionKey(testItem.id), - id: testItem.id, - patchOperations: patch); - - //Delete an Item - await container.DeleteItemStreamAsync(testItem.id, new Cosmos.PartitionKey(testItem.id)); - - IDictionary expectedRecordCountInOperation = new Dictionary - { - { Documents.OperationType.Create.ToString(), 1}, - { Documents.OperationType.Upsert.ToString(), 1}, - { Documents.OperationType.Read.ToString(), 1}, - { Documents.OperationType.Replace.ToString(), 1}, - { Documents.OperationType.Patch.ToString(), 1}, - { Documents.OperationType.Delete.ToString(), 1} - }; - - await this.WaitAndAssert(expectedOperationCount: 12, - expectedOperationRecordCountMap: expectedRecordCountInOperation, - expectedCacheSource: null); + await base.StreamOperationsTest(mode); } [TestMethod] [DataRow(ConnectionMode.Direct)] [DataRow(ConnectionMode.Gateway)] - public async Task BatchOperationsTest(ConnectionMode mode) + public override async Task BatchOperationsTest(ConnectionMode mode) { - Container container = await this.CreateClientAndContainer(mode, Microsoft.Azure.Cosmos.ConsistencyLevel.Eventual); // Client level consistency - using (BatchAsyncContainerExecutor executor = - new BatchAsyncContainerExecutor( - (ContainerInlineCore)container, - ((ContainerInlineCore)container).ClientContext, - 20, - Documents.Constants.MaxDirectModeBatchRequestBodySizeInBytes) - ) - { - List> tasks = new List>(); - for (int i = 0; i < 10; i++) - { - tasks.Add(executor.AddAsync(CreateItem(i.ToString()), NoOpTrace.Singleton, default)); - } - - await Task.WhenAll(tasks); - } - - IDictionary expectedRecordCountInOperation = new Dictionary - { - { Documents.OperationType.Batch.ToString(), 1} - }; - - await this.WaitAndAssert(expectedOperationCount: 2, - expectedConsistencyLevel: Microsoft.Azure.Cosmos.ConsistencyLevel.Eventual, - expectedOperationRecordCountMap: expectedRecordCountInOperation); + await base.BatchOperationsTest(mode); } [TestMethod] [DataRow(ConnectionMode.Direct)] [DataRow(ConnectionMode.Gateway)] - public async Task SingleOperationMultipleTimesTest(ConnectionMode mode) + public override async Task SingleOperationMultipleTimesTest(ConnectionMode mode) { - Container container = await this.CreateClientAndContainer(mode); - - // Create an item - ToDoActivity testItem = ToDoActivity.CreateRandomToDoActivity(); - - await container.CreateItemAsync(testItem, requestOptions: new ItemRequestOptions()); - - for (int count = 0; count < 50; count++) - { - // Read an Item - await container.ReadItemAsync(testItem.id, new Cosmos.PartitionKey(testItem.id)); - } - - IDictionary expectedRecordCountInOperation = new Dictionary - { - { Documents.OperationType.Read.ToString(), 50}, - { Documents.OperationType.Create.ToString(), 1} - }; - - await this.WaitAndAssert( - expectedOperationCount: 4,// 2 (read, requetLatency + requestCharge) + 2 (create, requestLatency + requestCharge) - expectedOperationRecordCountMap: expectedRecordCountInOperation); + await base.SingleOperationMultipleTimesTest(mode); } [TestMethod] [DataRow(ConnectionMode.Direct)] [DataRow(ConnectionMode.Gateway)] - public async Task QueryOperationSinglePartitionTest(ConnectionMode mode) + public override async Task QueryOperationSinglePartitionTest(ConnectionMode mode) { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, "20"); - - Container container = await this.CreateClientAndContainer(mode); - - ToDoActivity testItem = ToDoActivity.CreateRandomToDoActivity("MyTestPkValue", "MyTestItemId"); - ItemRequestOptions requestOptions = new ItemRequestOptions() - { - ConsistencyLevel = Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix - }; - - ItemResponse createResponse = await container.CreateItemAsync( - item: testItem, - requestOptions: requestOptions); - - QueryRequestOptions queryRequestOptions = new QueryRequestOptions() - { - ConsistencyLevel = Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix, - }; - - List families = new List(); - if (createResponse.StatusCode == HttpStatusCode.Created) - { - string sqlQueryText = "SELECT * FROM c"; - - QueryDefinition queryDefinition = new QueryDefinition(sqlQueryText); - using (FeedIterator queryResultSetIterator = container.GetItemQueryIterator( - queryDefinition: queryDefinition, - requestOptions: queryRequestOptions)) - { - while (queryResultSetIterator.HasMoreResults) - { - FeedResponse currentResultSet = await queryResultSetIterator.ReadNextAsync(); - foreach (object family in currentResultSet) - { - families.Add(family); - } - } - } - - Assert.AreEqual(1, families.Count); - - } - - IDictionary expectedRecordCountInOperation = new Dictionary - { - { Documents.OperationType.Query.ToString(), 1}, - { Documents.OperationType.Create.ToString(), 1} - }; - - await this.WaitAndAssert(expectedOperationCount: 4, - expectedOperationRecordCountMap: expectedRecordCountInOperation, - expectedConsistencyLevel: Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix); + await base.QueryOperationSinglePartitionTest(mode); } [TestMethod] [DataRow(ConnectionMode.Direct)] [DataRow(ConnectionMode.Gateway)] - public async Task QueryMultiPageSinglePartitionOperationTest(ConnectionMode mode) + public override async Task QueryMultiPageSinglePartitionOperationTest(ConnectionMode mode) { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, "20"); - Container container = await this.CreateClientAndContainer(mode: mode); - - ItemRequestOptions requestOptions = new ItemRequestOptions() - { - ConsistencyLevel = Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix - }; - - ToDoActivity testItem1 = ToDoActivity.CreateRandomToDoActivity("MyTestPkValue1", "MyTestItemId1"); - ItemResponse createResponse1 = await container.CreateItemAsync( - item: testItem1, - requestOptions: requestOptions); - ToDoActivity testItem2 = ToDoActivity.CreateRandomToDoActivity("MyTestPkValue2", "MyTestItemId2"); - ItemResponse createResponse2 = await container.CreateItemAsync( - item: testItem2, - requestOptions: requestOptions); - - if (createResponse1.StatusCode == HttpStatusCode.Created && - createResponse2.StatusCode == HttpStatusCode.Created) - { - string sqlQueryText = "SELECT * FROM c"; - - List families = new List(); - QueryDefinition queryDefinition = new QueryDefinition(sqlQueryText); - using (FeedIterator queryResultSetIterator = container.GetItemQueryIterator( - queryDefinition: queryDefinition, - requestOptions: new QueryRequestOptions() - { - ConsistencyLevel = Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix, - MaxItemCount = 1 - })) - { - while (queryResultSetIterator.HasMoreResults) - { - FeedResponse currentResultSet = await queryResultSetIterator.ReadNextAsync(); - foreach (object family in currentResultSet) - { - families.Add(family); - } - } - } - - Assert.AreEqual(2, families.Count); - - } - - IDictionary expectedRecordCountInOperation = new Dictionary - { - { Documents.OperationType.Query.ToString(), 3}, - { Documents.OperationType.Create.ToString(), 2} - }; - - await this.WaitAndAssert( - expectedOperationCount: 4, - expectedOperationRecordCountMap: expectedRecordCountInOperation, - expectedConsistencyLevel: Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix); + await base.QueryMultiPageSinglePartitionOperationTest(mode); } [TestMethod] [DataRow(ConnectionMode.Direct)] [DataRow(ConnectionMode.Gateway)] - public async Task QueryOperationCrossPartitionTest(ConnectionMode mode) + public override async Task QueryOperationCrossPartitionTest(ConnectionMode mode) { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, "20"); - - ContainerInternal itemsCore = (ContainerInternal)await this.CreateClientAndContainer( - mode: mode, - isLargeContainer: true); - - // Verify container has multiple partitions - int pkRangesCount = (await itemsCore.ClientContext.DocumentClient.ReadPartitionKeyRangeFeedAsync(itemsCore.LinkUri)).Count; - Assert.IsTrue(pkRangesCount > 1, "Should have created a multi partition container."); - - Container container = (Container)itemsCore; - - await ToDoActivity.CreateRandomItems( - container: container, - pkCount: 2, - perPKItemCount: 5); - - string sqlQueryText = "SELECT * FROM c"; - - List families = new List(); - - QueryDefinition queryDefinition = new QueryDefinition(sqlQueryText); - using (FeedIterator queryResultSetIterator = container.GetItemQueryIterator(queryDefinition)) - { - while (queryResultSetIterator.HasMoreResults) - { - FeedResponse currentResultSet = await queryResultSetIterator.ReadNextAsync(); - foreach (object family in currentResultSet) - { - families.Add(family); - } - } - } - - Assert.AreEqual(10, families.Count); - - IDictionary expectedRecordCountInOperation = new Dictionary - { - { Documents.OperationType.Query.ToString(), pkRangesCount}, - { Documents.OperationType.Create.ToString(), 10} - }; - - await this.WaitAndAssert( - expectedOperationCount: 4, - expectedOperationRecordCountMap: expectedRecordCountInOperation); + await base.QueryOperationCrossPartitionTest(mode); } [TestMethod] [DataRow(ConnectionMode.Direct)] [DataRow(ConnectionMode.Gateway)] - public async Task QueryOperationMutiplePageCrossPartitionTest(ConnectionMode mode) + public override async Task QueryOperationMutiplePageCrossPartitionTest(ConnectionMode mode) { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, "20"); - - ContainerInternal itemsCore = (ContainerInternal)await this.CreateClientAndContainer( - mode: mode, - isLargeContainer: true); - - // Verify container has multiple partitions - int pkRangesCount = (await itemsCore.ClientContext.DocumentClient.ReadPartitionKeyRangeFeedAsync(itemsCore.LinkUri)).Count; - Assert.IsTrue(pkRangesCount > 1, "Should have created a multi partition container."); - - Container container = (Container)itemsCore; - - await ToDoActivity.CreateRandomItems( - container: container, - pkCount: 2, - perPKItemCount: 5); - - string sqlQueryText = "SELECT * FROM c"; - - List families = new List(); - QueryDefinition queryDefinition = new QueryDefinition(sqlQueryText); - using (FeedIterator queryResultSetIterator = container.GetItemQueryIterator( - queryDefinition: queryDefinition, - requestOptions: new QueryRequestOptions() - { - MaxItemCount = 1 - })) - { - while (queryResultSetIterator.HasMoreResults) - { - FeedResponse currentResultSet = await queryResultSetIterator.ReadNextAsync(); - foreach (object family in currentResultSet) - { - families.Add(family); - } - } - } - - Assert.AreEqual(10, families.Count); - - IDictionary expectedRecordCountInOperation = new Dictionary - { - { Documents.OperationType.Query.ToString(), pkRangesCount + 10}, // 10 is number of items - { Documents.OperationType.Create.ToString(), 10} - }; - - await this.WaitAndAssert( - expectedOperationCount: 4, - expectedOperationRecordCountMap: expectedRecordCountInOperation); + await base.QueryOperationMutiplePageCrossPartitionTest(mode); } [TestMethod] [DataRow(ConnectionMode.Direct)] [DataRow(ConnectionMode.Gateway)] - public async Task QueryOperationInvalidContinuationTokenTest(ConnectionMode mode) + public override async Task QueryOperationInvalidContinuationTokenTest(ConnectionMode mode) { - Container container = await this.CreateClientAndContainer(mode); - - // Create an item : First successful request to load Cache - ToDoActivity testItem = ToDoActivity.CreateRandomToDoActivity("MyTestPkValue"); - await container.CreateItemAsync(testItem); - - List results = new List(); - using (FeedIterator resultSetIterator = container.GetItemQueryIterator( - "SELECT * FROM c", - continuationToken: "dummy token")) - { - try - { - while (resultSetIterator.HasMoreResults) - { - FeedResponse response = await resultSetIterator.ReadNextAsync(); - results.AddRange(response); - } - } - catch (CosmosException ce) when (ce.StatusCode == HttpStatusCode.BadRequest) - { - string message = ce.ToString(); - Assert.IsNotNull(message); - } - } - - IDictionary expectedRecordCountInOperation = new Dictionary - { - { Documents.OperationType.Create.ToString(), 1} - }; - - await this.WaitAndAssert(expectedOperationCount: 2, - expectedOperationRecordCountMap: expectedRecordCountInOperation); + await base.QueryOperationInvalidContinuationTokenTest(mode); } [TestMethod] [DataRow(ConnectionMode.Direct)] - public async Task CreateItemWithSubStatusCodeTest(ConnectionMode mode) + public override async Task CreateItemWithSubStatusCodeTest(ConnectionMode mode) { - HttpClientHandlerHelper httpHandler = new HttpClientHandlerHelper(); - HttpClient httpClient = new HttpClient(httpHandler); - - httpHandler.RequestCallBack = (request, cancellation) => - { - if (request.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) - { - HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK); - - string jsonObject = request.Content.ReadAsStringAsync().GetAwaiter().GetResult(); - - lock (this.actualInfo) - { - this.actualInfo.Add(JsonConvert.DeserializeObject(jsonObject)); - } - - return Task.FromResult(result); - } - else if (request.RequestUri.AbsoluteUri.Equals(VmMetadataApiHandler.vmMetadataEndpointUrl.AbsoluteUri)) - { - HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK); - - string payload = JsonConvert.SerializeObject(ClientTelemetryTests.jsonObject); - result.Content = new StringContent(payload, Encoding.UTF8, "application/json"); - - return Task.FromResult(result); - } - else if (request.Method == HttpMethod.Get && request.RequestUri.AbsolutePath == "//addresses/") - { - HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.Forbidden); - - // Add a substatus code that is not part of the enum. - // This ensures that if the backend adds a enum the status code is not lost. - result.Headers.Add(WFConstants.BackendHeaders.SubStatus, 999999.ToString(CultureInfo.InvariantCulture)); - - string payload = JsonConvert.SerializeObject(new Error() { Message = "test message" }); - result.Content = new StringContent(payload, Encoding.UTF8, "application/json"); - - return Task.FromResult(result); - } - - return null; - }; - - // Replacing originally initialized cosmos Builder with this one with new handler - this.cosmosClientBuilder = this.cosmosClientBuilder - .WithHttpClientFactory(() => new HttpClient(httpHandler)); - - Container container = await this.CreateClientAndContainer( - mode: mode, - customHttpHandler: httpHandler); - try - { - ToDoActivity testItem = ToDoActivity.CreateRandomToDoActivity("MyTestPkValue"); - ItemResponse createResponse = await container.CreateItemAsync(testItem); - Assert.Fail("Request should throw exception."); - } - catch (CosmosException ce) when (ce.StatusCode == HttpStatusCode.Forbidden) - { - Assert.AreEqual(999999, ce.SubStatusCode); - } - - IDictionary expectedRecordCountInOperation = new Dictionary - { - { Documents.OperationType.Create.ToString(), 1} - }; - - await this.WaitAndAssert(expectedOperationCount: 2, - expectedOperationRecordCountMap: expectedRecordCountInOperation, - expectedSubstatuscode: 999999, - isExpectedNetworkTelemetry: false); - + await base.CreateItemWithSubStatusCodeTest(mode); } - - /// - /// This method wait for the expected operations to get recorded by telemetry and assert the values - /// - /// Expected number of unique OperationInfo irrespective of response size. - /// Expected Consistency level of the operation recorded by telemetry - /// Expected number of requests recorded for each operation - /// - private async Task WaitAndAssert( - int expectedOperationCount = 0, - Microsoft.Azure.Cosmos.ConsistencyLevel? expectedConsistencyLevel = null, - IDictionary expectedOperationRecordCountMap = null, - int expectedSubstatuscode = 0, - bool? isAzureInstance = null, - string expectedCacheSource = "ClientCollectionCache", - bool isExpectedNetworkTelemetry = true) - { - Assert.IsNotNull(this.actualInfo, "Telemetry Information not available"); - - // As this feature is thread based execution so wait for the results to avoid test flakiness - List localCopyOfActualInfo = null; - ValueStopwatch stopwatch = ValueStopwatch.StartNew(); - - HashSet cacheRefreshInfoSet = new HashSet(); - do - { - await Task.Delay(TimeSpan.FromMilliseconds(1500)); // wait at least for 1 round of telemetry - - HashSet actualOperationSet = new HashSet(); - HashSet requestInfoSet = new HashSet(); - - lock (this.actualInfo) - { - // Setting the number of unique OperationInfo irrespective of response size as response size is varying in case of queries. - this.actualInfo - .ForEach(x => - { - if (x.CacheRefreshInfo != null && x.CacheRefreshInfo.Count > 0) - { - x.CacheRefreshInfo - .ForEach(y => - { - y.GreaterThan1Kb = false; - cacheRefreshInfoSet.Add(y); - }); - - } - - x.OperationInfo - .ForEach(y => - { - y.GreaterThan1Kb = false; - actualOperationSet.Add(y); - }); - }); - - if (actualOperationSet.Count == expectedOperationCount / 2) - { - // Copy the list to avoid it being modified while validating - localCopyOfActualInfo = new List(this.actualInfo); - break; - } - - Assert.IsTrue(stopwatch.Elapsed.TotalMinutes < 1, $"The expected operation count({expectedOperationCount}) was never hit, Actual Operation Count is {actualOperationSet.Count}. ActualInfo:{JsonConvert.SerializeObject(this.actualInfo)}"); - } - } - while (localCopyOfActualInfo == null); - - List actualOperationList = new List(); - List actualSystemInformation = new List(); - List actualRequestInformation = new List(); - - if (localCopyOfActualInfo[0].ConnectionMode == ConnectionMode.Direct.ToString().ToUpperInvariant()) - { - this.expectedMetricNameUnitMap.Add(ClientTelemetryOptions.NumberOfTcpConnectionName, ClientTelemetryOptions.NumberOfTcpConnectionUnit); - } - - ClientTelemetryTests.AssertAccountLevelInformation( - localCopyOfActualInfo: localCopyOfActualInfo, - actualOperationList: actualOperationList, - actualSystemInformation: actualSystemInformation, - actualRequestInformation: actualRequestInformation, - isAzureInstance: isAzureInstance); - - ClientTelemetryTests.AssertOperationLevelInformation( - expectedConsistencyLevel: expectedConsistencyLevel, - expectedOperationRecordCountMap: expectedOperationRecordCountMap, - actualOperationList: actualOperationList, - expectedSubstatuscode: expectedSubstatuscode); - - if(!string.IsNullOrEmpty(expectedCacheSource)) - { - Assert.IsTrue(cacheRefreshInfoSet.Count > 0, "Cache Refresh Information is not there"); - - ClientTelemetryTests.AssertCacheRefreshInfoInformation( - cacheRefreshInfoSet: cacheRefreshInfoSet, - expectedCacheSource: expectedCacheSource); - } - - ClientTelemetryTests.AssertSystemLevelInformation(actualSystemInformation, this.expectedMetricNameUnitMap); - if (localCopyOfActualInfo.First().ConnectionMode == ConnectionMode.Direct.ToString().ToUpperInvariant() - && isExpectedNetworkTelemetry) - { - ClientTelemetryTests.AssertNetworkLevelInformation(actualRequestInformation); - } - else - { - Assert.IsTrue(actualRequestInformation == null || actualRequestInformation.Count == 0, "Request Information is not expected in Gateway mode"); - } - } - - private static void AssertNetworkLevelInformation(List actualRequestInformation) - { - Assert.IsNotNull(actualRequestInformation); - Assert.IsTrue(actualRequestInformation.Count > 0); - - foreach(RequestInfo requestInfo in actualRequestInformation) - { - Assert.IsNotNull(requestInfo.Uri); - Assert.IsNotNull(requestInfo.DatabaseName); - Assert.IsNotNull(requestInfo.ContainerName); - Assert.IsNotNull(requestInfo.Operation); - Assert.IsNotNull(requestInfo.Resource); - Assert.IsNotNull(requestInfo.StatusCode); - Assert.AreNotEqual(0, requestInfo.StatusCode); - Assert.IsNotNull(requestInfo.SubStatusCode); - - Assert.IsNotNull(requestInfo.Metrics, "MetricInfo is null"); - } - } - - private static void AssertSystemLevelInformation(List actualSystemInformation, IDictionary expectedMetricNameUnitMap) - { - IDictionary actualMetricNameUnitMap = new Dictionary(); - - // Asserting If system information list is as expected - foreach (SystemInfo systemInfo in actualSystemInformation) - { - Assert.AreEqual("HostMachine", systemInfo.Resource); - Assert.IsNotNull(systemInfo.MetricInfo, "MetricInfo is null"); - - if(!actualMetricNameUnitMap.TryAdd(systemInfo.MetricInfo.MetricsName, systemInfo.MetricInfo.UnitName)) - { - Assert.AreEqual(systemInfo.MetricInfo.UnitName, actualMetricNameUnitMap[systemInfo.MetricInfo.MetricsName]); - } - - if(!systemInfo.MetricInfo.MetricsName.Equals(ClientTelemetryOptions.IsThreadStarvingName) && - !systemInfo.MetricInfo.MetricsName.Equals(ClientTelemetryOptions.ThreadWaitIntervalInMsName)) - { - Assert.IsTrue(systemInfo.MetricInfo.Count > 0, $"MetricInfo ({systemInfo.MetricInfo.MetricsName}) Count is not greater than 0"); - Assert.IsNotNull(systemInfo.MetricInfo.Percentiles, $"Percentiles is null for metrics ({systemInfo.MetricInfo.MetricsName})"); - } - Assert.IsTrue(systemInfo.MetricInfo.Mean >= 0, $"MetricInfo ({systemInfo.MetricInfo.MetricsName}) Mean is not greater than or equal to 0"); - Assert.IsTrue(systemInfo.MetricInfo.Max >= 0, $"MetricInfo ({systemInfo.MetricInfo.MetricsName}) Max is not greater than or equal to 0"); - Assert.IsTrue(systemInfo.MetricInfo.Min >= 0, $"MetricInfo ({systemInfo.MetricInfo.MetricsName}) Min is not greater than or equal to 0"); - if (systemInfo.MetricInfo.MetricsName.Equals(ClientTelemetryOptions.CpuName)) - { - Assert.IsTrue(systemInfo.MetricInfo.Mean <= 100, $"MetricInfo ({systemInfo.MetricInfo.MetricsName}) Mean is not greater than 100 for CPU Usage"); - Assert.IsTrue(systemInfo.MetricInfo.Max <= 100, $"MetricInfo ({systemInfo.MetricInfo.MetricsName}) Max is not greater than 100 for CPU Usage"); - Assert.IsTrue(systemInfo.MetricInfo.Min <= 100, $"MetricInfo ({systemInfo.MetricInfo.MetricsName}) Min is not greater than 100 for CPU Usage"); - }; - } - - Assert.IsTrue(expectedMetricNameUnitMap.EqualsTo(actualMetricNameUnitMap), $"Actual System Information metric i.e {string.Join(", ", actualMetricNameUnitMap)} is not matching with expected System Information Metric i.e. {string.Join(", ", expectedMetricNameUnitMap)}"); - - } - - private static void AssertOperationLevelInformation( - Microsoft.Azure.Cosmos.ConsistencyLevel? expectedConsistencyLevel, - IDictionary expectedOperationRecordCountMap, - List actualOperationList, - int expectedSubstatuscode = 0) - { - IDictionary actualOperationRecordCountMap = new Dictionary(); - // Asserting If operation list is as expected - foreach (OperationInfo operation in actualOperationList) - { - Assert.IsNotNull(operation.Operation, "Operation Type is null"); - Assert.IsNotNull(operation.Resource, "Resource Type is null"); - - Assert.AreEqual(expectedSubstatuscode, operation.SubStatusCode); - Assert.AreEqual(expectedConsistencyLevel?.ToString(), operation.Consistency, $"Consistency is not {expectedConsistencyLevel}"); - - Assert.IsNotNull(operation.MetricInfo, "MetricInfo is null"); - Assert.IsNotNull(operation.MetricInfo.MetricsName, "MetricsName is null"); - Assert.IsNotNull(operation.MetricInfo.UnitName, "UnitName is null"); - Assert.IsNotNull(operation.MetricInfo.Percentiles, "Percentiles is null"); - Assert.IsTrue(operation.MetricInfo.Count > 0, "MetricInfo Count is not greater than 0"); - Assert.IsTrue(operation.MetricInfo.Mean >= 0, "MetricInfo Mean is not greater than or equal to 0"); - Assert.IsTrue(operation.MetricInfo.Max >= 0, "MetricInfo Max is not greater than or equal to 0"); - Assert.IsTrue(operation.MetricInfo.Min >= 0, "MetricInfo Min is not greater than or equal to 0"); - if (operation.MetricInfo.MetricsName.Equals(ClientTelemetryOptions.RequestLatencyName)) // putting this condition to avoid doubling of count as we have same information for each metrics - { - if (!actualOperationRecordCountMap.TryGetValue(operation.Operation.ToString(), out long recordCount)) - { - actualOperationRecordCountMap.Add(operation.Operation.ToString(), operation.MetricInfo.Count); - } - else - { - actualOperationRecordCountMap.Remove(operation.Operation.ToString()); - actualOperationRecordCountMap.Add(operation.Operation.ToString(), recordCount + operation.MetricInfo.Count); - } - } - } - - if (expectedOperationRecordCountMap != null) - { - Assert.IsTrue(expectedOperationRecordCountMap.EqualsTo(actualOperationRecordCountMap), $"actual record i.e. ({actualOperationRecordCountMap}) for operation does not match with expected record i.e. ({expectedOperationRecordCountMap})"); - } - } - - private static void AssertAccountLevelInformation( - List localCopyOfActualInfo, - List actualOperationList, - List actualSystemInformation, - List actualRequestInformation, - bool? isAzureInstance) - { - ISet machineId = new HashSet(); - - // Asserting If basic client telemetry object is as expected - foreach (ClientTelemetryProperties telemetryInfo in localCopyOfActualInfo) - { - if (telemetryInfo.OperationInfo != null) - { - actualOperationList.AddRange(telemetryInfo.OperationInfo); - } - - if (telemetryInfo.SystemInfo != null) - { - foreach (SystemInfo sysInfo in telemetryInfo.SystemInfo) - { - actualSystemInformation.Add(sysInfo); - } - } - - if (telemetryInfo.RequestInfo != null) - { - actualRequestInformation.AddRange(telemetryInfo.RequestInfo); - } - - if (telemetryInfo.ConnectionMode == ConnectionMode.Direct.ToString().ToUpperInvariant()) - { - Assert.AreEqual(6, telemetryInfo.SystemInfo.Count, $"System Information Count doesn't Match; {JsonConvert.SerializeObject(telemetryInfo.SystemInfo)}"); - } - else - { - Assert.AreEqual(5, telemetryInfo.SystemInfo.Count, $"System Information Count doesn't Match; {JsonConvert.SerializeObject(telemetryInfo.SystemInfo)}"); - } - - Assert.IsNotNull(telemetryInfo.GlobalDatabaseAccountName, "GlobalDatabaseAccountName is null"); - Assert.IsNotNull(telemetryInfo.DateTimeUtc, "Timestamp is null"); - Assert.AreEqual(2, telemetryInfo.PreferredRegions.Count); - Assert.AreEqual("region1", telemetryInfo.PreferredRegions[0]); - Assert.AreEqual("region2", telemetryInfo.PreferredRegions[1]); - Assert.AreEqual(1, telemetryInfo.AggregationIntervalInSec); - Assert.IsNull(telemetryInfo.AcceleratedNetworking); - Assert.IsNotNull(telemetryInfo.ClientId); - Assert.IsNotNull(telemetryInfo.ProcessId); - Assert.AreEqual(HashingExtension.ComputeHash(System.Diagnostics.Process.GetCurrentProcess().ProcessName), telemetryInfo.ProcessId); - Assert.IsNotNull(telemetryInfo.UserAgent); - Assert.IsFalse(telemetryInfo.UserAgent.Contains("userAgentSuffix"), "Useragent should not have suffix appended"); // Useragent should not contain useragentsuffix as it can have PII - Assert.IsNotNull(telemetryInfo.ConnectionMode); - - if(!string.IsNullOrEmpty(telemetryInfo.MachineId)) - { - machineId.Add(telemetryInfo.MachineId); - } - } - - if(isAzureInstance.HasValue) - { - if (isAzureInstance.Value) - { - Assert.AreEqual($"{VmMetadataApiHandler.VmIdPrefix}{"d0cb93eb-214b-4c2b-bd3d-cc93e90d9efd"}", machineId.First(), $"Generated Machine id is : {machineId.First()}"); - } - else - { - Assert.AreNotEqual($"{VmMetadataApiHandler.VmIdPrefix}{"d0cb93eb-214b-4c2b-bd3d-cc93e90d9efd"}", machineId.First(), $"Generated Machine id is : {machineId.First()}"); - Assert.AreEqual(1, machineId.Count, $"Multiple Machine Id has been generated i.e {JsonConvert.SerializeObject(machineId)}"); - } - } - } - - - private static void AssertCacheRefreshInfoInformation( - HashSet cacheRefreshInfoSet, - string expectedCacheSource) - { - foreach(CacheRefreshInfo cacheRefreshInfo in cacheRefreshInfoSet) - { - Assert.IsNotNull(cacheRefreshInfo.CacheRefreshSource); - Assert.IsTrue(expectedCacheSource.Contains(cacheRefreshInfo.CacheRefreshSource)); - Assert.IsNotNull(cacheRefreshInfo.Operation, "Operation Type is null"); - Assert.IsNotNull(cacheRefreshInfo.Resource, "Resource Type is null"); - Assert.IsNotNull(cacheRefreshInfo.StatusCode, "StatusCode is null"); - Assert.IsNotNull(cacheRefreshInfo.SubStatusCode); - Assert.IsNull(cacheRefreshInfo.Consistency); - Assert.IsNotNull(cacheRefreshInfo.ContainerName, "ContainerName is null"); - Assert.IsNotNull(cacheRefreshInfo.MetricInfo, "MetricInfo is null"); - Assert.IsNotNull(cacheRefreshInfo.MetricInfo.MetricsName, "MetricsName is null"); - Assert.IsNotNull(cacheRefreshInfo.MetricInfo.UnitName, "UnitName is null"); - Assert.IsNotNull(cacheRefreshInfo.MetricInfo.Percentiles, "Percentiles is null"); - Assert.IsTrue(cacheRefreshInfo.MetricInfo.Count >= 0, "MetricInfo Count is not greater than 0"); - Assert.IsTrue(cacheRefreshInfo.MetricInfo.Mean >= 0, "MetricInfo Mean is not greater than or equal to 0"); - Assert.IsTrue(cacheRefreshInfo.MetricInfo.Max >= 0, "MetricInfo Max is not greater than or equal to 0"); - Assert.IsTrue(cacheRefreshInfo.MetricInfo.Min >= 0, "MetricInfo Min is not greater than or equal to 0"); - } - } - - private static ItemBatchOperation CreateItem(string itemId) - { - var testItem = new { id = itemId, Status = itemId }; - return new ItemBatchOperation(Documents.OperationType.Create, 0, new Cosmos.PartitionKey(itemId), itemId, TestCommon.SerializerCore.ToStream(testItem)); - } - - private async Task CreateClientAndContainer(ConnectionMode mode, - Microsoft.Azure.Cosmos.ConsistencyLevel? consistency = null, - bool isLargeContainer = false, - bool isAzureInstance = false, - HttpClientHandlerHelper customHttpHandler = null) - { - if (consistency.HasValue) - { - this.cosmosClientBuilder = this.cosmosClientBuilder - .WithConsistencyLevel(consistency.Value); - } - - HttpClientHandlerHelper handlerHelper; - if (customHttpHandler == null) - { - handlerHelper = isAzureInstance ? this.httpHandler : this.httpHandlerForNonAzureInstance; - } - else - { - handlerHelper = customHttpHandler; - } - - this.cosmosClientBuilder = this.cosmosClientBuilder - .WithHttpClientFactory(() => new HttpClient(handlerHelper)) - .WithApplicationName("userAgentSuffix"); - - this.SetClient(mode == ConnectionMode.Gateway - ? this.cosmosClientBuilder.WithConnectionModeGateway().Build() - : this.cosmosClientBuilder.Build()); - - this.database = await this.GetClient().CreateDatabaseAsync(Guid.NewGuid().ToString()); - - return await this.database.CreateContainerAsync( - id: Guid.NewGuid().ToString(), - partitionKeyPath: "/id", - throughput: isLargeContainer? 15000 : 400); - - } - } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs new file mode 100644 index 0000000000..259a5346df --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs @@ -0,0 +1,1087 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests +{ + using System; + using System.Collections.Generic; + using System.Text; + using System.Threading.Tasks; + using System.Net; + using System.Net.Http; + using System.Reflection; + using Microsoft.Azure.Cosmos.Fluent; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Cosmos.Telemetry; + using Microsoft.Azure.Cosmos.Handler; + using Microsoft.Azure.Documents; + using Newtonsoft.Json.Linq; + using Newtonsoft.Json; + using Documents.Rntbd; + using System.Globalization; + using System.Linq; + using Cosmos.Util; + using Microsoft.Azure.Cosmos.Telemetry.Models; + + public abstract class ClientTelemetryTestsBase : BaseCosmosClientHelper + { + private static SystemUsageMonitor systemUsageMonitor; + private static readonly List preferredRegionList = new List + { + Regions.EastUS, + Regions.WestUS2 + }; + + private static readonly IDictionary expectedMetricNameUnitMap = new Dictionary() + { + { ClientTelemetryOptions.CpuName, ClientTelemetryOptions.CpuUnit }, + { ClientTelemetryOptions.MemoryName, ClientTelemetryOptions.MemoryUnit }, + { ClientTelemetryOptions.AvailableThreadsName, ClientTelemetryOptions.AvailableThreadsUnit }, + { ClientTelemetryOptions.IsThreadStarvingName, ClientTelemetryOptions.IsThreadStarvingUnit }, + { ClientTelemetryOptions.ThreadWaitIntervalInMsName, ClientTelemetryOptions.ThreadWaitIntervalInMsUnit } + }; + + private List actualInfo; + protected CosmosClientBuilder cosmosClientBuilder; + + protected HttpClientHandlerHelper httpHandler; + protected HttpClientHandlerHelper httpHandlerForNonAzureInstance; + + private bool isClientTelemetryAPICallFailed = false; + + public static void ClassInitialize(TestContext _) + { + Util.EnableClientTelemetryEnvironmentVariables(); + + SystemUsageMonitor oldSystemUsageMonitor = (SystemUsageMonitor)typeof(DiagnosticsHandlerHelper) + .GetField("systemUsageMonitor", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(DiagnosticsHandlerHelper.Instance); + oldSystemUsageMonitor.Stop(); + + ClientTelemetryTestsBase.ResetSystemUsageMonitor(true); + } + + public virtual void TestInitialize() + { + this.actualInfo = new List(); + + this.httpHandler = new HttpClientHandlerHelper + { + RequestCallBack = (request, cancellation) => + { + if (request.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) + { + string jsonObject = request.Content.ReadAsStringAsync().GetAwaiter().GetResult(); + + lock (this.actualInfo) + { + this.actualInfo.Add(JsonConvert.DeserializeObject(jsonObject)); + } + } + return this.HttpHandlerRequestCallbackChecks(request); + }, + ResponseIntercepter = (response) => + { + if (response.RequestMessage.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) + { + Assert.AreEqual(HttpStatusCode.NoContent, response.StatusCode); + } + + return Task.FromResult(response); + }, + ExceptionIntercepter = (request, exception) => + { + if (request.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) + { + this.isClientTelemetryAPICallFailed = true; + } + } + }; + + this.httpHandlerForNonAzureInstance = new HttpClientHandlerHelper + { + RequestCallBack = (request, cancellation) => + { + if (request.RequestUri.AbsoluteUri.Equals(VmMetadataApiHandler.vmMetadataEndpointUrl.AbsoluteUri)) + { + HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.NotFound); + return Task.FromResult(result); + } + + if (request.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) + { + string jsonObject = request.Content.ReadAsStringAsync().GetAwaiter().GetResult(); + + lock(this.actualInfo) + { + this.actualInfo.Add(JsonConvert.DeserializeObject(jsonObject)); + } + } + + return this.HttpHandlerRequestCallbackChecks(request); + }, + ResponseIntercepter = (response) => + { + if (response.RequestMessage.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) + { + Assert.AreEqual(HttpStatusCode.NoContent, response.StatusCode); + } + return Task.FromResult(response); + }, + ExceptionIntercepter = (request, exception) => + { + if (request.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) + { + this.isClientTelemetryAPICallFailed = true; + } + } + }; + + this.cosmosClientBuilder = this.GetBuilder() + .WithApplicationPreferredRegions(ClientTelemetryTestsBase.preferredRegionList); + } + + public abstract Task HttpHandlerRequestCallbackChecks(HttpRequestMessage request); + + public abstract CosmosClientBuilder GetBuilder(); + + private static void ResetSystemUsageMonitor(bool isTelemetryEnabled) + { + ClientTelemetryTestsBase.systemUsageMonitor?.Stop(); + + FieldInfo diagnosticsHandlerHelperInstance = typeof(DiagnosticsHandlerHelper) + .GetField("isTelemetryMonitoringEnabled", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); + diagnosticsHandlerHelperInstance.SetValue(null, isTelemetryEnabled); + + List recorders = new List() + { + (SystemUsageRecorder)typeof(DiagnosticsHandlerHelper) + .GetField("diagnosticSystemUsageRecorder", + BindingFlags.Instance | BindingFlags.NonPublic) + .GetValue(DiagnosticsHandlerHelper.Instance) + }; + + if (isTelemetryEnabled) + { + recorders.Add( + (SystemUsageRecorder)typeof(DiagnosticsHandlerHelper) + .GetField("telemetrySystemUsageRecorder", + BindingFlags.Instance | BindingFlags.NonPublic) + .GetValue(DiagnosticsHandlerHelper.Instance)); + } + + ClientTelemetryTestsBase.systemUsageMonitor = SystemUsageMonitor.CreateAndStart(recorders); + } + + public virtual async Task Cleanup() + { + FieldInfo isInitializedField = typeof(VmMetadataApiHandler).GetField("isInitialized", + BindingFlags.Static | + BindingFlags.NonPublic); + isInitializedField.SetValue(null, false); + + FieldInfo azMetadataField = typeof(VmMetadataApiHandler).GetField("azMetadata", + BindingFlags.Static | + BindingFlags.NonPublic); + azMetadataField.SetValue(null, null); + await base.TestCleanup(); + + Assert.IsFalse(this.isClientTelemetryAPICallFailed, $"Call to client telemetry service endpoint (i.e. {ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri}) failed"); + } + + public static void FinalCleanup() + { + ClientTelemetryTestsBase.ResetSystemUsageMonitor(false); + } + + public virtual async Task PointSuccessOperationsTest(ConnectionMode mode, bool isAzureInstance) + { + Container container = await this.CreateClientAndContainer( + mode: mode, + isAzureInstance: isAzureInstance); + + // Create an item + ToDoActivity testItem = ToDoActivity.CreateRandomToDoActivity("MyTestPkValue"); + ItemResponse createResponse = await container.CreateItemAsync(testItem); + ToDoActivity testItemCreated = createResponse.Resource; + + // Read an Item + await container.ReadItemAsync(testItem.id, new Cosmos.PartitionKey(testItem.id)); + + // Upsert an Item + await container.UpsertItemAsync(testItem); + + // Replace an Item + await container.ReplaceItemAsync(testItemCreated, testItemCreated.id.ToString()); + + // Patch an Item + List patch = new List() + { + PatchOperation.Add("/new", "patched") + }; + await ((ContainerInternal)container).PatchItemAsync( + testItem.id, + new Cosmos.PartitionKey(testItem.id), + patch); + + // Delete an Item + await container.DeleteItemAsync(testItem.id, new Cosmos.PartitionKey(testItem.id)); + + IDictionary expectedRecordCountInOperation = new Dictionary + { + { Documents.OperationType.Create.ToString(), 1}, + { Documents.OperationType.Upsert.ToString(), 1}, + { Documents.OperationType.Read.ToString(), 1}, + { Documents.OperationType.Replace.ToString(), 1}, + { Documents.OperationType.Patch.ToString(), 1}, + { Documents.OperationType.Delete.ToString(), 1} + }; + + await this.WaitAndAssert(expectedOperationCount: 12, + expectedOperationRecordCountMap: expectedRecordCountInOperation, + isAzureInstance: isAzureInstance); + } + + public virtual async Task PointReadFailureOperationsTest(ConnectionMode mode) + { + // Fail Read + try + { + Container container = await this.CreateClientAndContainer(mode, Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix); + + await container.ReadItemAsync( + new Guid().ToString(), + new Cosmos.PartitionKey(new Guid().ToString()), + new ItemRequestOptions() + { + BaseConsistencyLevel = Microsoft.Azure.Cosmos.ConsistencyLevel.Eventual // overriding client level consistency + }); + } + catch (CosmosException ce) when (ce.StatusCode == HttpStatusCode.NotFound) + { + string message = ce.ToString(); + Assert.IsNotNull(message); + } + + IDictionary expectedRecordCountInOperation = new Dictionary + { + { Documents.OperationType.Read.ToString(), 1} + }; + + await this.WaitAndAssert(expectedOperationCount: 2, + expectedConsistencyLevel: Microsoft.Azure.Cosmos.ConsistencyLevel.Eventual, + expectedOperationRecordCountMap: expectedRecordCountInOperation, + expectedCacheSource: null, + isExpectedNetworkTelemetry: false); + } + + public virtual async Task StreamReadFailureOperationsTest(ConnectionMode mode) + { + Container container = await this.CreateClientAndContainer(mode); + + // Fail Read + try + { + await container.ReadItemStreamAsync( + new Guid().ToString(), + new Cosmos.PartitionKey(new Guid().ToString()), + new ItemRequestOptions() + { + BaseConsistencyLevel = Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix // Request level consistency + }); + } + catch (CosmosException ce) when (ce.StatusCode == HttpStatusCode.NotFound) + { + string message = ce.ToString(); + Assert.IsNotNull(message); + } + + IDictionary expectedRecordCountInOperation = new Dictionary + { + { Documents.OperationType.Read.ToString(), 1} + }; + + await this.WaitAndAssert(expectedOperationCount: 2, + expectedConsistencyLevel: Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix, + expectedOperationRecordCountMap: expectedRecordCountInOperation, + expectedCacheSource: null, + isExpectedNetworkTelemetry: false); + } + + public virtual async Task StreamOperationsTest(ConnectionMode mode) + { + Container container = await this.CreateClientAndContainer(mode); + + // Create an item + var testItem = new { id = "MyTestItemId", partitionKeyPath = "MyTestPkValue", details = "it's working", status = "done" }; + await container + .CreateItemStreamAsync(TestCommon.SerializerCore.ToStream(testItem), + new Cosmos.PartitionKey(testItem.id)); + + //Upsert an Item + await container.UpsertItemStreamAsync(TestCommon.SerializerCore.ToStream(testItem), new Cosmos.PartitionKey(testItem.id)); + + //Read an Item + await container.ReadItemStreamAsync(testItem.id, new Cosmos.PartitionKey(testItem.id)); + + //Replace an Item + await container.ReplaceItemStreamAsync(TestCommon.SerializerCore.ToStream(testItem), testItem.id, new Cosmos.PartitionKey(testItem.id)); + + // Patch an Item + List patch = new List() + { + PatchOperation.Add("/new", "patched") + }; + await ((ContainerInternal)container).PatchItemStreamAsync( + partitionKey: new Cosmos.PartitionKey(testItem.id), + id: testItem.id, + patchOperations: patch); + + //Delete an Item + await container.DeleteItemStreamAsync(testItem.id, new Cosmos.PartitionKey(testItem.id)); + + IDictionary expectedRecordCountInOperation = new Dictionary + { + { Documents.OperationType.Create.ToString(), 1}, + { Documents.OperationType.Upsert.ToString(), 1}, + { Documents.OperationType.Read.ToString(), 1}, + { Documents.OperationType.Replace.ToString(), 1}, + { Documents.OperationType.Patch.ToString(), 1}, + { Documents.OperationType.Delete.ToString(), 1} + }; + + await this.WaitAndAssert(expectedOperationCount: 12, + expectedOperationRecordCountMap: expectedRecordCountInOperation, + expectedCacheSource: null); + } + + public virtual async Task BatchOperationsTest(ConnectionMode mode) + { + Container container = await this.CreateClientAndContainer(mode, Microsoft.Azure.Cosmos.ConsistencyLevel.Eventual); // Client level consistency + using (BatchAsyncContainerExecutor executor = + new BatchAsyncContainerExecutor( + (ContainerInlineCore)container, + ((ContainerInlineCore)container).ClientContext, + 20, + Documents.Constants.MaxDirectModeBatchRequestBodySizeInBytes) + ) + { + List> tasks = new List>(); + for (int i = 0; i < 10; i++) + { + tasks.Add(executor.AddAsync(CreateItem(i.ToString()), NoOpTrace.Singleton, default)); + } + + await Task.WhenAll(tasks); + } + + IDictionary expectedRecordCountInOperation = new Dictionary + { + { Documents.OperationType.Batch.ToString(), 1} + }; + + await this.WaitAndAssert(expectedOperationCount: 2, + expectedConsistencyLevel: Microsoft.Azure.Cosmos.ConsistencyLevel.Eventual, + expectedOperationRecordCountMap: expectedRecordCountInOperation); + } + + public virtual async Task SingleOperationMultipleTimesTest(ConnectionMode mode) + { + Container container = await this.CreateClientAndContainer(mode); + + // Create an item + ToDoActivity testItem = ToDoActivity.CreateRandomToDoActivity(); + + await container.CreateItemAsync(testItem, requestOptions: new ItemRequestOptions()); + + for (int count = 0; count < 50; count++) + { + // Read an Item + await container.ReadItemAsync(testItem.id, new Cosmos.PartitionKey(testItem.id)); + } + + IDictionary expectedRecordCountInOperation = new Dictionary + { + { Documents.OperationType.Read.ToString(), 50}, + { Documents.OperationType.Create.ToString(), 1} + }; + + await this.WaitAndAssert( + expectedOperationCount: 4,// 2 (read, requestLatency + requestCharge) + 2 (create, requestLatency + requestCharge) + expectedOperationRecordCountMap: expectedRecordCountInOperation); + } + + public virtual async Task QueryOperationSinglePartitionTest(ConnectionMode mode) + { + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, "20"); + + Container container = await this.CreateClientAndContainer(mode); + + ToDoActivity testItem = ToDoActivity.CreateRandomToDoActivity("MyTestPkValue", "MyTestItemId"); + ItemRequestOptions requestOptions = new ItemRequestOptions() + { + ConsistencyLevel = Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix + }; + + ItemResponse createResponse = await container.CreateItemAsync( + item: testItem, + requestOptions: requestOptions); + + QueryRequestOptions queryRequestOptions = new QueryRequestOptions() + { + EnableOptimisticDirectExecution = false, + ConsistencyLevel = Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix, + }; + + List families = new List(); + if (createResponse.StatusCode == HttpStatusCode.Created) + { + string sqlQueryText = "SELECT * FROM c"; + + QueryDefinition queryDefinition = new QueryDefinition(sqlQueryText); + using (FeedIterator queryResultSetIterator = container.GetItemQueryIterator( + queryDefinition: queryDefinition, + requestOptions: queryRequestOptions)) + { + while (queryResultSetIterator.HasMoreResults) + { + FeedResponse currentResultSet = await queryResultSetIterator.ReadNextAsync(); + foreach (object family in currentResultSet) + { + families.Add(family); + } + } + } + + Assert.AreEqual(1, families.Count); + + } + + IDictionary expectedRecordCountInOperation = new Dictionary + { + { Documents.OperationType.Query.ToString(), 1}, + { Documents.OperationType.Create.ToString(), 1} + }; + + await this.WaitAndAssert(expectedOperationCount: 4, + expectedOperationRecordCountMap: expectedRecordCountInOperation, + expectedConsistencyLevel: Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix); + } + + public virtual async Task QueryMultiPageSinglePartitionOperationTest(ConnectionMode mode) + { + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, "20"); + Container container = await this.CreateClientAndContainer(mode: mode); + + ItemRequestOptions requestOptions = new ItemRequestOptions() + { + ConsistencyLevel = Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix + }; + + ToDoActivity testItem1 = ToDoActivity.CreateRandomToDoActivity("MyTestPkValue1", "MyTestItemId1"); + ItemResponse createResponse1 = await container.CreateItemAsync( + item: testItem1, + requestOptions: requestOptions); + ToDoActivity testItem2 = ToDoActivity.CreateRandomToDoActivity("MyTestPkValue2", "MyTestItemId2"); + ItemResponse createResponse2 = await container.CreateItemAsync( + item: testItem2, + requestOptions: requestOptions); + + if (createResponse1.StatusCode == HttpStatusCode.Created && + createResponse2.StatusCode == HttpStatusCode.Created) + { + string sqlQueryText = "SELECT * FROM c"; + + List families = new List(); + QueryDefinition queryDefinition = new QueryDefinition(sqlQueryText); + using (FeedIterator queryResultSetIterator = container.GetItemQueryIterator( + queryDefinition: queryDefinition, + requestOptions: new QueryRequestOptions() + { + EnableOptimisticDirectExecution = false, + ConsistencyLevel = Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix, + MaxItemCount = 1 + })) + { + while (queryResultSetIterator.HasMoreResults) + { + FeedResponse currentResultSet = await queryResultSetIterator.ReadNextAsync(); + foreach (object family in currentResultSet) + { + families.Add(family); + } + } + } + + Assert.AreEqual(2, families.Count); + + } + + IDictionary expectedRecordCountInOperation = new Dictionary + { + { Documents.OperationType.Query.ToString(), 3}, + { Documents.OperationType.Create.ToString(), 2} + }; + + await this.WaitAndAssert( + expectedOperationCount: 4, + expectedOperationRecordCountMap: expectedRecordCountInOperation, + expectedConsistencyLevel: Microsoft.Azure.Cosmos.ConsistencyLevel.ConsistentPrefix); + } + + public virtual async Task QueryOperationCrossPartitionTest(ConnectionMode mode) + { + Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, "20"); + + ContainerInternal itemsCore = (ContainerInternal)await this.CreateClientAndContainer( + mode: mode, + isLargeContainer: true); + + // Verify container has multiple partitions + int pkRangesCount = (await itemsCore.ClientContext.DocumentClient.ReadPartitionKeyRangeFeedAsync(itemsCore.LinkUri)).Count; + Assert.IsTrue(pkRangesCount > 1, "Should have created a multi partition container."); + + Container container = (Container)itemsCore; + + await ToDoActivity.CreateRandomItems( + container: container, + pkCount: 2, + perPKItemCount: 5); + + string sqlQueryText = "SELECT * FROM c"; + + List families = new List(); + + QueryDefinition queryDefinition = new QueryDefinition(sqlQueryText); + using (FeedIterator queryResultSetIterator = container.GetItemQueryIterator(queryDefinition)) + { + while (queryResultSetIterator.HasMoreResults) + { + FeedResponse currentResultSet = await queryResultSetIterator.ReadNextAsync(); + foreach (object family in currentResultSet) + { + families.Add(family); + } + } + } + + Assert.AreEqual(10, families.Count); + + IDictionary expectedRecordCountInOperation = new Dictionary + { + { Documents.OperationType.Query.ToString(), pkRangesCount}, + { Documents.OperationType.Create.ToString(), 10} + }; + + await this.WaitAndAssert( + expectedOperationCount: 4, + expectedOperationRecordCountMap: expectedRecordCountInOperation); + } + + public virtual async Task QueryOperationMutiplePageCrossPartitionTest(ConnectionMode mode) + { + ContainerInternal itemsCore = (ContainerInternal)await this.CreateClientAndContainer( + mode: mode, + isLargeContainer: true); + + // Verify container has multiple partitions + int pkRangesCount = (await itemsCore.ClientContext.DocumentClient.ReadPartitionKeyRangeFeedAsync(itemsCore.LinkUri)).Count; + Assert.IsTrue(pkRangesCount > 1, "Should have created a multi partition container."); + + Container container = (Container)itemsCore; + + await ToDoActivity.CreateRandomItems( + container: container, + pkCount: 2, + perPKItemCount: 5); + + string sqlQueryText = "SELECT * FROM c"; + + List families = new List(); + QueryDefinition queryDefinition = new QueryDefinition(sqlQueryText); + using (FeedIterator queryResultSetIterator = container.GetItemQueryIterator( + queryDefinition: queryDefinition, + requestOptions: new QueryRequestOptions() + { + MaxItemCount = 1 + })) + { + while (queryResultSetIterator.HasMoreResults) + { + FeedResponse currentResultSet = await queryResultSetIterator.ReadNextAsync(); + foreach (object family in currentResultSet) + { + families.Add(family); + } + } + } + + Assert.AreEqual(10, families.Count); + + IDictionary expectedRecordCountInOperation = new Dictionary + { + { Documents.OperationType.Query.ToString(), pkRangesCount + 10}, // 10 is number of items + { Documents.OperationType.Create.ToString(), 10} + }; + + await this.WaitAndAssert( + expectedOperationCount: 4, + expectedOperationRecordCountMap: expectedRecordCountInOperation); + } + + public virtual async Task QueryOperationInvalidContinuationTokenTest(ConnectionMode mode) + { + Container container = await this.CreateClientAndContainer(mode); + + // Create an item : First successful request to load Cache + ToDoActivity testItem = ToDoActivity.CreateRandomToDoActivity("MyTestPkValue"); + await container.CreateItemAsync(testItem); + + List results = new List(); + using (FeedIterator resultSetIterator = container.GetItemQueryIterator( + "SELECT * FROM c", + continuationToken: "dummy token")) + { + try + { + while (resultSetIterator.HasMoreResults) + { + FeedResponse response = await resultSetIterator.ReadNextAsync(); + results.AddRange(response); + } + } + catch (CosmosException ce) when (ce.StatusCode == HttpStatusCode.BadRequest) + { + string message = ce.ToString(); + Assert.IsNotNull(message); + } + } + + IDictionary expectedRecordCountInOperation = new Dictionary + { + { Documents.OperationType.Create.ToString(), 1} + }; + + await this.WaitAndAssert(expectedOperationCount: 2, + expectedOperationRecordCountMap: expectedRecordCountInOperation); + } + + public virtual async Task CreateItemWithSubStatusCodeTest(ConnectionMode mode) + { + HttpClientHandlerHelper httpHandler = new HttpClientHandlerHelper(); + HttpClient httpClient = new HttpClient(httpHandler); + + httpHandler.RequestCallBack = (request, cancellation) => + { + if (request.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) + { + string jsonObject = request.Content.ReadAsStringAsync().GetAwaiter().GetResult(); + + lock (this.actualInfo) + { + this.actualInfo.Add(JsonConvert.DeserializeObject(jsonObject)); + } + } + else if (request.Method == HttpMethod.Get && request.RequestUri.AbsolutePath == "//addresses/") + { + HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.Forbidden); + + // Add a substatus code that is not part of the enum. + // This ensures that if the backend adds a enum the status code is not lost. + result.Headers.Add(WFConstants.BackendHeaders.SubStatus, 999999.ToString(CultureInfo.InvariantCulture)); + + string payload = JsonConvert.SerializeObject(new Error() { Message = "test message" }); + result.Content = new StringContent(payload, Encoding.UTF8, "application/json"); + + return Task.FromResult(result); + } + return null; + }; + + // Replacing originally initialized cosmos Builder with this one with new handler + this.cosmosClientBuilder = this.cosmosClientBuilder + .WithHttpClientFactory(() => new HttpClient(httpHandler)); + + Container container = await this.CreateClientAndContainer( + mode: mode, + customHttpHandler: httpHandler); + try + { + ToDoActivity testItem = ToDoActivity.CreateRandomToDoActivity("MyTestPkValue"); + ItemResponse createResponse = await container.CreateItemAsync(testItem); + Assert.Fail("Request should throw exception."); + } + catch (CosmosException ce) when (ce.StatusCode == HttpStatusCode.Forbidden) + { + Assert.AreEqual(999999, ce.SubStatusCode); + } + + IDictionary expectedRecordCountInOperation = new Dictionary + { + { Documents.OperationType.Create.ToString(), 1} + }; + + await this.WaitAndAssert(expectedOperationCount: 2, + expectedOperationRecordCountMap: expectedRecordCountInOperation, + expectedSubstatuscode: 999999, + isExpectedNetworkTelemetry: false); + + } + + /// + /// This method wait for the expected operations to get recorded by telemetry and assert the values + /// + /// Expected number of unique OperationInfo irrespective of response size. + /// Expected Consistency level of the operation recorded by telemetry + /// Expected number of requests recorded for each operation + /// + private async Task WaitAndAssert( + int expectedOperationCount = 0, + Microsoft.Azure.Cosmos.ConsistencyLevel? expectedConsistencyLevel = null, + IDictionary expectedOperationRecordCountMap = null, + int expectedSubstatuscode = 0, + bool? isAzureInstance = null, + string expectedCacheSource = "ClientCollectionCache", + bool isExpectedNetworkTelemetry = true) + { + Assert.IsNotNull(this.actualInfo, "Telemetry Information not available"); + + // As this feature is thread based execution so wait for the results to avoid test flakiness + List localCopyOfActualInfo = null; + ValueStopwatch stopwatch = ValueStopwatch.StartNew(); + + HashSet cacheRefreshInfoSet = new HashSet(); + do + { + await Task.Delay(TimeSpan.FromMilliseconds(1500)); // wait at least for 1 round of telemetry + + HashSet actualOperationSet = new HashSet(); + HashSet requestInfoSet = new HashSet(); + + lock (this.actualInfo) + { + // Setting the number of unique OperationInfo irrespective of response size as response size is varying in case of queries. + this.actualInfo + .ForEach(x => + { + if (x.CacheRefreshInfo != null && x.CacheRefreshInfo.Count > 0) + { + x.CacheRefreshInfo + .ForEach(y => + { + y.GreaterThan1Kb = false; + cacheRefreshInfoSet.Add(y); + }); + + } + + x.OperationInfo + .ForEach(y => + { + y.GreaterThan1Kb = false; + actualOperationSet.Add(y); + }); + }); + + if (actualOperationSet.Count == expectedOperationCount / 2) + { + // Copy the list to avoid it being modified while validating + localCopyOfActualInfo = new List(this.actualInfo); + break; + } + + Assert.IsTrue(stopwatch.Elapsed.TotalMinutes < 1, $"The expected operation count({expectedOperationCount}) was never hit, Actual Operation Count is {actualOperationSet.Count}. ActualInfo:{JsonConvert.SerializeObject(this.actualInfo)}"); + } + } + while (localCopyOfActualInfo == null); + + List actualOperationList = new List(); + List actualSystemInformation = new List(); + List actualRequestInformation = new List(); + + if (localCopyOfActualInfo[0].ConnectionMode == ConnectionMode.Direct.ToString().ToUpperInvariant()) + { + ClientTelemetryTestsBase.expectedMetricNameUnitMap.TryAdd(ClientTelemetryOptions.NumberOfTcpConnectionName, ClientTelemetryOptions.NumberOfTcpConnectionUnit); + } + else + { + ClientTelemetryTestsBase.expectedMetricNameUnitMap.Remove(ClientTelemetryOptions.NumberOfTcpConnectionName); + } + + ClientTelemetryTestsBase.AssertAccountLevelInformation( + localCopyOfActualInfo: localCopyOfActualInfo, + actualOperationList: actualOperationList, + actualSystemInformation: actualSystemInformation, + actualRequestInformation: actualRequestInformation, + isAzureInstance: isAzureInstance); + + ClientTelemetryTestsBase.AssertOperationLevelInformation( + expectedConsistencyLevel: expectedConsistencyLevel, + expectedOperationRecordCountMap: expectedOperationRecordCountMap, + actualOperationList: actualOperationList, + expectedSubstatuscode: expectedSubstatuscode); + + if(!string.IsNullOrEmpty(expectedCacheSource)) + { + Assert.IsTrue(cacheRefreshInfoSet.Count > 0, "Cache Refresh Information is not there"); + + ClientTelemetryTestsBase.AssertCacheRefreshInfoInformation( + cacheRefreshInfoSet: cacheRefreshInfoSet, + expectedCacheSource: expectedCacheSource); + } + + ClientTelemetryTestsBase.AssertSystemLevelInformation(actualSystemInformation, ClientTelemetryTestsBase.expectedMetricNameUnitMap); + if (localCopyOfActualInfo.First().ConnectionMode == ConnectionMode.Direct.ToString().ToUpperInvariant()) + { + if (isExpectedNetworkTelemetry) + { + ClientTelemetryTestsBase.AssertNetworkLevelInformation(actualRequestInformation); + } + } + else + { + Assert.IsTrue(actualRequestInformation == null || actualRequestInformation.Count == 0, $"Request Information is not expected in {localCopyOfActualInfo.First().ConnectionMode} mode"); + } + } + + private static void AssertNetworkLevelInformation(List actualRequestInformation) + { + Assert.IsNotNull(actualRequestInformation); + Assert.IsTrue(actualRequestInformation.Count > 0); + + foreach(RequestInfo requestInfo in actualRequestInformation) + { + Assert.IsNotNull(requestInfo.Uri); + Assert.IsNotNull(requestInfo.DatabaseName); + Assert.IsNotNull(requestInfo.ContainerName); + Assert.IsNotNull(requestInfo.Operation); + Assert.IsNotNull(requestInfo.Resource); + Assert.IsNotNull(requestInfo.StatusCode); + Assert.AreNotEqual(0, requestInfo.StatusCode); + Assert.IsNotNull(requestInfo.SubStatusCode); + + Assert.IsNotNull(requestInfo.Metrics, "MetricInfo is null"); + } + } + + private static void AssertSystemLevelInformation(List actualSystemInformation, IDictionary expectedMetricNameUnitMap) + { + IDictionary actualMetricNameUnitMap = new Dictionary(); + + // Asserting If system information list is as expected + foreach (SystemInfo systemInfo in actualSystemInformation) + { + Assert.AreEqual("HostMachine", systemInfo.Resource); + Assert.IsNotNull(systemInfo.MetricInfo, "MetricInfo is null"); + + if(!actualMetricNameUnitMap.TryAdd(systemInfo.MetricInfo.MetricsName, systemInfo.MetricInfo.UnitName)) + { + Assert.AreEqual(systemInfo.MetricInfo.UnitName, actualMetricNameUnitMap[systemInfo.MetricInfo.MetricsName]); + } + + if(!systemInfo.MetricInfo.MetricsName.Equals(ClientTelemetryOptions.IsThreadStarvingName) && + !systemInfo.MetricInfo.MetricsName.Equals(ClientTelemetryOptions.ThreadWaitIntervalInMsName)) + { + Assert.IsTrue(systemInfo.MetricInfo.Count > 0, $"MetricInfo ({systemInfo.MetricInfo.MetricsName}) Count is not greater than 0"); + Assert.IsNotNull(systemInfo.MetricInfo.Percentiles, $"Percentiles is null for metrics ({systemInfo.MetricInfo.MetricsName})"); + } + Assert.IsTrue(systemInfo.MetricInfo.Mean >= 0, $"MetricInfo ({systemInfo.MetricInfo.MetricsName}) Mean is not greater than or equal to 0"); + Assert.IsTrue(systemInfo.MetricInfo.Max >= 0, $"MetricInfo ({systemInfo.MetricInfo.MetricsName}) Max is not greater than or equal to 0"); + Assert.IsTrue(systemInfo.MetricInfo.Min >= 0, $"MetricInfo ({systemInfo.MetricInfo.MetricsName}) Min is not greater than or equal to 0"); + if (systemInfo.MetricInfo.MetricsName.Equals(ClientTelemetryOptions.CpuName)) + { + Assert.IsTrue(systemInfo.MetricInfo.Mean <= 100, $"MetricInfo ({systemInfo.MetricInfo.MetricsName}) Mean is not greater than 100 for CPU Usage"); + Assert.IsTrue(systemInfo.MetricInfo.Max <= 100, $"MetricInfo ({systemInfo.MetricInfo.MetricsName}) Max is not greater than 100 for CPU Usage"); + Assert.IsTrue(systemInfo.MetricInfo.Min <= 100, $"MetricInfo ({systemInfo.MetricInfo.MetricsName}) Min is not greater than 100 for CPU Usage"); + }; + } + + Assert.IsTrue(expectedMetricNameUnitMap.EqualsTo(actualMetricNameUnitMap), $"Actual System Information metric i.e {string.Join(", ", actualMetricNameUnitMap)} is not matching with expected System Information Metric i.e. {string.Join(", ", expectedMetricNameUnitMap)}"); + + } + + private static void AssertOperationLevelInformation( + Microsoft.Azure.Cosmos.ConsistencyLevel? expectedConsistencyLevel, + IDictionary expectedOperationRecordCountMap, + List actualOperationList, + int expectedSubstatuscode = 0) + { + IDictionary actualOperationRecordCountMap = new Dictionary(); + // Asserting If operation list is as expected + foreach (OperationInfo operation in actualOperationList) + { + Assert.IsNotNull(operation.Operation, "Operation Type is null"); + Assert.IsNotNull(operation.Resource, "Resource Type is null"); + + Assert.AreEqual(expectedSubstatuscode, operation.SubStatusCode); + Assert.AreEqual(expectedConsistencyLevel?.ToString(), operation.Consistency, $"Consistency is not {expectedConsistencyLevel}"); + + Assert.IsNotNull(operation.MetricInfo, "MetricInfo is null"); + Assert.IsNotNull(operation.MetricInfo.MetricsName, "MetricsName is null"); + Assert.IsNotNull(operation.MetricInfo.UnitName, "UnitName is null"); + Assert.IsNotNull(operation.MetricInfo.Percentiles, "Percentiles is null"); + Assert.IsTrue(operation.MetricInfo.Count > 0, "MetricInfo Count is not greater than 0"); + Assert.IsTrue(operation.MetricInfo.Mean >= 0, "MetricInfo Mean is not greater than or equal to 0"); + Assert.IsTrue(operation.MetricInfo.Max >= 0, "MetricInfo Max is not greater than or equal to 0"); + Assert.IsTrue(operation.MetricInfo.Min >= 0, "MetricInfo Min is not greater than or equal to 0"); + + if (operation.MetricInfo.MetricsName.Equals(ClientTelemetryOptions.RequestLatencyName)) // putting this condition to avoid doubling of count as we have same information for each metrics + { + if (!actualOperationRecordCountMap.TryGetValue(operation.Operation, out long recordCount)) + { + actualOperationRecordCountMap.Add(operation.Operation, operation.MetricInfo.Count); + } + else + { + actualOperationRecordCountMap.Remove(operation.Operation); + actualOperationRecordCountMap.Add(operation.Operation, recordCount + operation.MetricInfo.Count); + } + } + } + + if (expectedOperationRecordCountMap != null) + { + Assert.IsTrue(expectedOperationRecordCountMap.EqualsTo(actualOperationRecordCountMap), $"actual record i.e. ({string.Join(", ", actualOperationRecordCountMap)}) for operation does not match with expected record i.e. ({string.Join(", ", expectedOperationRecordCountMap)})"); + } + } + + private static void AssertAccountLevelInformation( + List localCopyOfActualInfo, + List actualOperationList, + List actualSystemInformation, + List actualRequestInformation, + bool? isAzureInstance) + { + ISet machineId = new HashSet(); + + // Asserting If basic client telemetry object is as expected + foreach (ClientTelemetryProperties telemetryInfo in localCopyOfActualInfo) + { + if (telemetryInfo.OperationInfo != null) + { + actualOperationList.AddRange(telemetryInfo.OperationInfo); + } + + if (telemetryInfo.SystemInfo != null) + { + foreach (SystemInfo sysInfo in telemetryInfo.SystemInfo) + { + actualSystemInformation.Add(sysInfo); + } + } + + if (telemetryInfo.RequestInfo != null) + { + actualRequestInformation.AddRange(telemetryInfo.RequestInfo); + } + + if (telemetryInfo.ConnectionMode == ConnectionMode.Direct.ToString().ToUpperInvariant()) + { + Assert.AreEqual(6, telemetryInfo.SystemInfo.Count, $"System Information Count doesn't Match; {JsonConvert.SerializeObject(telemetryInfo.SystemInfo)}"); + } + else + { + Assert.AreEqual(5, telemetryInfo.SystemInfo.Count, $"System Information Count doesn't Match; {JsonConvert.SerializeObject(telemetryInfo.SystemInfo)}"); + } + + Assert.IsNotNull(telemetryInfo.GlobalDatabaseAccountName, "GlobalDatabaseAccountName is null"); + Assert.IsNotNull(telemetryInfo.DateTimeUtc, "Timestamp is null"); + Assert.AreEqual(2, telemetryInfo.PreferredRegions.Count); + Assert.AreEqual(Regions.EastUS, telemetryInfo.PreferredRegions[0]); + Assert.AreEqual(Regions.WestUS2, telemetryInfo.PreferredRegions[1]); + Assert.AreEqual(1, telemetryInfo.AggregationIntervalInSec); + Assert.IsNull(telemetryInfo.AcceleratedNetworking); + Assert.IsNotNull(telemetryInfo.ClientId); + Assert.IsNotNull(telemetryInfo.ProcessId); + Assert.AreEqual(HashingExtension.ComputeHash(System.Diagnostics.Process.GetCurrentProcess().ProcessName), telemetryInfo.ProcessId); + Assert.IsNotNull(telemetryInfo.UserAgent); + Assert.IsFalse(telemetryInfo.UserAgent.Contains("userAgentSuffix"), "Useragent should not have suffix appended"); // Useragent should not contain useragentsuffix as it can have PII + Assert.IsNotNull(telemetryInfo.ConnectionMode); + + if (!string.IsNullOrEmpty(telemetryInfo.MachineId)) + { + machineId.Add(telemetryInfo.MachineId); + } + } + + if (isAzureInstance.HasValue) + { + if (isAzureInstance.Value) + { + Assert.IsTrue(machineId.First().StartsWith(VmMetadataApiHandler.VmIdPrefix), $"Generated Machine id is : {machineId.First()}"); + } + else + { + Assert.IsTrue(machineId.First().StartsWith(VmMetadataApiHandler.HashedMachineNamePrefix), $"Generated Machine id is : {machineId.First()}"); + } + } + + Assert.AreEqual(1, machineId.Count, $"Multiple Machine Id has been generated i.e {JsonConvert.SerializeObject(machineId)}"); + } + + private static void AssertCacheRefreshInfoInformation( + HashSet cacheRefreshInfoSet, + string expectedCacheSource) + { + foreach(CacheRefreshInfo cacheRefreshInfo in cacheRefreshInfoSet) + { + Assert.IsNotNull(cacheRefreshInfo.CacheRefreshSource); + Assert.IsTrue(expectedCacheSource.Contains(cacheRefreshInfo.CacheRefreshSource)); + Assert.IsNotNull(cacheRefreshInfo.Operation, "Operation Type is null"); + Assert.IsNotNull(cacheRefreshInfo.Resource, "Resource Type is null"); + Assert.IsNotNull(cacheRefreshInfo.StatusCode, "StatusCode is null"); + Assert.IsNotNull(cacheRefreshInfo.SubStatusCode); + Assert.IsNull(cacheRefreshInfo.Consistency); + Assert.IsNotNull(cacheRefreshInfo.ContainerName, "ContainerName is null"); + Assert.IsNotNull(cacheRefreshInfo.MetricInfo, "MetricInfo is null"); + Assert.IsNotNull(cacheRefreshInfo.MetricInfo.MetricsName, "MetricsName is null"); + Assert.IsNotNull(cacheRefreshInfo.MetricInfo.UnitName, "UnitName is null"); + Assert.IsNotNull(cacheRefreshInfo.MetricInfo.Percentiles, "Percentiles is null"); + Assert.IsTrue(cacheRefreshInfo.MetricInfo.Count >= 0, "MetricInfo Count is not greater than 0"); + Assert.IsTrue(cacheRefreshInfo.MetricInfo.Mean >= 0, "MetricInfo Mean is not greater than or equal to 0"); + Assert.IsTrue(cacheRefreshInfo.MetricInfo.Max >= 0, "MetricInfo Max is not greater than or equal to 0"); + Assert.IsTrue(cacheRefreshInfo.MetricInfo.Min >= 0, "MetricInfo Min is not greater than or equal to 0"); + } + } + + private static ItemBatchOperation CreateItem(string itemId) + { + var testItem = new { id = itemId, Status = itemId }; + return new ItemBatchOperation(Documents.OperationType.Create, 0, new Cosmos.PartitionKey(itemId), itemId, TestCommon.SerializerCore.ToStream(testItem)); + } + + private async Task CreateClientAndContainer(ConnectionMode mode, + Microsoft.Azure.Cosmos.ConsistencyLevel? consistency = null, + bool isLargeContainer = false, + bool isAzureInstance = true, + HttpClientHandlerHelper customHttpHandler = null) + { + if (consistency.HasValue) + { + this.cosmosClientBuilder = this.cosmosClientBuilder + .WithConsistencyLevel(consistency.Value); + } + + HttpClientHandlerHelper handlerHelper = customHttpHandler ?? (isAzureInstance ? this.httpHandler : this.httpHandlerForNonAzureInstance); + this.cosmosClientBuilder = this.cosmosClientBuilder + .WithHttpClientFactory(() => new HttpClient(handlerHelper)) + .WithApplicationName("userAgentSuffix"); + + this.SetClient(mode == ConnectionMode.Gateway + ? this.cosmosClientBuilder.WithConnectionModeGateway().Build() + : this.cosmosClientBuilder.Build()); + + // Making sure client telemetry is enabled + Assert.IsNotNull(this.GetClient().DocumentClient.clientTelemetry); + + this.database = await this.GetClient().CreateDatabaseAsync(Guid.NewGuid().ToString()); + + return await this.database.CreateContainerAsync( + id: Guid.NewGuid().ToString(), + partitionKeyPath: "/id", + throughput: isLargeContainer? 15000 : 400); + + } + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/HttpHandlerHelper.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/HttpHandlerHelper.cs index cedef0658a..9b78eb573c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/HttpHandlerHelper.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/HttpHandlerHelper.cs @@ -19,6 +19,8 @@ public HttpClientHandlerHelper() : base(new HttpClientHandler()) public Func> ResponseIntercepter { get; set; } + public Action ExceptionIntercepter { get; set; } + protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { HttpResponseMessage httpResponse = null; @@ -39,7 +41,19 @@ protected override async Task SendAsync(HttpRequestMessage } } - httpResponse = await base.SendAsync(request, cancellationToken); + try + { + httpResponse = await base.SendAsync(request, cancellationToken); + } + catch (Exception ex) { + + if (this.ExceptionIntercepter == null) + { + throw; + } + this.ExceptionIntercepter.Invoke(request, ex); + } + if (this.ResponseIntercepter != null) { httpResponse = await this.ResponseIntercepter(httpResponse); diff --git a/azure-pipelines-official.yml b/azure-pipelines-official.yml index 510bf5f6f8..81cd3d3d91 100644 --- a/azure-pipelines-official.yml +++ b/azure-pipelines-official.yml @@ -7,6 +7,8 @@ variables: VmImage: windows-latest # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops BuildConfiguration: Release Packaging.EnableSBOMSigning: true + ReleasePackage: true + OS: 'Windows' stages: - stage: @@ -22,14 +24,45 @@ stages: BuildConfiguration: $(BuildConfiguration) Arguments: $(ReleaseArguments) VmImage: $(VmImage) + + - job: + displayName: TelemetryToService $(BuildConfiguration) + timeoutInMinutes: 120 + condition: and(succeeded(), eq('$(OS)', 'Windows')) + pool: + vmImage: windows-2019 + + steps: + - checkout: self # self represents the repo where the initial Pipelines YAML file was found + clean: true # if true, execute `execute git clean -ffdx && git reset --hard HEAD` before fetching + + # Add this Command to Include the .NET 6 SDK + - task: UseDotNet@2 + displayName: Use .NET 6.0 + inputs: + packageType: 'sdk' + version: '6.x' + + - task: DotNetCoreCLI@2 + displayName: Integration Test With Client Telemetry Service + condition: succeeded() + inputs: + command: test + projects: 'Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/*.csproj' + arguments: --filter "TestCategory=ClientTelemetryRelease" --verbosity normal --configuration $(BuildConfiguration) /p:OS=$(OS) + nugetConfigPath: NuGet.config + publishTestResults: true + testRunTitle: Microsoft.Azure.Cosmos.EmulatorTests + env: + COSMOSDB_ACCOUNT_CONNECTION_STRING: $(COSMOSDB_ACCOUNT_CONNECTION_STRING) # Real Account Connection String used by Integration Tests while running as part of release pipeline - stage: displayName: Publish jobs: - template: templates/nuget-pack.yml parameters: - BuildConfiguration: Release + BuildConfiguration: $(BuildConfiguration) VmImage: $(VmImage) - ReleasePackage: true + ReleasePackage: $(ReleasePackage) OutputPath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/$(BuildConfiguration)/Microsoft.Azure.Cosmos' BlobVersion: $(BlobVersion) \ No newline at end of file diff --git a/templates/build-test.yml b/templates/build-test.yml index 3a016080e1..8d22aeb758 100644 --- a/templates/build-test.yml +++ b/templates/build-test.yml @@ -5,9 +5,9 @@ parameters: Arguments: '' VmImage: '' # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops OS: 'Windows' - EmulatorPipeline1Arguments: ' --filter "TestCategory!=Quarantine & TestCategory!=Functional & (TestCategory=Query|TestCategory=ReadFeed|TestCategory=Batch|TestCategory=ChangeFeed)" --verbosity normal ' - EmulatorPipeline2Arguments: ' --filter "TestCategory!=Quarantine & TestCategory!=Functional & TestCategory!=Query & TestCategory!=ReadFeed & TestCategory!=Batch & TestCategory!=ChangeFeed" --verbosity normal ' - EmulatorPipeline1CategoryListName: ' Query, ChangeFeed, ReadFeed, Batch ' # Divided in 2 categories to run them in parallel and reduce the PR feedback time + EmulatorPipeline1Arguments: ' --filter "TestCategory!=Quarantine & TestCategory!=Functional & TestCategory!=ClientTelemetryRelease & (TestCategory=ClientTelemetryEmulator|TestCategory=Query|TestCategory=ReadFeed|TestCategory=Batch|TestCategory=ChangeFeed)" --verbosity normal ' + EmulatorPipeline2Arguments: ' --filter "TestCategory!=Quarantine & TestCategory!=Functional & TestCategory!=ClientTelemetryRelease & TestCategory!=ClientTelemetryEmulator & TestCategory!=Query & TestCategory!=ReadFeed & TestCategory!=Batch & TestCategory!=ChangeFeed" --verbosity normal ' + EmulatorPipeline1CategoryListName: ' Client Telemetry, Query, ChangeFeed, ReadFeed, Batch ' # Divided in 2 categories to run them in parallel and reduce the PR feedback time EmulatorPipeline2CategoryListName: ' Others ' jobs: From e2311a9fdcca392ec7d49c13939aaff3404deb85 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 22 Aug 2023 22:55:01 +0530 Subject: [PATCH 179/240] [Internal] Client Telemetry: Refactors code for collectors (#4037) * refactored code * implemented review comments * test fix * fix tests * fix test * fix test * logger fix * update contract * fic test * updated benchmarks --- Microsoft.Azure.Cosmos/src/DocumentClient.cs | 67 +- .../src/Fluent/CosmosClientBuilder.cs | 1 - .../src/Handler/ClientPipelineBuilder.cs | 9 +- .../src/Handler/TelemetryHandler.cs | 38 +- .../src/Resource/ClientContextCore.cs | 4 +- .../src/Routing/ClientCollectionCache.cs | 42 +- .../src/Telemetry/ClientTelemetry.cs | 143 +-- .../Collector/ITelemetryCollector.cs | 25 + .../Telemetry/Collector/TelemetryCollector.cs | 77 ++ .../Collector/TelemetryCollectorNoOp.cs | 21 + .../Collector/TelemetryInformation.cs | 30 + .../src/Telemetry/TelemetryToServiceHelper.cs | 134 ++ .../src/Telemetry/VmMetadataApiHandler.cs | 6 +- ...iterBaselineTests.BatchOperationsAsync.xml | 37 +- ...riterBaselineTests.BulkOperationsAsync.xml | 974 ++++++++------- ...aceWriterBaselineTests.ChangeFeedAsync.xml | 888 ++++++++------ ...eWriterBaselineTests.MiscellanousAsync.xml | 86 +- ...neTests.PointOperationsExceptionsAsync.xml | 716 ++++++----- ...EndTraceWriterBaselineTests.QueryAsync.xml | 1079 ++++++++++------- ...TraceWriterBaselineTests.ReadFeedAsync.xml | 592 +++++---- ...TraceWriterBaselineTests.ReadManyAsync.xml | 222 ++-- ...selineTests.StreamPointOperationsAsync.xml | 148 ++- ...aselineTests.TypedPointOperationsAsync.xml | 148 ++- .../ClientTelemetryTestsBase.cs | 2 +- .../Contracts/BenchmarkResults.json | 2 +- .../Mocks/MockDocumentClient.cs | 33 +- .../HandlerTests.cs | 24 +- .../Utils/MockCosmosUtil.cs | 15 +- .../Utils/MockDocumentClient.cs | 17 +- 29 files changed, 3280 insertions(+), 2300 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/src/Telemetry/Collector/ITelemetryCollector.cs create mode 100644 Microsoft.Azure.Cosmos/src/Telemetry/Collector/TelemetryCollector.cs create mode 100644 Microsoft.Azure.Cosmos/src/Telemetry/Collector/TelemetryCollectorNoOp.cs create mode 100644 Microsoft.Azure.Cosmos/src/Telemetry/Collector/TelemetryInformation.cs create mode 100644 Microsoft.Azure.Cosmos/src/Telemetry/TelemetryToServiceHelper.cs diff --git a/Microsoft.Azure.Cosmos/src/DocumentClient.cs b/Microsoft.Azure.Cosmos/src/DocumentClient.cs index c7aeb07a6f..9dee309028 100644 --- a/Microsoft.Azure.Cosmos/src/DocumentClient.cs +++ b/Microsoft.Azure.Cosmos/src/DocumentClient.cs @@ -142,7 +142,8 @@ internal partial class DocumentClient : IDisposable, IAuthorizationTokenProvider private Documents.ConsistencyLevel? desiredConsistencyLevel; internal CosmosAccountServiceConfiguration accountServiceConfiguration { get; private set; } - internal ClientTelemetry clientTelemetry { get; set; } + + internal TelemetryToServiceHelper telemetryToServiceHelper { get; set; } private ClientCollectionCache collectionCache; @@ -564,11 +565,11 @@ public DocumentClient(Uri serviceEndpoint, /// /// Internal constructor purely for unit-testing /// - internal DocumentClient(Uri serviceEndpoint, string authKey) + internal DocumentClient(Uri serviceEndpoint, ConnectionPolicy connectionPolicy) { // do nothing this.ServiceEndpoint = serviceEndpoint; - this.ConnectionPolicy = new ConnectionPolicy(); + this.ConnectionPolicy = connectionPolicy ?? new ConnectionPolicy(); } internal virtual async Task GetCollectionCacheAsync(ITrace trace) @@ -660,7 +661,7 @@ private async Task OpenPrivateAsync(CancellationToken cancellationToken) storeModel: this.GatewayStoreModel, tokenProvider: this, retryPolicy: this.retryPolicy, - clientTelemetry: this.clientTelemetry); + telemetryToServiceHelper: this.telemetryToServiceHelper); this.partitionKeyRangeCache = new PartitionKeyRangeCache(this, this.GatewayStoreModel, this.collectionCache); DefaultTrace.TraceWarning("{0} occurred while OpenAsync. Exception Message: {1}", ex.ToString(), ex.Message); @@ -939,6 +940,15 @@ internal virtual void Initialize(Uri serviceEndpoint, // Loading VM Information (non blocking call and initialization won't fail if this call fails) VmMetadataApiHandler.TryInitialize(this.httpClient); + // Starting ClientTelemetry Job + this.telemetryToServiceHelper = TelemetryToServiceHelper.CreateAndInitializeClientConfigAndTelemetryJob(this.clientId, + this.ConnectionPolicy, + this.cosmosAuthorization, + this.httpClient, + this.ServiceEndpoint, + this.GlobalEndpointManager, + this.cancellationTokenSource); + if (sessionContainer != null) { this.sessionContainer = sessionContainer; @@ -961,12 +971,6 @@ internal virtual void Initialize(Uri serviceEndpoint, // For direct: WFStoreProxy [set in OpenAsync()]. this.eventSource = DocumentClientEventSource.Instance; - // Disable system usage for internal builds. Cosmos DB owns the VMs and already logs - // the system information so no need to track it. -#if !INTERNAL - this.InitializeClientTelemetry(); -#endif - this.initializeTaskFactory = (_) => TaskHelper.InlineIfPossible( () => this.GetInitializationTaskAsync(storeClientFactory: storeClientFactory), new ResourceThrottleRetryPolicy( @@ -1028,7 +1032,7 @@ private async Task GetInitializationTaskAsync(IStoreClientFactory storeCli storeModel: this.GatewayStoreModel, tokenProvider: this, retryPolicy: this.retryPolicy, - clientTelemetry: this.clientTelemetry); + telemetryToServiceHelper: this.telemetryToServiceHelper); this.partitionKeyRangeCache = new PartitionKeyRangeCache(this, this.GatewayStoreModel, this.collectionCache); this.ResetSessionTokenRetryPolicy = new ResetSessionTokenRetryPolicyFactory(this.sessionContainer, this.collectionCache, this.retryPolicy); @@ -1046,36 +1050,6 @@ private async Task GetInitializationTaskAsync(IStoreClientFactory storeCli return true; } - private void InitializeClientTelemetry() - { - if (this.ConnectionPolicy.EnableClientTelemetry) - { - try - { - this.clientTelemetry = ClientTelemetry.CreateAndStartBackgroundTelemetry( - clientId: this.clientId, - httpClient: this.httpClient, - userAgent: this.ConnectionPolicy.UserAgentContainer.BaseUserAgent, - connectionMode: this.ConnectionPolicy.ConnectionMode, - authorizationTokenProvider: this.cosmosAuthorization, - diagnosticsHelper: DiagnosticsHandlerHelper.Instance, - preferredRegions: this.ConnectionPolicy.PreferredLocations, - globalEndpointManager: this.GlobalEndpointManager); - - DefaultTrace.TraceInformation("Client Telemetry Enabled."); - } - catch (Exception ex) - { - DefaultTrace.TraceInformation($"Error While starting Telemetry Job : {ex.Message}. Hence disabling Client Telemetry"); - this.ConnectionPolicy.EnableClientTelemetry = false; - } - } - else - { - DefaultTrace.TraceInformation("Client Telemetry Disabled."); - } - } - private async Task InitializeCachesAsync(string databaseName, DocumentCollection collection, CancellationToken cancellationToken) { if (databaseName == null) @@ -1279,6 +1253,12 @@ public void Dispose() return; } + if (this.telemetryToServiceHelper != null) + { + this.telemetryToServiceHelper.Dispose(); + this.telemetryToServiceHelper = null; + } + if (!this.cancellationTokenSource.IsCancellationRequested) { this.cancellationTokenSource.Cancel(); @@ -1346,11 +1326,6 @@ public void Dispose() this.initTaskCache = null; } - if (this.clientTelemetry != null) - { - this.clientTelemetry.Dispose(); - } - DefaultTrace.TraceInformation("DocumentClient with id {0} disposed.", this.traceId); DefaultTrace.Flush(); diff --git a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs index 9c8c2fbb4e..bf04d103bb 100644 --- a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs +++ b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs @@ -15,7 +15,6 @@ namespace Microsoft.Azure.Cosmos.Fluent using Microsoft.Azure.Cosmos.Core.Trace; using Microsoft.Azure.Documents; using Microsoft.Azure.Documents.Client; - using Telemetry; /// /// This is a Builder class that creates a cosmos client diff --git a/Microsoft.Azure.Cosmos/src/Handler/ClientPipelineBuilder.cs b/Microsoft.Azure.Cosmos/src/Handler/ClientPipelineBuilder.cs index d4c260f904..aa69b770e1 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/ClientPipelineBuilder.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/ClientPipelineBuilder.cs @@ -27,7 +27,7 @@ public ClientPipelineBuilder( CosmosClient client, ConsistencyLevel? requestedClientConsistencyLevel, IReadOnlyCollection customHandlers, - ClientTelemetry telemetry) + TelemetryToServiceHelper telemetryToServiceHelper) { this.client = client ?? throw new ArgumentNullException(nameof(client)); this.requestedClientConsistencyLevel = requestedClientConsistencyLevel; @@ -48,11 +48,8 @@ public ClientPipelineBuilder( #else this.diagnosticsHandler = null; #endif - if (telemetry != null) - { - this.telemetryHandler = new TelemetryHandler(telemetry); - Debug.Assert(this.telemetryHandler.InnerHandler == null, nameof(this.telemetryHandler)); - } + this.telemetryHandler = new TelemetryHandler(telemetryToServiceHelper); + Debug.Assert(this.telemetryHandler.InnerHandler == null, nameof(this.telemetryHandler)); this.UseRetryPolicy(); this.AddCustomHandlers(customHandlers); diff --git a/Microsoft.Azure.Cosmos/src/Handler/TelemetryHandler.cs b/Microsoft.Azure.Cosmos/src/Handler/TelemetryHandler.cs index 9d7e504eba..039373718f 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/TelemetryHandler.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/TelemetryHandler.cs @@ -10,14 +10,15 @@ namespace Microsoft.Azure.Cosmos.Handlers using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Core.Trace; using Microsoft.Azure.Cosmos.Telemetry; + using Microsoft.Azure.Cosmos.Telemetry.Collector; internal class TelemetryHandler : RequestHandler { - private readonly ClientTelemetry telemetry; + private readonly TelemetryToServiceHelper telemetryToServiceHelper; - public TelemetryHandler(ClientTelemetry telemetry) + public TelemetryHandler(TelemetryToServiceHelper telemetryToServiceHelper) { - this.telemetry = telemetry ?? throw new ArgumentNullException(nameof(telemetry)); + this.telemetryToServiceHelper = telemetryToServiceHelper ?? throw new ArgumentNullException(nameof(telemetryToServiceHelper)); } public override async Task SendAsync( @@ -29,19 +30,22 @@ public override async Task SendAsync( { try { - this.telemetry - .CollectOperationInfo( - cosmosDiagnostics: response.Diagnostics, - statusCode: response.StatusCode, - responseSizeInBytes: this.GetPayloadSize(response), - containerId: request.ContainerId, - databaseId: request.DatabaseId, - operationType: request.OperationType, - resourceType: request.ResourceType, - consistencyLevel: request.Headers?[Documents.HttpConstants.HttpHeaders.ConsistencyLevel], - requestCharge: response.Headers.RequestCharge, - subStatusCode: response.Headers.SubStatusCode, - trace: response.Trace); + this.telemetryToServiceHelper.GetCollector().CollectOperationAndNetworkInfo( + () => new TelemetryInformation + { + RegionsContactedList = response.Diagnostics.GetContactedRegions(), + RequestLatency = response.Diagnostics.GetClientElapsedTime(), + StatusCode = response.StatusCode, + ResponseSizeInBytes = TelemetryHandler.GetPayloadSize(response), + ContainerId = request.ContainerId, + DatabaseId = request.DatabaseId, + OperationType = request.OperationType, + ResourceType = request.ResourceType, + ConsistencyLevel = request.Headers?[Documents.HttpConstants.HttpHeaders.ConsistencyLevel], + RequestCharge = response.Headers.RequestCharge, + SubStatusCode = response.Headers.SubStatusCode, + Trace = response.Trace + }); } catch (Exception ex) { @@ -63,7 +67,7 @@ private bool IsAllowed(RequestMessage request) /// /// /// Size of Payload - private long GetPayloadSize(ResponseMessage response) + private static long GetPayloadSize(ResponseMessage response) { if (response != null) { diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index 42e128ac2e..a128e178d0 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -13,8 +13,6 @@ namespace Microsoft.Azure.Cosmos using System.Text; using System.Threading; using System.Threading.Tasks; - using Microsoft.Azure.Cosmos.Core.Trace; - using Microsoft.Azure.Cosmos.Handler; using Microsoft.Azure.Cosmos.Handlers; using Microsoft.Azure.Cosmos.Resource.CosmosExceptions; using Microsoft.Azure.Cosmos.Routing; @@ -122,7 +120,7 @@ internal static CosmosClientContext Create( cosmosClient, clientOptions.ConsistencyLevel, clientOptions.CustomHandlers, - telemetry: documentClient.clientTelemetry); + telemetryToServiceHelper: documentClient.telemetryToServiceHelper); requestInvokerHandler = clientPipelineBuilder.Build(); } diff --git a/Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs b/Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs index 530bbfceb5..534a0b8a22 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/ClientCollectionCache.cs @@ -9,6 +9,7 @@ namespace Microsoft.Azure.Cosmos.Routing using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Common; using Microsoft.Azure.Cosmos.Telemetry; + using Microsoft.Azure.Cosmos.Telemetry.Collector; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; using Microsoft.Azure.Documents; @@ -25,20 +26,20 @@ internal class ClientCollectionCache : CollectionCache private readonly ICosmosAuthorizationTokenProvider tokenProvider; private readonly IRetryPolicyFactory retryPolicy; private readonly ISessionContainer sessionContainer; - private readonly ClientTelemetry clientTelemetry; + private readonly TelemetryToServiceHelper telemetryToServiceHelper; public ClientCollectionCache( ISessionContainer sessionContainer, IStoreModel storeModel, ICosmosAuthorizationTokenProvider tokenProvider, IRetryPolicyFactory retryPolicy, - ClientTelemetry clientTelemetry) + TelemetryToServiceHelper telemetryToServiceHelper) { this.storeModel = storeModel ?? throw new ArgumentNullException("storeModel"); this.tokenProvider = tokenProvider; this.retryPolicy = retryPolicy; this.sessionContainer = sessionContainer; - this.clientTelemetry = clientTelemetry; + this.telemetryToServiceHelper = telemetryToServiceHelper; } protected override Task GetByRidAsync(string apiVersion, @@ -214,21 +215,19 @@ private async Task ReadCollectionAsync( await this.storeModel.ProcessMessageAsync(request)) { ContainerProperties containerProperties = CosmosResource.FromStream(response); - - if (this.clientTelemetry != null) - { - ClientCollectionCache.GetDatabaseAndCollectionName(collectionLink, out string databaseName, out string collectionName); - this.clientTelemetry.CollectCacheInfo( - cacheRefreshSource: ClientCollectionCache.TelemetrySourceName, - regionsContactedList: response.RequestStats.RegionsContacted, - requestLatency: response.RequestStats.RequestLatency, - statusCode: response.StatusCode, - containerId: collectionName, - operationType: request.OperationType, - resourceType: request.ResourceType, - subStatusCode: response.SubStatusCode, - databaseId: databaseName); - } + + this.telemetryToServiceHelper.GetCollector().CollectCacheInfo( + ClientCollectionCache.TelemetrySourceName, + () => new TelemetryInformation + { + RegionsContactedList = response.RequestStats.RegionsContacted, + RequestLatency = response.RequestStats.RequestLatency, + StatusCode = response.StatusCode, + OperationType = request.OperationType, + ResourceType = request.ResourceType, + SubStatusCode = response.SubStatusCode, + CollectionLink = collectionLink + }); return containerProperties; } @@ -242,12 +241,5 @@ await this.storeModel.ProcessMessageAsync(request)) } } } - - private static void GetDatabaseAndCollectionName(string path, out string databaseName, out string collectionName) - { - string[] segments = path.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); - - PathsHelper.ParseDatabaseNameAndCollectionNameFromUrlSegments(segments, out databaseName, out collectionName); - } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs index dde7d5a7c5..2dfcbab496 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs @@ -7,18 +7,16 @@ namespace Microsoft.Azure.Cosmos.Telemetry using System; using System.Collections.Concurrent; using System.Collections.Generic; - using System.Net; using System.Threading; using System.Threading.Tasks; using Handler; using HdrHistogram; using Microsoft.Azure.Cosmos.Core.Trace; using Microsoft.Azure.Cosmos.Routing; + using Microsoft.Azure.Cosmos.Telemetry.Collector; using Microsoft.Azure.Cosmos.Telemetry.Models; - using Microsoft.Azure.Cosmos.Tracing; - using Microsoft.Azure.Cosmos.Tracing.TraceData; - using Microsoft.Azure.Documents; using Util; + using static Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum; /// /// This class collects and send all the telemetry information. @@ -215,9 +213,9 @@ internal static async Task RunProcessorTaskAsync(string telemetryDate, Task proc Task resultTask = await Task.WhenAny(processingTask, delayTask); if (resultTask == delayTask) { - DefaultTrace.TraceVerbose($"Processor task with date as {telemetryDate} is canceled as it did not finish in {timeout}"); + DefaultTrace.TraceVerbose($"Processor task with date as {0} is canceled as it did not finish in {1}", telemetryDate, timeout); // Operation cancelled - throw new OperationCanceledException($"Processor task with date as {telemetryDate} is canceled as it did not finish in {timeout}"); + throw new OperationCanceledException(string.Format($"Processor task with date as {0} is canceled as it did not finish in {1}", telemetryDate, timeout)); } else { @@ -230,38 +228,36 @@ internal static async Task RunProcessorTaskAsync(string telemetryDate, Task proc /// /// Collects Cache Telemetry Information. /// - internal void CollectCacheInfo(string cacheRefreshSource, - HashSet<(string regionName, Uri uri)> regionsContactedList, - TimeSpan? requestLatency, - HttpStatusCode statusCode, - string containerId, - OperationType operationType, - ResourceType resourceType, - SubStatusCodes subStatusCode, - string databaseId, - long responseSizeInBytes = 0, - string consistencyLevel = null ) + internal void PushCacheDatapoint(string cacheName, TelemetryInformation data) { - if (string.IsNullOrEmpty(cacheRefreshSource)) + if (string.IsNullOrEmpty(cacheName)) { - throw new ArgumentNullException(nameof(cacheRefreshSource)); + throw new ArgumentNullException(nameof(cacheName)); } - DefaultTrace.TraceVerbose($"Collecting cacheRefreshSource {0} data for Telemetry.", cacheRefreshSource); + // If latency information is not available. Ignore this datapoint. It is not expected but putting this safety check + if (!data.RequestLatency.HasValue) + { + DefaultTrace.TraceWarning($"Latency data point is not available for {0} cache call", cacheName); + + return; + } + + DefaultTrace.TraceVerbose($"Collecting cacheRefreshSource {0} data for Telemetry.", cacheName); - string regionsContacted = ClientTelemetryHelper.GetContactedRegions(regionsContactedList); + string regionsContacted = ClientTelemetryHelper.GetContactedRegions(data.RegionsContactedList); // Recording Request Latency - CacheRefreshInfo payloadKey = new CacheRefreshInfo(cacheRefreshSource: cacheRefreshSource, + CacheRefreshInfo payloadKey = new CacheRefreshInfo(cacheRefreshSource: cacheName, regionsContacted: regionsContacted?.ToString(), - responseSizeInBytes: responseSizeInBytes, - consistency: consistencyLevel, - databaseName: databaseId, - containerName: containerId, - operation: operationType, - resource: resourceType, - statusCode: (int)statusCode, - subStatusCode: (int)subStatusCode); + responseSizeInBytes: data.ResponseSizeInBytes, + consistency: data.ConsistencyLevel, + databaseName: data.DatabaseId, + containerName: data.ContainerId, + operation: data.OperationType, + resource: data.ResourceType, + statusCode: (int)data.StatusCode, + subStatusCode: (int)data.SubStatusCode); LongConcurrentHistogram latency = this.cacheRefreshInfoMap .GetOrAdd(payloadKey, new LongConcurrentHistogram(ClientTelemetryOptions.RequestLatencyMin, @@ -269,7 +265,7 @@ internal void CollectCacheInfo(string cacheRefreshSource, ClientTelemetryOptions.RequestLatencyPrecision)); try { - latency.RecordValue(requestLatency.Value.Ticks); + latency.RecordValue(data.RequestLatency.Value.Ticks); } catch (Exception ex) { @@ -280,52 +276,22 @@ internal void CollectCacheInfo(string cacheRefreshSource, /// /// Collects Telemetry Information. /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - internal void CollectOperationInfo(CosmosDiagnostics cosmosDiagnostics, - HttpStatusCode statusCode, - long responseSizeInBytes, - string containerId, - string databaseId, - OperationType operationType, - ResourceType resourceType, - string consistencyLevel, - double requestCharge, - SubStatusCodes subStatusCode, - ITrace trace) + internal void PushOperationDatapoint(TelemetryInformation data) { DefaultTrace.TraceVerbose("Collecting Operation data for Telemetry."); - if (cosmosDiagnostics == null) - { - throw new ArgumentNullException(nameof(cosmosDiagnostics)); - } - - // Record Network/Replica Information - SummaryDiagnostics summaryDiagnostics = new SummaryDiagnostics(trace); - this.networkDataRecorder.Record(summaryDiagnostics.StoreResponseStatistics.Value, databaseId, containerId); - - string regionsContacted = ClientTelemetryHelper.GetContactedRegions(cosmosDiagnostics.GetContactedRegions()); + string regionsContacted = ClientTelemetryHelper.GetContactedRegions(data.RegionsContactedList); // Recording Request Latency and Request Charge OperationInfo payloadKey = new OperationInfo(regionsContacted: regionsContacted?.ToString(), - responseSizeInBytes: responseSizeInBytes, - consistency: consistencyLevel, - databaseName: databaseId, - containerName: containerId, - operation: operationType, - resource: resourceType, - statusCode: (int)statusCode, - subStatusCode: (int)subStatusCode); + responseSizeInBytes: data.ResponseSizeInBytes, + consistency: data.ConsistencyLevel, + databaseName: data.DatabaseId, + containerName: data.ContainerId, + operation: data.OperationType, + resource: data.ResourceType, + statusCode: (int)data.StatusCode, + subStatusCode: (int)data.SubStatusCode); (LongConcurrentHistogram latency, LongConcurrentHistogram requestcharge) = this.operationInfoMap .GetOrAdd(payloadKey, x => (latency: new LongConcurrentHistogram(ClientTelemetryOptions.RequestLatencyMin, @@ -334,16 +300,26 @@ internal void CollectOperationInfo(CosmosDiagnostics cosmosDiagnostics, requestcharge: new LongConcurrentHistogram(ClientTelemetryOptions.RequestChargeMin, ClientTelemetryOptions.RequestChargeMax, ClientTelemetryOptions.RequestChargePrecision))); - try + + // If latency information is not available. Ignore this datapoint. It is not expected but putting this safety check + if (data.RequestLatency.HasValue) { - latency.RecordValue(cosmosDiagnostics.GetClientElapsedTime().Ticks); + try + { + latency.RecordValue(data.RequestLatency.Value.Ticks); + } + catch (Exception ex) + { + DefaultTrace.TraceError("Latency Recording Failed by Telemetry. Exception : {0}", ex); + } + } - catch (Exception ex) + else { - DefaultTrace.TraceError("Latency Recording Failed by Telemetry. Exception : {0}", ex); + DefaultTrace.TraceWarning($"Latency data point is not available for an operation"); } - - long requestChargeToRecord = (long)(requestCharge * ClientTelemetryOptions.HistogramPrecisionFactor); + + long requestChargeToRecord = (long)(data.RequestCharge * ClientTelemetryOptions.HistogramPrecisionFactor); try { requestcharge.RecordValue(requestChargeToRecord); @@ -354,6 +330,19 @@ internal void CollectOperationInfo(CosmosDiagnostics cosmosDiagnostics, } } + /// + /// Record Network Request Telemetry Information + /// + /// + /// + /// + public void PushNetworkDataPoint(List storeResponseStatistics, string databaseId, string containerId) + { + // Record Network/Replica Information + this.networkDataRecorder.Record(storeResponseStatistics, databaseId, containerId); + + } + /// /// Dispose of cosmos client.It will get disposed with client so not making it thread safe. /// diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/Collector/ITelemetryCollector.cs b/Microsoft.Azure.Cosmos/src/Telemetry/Collector/ITelemetryCollector.cs new file mode 100644 index 0000000000..aef7a5efc4 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Telemetry/Collector/ITelemetryCollector.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Telemetry +{ + using System; + using Microsoft.Azure.Cosmos.Telemetry.Collector; + + internal interface ITelemetryCollector + { + /// + /// Collect information required to collect the telemetry information for the cache. + /// + /// Cache Name + /// delegate that encapsulates a method that returns a CacheTelemetryInformation object + public void CollectCacheInfo(string cacheName, Func functionFordata); + + /// + /// Collect information required to collect the telemetry information for the operation. + /// + /// delegate that encapsulates a method that returns a OperationTelemetryInformation object + public void CollectOperationAndNetworkInfo(Func functionFordata); + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/Collector/TelemetryCollector.cs b/Microsoft.Azure.Cosmos/src/Telemetry/Collector/TelemetryCollector.cs new file mode 100644 index 0000000000..9570fcd56a --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Telemetry/Collector/TelemetryCollector.cs @@ -0,0 +1,77 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Telemetry.Collector +{ + using System; + using Microsoft.Azure.Cosmos; + using Microsoft.Azure.Cosmos.Core.Trace; + using Microsoft.Azure.Cosmos.Telemetry; + using Microsoft.Azure.Cosmos.Tracing.TraceData; + using Microsoft.Azure.Documents; + + internal class TelemetryCollector : ITelemetryCollector + { + private readonly ClientTelemetry clientTelemetry = null; + private readonly ConnectionPolicy connectionPolicy = null; + + internal TelemetryCollector( + ClientTelemetry clientTelemetry, + ConnectionPolicy connectionPolicy) + { + this.clientTelemetry = clientTelemetry; + this.connectionPolicy = connectionPolicy; + } + + public void CollectCacheInfo(string cacheName, Func functionFordata) + { + try + { + TelemetryInformation data = functionFordata(); + + if (data.CollectionLink != null) + { + GetDatabaseAndCollectionName(data.CollectionLink, out string databaseName, out string collectionName); + + data.DatabaseId = databaseName; + data.ContainerId = collectionName; + } + + this.clientTelemetry?.PushCacheDatapoint(cacheName, data); + } + catch (Exception ex) + { + DefaultTrace.TraceError($"Error while collecting cache {0} telemetry. Exception : {1}", cacheName, ex); + } + } + + public void CollectOperationAndNetworkInfo(Func functionFordata) + { + try + { + TelemetryInformation data = functionFordata(); + + this.clientTelemetry?.PushOperationDatapoint(data); + + // Collect network level telemetry only in Direct Mode + if (this.connectionPolicy.ConnectionMode == ConnectionMode.Direct) + { + SummaryDiagnostics summaryDiagnostics = new SummaryDiagnostics(data.Trace); + this.clientTelemetry?.PushNetworkDataPoint(summaryDiagnostics.StoreResponseStatistics.Value, data.DatabaseId, data.ContainerId); + } + } + catch (Exception ex) + { + DefaultTrace.TraceError($"Error while collecting operation telemetry. Exception : {1}", ex); + } + } + + private static void GetDatabaseAndCollectionName(string path, out string databaseName, out string collectionName) + { + string[] segments = path.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); + + PathsHelper.ParseDatabaseNameAndCollectionNameFromUrlSegments(segments, out databaseName, out collectionName); + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/Collector/TelemetryCollectorNoOp.cs b/Microsoft.Azure.Cosmos/src/Telemetry/Collector/TelemetryCollectorNoOp.cs new file mode 100644 index 0000000000..a1d286fe94 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Telemetry/Collector/TelemetryCollectorNoOp.cs @@ -0,0 +1,21 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Telemetry.Collector +{ + using System; + + internal class TelemetryCollectorNoOp : ITelemetryCollector + { + public void CollectCacheInfo(string cacheName, Func functionFordata) + { + //NoOps + } + + public void CollectOperationAndNetworkInfo(Func functionFordata) + { + //NoOps + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/Collector/TelemetryInformation.cs b/Microsoft.Azure.Cosmos/src/Telemetry/Collector/TelemetryInformation.cs new file mode 100644 index 0000000000..a8210fb0a4 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Telemetry/Collector/TelemetryInformation.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Telemetry.Collector +{ + using System; + using System.Collections.Generic; + using System.Net; + using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Documents; + + internal class TelemetryInformation + { + internal HttpStatusCode StatusCode { get; set; } + internal SubStatusCodes SubStatusCode { get; set; } + internal OperationType OperationType { get; set; } + internal ResourceType ResourceType { get; set; } + internal string ContainerId { get; set; } + internal string DatabaseId { get; set; } + internal long ResponseSizeInBytes { get; set; } = 0; + internal string ConsistencyLevel { get; set; } = null; + internal IReadOnlyCollection<(string regionName, Uri uri)> RegionsContactedList { get; set; } + internal TimeSpan? RequestLatency { get; set; } + + internal double RequestCharge { get; set; } // Required only for operation level telemetry + internal string CollectionLink { get; set; } = null; // Required only for collection cache telemetry + internal ITrace Trace { get; set; } // Required to fetch network level telemetry out of the trace object + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/TelemetryToServiceHelper.cs b/Microsoft.Azure.Cosmos/src/Telemetry/TelemetryToServiceHelper.cs new file mode 100644 index 0000000000..2f78df0913 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Telemetry/TelemetryToServiceHelper.cs @@ -0,0 +1,134 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Telemetry +{ + using System; + using System.Threading; + using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Core.Trace; + using Microsoft.Azure.Cosmos.Handler; + using Microsoft.Azure.Cosmos.Routing; + using Microsoft.Azure.Cosmos.Telemetry.Collector; + + internal class TelemetryToServiceHelper : IDisposable + { + private ITelemetryCollector collector = new TelemetryCollectorNoOp(); + + internal static int DefaultBackgroundRefreshClientConfigTimeIntervalInMS = (int)TimeSpan.FromMinutes(10).TotalMilliseconds; + + private readonly AuthorizationTokenProvider cosmosAuthorization; + private readonly CosmosHttpClient httpClient; + private readonly Uri serviceEnpoint; + private readonly ConnectionPolicy connectionPolicy; + private readonly string clientId; + private readonly GlobalEndpointManager globalEndpointManager; + private readonly CancellationTokenSource cancellationTokenSource; + + private ClientTelemetry clientTelemetry = null; + + private TelemetryToServiceHelper() + { + //NoOpConstructor + } + + private TelemetryToServiceHelper( + string clientId, + ConnectionPolicy connectionPolicy, + AuthorizationTokenProvider cosmosAuthorization, + CosmosHttpClient httpClient, + Uri serviceEndpoint, + GlobalEndpointManager globalEndpointManager, + CancellationTokenSource cancellationTokenSource) + { + this.clientId = clientId; + this.cosmosAuthorization = cosmosAuthorization; + this.httpClient = httpClient; + this.connectionPolicy = connectionPolicy; + this.serviceEnpoint = serviceEndpoint; + this.globalEndpointManager = globalEndpointManager; + this.cancellationTokenSource = cancellationTokenSource; + } + + public static TelemetryToServiceHelper CreateAndInitializeClientConfigAndTelemetryJob(string clientId, + ConnectionPolicy connectionPolicy, + AuthorizationTokenProvider cosmosAuthorization, + CosmosHttpClient httpClient, + Uri serviceEndpoint, + GlobalEndpointManager globalEndpointManager, + CancellationTokenSource cancellationTokenSource) + { +#if INTERNAL + return new TelemetryToServiceHelper(); +#else + if (!connectionPolicy.EnableClientTelemetry) + { + return new TelemetryToServiceHelper(); + } + + TelemetryToServiceHelper helper = new TelemetryToServiceHelper( + clientId, connectionPolicy, cosmosAuthorization, httpClient, serviceEndpoint, globalEndpointManager, cancellationTokenSource); + + helper.InitializeClientTelemetry(); + + return helper; +#endif + } + + public ITelemetryCollector GetCollector() + { + return this.collector; + } + + public bool IsClientTelemetryJobRunning() + { + return this.clientTelemetry != null; + } + + /// + /// Trigger Client Telemetry job when it is enabled and not already running. + /// + private void InitializeClientTelemetry() + { + try + { + this.clientTelemetry = ClientTelemetry.CreateAndStartBackgroundTelemetry( + clientId: this.clientId, + httpClient: this.httpClient, + userAgent: this.connectionPolicy.UserAgentContainer.BaseUserAgent, + connectionMode: this.connectionPolicy.ConnectionMode, + authorizationTokenProvider: this.cosmosAuthorization, + diagnosticsHelper: DiagnosticsHandlerHelper.Instance, + preferredRegions: this.connectionPolicy.PreferredLocations, + globalEndpointManager: this.globalEndpointManager); + + this.collector = new TelemetryCollector(this.clientTelemetry, this.connectionPolicy); + + DefaultTrace.TraceVerbose("Client Telemetry Enabled."); + } + catch (Exception ex) + { + DefaultTrace.TraceWarning($"Error While starting Telemetry Job : {0}. Hence disabling Client Telemetry", ex.Message); + this.connectionPolicy.EnableClientTelemetry = false; + } + } + + public void Dispose() + { + this.StopClientTelemetry(); + } + + /// + /// Stopping a client telemetry job means now there shouldn't be any valid collector available, Hence switch it to NoOp collector. + /// Along with it, send a signal to stop client telemetry job. + /// + private void StopClientTelemetry() + { + this.collector = new TelemetryCollectorNoOp(); + + this.clientTelemetry?.Dispose(); + this.clientTelemetry = null; + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/VmMetadataApiHandler.cs b/Microsoft.Azure.Cosmos/src/Telemetry/VmMetadataApiHandler.cs index ed5ad111d7..b9d9c60d36 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/VmMetadataApiHandler.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/VmMetadataApiHandler.cs @@ -85,11 +85,11 @@ static ValueTask CreateRequestMessage() azMetadata = await VmMetadataApiHandler.ProcessResponseAsync(response); - DefaultTrace.TraceInformation($"Succesfully get Instance Metadata Response : {azMetadata.Compute.VMId}"); + DefaultTrace.TraceInformation($"Succesfully get Instance Metadata Response : {0}", azMetadata.Compute.VMId); } catch (Exception e) { - DefaultTrace.TraceInformation($"Azure Environment metadata information not available. {e.Message}"); + DefaultTrace.TraceInformation($"Azure Environment metadata information not available. {0}", e.Message); } } @@ -154,7 +154,7 @@ internal static string GetCloudInformation() } catch (Exception ex) { - DefaultTrace.TraceWarning("Error while generating hashed machine name " + ex.Message); + DefaultTrace.TraceWarning($"Error while generating hashed machine name {0}", ex.Message); } return $"{VmMetadataApiHandler.UuidPrefix}{Guid.NewGuid()}"; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml index fd097032d9..fb6a5fb720 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BatchOperationsAsync.xml @@ -50,14 +50,15 @@ │ │ [System Info] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) - │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ ( - │ [Client Side Request Stats] - │ Redacted To Not Change The Baselines From Run To Run - │ ) + │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ ( + │ [Client Side Request Stats] + │ Redacted To Not Change The Baselines From Run To Run + │ ) └── Create Trace(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds ]]> @@ -116,23 +117,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -454,14 +461,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Create Trace(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds └── Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ]]> @@ -503,23 +511,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -841,14 +855,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Create Trace(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds └── Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ]]> @@ -890,23 +905,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -1228,14 +1249,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Create Trace(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds └── Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ]]> @@ -1277,23 +1299,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -1615,14 +1643,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Create Trace(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds └── Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ]]> @@ -1664,23 +1693,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -2002,14 +2037,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Create Trace(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds └── Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ]]> @@ -2051,23 +2087,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -2389,14 +2431,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Create Trace(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds └── Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ]]> @@ -2438,23 +2481,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -2776,14 +2825,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Create Trace(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds └── Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ]]> @@ -2825,23 +2875,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -3163,14 +3219,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Create Trace(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds └── Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ]]> @@ -3212,23 +3269,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -3550,14 +3613,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Create Trace(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds └── Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ]]> @@ -3599,23 +3663,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -3959,35 +4029,36 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ │ ( - │ │ │ [Client Side Request Stats] - │ │ │ Redacted To Not Change The Baselines From Run To Run - │ │ │ ) - │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ │ ( - │ │ │ [Client Side Request Stats] - │ │ │ Redacted To Not Change The Baselines From Run To Run - │ │ │ ) - │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ │ ( - │ │ │ [Client Side Request Stats] - │ │ │ Redacted To Not Change The Baselines From Run To Run - │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ │ ( + │ │ │ [Client Side Request Stats] + │ │ │ Redacted To Not Change The Baselines From Run To Run + │ │ │ ) + │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ │ ( + │ │ │ [Client Side Request Stats] + │ │ │ Redacted To Not Change The Baselines From Run To Run + │ │ │ ) + │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ │ ( + │ │ │ [Client Side Request Stats] + │ │ │ Redacted To Not Change The Baselines From Run To Run + │ │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Create Trace(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds ├── Batch Retry Async(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds │ └── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -3999,35 +4070,36 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ │ ( - │ │ │ [Client Side Request Stats] - │ │ │ Redacted To Not Change The Baselines From Run To Run - │ │ │ ) - │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ │ ( - │ │ │ [Client Side Request Stats] - │ │ │ Redacted To Not Change The Baselines From Run To Run - │ │ │ ) - │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ │ ( - │ │ │ [Client Side Request Stats] - │ │ │ Redacted To Not Change The Baselines From Run To Run - │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ │ ( + │ │ │ [Client Side Request Stats] + │ │ │ Redacted To Not Change The Baselines From Run To Run + │ │ │ ) + │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ │ ( + │ │ │ [Client Side Request Stats] + │ │ │ Redacted To Not Change The Baselines From Run To Run + │ │ │ ) + │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ │ ( + │ │ │ [Client Side Request Stats] + │ │ │ Redacted To Not Change The Baselines From Run To Run + │ │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Create Trace(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds ├── Batch Retry Async(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds │ └── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -4039,35 +4111,36 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ │ ( - │ │ │ [Client Side Request Stats] - │ │ │ Redacted To Not Change The Baselines From Run To Run - │ │ │ ) - │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ │ ( - │ │ │ [Client Side Request Stats] - │ │ │ Redacted To Not Change The Baselines From Run To Run - │ │ │ ) - │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ │ ( - │ │ │ [Client Side Request Stats] - │ │ │ Redacted To Not Change The Baselines From Run To Run - │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ │ ( + │ │ │ [Client Side Request Stats] + │ │ │ Redacted To Not Change The Baselines From Run To Run + │ │ │ ) + │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ │ ( + │ │ │ [Client Side Request Stats] + │ │ │ Redacted To Not Change The Baselines From Run To Run + │ │ │ ) + │ │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ │ ( + │ │ │ [Client Side Request Stats] + │ │ │ Redacted To Not Change The Baselines From Run To Run + │ │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Create Trace(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds ├── Batch Retry Async(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds │ └── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds @@ -4079,35 +4152,36 @@ │ │ [System Info] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) - │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) - │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) - │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) - │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ ( - │ [Client Side Request Stats] - │ Redacted To Not Change The Baselines From Run To Run - │ ) + │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) + │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) + │ ├── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) + │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ ( + │ [Client Side Request Stats] + │ Redacted To Not Change The Baselines From Run To Run + │ ) └── Create Trace(00000000-0000-0000-0000-000000000000) Batch-Component 00:00:00:000 0.00 milliseconds ]]> @@ -369,23 +377,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -459,23 +473,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -547,23 +567,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -635,23 +661,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -723,23 +755,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -791,23 +829,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -855,23 +899,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -919,23 +969,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -1165,14 +1221,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ ├── Get RID(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ └── ChangeFeed Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds @@ -1195,14 +1252,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ ├── Get RID(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ └── ChangeFeed Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds @@ -1225,14 +1283,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ ├── Get RID(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ └── ChangeFeed Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds @@ -1255,14 +1314,15 @@ │ │ [System Info] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) - │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ ( - │ [Client Side Request Stats] - │ Redacted To Not Change The Baselines From Run To Run - │ ) + │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ ( + │ [Client Side Request Stats] + │ Redacted To Not Change The Baselines From Run To Run + │ ) ├── Get RID(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds └── ChangeFeed Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds @@ -1391,23 +1451,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -1485,23 +1551,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -1577,23 +1649,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -1669,23 +1747,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -1918,14 +2002,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ ├── Get RID(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ └── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds ├── Change Feed Iterator Read Next Async(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds @@ -1947,14 +2032,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ ├── Get RID(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ └── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds ├── Change Feed Iterator Read Next Async(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds @@ -1976,14 +2062,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ ├── Get RID(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ └── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds └── Change Feed Iterator Read Next Async(00000000-0000-0000-0000-000000000000) ChangeFeed-Component 00:00:00:000 0.00 milliseconds @@ -2005,14 +2092,15 @@ │ │ [System Info] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) - │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ ( - │ [Client Side Request Stats] - │ Redacted To Not Change The Baselines From Run To Run - │ ) + │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ ( + │ [Client Side Request Stats] + │ Redacted To Not Change The Baselines From Run To Run + │ ) ├── Get RID(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds └── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds ]]> @@ -2140,23 +2228,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -2230,23 +2324,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -2318,23 +2418,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -2406,23 +2512,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -2651,14 +2763,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ ├── Get RID(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ └── ChangeFeed Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds @@ -2681,14 +2794,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ ├── Get RID(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ └── ChangeFeed Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds @@ -2711,14 +2825,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ ├── Get RID(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ └── ChangeFeed Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds @@ -2741,14 +2856,15 @@ │ │ [System Info] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) - │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ ( - │ [Client Side Request Stats] - │ Redacted To Not Change The Baselines From Run To Run - │ ) + │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ ( + │ [Client Side Request Stats] + │ Redacted To Not Change The Baselines From Run To Run + │ ) ├── Get RID(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds ├── Get Collection Cache(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds └── ChangeFeed Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds @@ -2877,23 +2993,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -2971,23 +3093,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -3063,23 +3191,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -3155,23 +3289,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -3379,56 +3519,60 @@ │ │ [System Info] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) - │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ ( - │ [Client Side Request Stats] - │ Redacted To Not Change The Baselines From Run To Run - │ ) + │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ ( + │ [Client Side Request Stats] + │ Redacted To Not Change The Baselines From Run To Run + │ ) ├── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds │ └── Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds │ │ ( │ │ [System Info] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) - │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ ( - │ [Client Side Request Stats] - │ Redacted To Not Change The Baselines From Run To Run - │ ) + │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ ( + │ [Client Side Request Stats] + │ Redacted To Not Change The Baselines From Run To Run + │ ) ├── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds │ └── Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds │ │ ( │ │ [System Info] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) - │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ ( - │ [Client Side Request Stats] - │ Redacted To Not Change The Baselines From Run To Run - │ ) + │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ ( + │ [Client Side Request Stats] + │ Redacted To Not Change The Baselines From Run To Run + │ ) └── Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds └── Microsoft.Azure.Cosmos.Handlers.DiagnosticsHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds │ ( │ [System Info] │ Redacted To Not Change The Baselines From Run To Run │ ) - └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - ( - [Client Side Request Stats] - Redacted To Not Change The Baselines From Run To Run - ) + └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + ( + [Client Side Request Stats] + Redacted To Not Change The Baselines From Run To Run + ) ]]> @@ -958,23 +990,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -1056,23 +1094,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -1154,23 +1198,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -1252,23 +1302,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -1461,14 +1517,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Get Cosmos Element Response(00000000-0000-0000-0000-000000000000) Json-Component 00:00:00:000 0.00 milliseconds ├── FeedIterator Read Next Async(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds │ │ ( @@ -1496,14 +1553,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Get Cosmos Element Response(00000000-0000-0000-0000-000000000000) Json-Component 00:00:00:000 0.00 milliseconds ├── FeedIterator Read Next Async(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds │ │ ( @@ -1531,14 +1589,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Get Cosmos Element Response(00000000-0000-0000-0000-000000000000) Json-Component 00:00:00:000 0.00 milliseconds └── FeedIterator Read Next Async(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds │ ( @@ -1566,14 +1625,15 @@ │ │ [System Info] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) - │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ ( - │ [Client Side Request Stats] - │ Redacted To Not Change The Baselines From Run To Run - │ ) + │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ ( + │ [Client Side Request Stats] + │ Redacted To Not Change The Baselines From Run To Run + │ ) └── Get Cosmos Element Response(00000000-0000-0000-0000-000000000000) Json-Component 00:00:00:000 0.00 milliseconds ]]> @@ -2366,23 +2454,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -2464,23 +2558,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -2562,23 +2662,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -2660,23 +2766,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -2862,16 +2974,17 @@ │ │ │ │ [System Info] │ │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ │ ) - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.GatewayStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ │ ( - │ │ │ [Client Side Request Stats] - │ │ │ Redacted To Not Change The Baselines From Run To Run - │ │ │ [PointOperationStatisticsTraceDatum] - │ │ │ Redacted To Not Change The Baselines From Run To Run - │ │ │ ) + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.GatewayStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ │ ( + │ │ │ [Client Side Request Stats] + │ │ │ Redacted To Not Change The Baselines From Run To Run + │ │ │ [PointOperationStatisticsTraceDatum] + │ │ │ Redacted To Not Change The Baselines From Run To Run + │ │ │ ) │ │ └── Get Partition Key Ranges(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ │ └── Try Get Overlapping Ranges(00000000-0000-0000-0000-000000000000) Routing-Component 00:00:00:000 0.00 milliseconds │ ├── MoveNextAsync(00000000-0000-0000-0000-000000000000) Pagination-Component 00:00:00:000 0.00 milliseconds @@ -2892,14 +3005,15 @@ │ │ │ │ [System Info] │ │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ │ ) - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ │ ( - │ │ │ [Client Side Request Stats] - │ │ │ Redacted To Not Change The Baselines From Run To Run - │ │ │ ) + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ │ ( + │ │ │ [Client Side Request Stats] + │ │ │ Redacted To Not Change The Baselines From Run To Run + │ │ │ ) │ │ └── Get Cosmos Element Response(00000000-0000-0000-0000-000000000000) Json-Component 00:00:00:000 0.00 milliseconds │ └── Query Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Typed FeedIterator ReadNextAsync(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds @@ -2928,14 +3042,15 @@ │ │ │ │ [System Info] │ │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ │ ) - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ │ ( - │ │ │ [Client Side Request Stats] - │ │ │ Redacted To Not Change The Baselines From Run To Run - │ │ │ ) + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ │ ( + │ │ │ [Client Side Request Stats] + │ │ │ Redacted To Not Change The Baselines From Run To Run + │ │ │ ) │ │ └── Get Cosmos Element Response(00000000-0000-0000-0000-000000000000) Json-Component 00:00:00:000 0.00 milliseconds │ └── Query Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ├── Typed FeedIterator ReadNextAsync(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds @@ -2964,14 +3079,15 @@ │ │ │ │ [System Info] │ │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ │ ) - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ │ ( - │ │ │ [Client Side Request Stats] - │ │ │ Redacted To Not Change The Baselines From Run To Run - │ │ │ ) + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ │ ( + │ │ │ [Client Side Request Stats] + │ │ │ Redacted To Not Change The Baselines From Run To Run + │ │ │ ) │ │ └── Get Cosmos Element Response(00000000-0000-0000-0000-000000000000) Json-Component 00:00:00:000 0.00 milliseconds │ └── Query Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds └── Typed FeedIterator ReadNextAsync(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds @@ -3000,14 +3116,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Get Cosmos Element Response(00000000-0000-0000-0000-000000000000) Json-Component 00:00:00:000 0.00 milliseconds └── Query Response Serialization(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds ]]> @@ -3059,24 +3176,30 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.GatewayStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run", - "PointOperationStatisticsTraceDatum": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Cosmos.GatewayStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run", + "PointOperationStatisticsTraceDatum": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -3147,23 +3270,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -3245,23 +3374,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -3343,23 +3478,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -3441,23 +3582,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -3653,14 +3800,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Get Cosmos Element Response(00000000-0000-0000-0000-000000000000) Json-Component 00:00:00:000 0.00 milliseconds ├── FeedIterator Read Next Async(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds │ │ ( @@ -3688,14 +3836,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Get Cosmos Element Response(00000000-0000-0000-0000-000000000000) Json-Component 00:00:00:000 0.00 milliseconds ├── FeedIterator Read Next Async(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds │ │ ( @@ -3723,14 +3872,15 @@ │ │ │ [System Info] │ │ │ Redacted To Not Change The Baselines From Run To Run │ │ │ ) - │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ │ ( - │ │ [Client Side Request Stats] - │ │ Redacted To Not Change The Baselines From Run To Run - │ │ ) + │ │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ │ ( + │ │ [Client Side Request Stats] + │ │ Redacted To Not Change The Baselines From Run To Run + │ │ ) │ └── Get Cosmos Element Response(00000000-0000-0000-0000-000000000000) Json-Component 00:00:00:000 0.00 milliseconds └── FeedIterator Read Next Async(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds │ ( @@ -3758,14 +3908,15 @@ │ │ [System Info] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) - │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ ( - │ [Client Side Request Stats] - │ Redacted To Not Change The Baselines From Run To Run - │ ) + │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ ( + │ [Client Side Request Stats] + │ Redacted To Not Change The Baselines From Run To Run + │ ) └── Get Cosmos Element Response(00000000-0000-0000-0000-000000000000) Json-Component 00:00:00:000 0.00 milliseconds ]]> @@ -4573,23 +4752,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -4671,23 +4856,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -4769,23 +4960,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } @@ -4867,23 +5064,29 @@ }, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.TelemetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RetryHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", + "name": "Microsoft.Azure.Cosmos.Handlers.RouterHandler", "duration in milliseconds": 0, "children": [ { - "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "name": "Microsoft.Azure.Cosmos.Handlers.TransportHandler", "duration in milliseconds": 0, - "data": { - "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" - } + "children": [ + { + "name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request", + "duration in milliseconds": 0, + "data": { + "Client Side Request Stats": "Redacted To Not Change The Baselines From Run To Run" + } + } + ] } ] } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml index 86f16841b5..60f1b42df3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadFeedAsync.xml @@ -54,14 +54,15 @@ │ │ [System Info] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) - │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ ( - │ [Client Side Request Stats] - │ Redacted To Not Change The Baselines From Run To Run - │ ) + │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ ( + │ [Client Side Request Stats] + │ Redacted To Not Change The Baselines From Run To Run + │ ) ├── FeedIterator Read Next Async(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds │ │ ( │ │ [Client Configuration] @@ -81,14 +82,15 @@ │ │ [System Info] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) - │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ ( - │ [Client Side Request Stats] - │ Redacted To Not Change The Baselines From Run To Run - │ ) + │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ ( + │ [Client Side Request Stats] + │ Redacted To Not Change The Baselines From Run To Run + │ ) ├── FeedIterator Read Next Async(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds │ │ ( │ │ [Client Configuration] @@ -108,14 +110,15 @@ │ │ [System Info] │ │ Redacted To Not Change The Baselines From Run To Run │ │ ) - │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - │ ( - │ [Client Side Request Stats] - │ Redacted To Not Change The Baselines From Run To Run - │ ) + │ └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + │ └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + │ ( + │ [Client Side Request Stats] + │ Redacted To Not Change The Baselines From Run To Run + │ ) └── FeedIterator Read Next Async(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds │ ( │ [Client Configuration] @@ -135,14 +138,15 @@ │ [System Info] │ Redacted To Not Change The Baselines From Run To Run │ ) - └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds - └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds - ( - [Client Side Request Stats] - Redacted To Not Change The Baselines From Run To Run - ) + └── Microsoft.Azure.Cosmos.Handlers.TelemetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + └── Microsoft.Azure.Cosmos.Handlers.RetryHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + └── Microsoft.Azure.Cosmos.Handlers.RouterHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + └── Microsoft.Azure.Cosmos.Handlers.TransportHandler(00000000-0000-0000-0000-000000000000) RequestHandler-Component 00:00:00:000 0.00 milliseconds + └── Microsoft.Azure.Documents.ServerStoreModel Transport Request(00000000-0000-0000-0000-000000000000) Transport-Component 00:00:00:000 0.00 milliseconds + ( + [Client Side Request Stats] + Redacted To Not Change The Baselines From Run To Run + ) ]]> CreateClientAndContainer(ConnectionMode mode, : this.cosmosClientBuilder.Build()); // Making sure client telemetry is enabled - Assert.IsNotNull(this.GetClient().DocumentClient.clientTelemetry); + Assert.IsNotNull(this.GetClient().DocumentClient.telemetryToServiceHelper); this.database = await this.GetClient().CreateDatabaseAsync(Guid.NewGuid().ToString()); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json index a06dabf09c..8e45a72922 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Contracts/BenchmarkResults.json @@ -39,7 +39,7 @@ "MockedItemBenchmark.ReadItemNotExists;[Type=OfT]": 43489.25, "MockedItemBenchmark.ReadItemNotExists;[Type=OfTCustom]": 43490, "MockedItemBenchmark.ReadItemNotExists;[Type=OfTWithClientTelemetryEnabled]": 43489.25, - "MockedItemBenchmark.ReadItemNotExists;[Type=OfTWithDiagnosticsToString]": 58054, + "MockedItemBenchmark.ReadItemNotExists;[Type=OfTWithDiagnosticsToString]": 64764.75, "MockedItemBenchmark.ReadItemNotExists;[Type=Stream]": 39044, "MockedItemBenchmark.UpdateItem;[Type=OfT]": 36591, "MockedItemBenchmark.UpdateItem;[Type=OfTCustom]": 36594.25, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/MockDocumentClient.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/MockDocumentClient.cs index 2baee14bd8..3403269950 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/MockDocumentClient.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/MockDocumentClient.cs @@ -6,7 +6,6 @@ namespace Microsoft.Azure.Cosmos.Performance.Tests { using System; using System.Globalization; - using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos; @@ -19,11 +18,10 @@ namespace Microsoft.Azure.Cosmos.Performance.Tests using Moq; using System.Collections.ObjectModel; using System.Collections.Generic; - using Microsoft.CodeAnalysis.CSharp.Syntax; - using System.IO; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Query.Core.QueryPlan; using Newtonsoft.Json; + using Microsoft.Azure.Cosmos.Telemetry; internal class MockDocumentClient : DocumentClient, ICosmosAuthorizationTokenProvider { @@ -47,7 +45,18 @@ public static CosmosClient CreateMockCosmosClient( bool? isClientTelemetryEnabled = null, Action < CosmosClientBuilder> customizeClientBuilder = null) { - MockDocumentClient documentClient = new MockDocumentClient(); + ConnectionPolicy policy = new ConnectionPolicy(); + + if (isClientTelemetryEnabled.HasValue) + { + policy = new ConnectionPolicy + { + EnableClientTelemetry = isClientTelemetryEnabled.Value + }; + + } + + MockDocumentClient documentClient = new MockDocumentClient(policy); CosmosClientBuilder cosmosClientBuilder = new CosmosClientBuilder("http://localhost", Convert.ToBase64String(Guid.NewGuid().ToByteArray())); cosmosClientBuilder.WithConnectionModeDirect(); customizeClientBuilder?.Invoke(cosmosClientBuilder); @@ -61,11 +70,6 @@ public static CosmosClient CreateMockCosmosClient( }); } - if (isClientTelemetryEnabled.HasValue && isClientTelemetryEnabled.Value) - { - cosmosClientBuilder.WithTelemetryEnabled(); - } - documentClient.dummyHeaderNames = new string[100]; for (int i = 0; i < documentClient.dummyHeaderNames.Length; i++) { @@ -79,8 +83,8 @@ public static CosmosClient CreateMockCosmosClient( return cosmosClientBuilder.Build(documentClient); } - public MockDocumentClient() - : base(new Uri("http://localhost"), null) + public MockDocumentClient(ConnectionPolicy policy = null) + : base(new Uri("http://localhost"), connectionPolicy: policy) { this.authKeyHashFunction = new StringHMACSHA256Hash(MockDocumentClient.GenerateRandomKey()); @@ -212,6 +216,13 @@ private void Init() this.globalEndpointManager = new Mock(this, new ConnectionPolicy()); + this.telemetryToServiceHelper = TelemetryToServiceHelper.CreateAndInitializeClientConfigAndTelemetryJob("perf-test-client", + this.ConnectionPolicy, + new Mock().Object, + new Mock().Object, + this.ServiceEndpoint, + this.GlobalEndpointManager, + default); this.InitStoreModels(); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/HandlerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/HandlerTests.cs index ae5dccd2c8..d3d0e45653 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/HandlerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/HandlerTests.cs @@ -36,6 +36,7 @@ public void HandlerOrder() { typeof(RequestInvokerHandler), typeof(DiagnosticsHandler), + typeof(TelemetryHandler), typeof(RetryHandler), typeof(RouterHandler) }; @@ -50,29 +51,6 @@ public void HandlerOrder() Assert.IsNull(handler); } - [TestMethod] - public void HandlerOrderIfTelemetryIsEnabled() - { - using CosmosClient client = MockCosmosUtil.CreateMockCosmosClient(enableTelemetry: true); - - Type[] types = new Type[] - { - typeof(RequestInvokerHandler), - typeof(DiagnosticsHandler), - typeof(TelemetryHandler), - typeof(RetryHandler), - typeof(RouterHandler) - }; - - RequestHandler handler = client.RequestHandler; - foreach (Type type in types) - { - Assert.IsTrue(type.Equals(handler.GetType()), $"{type} is not equal to {handler.GetType()}"); - handler = handler.InnerHandler; - } - Assert.IsNull(handler); - } - [TestMethod] public async Task TestPreProcessingHandler() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Utils/MockCosmosUtil.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Utils/MockCosmosUtil.cs index 8ea04f99a5..92a6e60038 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Utils/MockCosmosUtil.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Utils/MockCosmosUtil.cs @@ -34,16 +34,15 @@ public static CosmosClient CreateMockCosmosClient( Cosmos.ConsistencyLevel? accountConsistencyLevel = null, bool enableTelemetry = false) { - DocumentClient documentClient = accountConsistencyLevel.HasValue ? new MockDocumentClient(accountConsistencyLevel.Value) : new MockDocumentClient(); - CosmosClientBuilder cosmosClientBuilder = new CosmosClientBuilder("http://localhost", MockCosmosUtil.RandomInvalidCorrectlyFormatedAuthKey); - customizeClientBuilder?.Invoke(cosmosClientBuilder); - if(enableTelemetry) + ConnectionPolicy policy = new ConnectionPolicy { - documentClient.clientTelemetry = new Mock().Object; - - cosmosClientBuilder.WithTelemetryEnabled(); - } + EnableClientTelemetry = enableTelemetry + }; + DocumentClient documentClient = accountConsistencyLevel.HasValue ? new MockDocumentClient(accountConsistencyLevel.Value, policy) : new MockDocumentClient(policy); + CosmosClientBuilder cosmosClientBuilder = new CosmosClientBuilder("http://localhost", MockCosmosUtil.RandomInvalidCorrectlyFormatedAuthKey); + + customizeClientBuilder?.Invoke(cosmosClientBuilder); return cosmosClientBuilder.Build(documentClient); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Utils/MockDocumentClient.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Utils/MockDocumentClient.cs index 12d776fb38..b0c29eb016 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Utils/MockDocumentClient.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Utils/MockDocumentClient.cs @@ -15,6 +15,7 @@ namespace Microsoft.Azure.Cosmos.Tests using Microsoft.Azure.Cosmos.Common; using Microsoft.Azure.Cosmos.Query.Core.QueryPlan; using Microsoft.Azure.Cosmos.Routing; + using Microsoft.Azure.Cosmos.Telemetry; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; using Microsoft.Azure.Documents.Collections; @@ -27,14 +28,14 @@ internal class MockDocumentClient : DocumentClient, IAuthorizationTokenProvider, Mock partitionKeyRangeCache; private readonly Cosmos.ConsistencyLevel accountConsistencyLevel; - public MockDocumentClient() - : base(new Uri("http://localhost"), MockCosmosUtil.RandomInvalidCorrectlyFormatedAuthKey) + public MockDocumentClient(ConnectionPolicy connectionPolicy = null) + : base(new Uri("http://localhost"), MockCosmosUtil.RandomInvalidCorrectlyFormatedAuthKey, connectionPolicy) { this.Init(); } - public MockDocumentClient(Cosmos.ConsistencyLevel accountConsistencyLevel) - : base(new Uri("http://localhost"), null) + public MockDocumentClient(Cosmos.ConsistencyLevel accountConsistencyLevel, ConnectionPolicy connectionPolicy = null) + : base(new Uri("http://localhost"), connectionPolicy) { this.accountConsistencyLevel = accountConsistencyLevel; this.Init(); @@ -261,6 +262,14 @@ private void Init() this.MockGlobalEndpointManager.Setup(gep => gep.ResolveServiceEndpoint(It.IsAny())).Returns(new Uri("http://localhost")); this.MockGlobalEndpointManager.Setup(gep => gep.InitializeAccountPropertiesAndStartBackgroundRefresh(It.IsAny())); SessionContainer sessionContainer = new SessionContainer(this.ServiceEndpoint.Host); + + this.telemetryToServiceHelper = TelemetryToServiceHelper.CreateAndInitializeClientConfigAndTelemetryJob("test-client", + this.ConnectionPolicy, + new Mock().Object, + new Mock().Object, + this.ServiceEndpoint, + this.GlobalEndpointManager, + default); this.sessionContainer = sessionContainer; } From f56944ef55fef63549067823d6274d867a44c065 Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Wed, 23 Aug 2023 08:30:36 -0700 Subject: [PATCH 180/240] [Internal] Automation: Adds logic to tag customer-reported issues (#4047) * Added customer-reported label * Changing condition * padding * more padding * permission name * padding --- .github/policies/resourceManagement.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/policies/resourceManagement.yml b/.github/policies/resourceManagement.yml index 8207a0708a..7d78118b0e 100644 --- a/.github/policies/resourceManagement.yml +++ b/.github/policies/resourceManagement.yml @@ -38,6 +38,20 @@ configuration: - addLabel: label: needs-investigation description: + - if: + - payloadType: Issues + - isAction: + action: Opened + - not: + or: + - activitySenderHasPermission: + permission: Write + - activitySenderHasPermission: + permission: Admin + then: + - addLabel: + label: customer-reported + description: Identifies issues created by users without write access as customers - if: - payloadType: Pull_Request - hasLabel: From 83dd4b54348a4b2d172d1bbcfd830134363e212b Mon Sep 17 00:00:00 2001 From: David Chaava Date: Wed, 23 Aug 2023 21:57:27 +0200 Subject: [PATCH 181/240] [Internal] Benchmark tool: Adds requests diagnostic data capture and upload to storage (#3926) * azure-cosmos-dotnet-v3/issues/3889 add diagnostics data capturing during bechmark and storing into blob storage after finish * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/README.md * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/custom-script.sh * fix bug * fix review comments * fix comments * fix comments * fix case * add tests and refactoring * fix * unify logging * add summaries * fix method summary * fix BOM * fix review comments * fix comment * fix line breaks * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/README.md * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/README.md * catch exceptions * add container prefix * ResultStorageContainerPrefix * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/execute.sh * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/custom-script.sh * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json * Update Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs Co-authored-by: Kiran Kumar Kolli * Update Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json Co-authored-by: Matias Quaranta * Update Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs Co-authored-by: Kiran Kumar Kolli * Update Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/DiagnosticDataListener.cs Co-authored-by: Matias Quaranta * fix comments * fix comments * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/README.md * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/execute.sh * make BlobCLient Lazy singleton * new file: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/README.md modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/README.md * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/execute.sh * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/execute.sh * check on diagnostic colletiong * remove locks and improve logs appending * removed unnecesary directory * removed unnecesary directory * removed unnecesary directory * new file: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md * add dashboard * fix arm template * change branch * fix * add dashboard name * fix dashboard * add logging * fix * trace error * fix devide zero * add trace errors * fix * fix * fix * fix * fix * migrate to text writer * fixes * diagnostic logs * add diagnostic logs * remove flush and reset * metric collection window lock * collection window * force flush every n seconds * fix bug * fix * Update Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/README.md Co-authored-by: Matias Quaranta * change deafult metric interval * constant * fix container creating conflict issue * change azuredeply branch name * remove ArmTemplate folder * fix DiagnosticLatencyThresholdInMs default value --------- Co-authored-by: David Chaava Co-authored-by: Kiran Kumar Kolli Co-authored-by: Matias Quaranta --- .../Tools/Benchmark/ARMTemplate/README.md | 73 -- .../Tools/Benchmark/ARMTemplate/arm1.png | Bin 73958 -> 0 bytes .../Tools/Benchmark/ARMTemplate/arm2.png | Bin 85941 -> 0 bytes .../Tools/Benchmark/ARMTemplate/arm3.png | Bin 15913 -> 0 bytes .../ARMTemplate/benchmarkTemplate.json | 154 --- .../Benchmark/ARMTemplate/parameters.json | 39 - .../Tools/Benchmark/ARMTemplate/run.sh | 2 - .../Benchmark/AzureVmBenchmark/README.md | 111 ++ .../AzureVmBenchmark/azuredeploy.json | 1160 +++++++++++++++++ .../AzureVmBenchmark/scripts/custom-script.sh | 28 + .../AzureVmBenchmark/scripts/execute.sh | 9 + .../AzureVmBenchmark/system/cloud-init.txt | 16 + .../Tools/Benchmark/BenchmarkConfig.cs | 10 + .../Benchmark/BenchmarkLatencyEventSource.cs | 5 +- .../Tools/Benchmark/BenchmarkProgress.cs | 50 + .../Tools/Benchmark/CosmosBenchmark.csproj | 1 + .../Benchmark/Fx/DiagnosticDataListener.cs | 224 ++++ .../Tools/Benchmark/Fx/MetricsCollector.cs | 16 +- .../Benchmark/Fx/MetricsCollectorProvider.cs | 50 +- .../Benchmark/Fx/ParallelExecutionStrategy.cs | 9 +- .../Benchmark/Fx/SerialOperationExecutor.cs | 6 +- .../Tools/Benchmark/Fx/TelemetrySpan.cs | 8 +- .../Tools/Benchmark/Program.cs | 111 +- .../Tools/Benchmark/README.md | 5 + .../Tools/Benchmark/Utility.cs | 6 + .../CosmosBenchmarkTests.csproj | 23 + .../Fx/DiagnosticDataListenerTests.cs | 54 + 27 files changed, 1845 insertions(+), 325 deletions(-) delete mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md delete mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm1.png delete mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm2.png delete mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm3.png delete mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/benchmarkTemplate.json delete mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/parameters.json delete mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/run.sh create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/README.md create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/custom-script.sh create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/execute.sh create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/system/cloud-init.txt create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkProgress.cs create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/DiagnosticDataListener.cs create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/CosmosBenchmarkTests/CosmosBenchmarkTests.csproj create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/CosmosBenchmarkTests/Fx/DiagnosticDataListenerTests.cs diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md deleted file mode 100644 index 7821e1eefd..0000000000 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# Running benchmarks on ARM Tempaltes - -[ARM Templates](https://learn.microsoft.com/azure/azure-resource-manager/templates/) makes executing the Azure Cosmos DB SDK Benchmark extremely easy, with very few steps involved. Plus, it lets you test and evaluate performance quickly on multiple resource (CPU/RAM) configurations and across multiple Azure regions seamlessly. - -For the below steps, you will **need an Azure Subscription**. - -## Steps - -### Deploy with one click - -Just click in the **Deploy to Azure button** and it will guide you into automatically configuring, deploying, and running the benchmark. - -[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-cosmos-dotnet-v3%2Fmaster%2FMicrosoft.Azure.Cosmos.Samples%2FTools%2FBenchmark%2FARMTemplate%2FbenchmarkTemplate.json) - -Please populate the `endpoint` and `key` for your Azure Cosmos DB account. You can [obtain these from the Azure Portal or through CLI](https://learn.microsoft.com/azure/cosmos-db/secure-access-to-data?tabs=using-primary-key#primary-keys). - -Optionally you can modify the other parameters, such as the `throughput` for the container that will get created, the amount of `documents` to insert, the degree of `parallelism`, and if you want the container to be deleted after the benchmark is run (`cleanUpOnFinish` `true/false`). - -Additionally, the template lets you customize the size of the container instance that will be deployed, which you can make as similar as possible to the instance you will be running in production to simulate results. - -### Deploy with Azure CLI - -First open the `parameters.json` file and populate the `endpoint` and `key` for your Azure Cosmos DB account. You can [obtain these from the Azure Portal or through CLI](https://learn.microsoft.com/azure/cosmos-db/secure-access-to-data?tabs=using-primary-key#primary-keys). - - Next, modify the other parameters, such as the `throughput` for the container that will get created, the amount of `documents` to insert, the degree of `parallelism`, and if you want the container to be deleted after the benchmark is run (`cleanUpOnFinish` `true/false`). - - If you're deploying the template to a resource group that does not exist you must create one first. Please note that the name of the resource group can only include alphanumeric characters, periods, underscores, hyphens, and parenthesis. It can be up to 90 characters. The name can't end in a period. To create a resource group use the following command: - ```bash - az group create --name $resourceGroupName --location $location - ``` - - To run the benchmark first navigate to the directory the `benchmarkTemplate.json` and `parameters.json` files are stored and use the Azure CLI with the following command: - ```bash - az deployment group create --resource-group $resourceGroupName --template-file benchmarkTemplate.json --parameters @parameters.json - ``` - -### The Benchmark - -Once you create the benchmark, it will do the following: - -1. It will create a Linux container named `cosmosdbsdkperf` and provision an image with NET 6 inside an instance with the configured CPU and RAM. -![Provisioned Container Instance](./arm1.png) -2. Clone the Azure Cosmos DB SDK repository with the required files -3. Execute the benchmark and provide output logs -4. Stop the instance - -While the container instance is running (or after), you can either use the Azure Portal or the Azure CLI to check the benchmark results with: - -```bash -az container logs -g $resourceGroupName -n cosmosdbsdkperf -``` - -Additionally you can check the logs in the Azure Portal by navigating to the container instance and clicking on the **Logs** tab. - -The logs will show the information, including the initial parameters: - -![Initial benchmark parameters](./arm2.png) - -And the results: - -![Benchmark results](./arm3.png) - -### Clean up - -If you want to remove the Benchmark instance, ypu can delete the container from the Azure Portal. You can also do so from the Azure CLI: - -```bash -az container delete -g $resourceGroupName -n cosmosdbsdkperf -``` - -You can also delete the Benchmark instance from the Azure Portal by navigating to the container instance and clicking on the **Delete** button. - -**Remember to delete the Database and Container** that were created for the Benchmark in your CosmosDB account if you did not use the `CLEANUPFINISH` parameter as `true`. diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm1.png b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/arm1.png deleted file mode 100644 index c740b8b3d7528c4f7232b24da55fee45cdb4f6c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 73958 zcmdqJhgVZw+r|mfL_}3OQlnBs=mA0qfjPe4yz|YPe_&=!)?%>^hb+xLd*9`ET{o{DnHg}O5;(=g#Kdj* z@SX(|6Gtx-(+Q80?7&ZMtxQ$|-q_vq?vx*4_@f!rR`0bTYPvB+?S!4K;s@hCPvP2 z+oOVB6`W%FCXc22W3y)S(6~?U2MblPte%J$rN)`P<%Q8#Xa2PCOgX zJ?`}^jFP@)kd*T3g5;znbLULH=O<>D7pE?zs30Bsh6*&-(wWZMeR-xAO~%XeD~7+# zR}bt)oB$U5AKe5V(acZ*m6YGa$ZH%tLYrJ-q~q4mjZ|UHkZkNRgIZ{kr((K-ueipw zh*iaj^km99lmsrBjh2VPB2F>=Biyb^{Nf)Ux&NDE6zzic9DS|{e|<4k$zGu^U8>$~ zD1QQR5UCL`|8E~!vjOHQEv|LO$Nad9$F<~1{6QU@;sLBi4^A#mdvNaNwU3ck4M$5- zzYXzFmav{6Hl~jc-(5BAPnQx8&Q&@uV{;RSdudZ0S!-`;-{_rDARYALLCd;1qFVtW zj)48L=W2GUhQ7CMHK%NCeJ=mIoqi|i?2IMU(y1G&s(*k5O7)ov?HzJzb;m8nlpM!0 zpO*{~O0$VKQ7k)_a%lE_2mE3lB-s^sHf5QI$f@R4DWK(`edEXLOYhEgCFEi2J%*G>LAlZ84NKy} zl6C`~2b#t5p4Fz|?k6_C{Q3Usnqitmqb_YU64TeyV9~nhlDl-%?o(&v@yCFLF)2%v zgHsCwIdUo5>a>DBRYLU^eKm(Dg(28f+db)i7`i=F)SVa9{~I-nFe}gyx301}lb*$% zU%S{BuR~vbk4(<53vH~lKHPpBr5myL487oWRJ%jH(+pZdB0a495Rm1NWu5VLm0fki zu9w^<;DU9v(DnQsGJ#NCA6-tLpNnI`WDj<}S%+j|(mjt#2;Q{_?ZL*XV_k24W^L(0 zzm8BH87w5cu$D>>C)SdS+&j4i@p)RNt#F=wN3mZi{8~Iro5d~g0jjDPWYq1vOvp2e zGh2D}j#7UxGsO=Rue{-dZ>SLZ)Zdc~e(xzB7 zN1AD#O3qzUm)F;T;UaAHY46PM|DMx7#V7a7_fIp7=qvXKo9ETD=QCAeTZ>pMQwZN# z4mdi5^Q)|K(L%;l2b7S#I)XPq{RCJlGAN7C1BD4Ie`B#hE~ zOQ2ItiToQUnVxT7r(s9MjZLnY#V_V4c&gA!Lh2Qtd}F1p;y{O^B+R;GVdTxi7@e_; zI_D+LZoa!_@DBLu-RGP$6#&gcna&1G&b`AakZRFKsb!`D1E^r~3APWxryIs9Eb|hY zj3{nvdx{+y1cSGiZ`;8m#y*;h!?!P<*Nu);_F55zN_9zy>57(f}Z>HRXnWWUYIDy(hLGt9$I$ zPhgJ!eWjHAe!#9d1o{2V68*I6)}J4v!~>sk2IbR|V5g z-wLUJGs#o*Yy!>NZtthxG@tgwm6>`>c5@3xzP=>&%=y5XL|h>XX$O3dw6S@)VA*Wu zqlmtu&pu@t6^RO>4V&O-L)khrCasT4qspJ?D>}JoM+8w@{O4X`8FXsYgVUnEWf?#y zTA>+V~uOX*rZK^p66};wMMqQigF=6>-7PvHc8?KkppAl(>(1L)X zwhs+t9Z+MQ+w+Dxp&PTxh2x?zhwEvI1|cz|qXTFh2r=CIP+Lvq2iZg>hW2off5tFBb1UD%`IHLA)Ty$zE z1kdva?W&rg>zh(el_j9KLt12}oYPa#u9N6Y!kHzVuTlw`cehQh{nF43A~r&1`b&-@ zmmk$*GuGoniCgVNzdfnVs}Z^Gijpy-@a6h}3>jPY2!1_IAe7cbVc~GID*F#8?0fx$ z!5!-=n*(IlI>%B@tY`Fa#|&L!gWI=*o9XwvG*9m%$M=!yg+{zG`wPcxT=Uew(F(0# z?l)irs&ZV)Ng!)*9L|{Q$#w~1aE*>g((Xj94ok=~y~46=e}K|n>W|>(q5t7h#LxrvO&4gM2Pc(M0zBRl1H8Nd2mPEI5S<^I;!XW!^fpayU)e&TIK8HaoA(; zBB=4+c^eJJZ2uk8H36AxXRC^&fMb#Nl3O5mQq~CCo-SqC-9~JOHq%6z+ThcN1{pW4 zjl9Rh2gYK9=CN7Cpa@cq?^f~svToOjx`pbGI!454)@!sxdSjX z1Js{Y`&b9q2ZXWAqa7UR`Au~ADc@OerMh=Fz-R05H)>*zrVPza`K!2{I& z|NJAQwyY^3$)xo*B>1C~P;QMF6zv0U@lxMnP>ESeBGhRkhrFHT30y7L9F#5c}qkwaI8&c~gn+*q2vQwoqrGPgT1HBeZ*o z0zcY_ErAI_x*>yY1QMLGxC`YJc+~K5rjiBXf{fI(e%@HQd%TzgtU8bv)?0}n@`4OaATGZiD)*z7Rab-gHsF< zTD93!wo{jY$5ENRJ9=0Y_A1rmV7$uK6!GJ406ekQuD=0qyx*|sGr1kUzj^L&(e^*P z=-t%^;VTO$jo_93JQ#kP+IqnPh=q#UGNkQ@omF=Pv*r#%5Y|D;S|SJJs`y;Gkw_V| zYYieGibb;aJZx*Dqw0kyZ(GAS4Kt)O4(S`{fQ%DR#TacQ>!dalE8V+8hi^y47dx3R9}1g=@=95hG&u910*2-0pH98d z4_@4XSf0gaDb8k50=obC67a%zfQfa@pCVey!y25w{lq2m2}+~Nv7)%meE|;c^!Kt= z9$K<>hW{YerL!Ap{oO5T1F6bYr$ukyEyHF*M7k?E=XwS{zPn~R%eV!UaH0W>TbK$<_mjH)4N{)|}amLv$#(_q(n4m75euWK>yww$$3(9)Mi8uXEcg|CJ>J zBX-Ebx94xqTq4I0A|0BuH}JI%p3=QgKS?K4kO%k<0*+{|t6|>)qC3@&h8QxAH!(!| zjD8-kvaXWeUBTaWRauEA6qOhkI(rjpTxX9ryDlr1xno6UOhYrj@{W26Fhj&yW;P}Z zJbs*7V5~(jd>#p$Wtsj1WJIMesp^3qbX@&8nZ+0)JiU{e8_t z(6YpYe;$^awgm0eaoBsdH^vdLFyt`A=+w0kGwi2EPO-x_yn8Xkbs z$}lEAX(Pm#jo@iPVQjMvQnl28x?blsa@Ue>0F4O8$8y%h^1&Vjy*=f_eBglu$2o)F z2s7PXF{dRbv8lLiK86qUZ$uyZ=L>21-KksZeKNC}rP|2S{z_!-YvSgIl)sPAxKO7( za(9=o-7N^q#RAPzYQ5)BHg#6ZZ1(7uMn_I_q@zpt2Og&6(V{2%Il3`%aL8j)7f&l| z09x;IZis_$|m--O7+d)At-MoZZ{`SeKgF_070t-QNrQ zAlds>jqJR#@UM{HI(KR+ZENMME3K4g+)NN!Qp0RI!IM_%Av+)24pyLbVSN@kx3*Mi z`*Wa@J8>sMUJs{ThghIbY&pQ%eKId>jyF1}QnZ==kyw-V1OS2rkAUX7L5?P@Ba*gY zJBkVxj8R{6BAxcHN$wUG@}9Tu&3$rw;Dw?ROf0YZ(wTKqt|syGA#TkdkG^6 zOyOy@JIpnImv?gXJkvJ|zk!TNBc}{Gr^$x4F|mdacuOc&MA774+zB=ebvA4fKHHB1 zj?=rjp5(m8p!_fXYZVx^3rMZ8@Wn5d?P=og2`34w5f4~ly90j zRG;Bju(GKE%kHj>t2zZH(fy~dwLauY^b~k?UQ&UKnA z|8yK9b&n{EvL?xQ$arK1zhYS)>8q@ay8epRK)}r0a6oNl43DtJ4f@`CVg}P?)EM+ zozzx^O)DX7l=j!Oti~ce@vHVnsBqkK$M<(%4ASp&@#Rjw9*Wn;6qebuDgW&XHp3bs z>YTMBdV$XWuu*y}V0qp!4HMyWg*1UIo&4;Y;L;&9-KH&usVY$T+~jx@+>j05uTq}; zTbH|ZdQIVx3Ws^HRS?tJkh|cT!A$K|{sHrz1B4cd2Pa#?-lOa#auGwx-x}~VDf9*J zsKF6BZGsF&Xu!da6jVFFNG>A(p{L_4CQqereWoMh{;v8r;L~7;YCB)cYYG+dC2}&M z>slUBL5xQC3RP6WOJ zf%{irJf#RZYCnl%SJV&V6Z9u){inGZNB`8y7SbZnZroTuL@fJ4nLOaUk7X zg{mY7zxIQ-kC)brDBiL>7?crS=$wso>Xz8+|IXUgv{T(GS+oyZg6RThG~@$w;l9W^}Vg9i|ThK6iVIqRwq0T zcg_fF(i&fn#iDe6;hae;g!*l;405qCOWtWOi?DJSO`}Psg?b~ZX%PjJusr`!=AhLPLPGr0Yb5=N+QFK0hsMOfpKn{)%S0>6DD}Al}T@)xC#R+M(X- zi6U^Mvm8)WDa*Ll<{a1*bt>mLSai8#n6_-(Gc@KezcJGe#j=In)_zkr(Z$+$n%kLG z96)>3n}4&~LmBlBr`9I7-jtE~a$TS^1lw}_B@F|?$>&pvtg_S&VoiY*Wd(-Nk-uTv zR1F_*j>ekVqoKJ=s<07@IuDG;^Ep`CQ7&3ZV<=p_>ZUU~nne+NQOe@s=chj~bfD!K zITZ1p)QO^J8MaQw2<|<`ek_Bf!FTeD7SEAJgeI%iF z@lu^z-&JB1wY}|$dy@a3@3;BK49OYN*538gqwf7brI^Kby!5O;h&m&f?!}VKIf`2Oz6%NhIx*2Wqy6jPd?`wPOyA&P?`VKK5W_HC zsu-M-?l?N;qL21$vx_eO{+8q-Gx2X}dDemQ07HpBAbG}g8F@9Yu^_c9aNZpiJUYsq zvmZP`F>qvN9%W$wCUVbr1~uMrcN~%^pqzQzHTstOGgztvxz;s{*dAeVqY$UD3y~?KSYHX9-sI3XKK!4jrUo_f#)1~=-fld_oY0nn&LL1Q0n#KP3`SSO(Cmeh5|}nkDCmr)dW-2sRD{)YK#ukO7%Kk@cLAOP+a_srT4b}?#=8qwGO`>t4rvtq!TQkpIu z?`FBUbr13f%x^wv3Ee<^f6Z$Q92N;#a8o*fkBt90d2V&=zi(q&|9|K$Z}ranU-y{& z*iOvh2?)Q z9pjk(e{_=;=+@a8XVL5&r5?CgO{+d8FNww+^hKUAM!j88_U^?a9WYB|Laj0VjPRhw z3j`N>TBd%xx=nEguS) z>*l5lQaQ7+*KWt!E+YUbNLFeMKX13ijT@$3v;+P-Cr-&S!$1RD95 zuN^J^sCzb{P_YFR(U3Wbh}ZPPy{Y38vjP;*g`bNs+V|gGQRdf){HN_;l5A1zCMD(a zzBp)Y(n-#xF24!&y&8EnLP$4&2b|Vm}7gHe*}sRt$ z8V^P9L~2*x#w{3Um3Y=Bx2ZIZ_Ses#f)&YC6#sQo;3GlHH+l2tDq~tbFamV>*iWT| zH_oczjAfcFGCVjf84}IT#B-sd@JF<0rSGg5%PAk@EZMZcr6J>SY3u7Y)!7nhg{m-w z+hDfdcE|SX0_kS}SJtfq^udZp9c|Z5bFJ2=TU<{i+0ofxAn94m1-s5jof2Q5 z*LUqc6qB*3Nh!Yn`ln@A5_<~zvWiKPsHR*?z(QR)d&ok+HNR#^^?YxRK2VTJpSybR z6PmL{(Q~L5=p8UEe-77IqBZ?~#S&qG4*`yB0sw!xsU}#KtqW4B7GHe@U2)SEP!U=rIl~ zio^aB=<_wAjE)Y-u$Hjj#p(~sMJ@j!*;uqEd***=`72JHUR+9B=%&R=+g( zu04YK(4QRWw^6>UQx;m-Q5P};u7J!)j(v2-pwM(snOUB9#?n>VR1&wKN`I2DW{LlY z2Np=MH9%6+;k@;kS+Y_NxgV; zQ3ZPzP|jr7wwEXlg;3jC!?%}5N&$>!QS;1R5&1aoM5;!xfPKf)`yWM{W994?w)-q4 z^629$_-JWx!$-%qFmsQgTwb>vCmDMl5e2L6P!3vt)B*|Drrqtg zqu&G?I(%EbA#f6&pH3nZ6NPTyU7tbA>$CHuK4;^~Mvrg^9Xula`l`S9^?R4JzF3g@ z(*2RAKjvl09$J<_czo|*Dg#rGI(SPz@8aE=`fXQP&c`%=~G z;Tf`)56-L-x}>{Ks>n8O2M`J^ee~=ABmC54k-v8A-qf! zobPBvH#Qrzmybd!s?j4wLH`NI(a3;>{#3%`8K)-um%$ss`P&Sr{=?HPwd z#DD7^?d$*fkt_*lVMU+MBVH?45qd$o$2T##DjAnBd3k~6GH5UCg&4CukEkIrdGujj zfk5Y*MMIYPpwCHsLj_aKA``slm>iF(KlqKcZ-lc5shSC)1?`(hF6{uRNI`XfB2cUC zc_*&PcSd8PBQUGs*~nds>mXlHl+xO)nM1y9jg?{QPvw2zX#q9hvkB~-` zel#xzf>E}Y>Pvt-HI)OYSL`MvWg|oDh$UunTh$m}9k9E?tL_=fERy;+?~)RmiZH3- z^$`2WwMpxUl`aT%LdK^07PAF+lV(GteQALEh3m6TKCRl;ciq(*Qf^u{+csG_O5su4Lby#cY+4knMQ&ec>qwc=rK#e`i9T7Qn4-~&-f zF7I8(Sx= zCZHd2EA1sUsS&nRz1w$fQs^qb>^`F8%S>{f@}izQH|bNe@IOZfEsdd`YBSxz9cE@hOXxuQbd! zrOIgByAFc$u>bT+KF!P}TsF)%>!<^g6*UC2rY8wAqSLgsS3>VBmG&4Ur-{frWiG)N z)chW!cj@)xK|D)ZMZ=VpC+;k~ep=dqTC7_GUNZLc%8Eh70AO2O5>%kT1}2|zNH2U&XF!5RHW6yoy%uhLsiic8ZHGqOiXve zE?jwf{nf=jRkh3D1#c{z{r-UCL4iY1XAFnS&CTP>SX%> z;%dO3c}|>z`C#_#RjDg{sqQO`(vW&2y|?}?oHTmh@|;-k%Gh4|@RnMSDekn0*1g$J z>!HEV){2%7$V4x)=bFg$J0-~Zzm~bOR%$H0D{Zf)g4#PLY4WLD%h4@Db4N$7Frfra zb4M2;^y9<(QYErJ7$ogap%Fucnx4`O^fTc+1Nc(G%Wc~5mA?W^gwdvYkCFpEf!OTL z6NU2}OqqlMLgFq9D85^%Vf57^a_f)er}6`%>>KY%_a7w~o($XIW=ito6(ex;Bc~cN z0FE*Mtwl?;>#m6VfSXm~ejl&iiPs5(5jx_n#WW-~I_OD;6ud*D+fvQUXbXkIL&S*d ztiWk}EHXqDS8oss87Xcd2^<2&hD4$(wZ>^1Acn@fE7qkmbRY5Xx62-mxMRjqLL>v@ zCuLhx9YmhIAF$XfuKQLP&^&16jI0i)Ht)wP^pOw9Z+9=Ht#|S0-kQNgQW;c_)2AhS zKe)C9ktQ*2vl|WrBf-*-#Lz;z(cdC#l`J=AKO{_Wpqx-qlWQxRzq>H;4`B`TA-#AG z<54%m5@;3=CIq1!YQui|@Fy(B>pk>WXPiRJ*As9?BLNc`tToAHbLA2AzVu8cK-v1M zC+bUsNEQ-_Ar(sSek;pf_~jX5%#r#GE2`3}<|+_9_H5q-^`(~DJn?TM^*?NGefr~6 zS%d`lSyF(o!1on=d&0d}0^_R&Q4r+Ag0i{G@X-^wBFX(3(*3DF-jskgW=DZup~AAY ziROGv@cC%}p^SD~%QW27Bv;{n$m*mNp#7&zHWF24j(LO+S`Ih6c^3YLM*t_gbq z1N}sHZhr6WlL^jzGZ8yGSwQro4{Gf(&Ds<hbFE`wx9xN;j&>qa99~uP&;mW)LDhP;>aX)NYhL!M{hw<_7G9Ehbl483Gs@ zH&mTqN1DN_o4s1|=2Nu;xX=A4Fgcn&SM};=z-r8;4CRT`F4-CgTr30YOD>S4`j;9;L1VGd&JB2`LTGUi@a@(vofvaS_v)E zFD4Ms-aLF<`6##Uw?c412mOm9$W~ul;t@mKzOH1kx$>`nFKJD4zP@K)c-Xc0zwt;! zQ@aUqqN#|$0OYT@vXR$(`Y+Gi=J^~%o7B!fsyTy~8v%q8((}4dqBHG~B7gnK^M5?r z+ZxY=`u^F`!vU2QgYA#KUAtT2vAC87!m?m3MULv$3atdmv@g@Gs{>fRpHY&p+&YcP*ja%4M>+4oax;7`zk}OdkDVLJ+h05K2^5UaPdO zl5o;ly$NxNwg)T_%LE0#m4*tB>Pdul_`^b-C=(Q5Iql^ujFAH%dnV8hI^e6FeSjLh z+1Zzfk^;1L1&9)oy)K4KOiPMD^AS~QpvE6rs$iIT(KzGsV1L#e0drg9>o~X zN?sK(5KT||w1;GWrV+e8FRxZJRUbo)=6}LFRN%Vzn?v+r!kINphr_4GafanRw(;iy z`|LZw&yyWhQhOyn;b90l8&r532SdxOC4Kbzebu7Q&CqgxRGT6{!}#yL!K_X69%S44W!TtVl0rzK>+W5m0-(hj^`WpFDiP57hggsNg)BLwgRt zrf+_Wh&JVtBz8D(_S~jM*kvDNzMK;nXm9dbR8W!o?@5`@;({%!X50Ze6?apg@-JY$ z0jqvVa0mLtJr|BLJ@UqbWEH1R@WsA^7%W2Db$sUZUU<(efRRw z2K6{+fgHYk;3eRs>jc7x9#iQXN4}4FgmrEv3Mwn~=rvn6E8g!rC(iUJl{ETxYZ{nZpsJXMu=%z`S zrW$2PJM?&^5H(H?mlXg=v_1Tpbz`;_itfUd@H8)C3*`eB2XALM z<|_F}XH`S%EtirO!{Ls(q2w+NpA00t@W^+0x9XC-)6=8Sf371{ue6vcZ{QBW6lEtH zm`v>`HFP83h?yyNQ-7mz2Vp!w11zE_mzGt-{&78wrMfmnt=$pgcX*BL?69%%Tu^OH z?9;4Fcf)$<^MK^)88PK#z0(rA46Rw;P<2cJHY zj(#2TI%UK+e+io>!!4-vshqWpthJaRYC^N$aLusU!@utgirkH9dUhL^?%T}13W)D+ zpe?fv|Hk6V!0BChZHR0wHTB@_o<9U+iGuZK$jCdPLX>ClF$W|`y;!N z7iF&|R7bs6KI8i1wbX6ow-4){Yi1Mghpeaa zaHed84gJE|qjYKeQDRHJqJf#EmyAWpzv##z{x|*nlH{En#lIeZU}|9d8f^4#fUwtO z@sHR0GwEb*S2;}=DVL6XG}LN|X0eksKh{?Sb*=@sgVzBy7A&Q+BJq%7hS3*(Ul6kb z>jGB2ZLu)?G=Lwx88c3}HCr#vp*?w*&)Nc^gu8B-+CLy){(0!#J&UFwe)L><#&adFYT3fZr?KS)njyJFeeD`E*-4=LxkAHm zpIJ*ah1Ce7gj)jWcm(gP#u{vPP~P=MMXyPZKwmARx)$fk#OxCA$)81k$>8#5~~9j@xE8t&%lv zxPR_%J5!VaM;}Kw9BxzOC5q@@^d5ndb3K*F2z`fZnqOB;aukh|MYK)Tx6F}oq6xDb zBt`c2!r?3%yTgM4dDGHBWJ*njs(zl00N%OY!+{drC4E6-N!N_|M}q` z=tZ-RC>#sM&yt?rOMWtgYgS=iO|X6$?bsT!uF%f%AnD={6p=h{8;zgaLp5$#)jGGE z)J7|MVp3<@>Aiqi(gWO!z9@^z7&;DQO|W?on$*%U*%(2zas$1)+QQE@&0nuw(h#aP zqY935i15u*Spz|ioC9%|xvEt*HK_o0?aPC8oLja(4GhINec?G?w_CjeafgDCWnHI1@2wrelDf4>z? zQ-<2akU!+RN2KXEg`=7Nl|&|fq~K`Ye1*dJFX>O9k$e5S$~4pDY_lLKnT0zXGL^5x=p_E(};##-ttkju1D zfwuxC!$r@pg;f8P@MHbQAeRHe*N6ayWxQ*~W0eK3-GA#=16%U2hq=`_xBpR=KY8Oi zAuj1$rk4FFdYXKBNLVNM&$(;&lm_rx*KY`X#}ye{B-?z`1B{Z5XdlkCLmcUh+{dU) zC5VC|`=^?~zo!Q}a0o16c$rbgD62mfp$P-=8m20JZmi*X{waLOE1HDNY+J+}GeQk~ zXWHCBTgb2Nep^>@+)fBB9xysVsgS1+=Ih5gEypVva#OMTRZ>p*-2=_D7a0Y6|C0ip zvWk*&0-ab($jUztWVNCW8iGipKddYwE+Zq)iyK+>70Sbk5>DQKb4fYFqv21SXRXv3 zAK}%&;|@}Y&W+Dcb(Y(iLCI$bpPtebaL-FTFt+a9J0t}t{w95@XGwPBjNQwCze(+D zi1yJ&sj+_OsK){>Z<7JUO>~ z`?MYOQ}}Rsp%I|@86SleZC+fi_SxxGq9b=Wgm4{o<XbgQ13{wsCzPlDb6QEu6NzE6r z<81f$EY&!aC!H2OYHXWYcA^oFqqD^E+HPJW5rdo;B#oAMbQ_ZNJ!l8y+7s5r_}_gm zx#@T7Jh4w+f^bG08YQy^qPwZ{QmMvmVg9D}I$wg08leOgtn}XM6b!`8kDRWeKZy8u zWx6Ge6Gf!9z+Ot@0&!`3?DVdm{`dpWELG>2E^@oV*~~v+DjJZlvgp+HDa#W$s7`>} zaiTbL=eZihW0HR3jgjKXLPY+hup{c!J;-=n>0gycBWTsF`&QKS-O0334hn<5o3ZgA zQNgLjJGArQ?A6Bv)sbR$^yY`>r<`S?m}+_cG^P}@>CT7(0z)R`^Ut>X#<)pL{mXe{ zy`VXfi^8tfESw2E!eocOPkS?N0uH(f4>zC$}Tngj{SyJ6F_M+CDx{^t2q=pu-Fdx6c1y$!OIF*PI#BiZ9mQ@d9Z(G(A)1eV(C{ z$CbUbN1h_2iz`18Rt788Vkd%bItg2-mEAXv#1*{N=gI^+gbbJH14E4v zFBor=O73ktef=>nbL0s#q52{4KIih}E*Y;~CF&i)K|~95LvauulTtLza(5YW|ThyDSd?x=i)J zrG9`{nVL!?&4V|G^(f8E>TLV54W;kcWdX(ZYJ9@!OnsX;sUkArI3sXLv>_?TQ7z`{ z#r^!d?FbfBqJZ1*9!W8zHf;(N1itek@=){^$?UR6o1JxNoRB0mB1rh1`8xe)~PwZ51Dj(^FG zxpg|mBvw~Dyk30gvKaCB;_Ld>pc3N0tNX%uC1KQ?RFLjli`p0b^Q}^mgNkQjEO56VJ~^yX@N z1>@W?h>5KVg6CQz6Sz9epF-u6XOCWHsQu}ABT1tyqycQx;IGUD+AU=(2Do+J3AcB5 zUtk)5d7k}<#|XgHTR$@?`$^}l={v0#C5CB}tf~!cMdiDK_`dGMyj9SV&rIF@J<&~K za8iK06i1TxHPrn+>r zO#GVA0A28yDQBo_KN4^P2}5W5%Jt)qROB3*Oio?A`S>M%^Wtcv&UJJPqT!|Qql`+C z1^;LcGkev$2$BCO3WUjyGM>wrjwSW-o&zi?hP}nd{KJDZz|Uzs+Xi2FBmYvnA(W+E z9hibCS)FY+08HENpxwssU2k>3(4dZP*M8WSuU_x=uy8hLW=(xC*0(uRv`sidOHe&< zKBW?vNm*BFR4CRTXw5|nZ(rtc!76L>J(p%lkW{bp%mTV@c9hxfL9TK{X1?JvL8;wHaa{QLw#1i#v0XxJ+H8HbL+g;)g7H8d*P{F_ zs_hj{iv&Q;lXKbwwCedbYaMy7nRsm}?j0!2C1PtZM=?QLd4Fd^((KUGDD%dZ9EF$F z&(X8x*c{ECRnZyHd%dL=H_~~^&95y~UHD2mzo>IFsHcbn!HbzvN(PMfwde@n_L|)s zV21wK5O74TRse(aCDH%!o5AOPy9%+Fxbk-=3fh*L=1IJ{B%e7I>N`-8Ch6YQov0A~ z=U!i$OcrOX*PE_b$R!81oC?jn`c<=Gjnu(5=x0*&BIz-FEMIWo9y?XOOoB&;iu zIP2r~Tt?%}955Vo9gwMyyjvl+^cBsmJ0jsYg~8836AFs3s9*dtHYPX$|D_ry1<2@i zbr0U|AVe$j+aUFWK^`3K%Dd`~uYMvDkSwaJ*TGoVRNPy?U6q0g-xbJF2(IKzTK;)w z^1!@RF;_Db!RhBEqcGD!QuOF`i8=NGr;%8~Jtu|^pl@0y>OJ#l2%RXSMF+N4fRsA} z1F1LHrrKe9RqXmGd-?;eNDT>E%}guu1mRvwC>5dPJ=WWBV(eERfK}aoe?yzTY2pHS zLlm8YMfVRtEb>0bHtsr)mKZYj-r)%;}pS_h0lLsbKiD%E?*kMn}to4rOXl0k>(unDrLRZn(MMd{LcO#S1=JpgcW0gU%#Dd;?5YAHpv2#q zO6KFbf;&d|W#fhIla_dWWwLm>Ztxa82;de>R1}pj3*p z=SsCXm3$_@KZ`H_mCl`NM|iK3K5X;r@1KbPDHv*h6x9=a#&)QkJFZyLjc#K2sr5&TZKw z-a7*kKrB`!G-h_0<*UhEkT6M)$HOZcv=-J5x7+p#4)3bFk4qZTKOIW`+7qvL>RayYoEMu%yC+^DDKqp$M~zdf98l14 zg|uk=AMCwnSd(e@_KTu87QhOE6crEw0cj!~E7C+oX`v`cZ_*)DyP^WpJE(*X0qHeX zdXEr#kPe}j!~jY5$~-g9><|0>`0n?=_mdBE96E+0xw-G_TGv|V`8)Yne|(xgOGv)? z+*BTnhZWE1BHLDjAFwIKkm6;enweP~J8SAH7rU+fkm%f+a0=KMKf;L@DvhV(ZDYP> z?roJZ(*tNs1+HUrk4gHlE_9Xjh4u4Cz03}9eKtuy7ui?onB&pDn!(i@s7kGIxkOh_ znFX%C;R65n8SKD*ZX;^K-%1!6LT!&V zDk4Kmrd?^R@AYb;s!vtQkIg#uh>V8yKy>rH&5DrW412V7{|j|QH}cSrnpdTYxT`vw zc^=j7%kK^K{qvVwmkzj+hW%$c-X*1J#5LWH{Y4yDyx-iDcdORer%0U9=|inz*`Yr) zH|8``wzVcJ)i3r16Gw^Q$k7-=dT0lHzzGJi>#iMT4T#`XgJM@C?_sPALa(pPD`j{3 zETfO8K~1<|C?ue&fM(f!5$C5$zxY-dXz-Bb3rbnB3OR#_YzI zlhL_mWuJFEi#cOrS4qyiS@Y~pn4Li9{KZgDj$BbUqS2=6R7roleqygn-lJ>2tEt0o zur$Vq>R-(^z*1wS)va1$ZMU0l-1w+Qa^l$*{)gT}mzX<$81V-pcAoG*n=Nyo3SkS{ zNBdhgjvbHS>{Ixme!|(FroigtL0Q=R^=t1JZ{M)^!G03w;IGZaryuWqy_&O>(!L|U zCm&%S@`mn#F4?*=d2beazZylPcyjl?Zc3zxzF5wughAmnsznHTAp<;3ad+>wa&}W5 zabHl{p|_)9IakRx$asd?PD+1RGF>`?{Vqe_-y)pDCob6tC* z)wY5?VZNqC17(h~J_9R9L~{LR6KCF?)NeCRf9iE(+e$~9ibsmAmjh?7=Sn~xIr)S? z(@fXIV^!JdN}cMR4Z0`|fimZz;(+ID@oY0218J;MYq2~kE*G1kMD3mO9~V)OZb|hU z%-957=CIZz1zaxe4xzjUxvDM26X)rZ!NZoiXVz-a?bt#7Yo}G9<+$4pmxrj|vSK_bwG&cHMMiws!tvWEj-Y>hleLw~`k>8V%Kzud zrb%vELlb+*?98mrw`3c@_1;G#EuoZb_+)=WZq%RvT8-UH{O~=E>}NeG({jy zryAZ4DIV>_Xvgzs$<=K`t50p=c3s{Wf+%xR007HysTV1$CS-P1}t0 zIu@9d>@UWk@E(gjt%(@#%12EDQ9PU1-ts|B<)&q-pQ;+*=8w`zX)80fGC8*KNg~E$ zD_+LYuFb1`OER;10AaYU-lcqow!7RPNo5l@Zn)j?!}P55BHY3;ha1dPXK`rf($A|T zXxok0R``*FIpozv7Hz*NrH*&0kY;-KhMi48Rw zBiaAKM(&n~0gn>0Wry(ku(VyI&C2IpNx7S6>)7m+?JZxdIx*h>XPz`qlER=T*cYkgA~t%3;?u%ap)_) z%32#y(trC|k1s;B`P9dS4<&*H$n{wzce9-yIy_4O+KiW{cn`27nHJo=;HLB7 zdnFBVmL?wOI3zOdMKi@XE$kYAh9+LJT4_wqe==9-1EChTLVEl4Im)2Wyer2#^m!={ z>+JBA=l8LxrNqOs_433@<&5h|k|e5;gef9SWXM`&>uk@yH|a_|NT-CUW;cb01>=fe zJFOogm28wVakp}M@><+vYgl(JjUu}ke0K28yPe!;tQgo6uuB&EsGA-1>DDO$v!uJc z4Er~V>l{ctN+_~#YZ`nL;%%?aVf|-*)TjHV2lQ7aNX*`h-pJyr@7K8%;({-LsJVbH zU!%X?iClQkPpqoHbOdyerVR4YzJupoc;wlJUTIZzU`=6^*mkDR?S5ItcJFxN;(#@> zvtyY5KW`0M3Z~l;#2Mx&*Xo;}ezt@V0hn7Tbse$7tsMK*&54A!ZGqLRH@4X}>O+UXL(R=9Rx~hoO`v z9sJL`{zw7F*Bt5H>?pa2sPLb^`}4oa#*Z%RocnQF^#3%%*8#sXMBjgXP*a0quzyBPx^n~qylE?Uen{%tLsQPoea_LMW~X4H6rQ7x?$D)G&;@J^KI+s9kZdQCJ(MFFQPVKGJaWd#3Q zI)t)krGG_tMj1;fa2aDN3WV8*m`t{Qgj9x3!lFmuOh5p@2ODEZM~Yb86DI;F8%@CA z)8c$CMXdwh+ISTT!2LyZ7tPmdf8D(y2tE?+!!$YB)F+Kp`w$uCNlUcZW#km!VNeZ%Sew=H4)&W!Zy^8^7WLWL}Hd5F`{+sBxb;X75oD978L}ehS zED~qzmb^WA3|x)T@2~7h!0e6<%nD2QI!_pz3vA_+LA$RYbdcPvJkkw|@m+AtuBn_n zsytiy8x`=!-gc895J4oZy_j!O`?(QRsc~%a@%dn!u$=BV0YDzx z)w10O`NIHgs=n#D*qj?DrH#}9mg!sYSTur|Wy?r|S0%uhiDg<`lTG|wO34+Em2n~d zfURGXtD539_aD_~Vbk8)^!PH52dp&KpPF`G8o8jJ*ehG^H`681SLU2TPMCVbbX?r5 z;v}6_GC;8Xy1^_tU8FMsPRdgwKKT0jxvHOEF>is0(}Ze{(JJd=WMYYgDH&YL2$UiA zlq)zHeOXwIF`n9Vz72Tx#kl1?!}EtK)pHFBTP1#^R#+1}tW`pfN(?3*OYvLDf*T8G zl(ODc>X@LqiV39EzUEOf0%41@l@hJWSHB6|2b5j=!nEQf)!$!!39#1C+%Xk{VI;wE z6TKb#>F0DOUK3O6&u_Rg-UT=k+wSZVxm}17hZBUn357a?W^Afii$P(UZ)oxgI3A2P z#Vfhw4tfuycyaR2cYdf^qh`ije#O@9;EWDMYR1Qyo!iX0v`M7a72w8jxc=vy`*9Yz z^_Bk5Sx%iF&O_)Qy1QNs##vjSPR@a+7wqzLUdl5vN0NPIdQ1HiS*ZrpE<|4ztp`QYUbg0xvT8r46=$)qaY7R)Vc6+Wx!6r8d$ zXp@PJaeP%esNf@hEL`XBro))vOPV8{tNC{DqB^p z)`r(-0Hv3jp5x;-wQ*S3;1ize9-X(jN)Dtt-#arwZV{)q)r=A<*-8lbbjOonln zUogA)WRYFBhHo$$q*xn=MQ`N1(%r{_Y|NZ)eMd^ICzp^sx zIVYGlWlSkAT@6)RFqUgwpQtcfqlBu2NZ|$x#A^#OnEXSgeUs8RhgOZbB<~l<;d{_# z);i0m&A!#jea>r&X8I0L*8>PwjEJ2ycUC# zn<`i+3fgr09(?3sepy&L&b~mKpf_pkxpE6t@A+-%=P74{Vw<;d=~JFV@+JPTNG}vQ zCDAM)37uV?K?SzT=`cq!N+9tL4Z0$UGwY6kEQ*hcyY+zF95BBp0Hl_{lGCz1lf)- zzroD;t0bh`F-68cn*VyD0i7?I+3irVGJ(4MGW?@uvkJBHqCQLjqvcBo*V3-B5)+6_ zH!_@*u-gZ1lk!C0mJn7Be%A!9=ap7zHRxgr=p^gkr`1x@HNETMZMkkgm3$_m^jmzE z&L=w3Yf7L(^x^&1szq*>7jP+htG1=6fW)%GV>24lQ&I_{%+=*9Keyy9QwxtGk3S*U>Gp#95`DMFJ^*7ll329orgYt zU#q@}4p72W-<~NH)vryI(^DvQmc`OXvjce~?Od|m-rorbK}#o%nHubWQ zk;8rZ^4AMOIH(^>beLE<>>jyoJ0fKK%}n+7W7IBIZfW2kJlJM?Rtmh=r(XE+s|Fdz zjBy0H*(@1`e(kiVozY2>7ZSXl7zWf0&5*giEp9XJ3@~sCJPgqX7QTR5NFp(#e#{|( z3F(3N7SlKD_pj0u?r^(RH6jl9=DCj{{!oFocuyujTw#Cdrnpv)-0MJ)u5t3HCP-Od zPw-Ehfnky;9k;Hl6gDXDTzv6mhNNXvys8^i7ZU@{YH?ze6n3MEOCn1PfTD+8D1zQ(cb9$8AZBNvq%l!;aUt zm1KQ(F)5=HaohiX*cg6(cf&n07Eq7>QEZ?m&z4_$xm$0fpHtBUAp8>r@_`H0yQghB zj1gxrhB?u=n2;0P{n8_(zSIjnmE#f?UiP0VuFsdDU=^n`?mV-XG#_`iQEhRxHLpR3 zQKu7o8VIBSBTaqS4nq3g6hB)LJRoB==FS%~zR_Q}79n4P+p|ahnePK5MtrpkcB`he z0ay5{rbga_`pK-|9K4$zgRqGmb1BtE)FBb+waT+Y13MmVldb7B{&IrdYTXHmW=dyKf5)plnnZY535<(zjJ ziw_E6isO`ZIs?$Qm$(?uGHy2MSjFWsTI0Bou6B+$^M)O1gm-<`*674@YpD9y22`N7 zmk_<6RHYag`JzXnYYp`3Qb%@FcOH-D;Z?f+*@e6!fE{v+Y&4cwUV+IOTviK zIjdv(Xrm)@7Wq>Z$&1Kg-!Ws>>jCUNYkoL;Ig2_i({>;KBf_^E()@q?QwAuCv|9!l z+cwVuqasei8<%S+s^B#zZBjr7246oB4o*bum7>y<_)?DqB^igoDlfeKh~{H5XU8$g z`&|;=0L7bK3J@lSH;KwuPxEW+lg_U)1cMtIL1~+c_vidb?ci;<7$&gxPlIk z!qaQB(zaWb2wo|x;+7SxVVU%+CI@enOD7d|nV_uiQFR&V0RW zt36n6*cMClU#+#riJe+p9%MoJbo~W5ophU#v}~bY_GDTzUD!l)fzvdqyo5D{DQ`Lg zwvISCi)S;tzebd@;R;Df%S|3h#b2J}Z_;(a(#{uMhkmE`Jb8AFa)!8Ry+Dsc0KQN> z4h}fmYffH%eSGKM4bPuBC)I-aVRecGF>O49HgqjesYBnUjejUi|#3{YeZ$WNsCj3q+VcRt7k%)aNQ3lvz7UxGwm60q&+n-bPhtiUgr3 z*RmtCv{Ezut2_gmu@V{9?eVsC=zOD+`0C}l1S`rH;2IksD(pnetTBqO7ucC!*u{)i ziYuYCW7>AS^}w{05o>t(9B(RHwH)P8AnwxjdFPd)9AJ{F(A={eU*Y= z(jD1H_-}XHb@Lk)+f3GEjMaxA2y!|gToR%g5k8ueU4?EGr0!mt*)!PyL< z564i)Qod?z^dKA*-fH&vbdBKD9f@H$!p;^ZxZIfx^~d4-Ry^3j!M zKr!P-*AnB49XD(773e5FPY3+HwztsZh#M>R?lk9E>&pl~iCT2QlI5q&X;jKM7>S}a z*~Q~r>S6jWtU_Ch7;j60kIuoVHXKw`&97&$mIFk`N#j^Kw{(xT z0J}ESY)?s=MXvoKyGyR06|`)6Jg?J5TFnz8ddgDsI%GicL+dGf-`1}~bY*HB?Q5IM zltN8i;+9C-jK^F6vyHfM`He{ff;&j}D_qIJeIeTznHoTpm8Q|1ZKVvprkG#LqX`~3 zi=3K^HauBAg{HKuT*}BA*MT4Z^m+EPeX$HuJe|Bv1GOzd23QV|OrUN59eD8STRV2o zIr{^%#b|xjm4vBs9sTBlJyOPWueij%Ro^TMaCjR#t9S)f^Dm$;_f!|Z@?tiy73mSa zlcNrRQSBR4Ff_VS2jvcN^^Dw`VpWc06Gdp;_vM;jIwcJY*ACG;mBqXFIN?i&c61j{ zl!wR-728V9^wd;g{O8Uf7@JM1JR>k{XU^u`Dv=2QX(D}Jzg2s2r$ULi5)Wr2_EULj zKgcL*9g4dk0puc`yV=IUtg3S6=yZoznul`#iXTk(!$p11fo858$56p!E@D7fxm6sa zrE1DJ0gkXpfQV{jv?aAl7H`@pwQ=&}@6Klc6r&jm_gpvrYf)Zd>>X6mf4mXB$lnHQ< zovFjC#?@|9Dt(ofujJa00f|LKMZlD9xDs@bl^iBd*KY%ABwDUOpM2SM^yZNw}oKD#?e*<6r9*fFrkUl6NK_ zVE%H>vC9B(>5g>{&#R!Lt!q?fCos_z6Qk_E0fAb7*EB)(q`{C2EF<56Pa{?V2TYDl z(0Kgy`hyun6i*cT^C&thl+$p|iU6m}z`x!s2%91`S{HwG5 z6PL2g(D{jgMl~vR5VGw`E7bkncVf_a#vm7DeF`XD;pa?@pubhPHZwF(4Ki+_iKeI+ zvp{Zf8M~fh-M`c)@L_bs9)*4n03r6@uTOhl{lDLAe=%ZFh*!})fSfD9S3GaGmYehX z`}0APTEW%5{|o8G#qt^R-v?s)zrOsx`q%&8RdHNiD(qd{_T*tny;D<*3GV*)pT|CK z4m!#OjwQz>pT5f97=J!K^4hUWc2=)MpX#c~Vjl(plSBsY%VFt?$r#QkJev_LeO#{gD<*OZ^TG zJhN{0(q6~E{3Xr!?Y38K>Tzol6IHl~0o|W^bo-nKAesp098o|OCH{Dx038WG1-rDv z!ndz&5DCtIlStvlc`VWJ@P_-$q>_--M!_IvkxxP1>JQHc#Q%BE8x%)$}&QI1R`Ts@~4mM(!5Z62B_iVCF(cV=IwQST>pH> zvESbae&shL?$7wl=!z9y4nF!h`CxB{eFa>4(!*0Fl!3-a zZJ@uEWc>0P`NDl@-=aL}wS%GyXy8^Q#Qo9OH3jXlH*LC8dCd1r;uyFEL{S)-(+*@D@F*mw&Cni|UoV>t2Cx;w=F-U@}!s_#E;-+Wlkav}* z%1LEnW44XaqE+(BLXqbHRc%K;?%BL_-^;+CtDLFo#qU(^h$y`7>&#}OzWT4x(PmDUxLw3Bv_N; zB;F?#zNg1E4OUJdPK@++e(1{4*AX(!oqk-Hrov-W7tgYrd2aR>jy`XL;KplYSIgEd z_ZEAU33?Y7FQWcak3>G?U|C0JHTTSuQ{AiqoBGIbSNja}u^%xY$LtNHe1iI;#jB0l zL6R3O=2rB+M$a+`+~Y6rY;x7R2o4_f6KVD8LRI)VN25P;6aTzes=X&vSrp%`$}Z3s zJGz}rfqUzd=M7u>T~go6Q;54Mn@75~6h`H&-S^8fa9K3Ws?OPWm(IAr@H7 zEYczC^h}V9r3EO_CFfp=kJq&(OfH)F&&wD>$+wSlEsh>!04T4EFnbh&VkHKe-Ws6` zLl9*lMKs%VvKTn$$Zz+<#>#A(0I8)`{i9c2&E0+nlnKr7;}^DX>P};Q2$EkCpu|t` zXigEwDE))SlQ=`Sb~va~(!M#7OJ<`g%2G^0g55hQr%OXx(Qi+j;&f1PtwNUbf{$fWFH>>t&`l3^;;5ip|&x|Dk98HbR zv`rImi?zQN%A*CEQ~c+8YsU&>#B{Ho(oP;F`2*IzMcPqjj^jl@Yb|(&2`$Pq=>&nNZ8yu`(MT-Jsmd$l(WE)o4 zlv@dTo6c_sihuNCEp2#iufPB15GfqQ^W?Eml`W&DvE><;Ymui5zrEtc|FbghFa2^S z$hbK?re@9iA639EJ)J9SW`=W$`*2UuUgdIi;P`?KS!)bi1~HzKI!$a4d!uwkC0_iYw) z^m1mMhukLG1nBm2I9SHD!$DbQo2R2kK4HECLr)dtQuezhX0oS-tq*9{vh^o&=_}9A zn`_hJaTdRyFT_P!O=;V~@sF0|#| zIJwiX*kcy(PEK{|#I%9Tf$V|Yfe>qP`%#;ZW3NdIorLia`+pXK3789k^T!ghU?X-P z1bg^(F71_IXN>vjKu>6mI?d;^nP-%adkmy}2)*#- zY`GpM8AWN-&yB6!<~tRr_U(@Y+Q%vV>-LkYaFJR|YjL@@sTvCXAHG2>41iA}PC42D ziz*2cNZP4~H{9X5T{;Ee3fHdw&`OoxyJ+&W2kgg5a~BN}sR0{($K&K3%pF#2f5mD$%cE#56kJe^0Z>2wCYTpa+D$V4lE@4dQYw%cLN2ZmeE7ZI~uZeAbk_{^(((G8zGnnK+3U}4U1Q+LU-HNMro4C6}@gY4bE zUaGxFr@G@hu&!_%lhaLap{Ewhxos3vn3o*7Ti6ikb4!jsbFGW(w^XFB<^R3^+!KI~ z#6ejnMfxmxu-XTkyz%MJV2IU;V)2AMXZjsC;JzCF_HxW~4^28u9-3?irLOKH4{ZcO z|FnzznANY!PA9(Q`jJ{&RRdp_hFFOR!$tTyhfL^S2Oj$&`G8w+nB%eX`QVt-_mG0W97mm9VP*aID(nN99U6>6GWI>vCW?!L69c0+ z>IKkH-OLbsU8dT&$u5KE=^G5-p1xMYgkPTpa7DGGtpr&8=?PFR22=6*bb$qO9ULF` zLb#QLVJrk$2*L4AF?)}kxm$S&=Y;B}i#4_aC==|feGyELIDeo8MUA9MoMAuKg+Xj# zyDn!xsfEc;nrclVkZSTVQm3j)haI2;!|~OmETa?L5|->Rs+`+3A3p3>=|re!3zFD zG(96pHH2lWYoArLOZ$Ufs6mRYZFQ&5pBu5jg-1JXl|Q)GcXytEp=~rL&uX^Qf$0eh zHjQw|E`}W_c2zGl$JBn?P`S(3G@Y>H?`)sWm&4H(K-XWWYu@>W^}1CmtoHJH6`ryx z78~y9fusE}J+ych6ALTv@A9c0Wl;~y^Jn8%MsL4FETp)M)om!KJ<=3W?uN`{j@23v z6}fiGtNne~LLL>}MoW<*;miUX`=qS3WLqwjTwJRN#HV4GLjgTBF5Bh;44D>d=4s}Q zIVreu)wj_%FWKR;_&}@@?e9y{fOIVWigm9x{IujLon(Fv$@^iI>$7q0_Il`O^6I2| zn{fp{kln1}IMX0)G8B)rRW*9t$$8qYqu^aNvEQB!O^K8D$TqHia8o1ljL^$N0^zWP z#NYLPy64E2hgwa)(X)IrYpBx4s_rJU<{*dYkV^03Fhdwe_7;HGI~0`B!L?g#$T zsxn>+ToryZ;b6Mc(uh6-A-{Su7X0=P&fNM&uRCmtD3vOZR;3O;VPPEFBqkiC5my-F zf$@hFSjqbhcZF`Grh<32cLNiYYgE&eCTdWS3L~O#rk7~%>tEdK(Z_ZAOteHHz%+WI zJ6k^nT2L@leXCV~(ai|4Y9V+5n{89HwOPCwidD{!mQN2za025((O;jl#M$46VZlmw48YPYE2W(~ zzsw<&^lxQc7xh{kidx1{g_|L7K!HXP1pjF`+`$Ms*sXYvvQttO@;Z--r?J!4CfZ@J z-~tmX4}YgAQeDh&Dy#Gpv6>AY*L(B{aofA*81crugtGhV*>_HbL8v#dN-;j!LAV!R z``F>P{T7<4eY*Z4tx!IxxlT1&^zgwvV^T5c{JlpQ$H9VoAGXd~y-qyu^QAJG2h;58 zTrBxnAH2D6=!}4v;*5oGJ$@)a1?f}1>aCSAuia>$a3W9Y<~0!-814tSSo3a3IP{){ z$a2&VG+uS~N1lEDde9?z9*uUT)4TF;A=e(X0LnmbIiOH{1&fZ+9hWv#l-210{wd0{{wSn4P z*z8Pio^i3Lj~9!6e5+E6BTm{Un0$;fKxJf#wFSDP#L!Ja?dTSx=aQ!yG9U6hXLKdJFf^fG!1w?p3$5Zgm&Wb(7Bz$t!#wOPzK#Ds$o!m5wF%3`lx6+)xMO9ZbfI zoAfh}^LozMO=2^g&4i3{V;u&IJ9kt>GQBG)@rB<1#Hx60*q_xQ3VxIKDw}#n?%Z&% zN%Z&;lV8P@E|W@yBU-C>w^}Gq6iiP{p=c1rP!_!~l%87uU1X1~9WU9%lXs8$mS$pH zCxUlB3E^7L>*MjCiCt^V^?x75pExE3!NWjR&w#8!*{(thK`FdgPbqP_uX)ELNLehp zo}%mw&FP&3)Ot#7-o~ZJZJJYAt1QgmH;ixx`yQUqe9tU)4^t%#L!CV4wk7K{XoFOn z#-mf@c;Hu}WmID4_-IUnhI40Bp|go>=&!&?AlL>F#tpN0D(YN9zN z&WA#0DY_K_X3mNy^b#T;v$;^!qZot0IXG85keD+%=Iiu$Fh~I=rL)#6M>Y$u1D>fC=`Bg zLrogBT2H(rkfFHsI}wux_7biEbZmlm9}kzu7=QyVqspfk^RSs(KNO^a%{gQ$-tUGt;g-yI$*BzsFWoSe-z1~Y7zQsqc!jCs7 zb&tbYWMN0^L!BQ@>3sD<3&zw;EnY*DYwKz1)6me7Zx^&A&gT!Anz>E2%1*uPS~Wy) ziW?XA`jt6uvgj73nST$aw(UmYxf1x4&?5Kz}mYm{e22|dndSL0>u zOF^BY-e2l(rk7{RM_$=1t?jWS$irl?$1mV0Sj64uL6J+dh|Y*Q9_f@ar5M%L?l!>H zR@*^Sg2ZS=McmiEIsh=lPt4#&O-hZKn0d~?c2=zWG@l-I5j|_>zm8IxSf2UwQ+K@g z8O(IXtSaOq&jfI*mjh0N5^JR|xRG(6E=#Ba4+HD7rh?xK!#(uc^Y0~dvaimev zYugGK=o3b4ZVdU`pDnpLb}IeY6o{C#q4|8zC~_B9krC{fefF=^xY0PNj`=rO8TY>u zU!f%)9rb5bzK${pvM>7yE5!O-pR%LGNe>t>l=y&H=tF z(%U8zWc?5h_Azyw)##faD)GO5ZZy4BN@z(|LR?Q#b}S{|Jm=7RoVGbHi+zfO5VyH3 z^SU=Zlz3po`348dQ<^54)7NV*g`zxZ^Xdq}`jA5dM);yh#g3+f`uWD^M4MK}+a{cc zJO)=_!Wbt(NQt&xOpA_EbJBo@nl}5)2~^;Rz?{_%pU?i!LXX-a-KPgKLUDeCn`^+q z_27{g|NUqvF2SQA^C?#}wFq+NbarbYvh8xdwk4^A9TL2L4SPx(R8T$XBDOl5{4Bwx zdT)66Dk+Va|A%Vd%FjfnG8wdU5@YKNgN2up?a=lG7t)Uma?PTAwZ&;I@u|mM}0%hYx`RC1w6!my^@O< zDnbO69Q$tz0r{Ek1Wlez@?0KFv(=4L_J6iE2a9HpN3NZYS}2!{$s^ycDKYU08HUGB{QR$k$Z&Pyw2yWw7Lyi>Dt`-%~Y4slJ6K#!$4?@(SPYm z_r5%VfEZz*v|kS4GBo|z(>z7>2S0Z_&I2bAn{sZR)8AnIz9e!;pi$ldGb2e^q|lnO z?7g%_T>NK1zlXO4txMn`&Y|ova)!wVFT(IplXF1KYP+8BFSrG zu+s5*v{TYmcYZg)z27RbZ*yhVux}=WD$iOPNkH~smpyJ;Y;4(A^%^Uq)@qlQO|BGfD0XXdh4 z$BT#=Jdg3GsBD=67|(~w?M6;;+~jxc{}i}+7Wo?FR~EuL4#U-b$(+i!n-4Y@@1T+A zBhzIl_0TaNc4oO&JX{6bMgpidur|=}{&X|@wk`JH76jt8_|O&n5F%ZD0zKa72r>2< zGhXpmq4WLsEyM7s3Qo(oyGu}DSk}Fsp|k2WU?!O6iVE(kydwfpb%k_Ly?VmAyd?Rv z+=NPyP_Hb1dT7OiO}`%1u1vWMx>jLG(<#s;2Okp5FLuOUh2D%~7aZFz%X`e--Cn_r zUmm{V4ZThQ>$XJ5yg4-kn{OQLmswyGY1sbM+mmXgx=N|5nMSDWL`9!3XFj;kNP^m7 zBzkh2?W+Y)>c>sIKBk}-u(hm)-J_Iib0hC+Yy8TP7hdDlR)%??~CkRPQS={Eugk8gqlSA**=~#kaQbX zJk!+(C9?q3Dz9)ojmgplx!dO86cp>TkL&!W9Ybobxi~T>JVAV!h9L2rip{naq%1$D zPhYNva;$b7_giHXO#?JAz^Ei=Kot-DVwyT&Skj<4f%837y?l^OC6zZ&g7SP|GeV+x z&hx|4Dv4YpNp5T|^5j^0J(!6l)FA!&LB0`9Z^)($*P!&^StREkQgbsSATB zbBeoL##078e|kf*wRX+VaiFq0Ess2#BS{Ah?|cGDh_Q>ObmIB%Wa~v0js^HlD+eB> zD9q2Ah9;GE;mE-9(+63wg?7#y8m034!Z476M-D~b#68eJ9F}$L>fPZ0gcExmW(A13 zie%yLPav5EQnbsD1^&x(G&oXm^zoKYnMX4lHn>t_LU>30@7@o?2*(Lkp1R_P)IlFN z?XuBrRo=g!eFg?ar5z1l8^8*4AC%53ooY4rp`+WC>2gRt{!AQ2^q)^PV#}w>bCn*K zG#0=mNLL9Fx#c0<731_zubhFwo9*N;8{UzB-o{WpV)H*ZaPfbe8S0-a_J3L=_PM>5u{$@{)+0ICoBbURX^>%z? zTD2}CrI1KgAvHBMRZ1*N<^D=ObB}BK`ugJflG^lfv%H_7g-YFYX5SS^o?s8$&G7A1 z*E5Fw;!@wf9vW4ox-q=4g&zLL`GK;5KI;@m@BtLTsA?0{U(o0YMFzQ2!t5)zG7!NbhrP*tAxF@>?$Qd{~ATzk`4X}&4Q?v(^)GJU8 z5V=_$D{5T+DNvvg7CfV;D-(m4+P58lP|xjEPTPA#_&%fp$~hragldJ@($|hNZNH{& z_44_#v56Rc zgSufBbFi;hjYmD)X~+HnNzMMVk(}nNywsrX{5#k^?3H!jt0hsIhRtkcy^!j#Rl;z* zu;n1D)X;ut6;i9TlcoDucoe6_w*^HCrHTZ#r>Njdyum~h*^M?+(dBpFc3jk4f@iXF z`egH4sSFd3?rzWZZv9P7tTUVnJlmC&97ZUlP0d@x<$B&KkHy*?#QW{Nd)>whUTygU z`1c7$dhDi--<`W9c70#gB^g7!(pa&A6|vEY80to|ReQ2yt8;B%^cmAR@i!U0xt&U& z(YKwlYF`j<_3q*%Jsf)|To318YaHLTntBlKx+*MIgJVN6`8k3H8I+DcA3YT#UVdM9 zUPSMH^|J^DszRKoW9HkY$iOOUW!*XG>Tb>zwGT?(9Mn&Cf`RbD;%ojqTP+4PQ>)B*?pL9?_b7PSq$U9Dy=he$W=aOCS-ZQyZG2CVtD`i7O)LO8NzhgbN0oW9rniY&`Vr zzf(5Rn8W9lEhoLbbNSh^;UAtYpj(s1_L$R{U!8#5!va#NL&>|Z&n(Mr&t62yEHHAI zcu#nbWas1uXNN0(sQVIeUB2GLjX*SBGxDei$PFEru6P6qnrl8*o- ze!m5jz+HEn4uR$JP^sq-a-h&HMifDPw!VPHwaKrZp>cDl8DV1?LULQ!SfxyMR!s8i z-kSpa{+xg(Zc}sHaiN{=J6D&2cwU?;paEl3h{>PfJkS2W9{f>}dJKg)z#ldC&_=jX z%I-`HB#YAq!vouIwfS+9`X} z{0X=+^qst0eXT|B$mg6YmzfaI1Eq2-JCo8oB5yeu!q&Pq7KeVoCjS0n@*r3`!8 z+m{)yz9UU{4zY0k>cU@CEcxU=x?G=kb=}U%_cJmjVC5x-Dahg-v_Be|)`GTIJ)#N3 z7>|m}QEN7uM8vLk=iVG5&JPj9-;f|G-1p@e;n3uLtnoyAk#T6rVlBbkWZiDLP_uAR zXmQKNVCcrT^CQ0w>f&92XB1(Nq+J8PD=!5HODAinl?Xxi&3BL5y9%lSOlKs5NH6vcMV@@N@QTX9)$E>yJZeL& z0FPh=uEg~Fo(abv4R7=J8*ZkO?8_BUHHZ?sxB}<*t1|b#c#B8;_%#2@6uS{|>bm=- zL?&t3kEU3~6nXv6we~F4ovcdJ3$p!z^C`qjXxpTYVYAO<9AEz?+kWBbv3L1zVod!y z0elrdZNy9cbe3IYyU_P10FTNziaps`g7zrRpRT!ZrlTY7UEztN8d7UU`ulz;3+tU0 zgMFe-d1IQ7-R!Wn`#gaXkI?;E{ybC~a%-6E-3Ib@*S}x?F`|6b>UP&5(z*|fK#Rn@ z+&!n%(KAJBaqpHzwuTSQ`7RkAJD2M<&?RBRTas+b8j5;H+T}>^oI4%6&;kdp49ux8 z#qXcSh3gr!`Sk^YCk0fJGfCbQCg#BxhnrTP#T+$AT#r$;9;bTYmj)WeD55K*i2y=L2vh{wx zwLVTGWyR~;3(pjxm_7VOlHN(*0oTS{epMBunEy@UngHFJ|ZdJIebH$7wC?K_BiR|-OBILmmwv>8(U zF}wCwt*-aU@>rf1I$2C2368h=cQe0DPCvgY*kYeX8uZ7RMorp*{sx3+Yvti!}TieI@RIoz$jwc_T`zt$F7Mrk-(#8Bcdq z+}yqqXPr`5&*S^!y8O=66K$(--ja=pX&ivw`mpJ&fmKFbL|)BS6^kO>JId*$0( zeUWPg87av>yWR%7$$M>*0`Eg>EK00Fh+?&9|Osa?F)i^CcC%V0$t3PT~s zTjHAM1D6n>FGv@;Or5Fc%`+$*UEulPwm$vAVyN2dr!>uEakyr1O2j1p;xwpk2Bte% z`+}&9b4hn{U_%&fM_+x-3C=l%=o_8GWkC-LxmfjK(`V*UY>>HJF*}=Ml5F%!rp`t4?;{r;8_(&Vx#_2_GpGW< zUuI5kObuaPpEx&FF(Y|lx0gBsgR;_Z27{;+lWHD`t!;zb@ddkp^5el9or|I-AHSI(z=Gp3@#N=wZIzw40febTcd@m{Y>x+_24f$i8G~X& z@b~|EXMl?Jp!qWzF9xDg+(VH+pRyaj-ls#dp=2b-->umyHlOLToQt>L;aAgZtHS+FzjT!`~s-Jw?soOk$Sg7r-ntFb%*-o^eKGZ|ue8Hy?9QRcneNeTjX zL2l;{XYe4GF0eO8I$B9{+pGBcN*~KD%+?YhD>~F;` z_XJ0oekspEm>s!pcO`pArcqRm%xw^iIeh+d<($)?cY-=pWvkxpaci$SPa0em z?;Wf_8&bFL%ngfS^PA|_&jUEz0tKg+V+FDmm*zF2^C(1$57DrSG)!G^MqQAZDj(Ku z^>wxj@vOY9w3F?O!N?w0*dQF;s>gn8xobv?xz#X74)dHHQC>W1RY~rWIfDnD_8ify z`O4F|L&?ad`T8O$>wZ7+p`mnb1gT%cxz7vlKb5@8T}yV*`vbyk6QAi~QMUDTD#dFv zZ|ui13pX(+N3p-g*DIXoZRcPa1Alr`!97;Rk^C5TGrvaDB&7i+7S8efW9wZv=Wd+2 zCUh#ZP|L`oKd)?fvZu51J;{!u#>0_dw{r+;s!`!LYvg9U_t)?C-=D$?*jw#`2Fpo= zF_+Iocb_MDBBn|sGs+q5zIf+*FP{ak%g)?TC1QEa(&(#mjvMa2O}?S#eXH$CQ$06* zE+R*%F9j3n=a`SOc%ysh_Jpa?)M2z+iPs_zqHN*DQ~!}Nvp|o{T>lhlpN~1lx)0Y5 zFZu+Em(Ch^w4gNW>;2Y$?L#vR0Oe7pc0r!xFU%s$V+wZH{JVY&gK}w&2e3a*ZXufzQA)pHh*}D&Lh;>exL4rj+6lkif%D=+wN5YL9 z-r9^khnqe6bj=}Sk}%=6WrewAW?8lSk8$+~(FXYqlw5-^IDyKOtZ zN`^kyysruk<$l5L;#hLmt#+Sf4Ic@mHRI-C-$kVueNEQyS#IsEPR-T5DCxFW;*^wu z($UPTo7bFcIT%hhMjjb|uQ#W0S@^~EI7OkpcZZ{v=es7Zm{#TMq zxQ*S5B(Iv3vp)_pa4`q#Kmp{otiv&L_h>nqg{PQQtyO7mnAcx2^f74k_9n}`$wXyl z>RL4HMIvtB`&tvu9T;P{uOW*c90Zf{ts$8b!yo(mD4fyplkO(rg@`-Ij z2>0QVWFjWttGz2=rt`h!UN5d&@BDo93v#|h@?Ltj9$~Y9U^tj#j0%>q_q=qmIwD*^ zqjG!WanI?JwYn#K>Mm&}n?$i_A*;;#Da#nM1yfzr?YNJYLvG(6rEXVl7|S`Rbwm{z zigaSy18jZr%7k0tMWr(AF;e&RT3f!!q4oC-;HNuQYxpSn{X3_c`O+tj?Bb?h21w=$ zK3QF;npguIcTPx!IjYI2!n}l2^hsBxXw5GkzZBseIL|B0f4KXpp3zO#pFx2ju)>yO zJjrXg5aw!??iyjw{)mcJM0cJ2h#x3T_dIM;1-b4nKFc=dn#IePR(BKP#YP=~<*q9|$?wRci`1W~hQ>>xx@Ga`0MMD8=6@ArHCe%HMokL$1dzWn1KJR*6&&-ZyA z$MZN|zO74@S}8D4;&9ea_WAs!bng>yxCMs|z6iwl`6IlAKvl|uDjF&y$yTi`SU^A$ zb-HVq`@V)oOvpCP%F>uWAa-tu+bPS{N|dneK?~+Yg!4yWX((v4(|4v0}uAqmkJf0 z(pIwZR|2TVTWvelyj@4@ODbDw{yWP)%@V&Ur_mCtG%4?AL#cPZh&j#KNRdh^rY`35 zw>2G>{|y)J@;+EO+sQ7JLb~#%P0t}~keQS9L5HZiYuaSh+9~1Sk{#VUv&{EUGqXUMMt=ExzlV*s#7jHjYy(-03&z}+XWC~r+R%9_; z>k#zYso0tJHE4>wSq0xp`ZdxmRiGRB0<<*Lw&E52k2i@HbcVIhtP-oAx%gT7rf9SbJA+Trc9PCrdl8Puu;@;=wjoFJZ~3d&|U|7k9o0b)i(wRJ#*UD+m8tDOy_ zvTw%cp?^jTadY!2qfTagf$gROQ%)wF7D;(^LGKKfkL~gttRr$7e}=iyh&;$;4n5D| z2y9><2PI|^M{E@z+H#3MLL{6!S!gsM5rpoloPDMj76Wxrt@N-G1lKX4K4ii>*tTa7?u+4)>E+K>f71i=AwmlLUXW% zh1$JQV_~;=1=qFDj~t!&q-i)(%q6ed2X=$6d;AF#Q5+caXvfG;F|qbTn*4F!cBeeV zeK#&54#Ne^%sB3SM@A$Ty$``;n9BO8yX8iop8w?!Jch~2`-gVsTVtB@wc%} zfvN1V&lP(LmwZ8u23hQa_NgNv?`%`TeLy1)kZ?53&Gct)+`sUN11K(e@zBfhcXT`Y zAYjI@s>D)qNYyuSFUQy$&JT(}p)YgJl$$b(1OeY_(@{(8_a}QvTy{_e=JW5xx{*V- z6ivfzJGq?!dnd4p>oNZg6##diE6>XW-vVrCim)NNn&0V)kjdI&&!`tyTewyzJCjJP z+E$xpMP6ONX?nJ6_b-g?<#R|))xyyhN618T^`VAl7e7K8AWKON_KRfo=;%GXNA~d# zlVyPj+zMPc}0ZSx;T9HO4k0Jz2%+|(NcdBB*Yc*;eRX=s*IOnP(5k+q`?4y~8+sRsms9rwzk05Il;v7?>kQbNSgI}LR`>{q zYlmGPrfCbAzY&7r@I}blYCGw9QHDS^mk~5JRaU(GeSve4f^N z%9N4vzwG5UVG|&ZX$tzc4tZ7Xe3y7VK7b7(L4s8}at)SJ zOrM|C6T3b{;Z;rWRD2aOOb-Fp_j<5)p8x9CF6W0*`bB`P{BZSj+ZP}#4O^pOX|Ri8 z-zA6WE`Q26ts{G@HT0^%UG<)O4H+OwQ2a}FGAnYTXlju1*s7S$J>v46Rl2CEbZAl4q1reT%LTk)x{Tk{ zZHX=wuy#f+^e_$Gh?Nfx>WLReA z5vJVMaF7Ous%yMWQGucG?m!X(f-~?3S`-;clQX(`kzrK(hkA0kkoadViT--*L^}wB z%~?m!y&Vc-;`>~ajFQ96rAslcR&{du_ktkqybG_KMen!$5`T+aM`jk?(KENe1ae`0PYp$jag`zpMZ zmo&V)csEPCqIvY2o#gfIttgB`E+*JZYM&KCpjxazfA zM5>}$Cp>)dIPJN5$;qd*HzXVV-_jX}TwtB67TY)?F-55jvpHbZA;<*KvGh!=ZU+6& z_4UaBh|06ueXH7VXAa%bUtkVBflk<~6jxtpfj7Z41tNSPTx_o-CX>F5C0#K|DoR)H zP8H|~*@Maqb$=CfqV8Qe;zERBI(4zZQ=?|;Q`L}SQ(;**3Q(RjuXcF;-8envH=x)$ z;Y7|Zr8JVK>PGCUU1s`sk969N;_{x8#ojEh)WB|db4#WVhg3PDHI}tYyIu5SZ`~5~ z!#<5*F|KkdHhDmR;@p+(B=qX}YnYk%{Wtll#BPiX7FAi`g2cMUcvQlOI$Qwk^` zAw^gV4SjIV{#!afOYGnmVM{sx)xt0##iAR1mwS;LoGg~#Is=_m1@(_z3uN0<{3$Kj zMe9xLS>?^IS1{nF&#ISWuPw03kd{Z;_2DU!;SygvCLCjmZaP{OAOSPO#FoVoZ2H2T@_m!L5-bI2eW{|6rXPy{Atf$g<~LWmItJBh*0D{ zRV}2u+CKEh-eO%NO&W3BM4uDqR!_uc-$_X-eMe6(U!?E};3V}{kE_z6;Iq1j9r61+ND7>qJTM@hfhus&Q`IK>HU$|y-rfPL zRx{cfXehYQ^oy%^*QYx*r15&ef)P@DKxw+e>4_if>rN0@IywTA67Tjn7@K9T4Q8Pl z5dJ>wd(EyaT$gW+uoSrJT(f@XOsY zpp4R=t=QNW3K**i4bQ<`yO&dUnT>V_JFKvLU&peiB=D3Q*p;>Z^UMj9R|(`8oR(M~LtErp)v))*PtZLddpv3!vvXM%dIl&W^5#auf{T&C5f^CBDr{1@uD@ST= ziZ4$F9_)B;|17>gpvVxpmw3GMLfJhVQ27(K+mIhxT#zCj7_!jqWv_RUMwtaTrgOF< zzE>Z}{yO&i8J&rIAka;Pnw_pz&)Ck+#0KOy57mGGUn(J3y z@vJg|>0i>$XBHxay7AD46A!&Vg#xcNyF(GU&%f`{zHJ29W2fzL!`6#^-^7OLR}2u| zX*MDZH{bNG_(q3fw7C!tybylUc1TF zJos4V{5q1Q}e2C z^#f`o8(3H>at|gUj-bcoThfp8{>OL|G05ad;d)gobDvzuxqdZA`fr~7KwGqRn#@sY zkuxkb>*56S$$^4(I=J+g_-i8<2~j6D{S!r%0m4*Z0+av3d_kJp=z97>j>W}Ne|L;{ z4etTRshL(?Ccbf$JY@~;w_IZi9^_yMYavq956sE)S>j7kvbkf-Mtbv$@73#^oY0F54{n(YM}KCGTRuQ5qQ`!| zKTWRs5<>k~tN!fQ(V~wF&0Pj!JS5lp8$FZUXUguO3ScLn; z%7jKugm6EESM{qWj^F0N!R(;LVrgZXTL-K2M9daAxl9CFgxn+KCYtnrlO*RVhlsoa z38No3pGKGfI{|#QUq(Qp0z81G_u5%3jrO+7O+jSu(C~tG<}k1a??C?Iboyq2zOHudph(Q`Lipt?BEnvmTc%G_D7~7WGhF-zygPbrkckR8B^t5(i_3iQ@ZBPg7D7K$8#*8 zBw}K1eSNwVK#ATfxrue#aL=RaQcOt^u@NlMyf^Uh#AnLr{ zSjge=0}p(BBg7t_$()+saqBE5C=tg&#Uln%Q&nbaGBp?U;2%56wdHKJ6&XrZT_D8M zh*CfhB#cVuRiNZLr9&4Ot8-O9f&Wo<)~KpPVV}->#Wpc_zb0gdo0E|tEL7zZgG~=e zP?g$*?!jU-XInnvL)cv^0p3wh*aA&gm26^8lgW1J4&ZUrNF;GugAThgW?}7?U}DTB ziGaiaYQoW_scg#pmU2q>@g^zX0T|*4>T{P>AKLxOtIy0IA_kbGRBnqsy0(;76#<$@ zd2_bcqx`{z3UiF_b_0HFG>Mv0&W(v=C%!ZT6`}J@f9K8xcg0k={(M&p4pAK-p7hhw z{f~X>Wc3~wjm{82H)=u7qC*Ta!~+AJq;6b6e={lFH^SeBe>5TbdW+5ry_uhxZTkeC zj}p!U-`~0kIy-Pu?dwkR-}z`ah%-VA2CkU)!0kSXBNI0_Of|%#tlA|*Ze4b^rG{HA z;cghX+cW$@VchRWW^p*UPevw+&U~y+H~)hz6)^CTnRMPr9&~=dn41dbMZ#*?MvL3= z(-obTY-yEiHn$t$pnBL15EW7-e@h{9GEh&m!dTupDtHp?U^eA~Bwz8N1QOes>+@a! z#hiK0q`H=O6|d}nVaBLwDscVp<~$<@2JlLAVD*i6lrqN*?zJFUAZnPqI<;C;fC5`f zpmm^3Ryo$sBnP>4O@Oz=RC7rz#pXhF+T_vd!JRMi86^2B(9!d!>2#V4IppTT&#xWN z@DiVFLVcgfe11i0YyI^pG`STt6HU9=PuF`L#r}HNur+u)_*@W4S%3?M=PVULajPut z`HpK|uTa%AIYuKAr+&ZfppztD4R1Q=2F2Yk^V6Y4$jda=iO}1iD}C_j?>vM5R@W^v zH7%M?Vr=j3mr|hyQ*cj=mKgW!{vH0r4l0L#$RwIsFQxgUBNL3l@K$`d0PF_{_t$#0 zd~{KE94!Lgpm(xA=fE?d0ea<6n(7Hlhk2*Q z+@1~qcPt`3j6#~B9Oe$H^vIoRXb8nkp zGhm;!B^8m_mXkJG5mec?5^-YZnh3|5^BDPkD` zU7X}x;214|dGaMNyW)OJ9sw*A+(AT3#8!9lA+K@<)PH)oB7Zu-!vn484NAt31b!8K z3Tqq<^2>0#Ef16|+V+Xh+IY-sB^AYb z2j{|D8NMy_aeCQMF$t8`Jqm0Ql>#j3mTwl&<^7_X8E^RMj%co>#jHudKX?&>YE0p# zH8AJo#dMul_4>sLDvMu-f*i)HaBLFp1Qlmk^$U3gG=kDZ8v3Sk`i%nU!4MQQsh#Cm zLS+zypC>Oq9yyH2+`h27zXOnY{c?foI~{jI_%$qo&23nSqIxMI{Ceto4I@sE%|@>U zLd`etdHR9MifNfInHV2jiHU8gX_dR17G~_*2cZ6Fi1(j(RI4dRZtIsLt%=ez<+peh zLh)7W!OQ{0-z^;OxBqH}1IsexH(;Uc+A?pn*2J;Vv-o9Mc75O1)!%g8w@pMKPp~bD zSsopFZ!{kx?Zjyw=60Q%e#H}>@AxvMRa#EpH@AIuEj#3u#ZiYlqQXf+dcHSjNxc>C zcmZ=qmye`&b2w0`HFL316pm~&vv@J}_v{!b*fLSybIv% zf7PPt^E@{%-smIXWE6}7e-m99zG88ovOWMex$$u0y2L@I%PB=k~@8wCj1yQ z_)F*o`wPJkOAP&1^Q@oS**$I}IG8m6hMY0dJ_wE+dD=}XzAN(3V9@LEcY*d<+X55i zecyPOki{Oa^HLo^Yr;@zwLMcDb$5hEc1tZhOYB=UQ?uXy(EmJ|bJ|?;9d-uPo`1S; z)0Z+jR%9FT0X66$crHh8@z^y&)^o6Uze>Er|4Zza7Vsex>2rmyz6M4^D=o0Kn_Tn=n3PRzpA^SJ% z%9Gc0aiIUTc$}qF!eQtMyXZzxVi$*~?~h%sd(FIGfKI(^QgPx@rQQ$E9zlx`xT{sF zl&yQ4y47uF@1j}Mcv-X&kaW#Tbgp%$N!Q43{klpZ+)xo&M1Wn+?wl`RY9LE6VySZ@ z^hn?pm>5}cmZ`%O%qcKe@AHO=*F=J@r*TjKId$lN@EIH=5lIIv=TIbqCoWzvuMim$9F$OpZ_k zMMgd!!%~Xzv!TiuDl@S7PXDKG!843X6x|N9+V(<^%LJJ-8AJf85-l2=`z48HM4#LG z%>~Wt>@HlfOb)5DmHjr+QB?~)3C7aGebAq@EPvroZk3V>{NzDbowdZYXB+_FVR|3Q?;*gz*0=7>cIM0&%qvAsSHD;7 z&;smfl)y6Fu*M>GX146&&NTzL44zv=eD22PhU-O!Y#^16kN9Tq3)a+L8k6$0C-4`% zSH)=YbL;tKcGK$z6_m@y^A@RV&)}Nh5)rCc45rEhK3bqX+|$|gg24~f%ANw6VLQf3 z&7CTiddo(gu;3M%PJYQ$#Dh(xJGu!ASDwB3bn0N!Bgf|lzzChvqeB8xW+ zPTUIAK>Cv~z~}kXt*YP8YN7&L;!gy)m0^iZzJ?G3TuFbDQiqlN!fhS#wjkPK1Gm z#xp{3(v#&dBuT!{gQqaUGek%DZZlHhDxv?@+t2LDxtBq3buap9q76n&3{TN zP}QA{ZT*VbT-AKfQ|q5BzBzWnERT}*<78flaymMZ_IIC74rZ-6SSJ>qOKCmlDn7L!l=2uPwbbQvjkPZ^>tT&58TLv!V3Rl!3 zxwVgBk(cPac!$JKsInK=MDlkQ=_AINvoumpO)}n&d=B=fF`c;74 z4VgZmr$(}ayE3uTlXklgb!-Pf1aL~0C)XqOTA-zXK@)!3KZFNC=t@(}-4tuvz`<{= zi|rnf5Nr5&0Wxw(i731Kl}#?7);wsR*#M!zL5Ww?bF}~jzA5O&F8+LedCK0Bs!6h) z&(|M#AheUoY3z`RZQ=i|)S)cH!x_TO$*CaonLgY<`ZEWv`{bxVE!a{5JS)H_@|2!Z z!Ina4_LgEizVPmS`)gU@a}@u5W)OC7^ncEbHL3Q-BUGSylr^#t!iSJPAYJk3?K=Z> z#78zag>3z0GPK}v{niR-Kk(E&sh%z(W<_F!~z>N&=rquCDTlXP|$9x>u;iHj--bds{~?6Xo$3)c1E} zCPKO>81!Cjj);;KbF*$~((rZ6!kKLhsR{FbRr@q&>2AwOL-YG@0(cBPjUORmF*9mY zLY`sYfL+{9Prox1A*`eyqm!vXD{N!dM-fO5Ii-6_xpnZP&Rn%?Ov{mF;qZV1XvEqU zsS7(tJK|pc=GYxPnA)~%Dxvs#beh%C!>Wv!gW00>J{!}w*eEf9c zV8#iw(N=>}gnFYii$aKQWS;114F4~x`<$z(S!0?aQ3J?>Uj291=qF*snAy9qa zp510pR?EKcpvQ;benVQXIga(iPwr~qmhhCpT9zEo3;LgmRXaB4JLLc+SnT=k5RP)%DzFj#a6?J+bHDU;2Yf3v*>U*IG6N(-a({E6U7YOiU}nkcLzgP zD>_N(SN&>i40c-NjUWy?N$#^8W-yR(Y*lVwunkacu3wtCuhS&f$ z_fH=ES?V5%h9=4-Iq#j!_bY+jy}f~WFX3#9wh(%DN0c1tGsSW1>x3a6F6O=sxF)2$ z91(Qh^olGR+p3_^tcN1t#peF}tXALI%ab?vQ{K@|H8eZ=m7XtU^k*^uilL{yyxzv7 zp{}QWl4ek6O)EM&V1H`@fNtFVb$REBAZ>)Qog4jq``cVPT_Lz1mqlvcUXv8^q@|51 z(D${U(s`QzMSmdv7?is8%{PmDgmDpy<8T#3+|uye4i$T?HM0tJGfwuTdB#8=0S-O3 z7|7A1wLw=X!__X6?HxW?IM;ypv8##M90MjOCJuZKiVful0gdkb?m zmopw9hpyZZ^)x9#?b#guN0&V)`%5!Vm<=-Zl31{cw{sz<-f2hcJc*D%lRn6{CmZG^0R;9woC~i5!cG znUvJ~xndJ7?_6p+<7nDAgK8!bYCs)@u_2*GyHUx@@I^X#YVByUYq-%sw*Q@K(uBt% zbU!}%&INh%>erGICZk#H5oW?g-{-V3I#!g~GtiEYaw7;qK~dVTbTPaB1BBz9EMQl2 zPqIyM&gxa3#%-WrHVR1S*~EcFmr0^@{gd8Xp}G@ki}grwnp*2%PpR8)7h8D3U^c_$}4B!2wo5l@W< zEJDaV%~uW^Y|kdq{&8bV-Ta(gx>ugl)ypPPU%pj-?Nf?i)W+B$=|UwNe(&EC6yor2+oA0`|rF2=6T4e9_d9Pa|ipNh^jVsyj<({moO*@7pin zlw->hN%9f-PS$O20Xpd#Sh02zIk&po8PLn%jO| zl-DP~rMz%_f4Gm%ajjz^T!ED+@UN{0u{>qELmCMv3pReQPn?W&L zs^k1svA+%@1)220zmG|vn?gtgY&L@3StgcAQ`JAl3AlKS@hl;73jPLml7i&Odr@uT zQ8|?feR-kX$_LZ_E^XV_dL_9YvQeLW*KK}P0vMq;W^t4bwGoPGf~2y08+m*{C6iL< zw;2(tJcb)0Tiw6%5=EjWPut#m|Jia`Q4l@)&KwuG*}k;*{6qI4m~`D*_4(AB*4)`{ zy`-G|{V||mAw{tc`Dw4fIW-E$o0WcbR_}NIm0jTV;uh(oQ$*)FKu3A$v??8m)f)aG#D)2t3| z3UP=61orZY2rOm3BeKRHy60&NmGt0=baTkPbJmjscgf<_RT*KA3p;b_mC6r~eWo(c#;iW{+bebN?R9l2T&R5Jtd(!e74j~roQ{~7iW3$VFkO+t&P5#nfe>yTL2a*(En}{ zRh-2K`aL1SUqwRM%AJ8wdx!6UBSk#-o?$ib11HuE3-g~n==K87(t))2na~o zSeW%LA{l4=vwSys_;{1{AkG>KI|j`;#A}WP`t+TCi^+Dzcq!!? zccu8xXmg)NL8E&!pi%bg>-PDw?{z9-5}V-7D#=c)e&O6d&$PL5@tM^oU6A|Y+N>Fibxl&1 zaz4+4cLp=9dRol`+&Cp@ALs0f#07_d59FTR+?^l__^5Az(Dw7()lr@L` zZLM$*cz@8S7@tnVLo?-y*W$d6BRLO?Ne1@4r)X%(mj31SIHCK~#y}ygKe-D1n(E3_ zB{mQJcws}991vAbSu9}Wg)V_?TcR-q8$`kTP<2$bfl{-w7T)@!1ClTm3&aC$-i?`1 z#*Ip&rGljsd0V+6s$$=&LM_SMc*B$ z40*d5>BLI;o&=%o zpwq2u^JEeviRgcZ|5RKYm`C|7#K-{t>!y`Ma38U-WtFLs@U#=o>GJkZl%&}YNbaSb zz)&s%tKGMikijuo?=m8Xy^*fDq7((-uI10K%KzjH^en+iiog7&RXp?kaa*|PG$uYn z1#jfGbBTe;CC>M1G}U3?J?I1B>cNiBe&b^>b0^Dy{f|AkRVgU6<2=hb=@~cW7O$L! zWq<7MT41Kd+SDItlt4!D4BjpyXt4#jc0T_mCYS{ojnJ6IkHd6i`=>sg z3vW!}(?JTiXHLMIR;x2>^L)u$6mkZ;)pPD!%QZza15=V7X0$$9A^TY@i9p$QVe$2I zfC%dtKYCQAUbX_9Lf1{Rh4=${oR6&E)=RXhX=8B}WfphaBI?@xskBxQJgZTSpJyM) z|0*12E>9<9B98_opt}fn#W^7jNR3bMX%hh0t539;J7-J^KN_dSzR+!O{7q zzWSX@CE>aU3qymvt+}IdwK! zf#yu24sD&iTl>OcBz)8<(ME~p&Ql}LbFp-rm)ZTNJff>0m@y5|UZ7V~ zvDC_7KAT6!1;o)So0%=->(2a<1(mrWDS9#n43D47-gh1N{$bW=XeZ%Wp`LnvzU!=P!c>hG&z{AsDJg2Af>xU7(u2M z?+IMxl(f!azHKx>`S2&#lk0q<*~c&aI6&S`Hy$b>2TiU|zAJr!>EiI%v~I_%5+tta zoq&Q^lMVNwp`W(tMft_S-fgj%%CBDE-R$dY%(Zs0^(2 zuZd)rzcH%%`OmdN{L7PIOmelAVkk(lb=KDj9cw!^XQcz!FY2!}h_qj$vPq9j9M+X~ zgU&DhkTp|wlxF>jmGz&hluwywe6)6*lkX`Yu)w&4-Uv?W57U^TP;!m_6Cj-AY+gUL zB24>cT=CyO5&1t?l)U)lMg4_;ef{sySTg(JVKn7XzRGQ0iSj?n^1;hjiN9++6zuIQ zqW<6EEgEGe#ghNukzW6c9Mpe49`FJGU(vMmcNswkU6a*yebf#F;rk@u43}C=OHnyL zKpte`^>17Di$kVBF9=P}tHG9!Z5sdly`kUl8RUK#2$~wrDxi%J7?&ErQMCv2dc|}r zMJG1+<&a0*mVG_Vlw-T&bTRAT1dGp0b*}7Bld5yKe<_6U##aK*e)9Lv_iF&I09Xx; zNVvN0W7rerpU3x^WQ+7*FIz+9Ur;R`^VoJ_JEkeT5s=VRP+kQT=J=Kdn_;YPLaoeexVi z-engz>V+Ac&trG_!7PAv&$#3aT)wjzh06IF9B~1!DlsEX>M0NJTgj%KU>;LXl^SjI zuFab0bp7cUmUmHq#h3ZEeu)+q?~y!|JGFmE^?>;w6K?X6WSCcXfj99%jzxZxE3&LqrXrlk?rm zB~#_YXytlwkR9V2+=VNH21B!_wj~2)SPVQPklZIRR^uWMo{RMqx+t+}Cd%%d!(FYr z^wv%ngLPHkzdQxDnu%nxPX{GP;$NIt%4#4JjYz8c==;ONZ4^=DC2^wQG*=~vJ=q$X zxqa-pUV~^X#m^vTEYHzcw}MTlQ-vLJ6`YyMmO{CLE2-$_BsK`4#uXw*$8u*59zOye zjsPi2GXRrQr5C>HzQ%%zbo1%@`tCQ6-=D^$nIk4cxz@euW5ivsYe<2@4LsrRR|9J($MKFemLSW2Xa^3P7Po-}>56yN2wpC^323f9FS||DF-SLY67lDSLX6 zI&FbkcOqs#FaW9`!6Hdt0frJx0@HK+8Nr3QKUcq!bk%vk+_u^oZ$g3pDZHf%CRRfh z!sER?winm^od(Nui$BzF_X~x|DWWjd4mKbx?T)*^CD#Jx+*n7;NsTE*2i>;*XzCt| zk=MUVzZvB*K9Feu<`?)hRmr(7?UNG=Y{w}}co7`L{W_#_{M$--b~WvLD@Ub6t>>@;sN?6TOA>RjFX&|*5)P%^DlW+S+-*Cm1_4xGJgrW^l`7kN23fms&+B>amXCI~hC zwf5hSH^di)F*VN2CLig%yaKixRn!nXXkwlll4tF!!3H}0`tnm~dIKPJe?bdOh%f6W z^-M5`)y)ex61DxV4#|Uc@>uF%7B&!F2jcG`?;sVepKtgah4FrbK`;3xi~qCa#0wjW zJI{yE17`D~Ot^8pfc|GH%V^feHabtOKmrERJEJRXGf~RtSngi;KK^X%|Bi6Fm2*0E zCO~&eVkTf7&dfqhnz1+m-)$btBorVGnyO=KL2j{b2@F=e&?Z)Q1SPT_lnmIWfozKr zA25)-Iid$em;Nzx= zWzN%5HR_dzvxC{gJM3U-*r@}9Q9rTE2bpErP**E6u$t)fah*iwZV;YghQuQ-3tc8s zH(Ry`W`RKf^PF~DAtrpICUti!X9ll1{lJgx8KO1c9_~+3W-9In>Bz)pkc-M-Vc zEI-YxeCAlRW>6!m@4@_ZUX8`ZjWSMS*S#lGP~D4W5?0gerkl=qO0&2Bek(c|3W z@-U8nfX>{a$;?=S;pOt)v{bQyG0vcLYARu}dXeWFXp$+XwWhha9;Yc^1~5#FySZl! zlE;hRj76;c@;~eoGhe31Fem^M-UCpgDd;zymIB~mTnZKW)z}eW6%8)p=M+M&xf6XJ zwSow2#taxN* zlSg;VgJX!MLoWPZqxJ!E;oZu}UmE;y%Et>ZP|8N{Ednj}>6pzHviMnBS7cCN>?|0T z{wFZh?=ZJBqD$=FN0i8-)wVB()r#&N` zE*!nU1}|74e2|#-jz^+6`^gVrd&Tpoeb=l}$8= z_KVruG)gSwF*J}}@4CgE5U1>K(K1?Uhyoee*MJW!2dwNQXi2NLWrT9>upe6}-h zrlNaCF%g%d9Sl)&mMc_>WJe_Q1vaMIYx#cPU0)e&rNZvTU_Q4g zJU8)b8tCrdgHcU`4X>!i{-lXqOnd5y;V) zbHXwNB1Mi^$bcv!9`KDtbnY z7TTAzuIW8a1Kg9vr~l49tw{Ba?rpSYQx!aqZA6Hn!jnl2cfId$qZDDwpq_Q&FTKZe z`%9KDmcIGJNYY>VU+5WaN6Modcw(wqHE=R}%SIB&*9Z(|0yH80Mlz;Vu4h9fG}5Hn zo$FWl(AgrgRGx{hMlC^RL|W&aYK9h@%G1W2kzx^@W8lP2R)Y;KAqYs1&O`mL+v_32 z_X}wRgO83M#rhsV#GFUQA<_je&+qn26KXv`xUrE3*=loRS+c|f9{8j~>0e73=bTkX zUI%-hOI^G9X%4AMpU6jgbzVFrmPi0(e0E8KJuE11N^gWBx(DSOQ4!u8`UlvF+=w*j zs)G<0EObx1M-+)%8!u~>@>&1Ge*k=Yr`FKuA3*Ix{1vKSA2n9q-*6l)#%x^TE&)T( z)@zZ(xt-iZ3rFH~Ff!H0(l&>R%aL?SO~i;t+)w>{BH6NVk0U=RIC!E!0fNa}P=cdZ z_|@h&3R@*QfSExa9S&1dTf5twx6(Yz!JxN+z))pf(V5WOudslkB2GKX`J|!#15wef z?mWC=%U`dVpIag|x$RynM_GHoF8;bezeH~WVv3xg7F^}2r@say0lN5wIkf%9Y``zLFD< zptn!tq;mm)=^T0kdn5C5w&*|n51bfXGxs+qj-Rl(GMRU;KKX`8!1OZ{{9Q96nN!epbH3? zU|k&kJKO{gI@Z+QYhJZ0i0)r+noi@@K%%3>H;nOUXt|J>6m%{#x^mB1+r=s^_+`Mq zc4&TJfA+nW2(ptfYa>~OR56J4xhuUs=;c|R?9ZS>xi)|Zx|Al&eWvl<2cWorrTdH+ z|5H(1z+8J5*sd7kC%x9d-kfQxnJGPGnXLf{+9uc8v=uK#G7eT43KQ$MhN(R1Is%Z< z@{UPc>jMh48_>Gr1zYBC9>TuDtVLm%Ub-&vP1QGA2ch%n{^cMIAroy#ZBd zrBB?fK^O*hLw&iDy=(B(`P~LGefKTTem>1)YtT{yc4zrd*V2M`o{$0y0&KT(!i2o# zMD_+h5DX|d!f^S^%^F|dsHe%Q?zW@zw`AgT?A$7scx87;wewLz&fSk7q{jq6Bcpho zSDQiB!UT>DoRYh6P4t&o({Sa@pQ3!=zIpq#ySydWE`x@K)ikf@Is@dAC5R;vI!1pU z?J?GaiNMuPu(}RQ+^->eFK~tv%H*)P{@s>pQWVQjz*z%74IWQ^6(cu=_4>cnHISoF z1IL?V@{C5nOyg7u!tTq^d*`f;bFSvTyU)8Pmh;Lt;x_<#dxcc^6t#PM-U!59sofDN zO+~|+q%znK?zv_rIy8ZE-CFa{6EIgbQJDs%xif-ahnJT6{8fq?EoiQPuhU`%Sd&!< zozlpeXRS`4_DfdVDvhr8ija{#=oYL53gdy=ya2N(11{-4gDGg+Hsk%mpQv{x$AUG2 zMQ{uKIdRInr4XG4y>{2QVH}7wIBPFxZuN8KE4#J%`Nh|D;lR<<_%Eo5hvR>OnhLLc z$a{$yD;?YI7xD)50MBFsov;2rua6gQHAGx5`U~eYp&Agd^(195e2Lq@BG;CpcP#f` zoDfRf zdK4&1(;IfS=Q*pt7b=B<|B>HVNCdUDD(t=-X9t70ioWRESpA7pQ;AP7$9_BxEH=%r7I<>v&CbAvA4peK18#}OaRUCXEs|Zrw=B;&>tStwg!FK}CV2DL z-5Y7&4T_1{rG~&pE?))~|2A49NIG*QTSt*nX!vWSaF}t|Nbgv_^*T_sQVUx6ztZKj z_~+zQ_PyCtR+KAxSMofydT-|e$_NZWgmmnzz!>kC46e@?=BF)&tmwP6kWODvt@_R{ z$xk!pEz0Bg(+LDEAH3q3NZ?0;WoDIsR^W#AP}=}$R`S0zA|r|QQBo2H7ERBTY5zVnBIDoV#tN(zbbmuAE46% zy3Y@tkC`Ojrbx8jw)>wiWb`Rgw=z(PX}G^*)o z2atEsm?^YH%`xIMa48^Fpo%msNmC;-?|x6ZEFx9ohU8$$HaL^k1$dLZYi{uyjwoic z77U`Oh!Vf`sLgI+KA({wA($S?A(iqD)`w|G%A2tUF{=u&VXNm{SXto>uKkLF8yDyG zpn-|iC8(>3^D!uOXI?6Nj=15sWws{8`Egk9s?@ESfIv^^iV|3R=PcuU*{r22*A(Bm zN9{bEwB;}2LEB&Nia+r&Q6KEthq&!v--M!0d48)$A#6|yeU@yRr2GzZB$-XV%HjVg z@65xg-rs(&+G?jX$u2`wLJ>BZGFCDtgk-KH^D-_Ot=bY<0{aZ;a-}U+2_v`(73*vOorW9n`PWN+CUHcrF zVPPV4EBwUs>wc*>8^as2eUtqtGy+Z|N9h@VDR>;H|2q|x{3~6ZtiOmTWR^sEy`s)> zS%U42A=i5i4$So(G)5#y;0z-DTZO6-6Nx=%C4Ke=FYHZDQI0IT0iK_~p{QdSe?n0- zM^_Cy0E%*%U5MhSIiv3JR@^1TscQK)F6m~yfkj!L+5k-3m?d041YbLeTrZvQZP8b% zO$`L`w?abF)RR7AUfRJ>cek@!78{!O&c1-DPN&`oY`(;szGeVe_$L1eMOl`ODQIpa zG{u^0q*aukV)a-^xKJ;-zx$Zg=to7wq)2uJX(_=gz1Ct~za(*QZP9#uh+dTnt`ghZ zqFwfAS^#IPzI@su{ZnC8n{qJC{7i37)JxM2uQX>qtvzwo+^dXQCf%vQOxCM2F4?yU z74xSl+t&Ev)yjDm7Vnc-!Igqkc_0aGVi+5q-6>CEtWCZU;}l^^ zav@a(HqkxxpP<#Qr{DS9@WSn5ocp{Rw{CWNGoDy+I5t!-*c-Wvkzr=oOz}pQmReiF z{$>O-W~>r?R}i-@z$cZ?-we_r1NKy|Rt;<~d&-iZ0&Q|gvRQTLwa6}kyGd_~A~TZV zT+1^#UURIam_t74@*yhQ?ZAFibG-LjG-dXsr{QCc99U95Y7Q65LafwpIWK?d^OX{O zXOK69%x(kgY!f5}_Ixu-S4;5WzSX(yVL9xHGh!qO^6j%jtV40aTpowg_DUD0x4D}e z;!aPSZ6eOt)_48A@2|@sj?A|jDw6Jk-=qAV{qo0(+6#?62@m5Q#xqOUerO532Wrf~ ziB!6rTtgA>-9`VJ3zt?q!y-!9Y^pX=nS4q#(prVh7LI9`AN!N5LVG^D!)V_C49$AK zemSpwb0XofMW^nE(=AelATd8EbJ|~8@LkS4Cvs^Z-puS)8yR}z&stJU?5$wQoXLsl z^|{=#XFW9PHlLQ*VqR2Y+pV@;YQdIQG#*azk}*~LwHnhq^btKKOKn~Vh2B6u#($~q zkVDy!mFVuVqk#0LdQ$eno88D_`ZE_=qkqv>G8zZEKd?t&>Q$v~d&B|)8qFJ@?cr#j zXdv$(V&pcib-bCr=U2sL|K}J_p?HFXh-R5T@%jNz)^7vybiQ$wg4s-aLtQE>WQ z9RU+%Nhz)g<)2I4^A|Mux>B)G5qmyda zugdAlZh4w<9n|V3p}nIhtul^B*V$s1?N~8p&6>AYyp%K5LQ3G3P}4=ZA&6t7qDpv( z@sUXXrL)~8q5jx(xgVV}H!Tq}f*8_m0N+}R;z(ItGKl3HMU&hQX4G3}&;X( zw0knXKE4kR)wS9Kq%H3~A4b$)Xk=@A)tG$+^TGytRF?LmvKzRQ_KP-);h%U}_6s`3 zq4BYhS38@48MfJ`(Je=pIq&VLTCU=H&nQ126|A)fL z{HpNWY)yTcdH;`>#G_<%VFVoebLhF&h>V8EG{T`A7+s-aR%PaOwL_=5}R?t`IKZf+JTjDCY*v)u9ydRMIJsF{jS_ zI_fOg{Y`FJ$sgPE1t=;mEw0$_ZprVvkwT+YdyB~nlo$8Op@fIyf(uKQBmFaq)%NgfPr$^Qs{5c!+|S0 z;jyNAcfO4Ovl~x})IRIwENJe*%)u__qt=CKe)Nh=Z-S?|$S={o*m5@q+^fnhf=ho= zXowS0Vt3sbf^{~yQ97y+VUri)jnm85xQ?IdGmI6NX5vWdRE)WiN64H+iTs= z4mu;&NC(fN@s_u^B{YL)vF*`^DWlUeM?>tR&rk*U(cEw+&rGA~xI!+bUP4lxy_Y5e zX=VjO%^Sm02HPfcvF?P!VdHT8P@W_{L(`; z!v&8U9|9q9OM%Z%3hv(1y;a*w%{e-SOyENs$`i*9jy%jqry??!w{%*P2iSS=@1X6K z(3A5P@6Cgwh_QSk1FE6}7z_bDLvJrX+3HL-Ae>*jaPTHJ)I8sIWG}ZyMFd{EpVA>e zU+G2OaZwCWKC1P?V^YMmXRtKJNPR1Tv{?_6EV6d zo5+%HfE}8y_V(N@Ta0YKGzH zQ}Tp7Jozvo)#{{{n0C5aM!(@aoRl(BDSw!CzGFJ@1MROBU)E}v=tFKMVg#{e8s8hWYk&F!LKhSv>8ND zmE6C#S4!_}t`$QNt{-bTv>MrCcTnuoJo`OP)o2S?xD}elc@6A$Wson9o0WcFL(iq( zm$Q#b{;jT6)&k!AqFs3SYT~NqgTZ=Zmi*ROlEOtb@t7jkeFtcr zqxnCXeo~^Rfi|>qZLY-&;pCy30!dnpTJIWOYk~B zl!l7v=X7RiaHtl5+iL(I6^>bV-4dN-1$B{?#W())*m1ECWCTZBF8by9>UGiy?Z%Zw zFOe0K97KIAYrw!@0uikvr6GA35jZyKaU zOqthijdN{n_~f&Zs6$SzI%zp;6x%qG@4h> zv_(te>H9A6rJNHd_GY=<>fEouI{IML8lpG|z$YHrrP*8>{f%H;?WGq7UfRY}NScy9JtxrMEA>W|!Li_{teNJIg+w-wZ|qh?wvt zNHK<3oY`@XII4YFYdm)}yf<2K@e(cz8#Am{b**;q5Yd~Xau*ZmKJODH3u zN2sBQYjb5Y?}5yivA>H)Ow3t!bIEx#b8H2xnRK__Rn<6&UG5AGooU$47pQQ>PYn;p z#r!@bUR{T=5)$l9Pg{9vco^p~dEG5*bo+~X(h=+xO_*<*RkYZRHDJSTu&h3;Zh8t4 zbY;?@^!@UxolU-}QfBLDCEcdXE_=gW?hgG>hJGV&%AEA`v<&s#?JL&7eN49n7G3|_`xKOHx`xbw{G=0v7H=7>zfnr>LpU76vx{ppyQWpwTZx zJH<@gc=27qnv<;$8lH)JlCIM4`FP|{;7LI`xG2xI_6F{)4x9bA_4i@Fl%nu6=yyhr z9kQUsq7pduqi*TgD?!eYQFdjziQykG6h&xtd$7XkITD_wm8CiB3=kSPrapu%)*fK( z+gv3I$ku1vE3lfrgU|D-dVN{FvsIen;eCmUD*DhrbWlhD+#m)5Ib+QbIy5#)5-Yj3 zPN%N@^2*1}{6gqqdn@D+3I7CArfm(JMOqGe%i3nco?E{xFWBu-_IT6lW>8W6@zwWF z1`EEXf3Q6y4M_@5jQAUjufwo=S~Bjs`8wbxSNk7JZDp?#@i-`qvw~n_39rkLIZXZ( z#zm>lYWyd4Rr^!se-NPmTQyR*1D4m@C>l_uw-W!8XX~XV$Y1_{lv7<=pH7Ru*BWYGRR6r8YjT-#|Qc%9$wy7q+6*6*hnAhB|MZSLLnBFsDOY9b@_?J z3LQVG|A1Qcb}ZsaH5+YI-)c^MtUoe`XMej$D=?c7?Fuk&x2s&RSzT8EI$2Y6<7eV( zF9&^VHdKJ>7F#_4$CmN`gxKl{O-HIq?2Mtfe#fkF*|*A@T^|&IyjuC+A+OA)-yua^ zD6`&f0yo=1isV$Gg=X#q&BC1%C*ND{wEM3uXB?!Ph3WqqPGSYmbGIk}#$Me8nou17zzrdns#WZDD0o=fz-f5 zm%@Yowq_KZCzg$_UI;LOo_mD=n}#Gw_chRsac4vNK9ZRD95h+SNIO9JQ7=#G5%p|} zAycB)qFa1|w;rZ)uCKb@&|`$U*;5@AReiYf->a@P)lSA>f}Mft zSq^TA*~r#{uJRZ`YYV8BbZR#A+MoPdchN;@&pew=GwB8wH^xN`LX8 z>=iY(Db}~me<+g!AvI7Ou3rjoYFfOB#XdeRMfP^36XSo0;Du*yt(w!{brf|ue>=5PyW^q55;WK@PM zDvVB$K=@#=DWwofbnv4+GgBQ3&z5qN#POq{EU`0_9`MoZ=I{g-?Wq_aJKBxT2`KbF z+oX8&x+Y_HsAYHF^^YFDQ-#fum(GZ|EhPsuM1_AVJ-J(DCJt{O&$<5=W0`vw4;NeZ zI5wmV>)Ef(6NtTCZYp#4*!!F0`dk zk4^q7ni3U>o9JI^Oq-5eIbx7?eU=8ZtbpSazzlnBwGg!HjZKq@wB~8c?x650ch~;Q z-<7$=LG?)ZCqm4*>QYbBVXB8ubaTP!)Uo=T+uv?1#N0`_jAr#*34^8bfJJZiIC?At zR|i<$-HKDd}n=9*wi2jSND0IKP2iO&uVhjeFZ0R}lMK$dtPCV{D(Q6e+cItyD5 zm>~sGEhw|d^oBU}1$c}OAlVFbzhV*o#rJLv)ned<29Ur%2(or3`GRljuJL~xm(*{Q zA|!#$eu_^et``gMod%>&YDiq5A>A-Mv8{hfoHV6wd9g~vri!PBRSyG`w0%ivJ^1pA7WsFYc^ay#6Z?+``x_z<#2T8N_xizROi`b zYi0E!@zX4|{6q>3)yK$NMvzMBRpgAF;_^q3W07Z(6A28`Uhir?pNk3Qh;hrT^R3}~ zqpG}o+gvJ-MX~~0-Y+Px1=BVCJ=aBZMDAbn772Ybkz~=A_k@Y1T9srNI8hCGR^)<- zGViFPC5iq?hH3VtY@CvrM0GDOTs7n zyxhW-VwU;JJ|JZxo<%nC;zQ7nqSwRqnjlflb@~MDK}llyN)3!rqLA#Sn_bpuPTP;uLDYUTL+i{dA(jp7S!NQNSm>WQ|aOV!th zu4s%8JTZ=S!8z_b8p8P6_TAmh$oQN`~Dm8_<`!wg7ta4jlt8*_VLZZA1+ezxmvP%{tY)5 z39;RI0?C>DF{0@fNKdoc$`Pn*QqP2+tL=yZrp@hsU*1jHn((cbnJTEmP+ULql*D(dWwFb^EKQx2Tswm?`m3K$t_bbv=$8MX~zR#2K)#m!Bgb|Rn zvxSfVhDvJ6H@)sD)B=>32|n0%)&7!LKJcUd4Bk5sc3qL{+<9xxt6c5cms_IvYD~!P zkKnn7L&gz(S103$yGK%JPSfA>9GjD|KW}~IU9a10M}CP%zksESyEyin&!KJY#8w{(}}UtUWk2!=PQO1p0@wTN6=V+sCT9lF-v z$Qk=6M$Z}AU^!3DW-O3iYa2RKzw}pbNWM|Jy+KFr?Y7CXOZq(TvH$gp1SC=I!V5Q_ zsP8VWmw%D;cbb3dqxnex$8ls~>KqG;v}Qu~#wwGMODrube;uQsl^Iaqd3$yal)Z7v zh7e->+Bcb_1JM6Tn4;aO+7Yd7ZaxYG7pSv{xlWGFM?z(X3?|p&SS0mdv`cIcP$F}5 z2eNgp5F~a-G_SguM)4x;!R7V`B~R)VA%oimoS26g2_&_~HE43dR;6g_aD6!YbL$8f zDJ}JFaHis`AQlPB@B+^vCr=<3c|ZSxY(RMQKD#Ki@2EC(6>8fQpU#u6a%ED;_c|b!|MPc2;lM|*Yj{)6CC3sV=k;U8B9B=K>vM7bvfVOZ?hJ$ITN&&l`?An`;NG=`*rv&hpYt5z9>*2xByk$t;tFvM6F4z96InP6NsWtfbL zEn+r4D~US<2eL+>*pz-r?}_9}QWe{Hgs9>vuZ>M{7=zvlElY%3Lu&6<|MVM0jo?Rg zEuZUJs6s53P{hixl}>QN5l{v@(lfRGl}z>?%C=OZ%uR1HO@nB7dX_||&YWn3DzbuA zVsAf4xc&vP<$M1Hu|1EW-zY(_8 zo74ET+%2oQrz}6oxHP{0viI71%?uf8POfD2>rIebsHl^r_j`uVdr;-M-N>m(gJS}% zH~~vW+9`jA*c@O~gZhBF)Q1em(66A6q?U({z^yq_+<;}JUh&Miw^8CkVhEqD z=9I5e7IGvZyG_vWd_}Ozee>91g5`mujE^+ZZY|A7(sZp1w;9a{{plnST5`sU}vLE zO?4sfWw3#NfBos)(C&^kp`sXbXYHOwo0HI2hOH@MUhnM6K(iQDo-xt}VVe6W2(wlS$aAqkH4xK*#;v?4;8`RhJanwqvM ztxEw?XC5lGR>l;3;pLrZ#WLh7e8$Dmu4{bSmDR(nXuQ!O@U3vJTuTf_Unl-b`}0Bz z*VIcwb!iK~rUdEiq-w>{c}SycxZc`ebAoH`dK|Tgh0Ty|nYzS<^_GnD29m)~Nw*qA z9eN#{3BZgXy@E|;vcV&QF-=uF2QEagOOAUQl@k6G0P>0|3@fhVyJXskIGg)0GE}{XamXeU6KrN&h{8XY@He&nWvvvA$tLIY(HuIwOs3mS@Ccwj>-+Up4U(Dhk~mE$zGe z`OfR{rgp#9;~blM4*q+tq0^}}gB>PX+zBSS=hah@bQB6DT|99lr7z`{k6-s;n+#8Q zu=TSyK3akK!GyrRC(3+X6>f7gS*pPyf6Er0N}OJ=eP zN*n0b^cLC8?k9=TZ8BZbPtJSmJX#1SjknD}QO8`pfy?mRnl$^R*U`_q%s4C3_6y$J z9*;7b7=3Vt#7w=F>3Qi+SpXu!z}SnNh;?{9oIaukUnM$E>97bc9j*>B#s_lzVx2a( zhZW(XPAFojEjj_LIqjkDLlR|vMOEMwZ;`~g!0al%kB0}PXumVfoM~Fccy@NE3U3r6 zW#qBwTWUip8&Q*&-*49YP;0(l zM$o%JvcfVgSL7uPXF#d9#-n7YrLWrSPx%c6UGSKfF%j*-a#Z@O93u)EB?_?a!C82W z-XwM;VSgCIdNbw(_^4j8aCv0tmls&~7kr{0pw{feT)jl>{Zkm$48pMT5&E9zY*WV* z4EOhBYP)EtJ-fU2LTRkpjC#g7hMukaGu`HaG}e$y8~u}>v)YqGV|9DE_t0w)HV&}T ze#)Q`ppTH;`FaKATF=mxhE+;7L)fM`=NKlrb#N`t?LK*Whv(X@5VVnnIAHgsJ~(~j zF4M0H1w2|_DscimT6N}M8qYmFfc5E8Phu&0&R5+B$`{<63p(B9e)0_~`lXEf_sH5p zeJa88#f&Th{~aQSE96Lb?JhYYlAE;UsP=$SqT8602f0+c03@eC+W3@@cpF)Gk*!Sq z*i*04FpRXP>7;8eHGM@xIOgqOIo}#3=v1||Ja%@$Y?9z~_&}wx0;Y20 z(9(CkTF_cGZ#Td741Pov|XhU`8Yz96zPo>5^%`^}RJZlJd>-aq?1TeORXuodS`6f2VsDtdT-) zX>Da*{oFId{iQv<)cJS8TXIq3f&yw(A#uyC;%ybq*k&op_7&W+yv%u)gG#fUQT?L& zT>6?56$lE~@Lb^Z-zc0u6`*iFsS7?q2ny#@@DmD`4t7q&4@R?xb~Wv|sI%W;ETF(Q z7p~mH>`BBBCYSt=A#6s)9-os#M~|}j zB15lKY|+z6>ySMX!lpj%&*g$l-Y3@G7i#_WuWMbf_*K|$^a8%b)8AcU=W8KKT55HT z(}NdZ52et&F0GmhjJK&XxRSTof=1|`CY*mN@qA6Z*gb>h?y5lsZmJgozg?e$G1|9c zE1U@YyV_ENRd}gQv-r2h{6*J}H5?cnIrp)?2*?6i2??nSWGpRn;PKx=QeWJ4e$!j& zewVZ@r)+Y1XTAz26nD_uEMTGD+RQOIy;3JQ{*HrS)2+_)F%EG9PRD75KA<LQW{84;V^wnNL>CHgHL<`&&cAMQl zo!wC|T8Sz^4)Top55gxV^|t0A{pZTKHZxn;W+!Q_x&GU2YA=h%x8%-B41Z@wazY-I z*IB~@yvS|&RM|#CccHvYe#VErRGl*Xx9N`uxz)b(o_PSkg5KR9#MX@5sRBFy|3e1-0Inj$s^i8Z@W%xOp zvUc^E?_aO9I`U66apx+TU8CDnOUj-_MtGjH<`hk-#HCj+l$JY98)JG@r0qnPjfjTH z$JI)0hUe$6k90pZlH8DCGMEEpWAa}oFp0{%0hRFFF_PEf_v@XusKTse;`@px-$}%g@ z?r=}J)N|!ieY4FtmIG`W>U2KR*U_8p?>BXaMBAeGj~%S(V&$5yM`#qpQ?`^tSxjQQ zRs_^6o-m6&8Y{8J&ptgmM5gThqdw_$+P$hOtk8p?6#7XIM*l9|@yvVZUEfK#<8=YMZrsAUN8>dc0Vu8CqpMlm8I5Qy)COzchNOy-QIM=v4E3S z^n8YcNPRFLWw?3X{m9e?F}Lb*lzT(6&tQ`5zaiAFG6_AK_?I*+z!|0T=<*LL)m%nG z;u)y=)!E{qys6^N@%B||_cbeAJNp;X9p}@r@cqyH+Pggv6c`koFy!s69iG9{y`Ye< zMviPRi&2jt&(ks5JpyQrBj^c3px>2T&HV5jgDnhG2Yb$vYfWjQ?DKv|4B`D~1Kpnx z#oe6NvM|@9=dmXY4;m#a92W`tK=E3ytx9!IVZ0(q8C+Iu?T3yIf|DB@UEfStg?=s_ z_IR88KsKElQ`Q;eM&?R!TERZQkb}G!JmAHk&w!ih$-?$NFd)s2`cd7HRc|41Y&Q}rFHLRSnu3t|g053&xj z3vvo_OWb>>#aOrC(It^0OHr+PGZbObuwr%%kFRhXd%@6^1I--x?TzJZ&>>;kFBH$E zUt0x(6^~`)Olvp$1sz3MZ}n_UwMzwFxGhzF32K+x&ZyUFe~%`j)`VxToQf z)=2ynu;iAxnnAmNUs#mTiNp_6!$b zk=#GzU4vM+y<5Jl#5!S#ykvY=l}b(VH}Q6tg8RE3*oNn;o0yv#e>l!`cNlQ%k`Q%0 zyqoK@SG{!~#A*W{$kPZrmiJCsktn9Bt(D+Dh076g{*7U5Y4{LEFO_&H!rffM*za+v z`pin>=kS4G><=!Ilvm7jZ+*$`7?@GoW$SkQaU@X9wq^Stz&qtmqKc zx2b@}bG`T?YfHkQeq}tCskQr(hW-ucHu&0|r9J#Pn3bgaT3XCGo0diJ3mmAFnV{jY z*>f?BL3cmZ-kDE{bv3q4CnbL7$4<8oo7iifCNI2^M`kCTgG`gQX43nQFwP1z2DRLFGV};R@@_aw=9;gEP9wnGVgyJc3zgy-eAnaG8ajN66|GFk&_c=`FamjdFiuv zHEiW*W^^78Wzz(^B1^o-W+0IvF@d2zR5=u32PJQRA9QFfMnuW;dKKO|de~k<>5Up9 zTY~!7XI=tknVzC|dd|xf1`Us3p}vL_LnAvUoMi??=kDg+zwSLfqB!r8TQ1Zfl91g z+#3m#Ok)1l*Dh786Mg)q`|$OII^Uh*(P`Z~<o_9AY+fVg<#uO zxA|hQ{BL}^-$VEVR$o<-^vF;CkQ3<$V4NQs^DMOxOeHGOw_msF-bBZXp?;a19j9zb zpORj^+VPb;*E%C#`vFPh3RF&z-~M{0ha;jy1U2Z2`@q*n@n`X9S5dT$9@dcLX>cvt zStSqe7P`j#Hr^)P)%yo6)k_dDiiCY}Ileu)(v$8x4Bjy-xc*T3Up@f3B|5BASH|yf z$x#=QvqJ?7>Qimlz-_trET`-Jj@bE{cbt5;=L>THQrPt5tE{AOkIYIVXM;)RxmQjzN~lD9 zE8f)bapip`>hvlfnb&P&k&ioBle#hq`p0a?XaUqk6RP~Du5V5+9{aF(_DaMVUcHKL z;cO!tcI6012QBbSF>@czkK2P7hlEiBQxnrokRpQC#Wuj@J@)3q^a&+(PGI~80Yr6e z;0#G7o0VkZ50B+S*#GEE3#5SUbZ`yP9Km94Et1b=Suyk*a3^?$jIbB`5>5h)LWz8$b<0HD%Ym zl;XDZ-EM0L3~u6J-`o*Gl;5;J@VY<$CKVO`ldE5TBE9&Z{6}*bJU0INlT=jy$EY;X zbFFYJR<#~1>+lBu=wH9C-GPPwO8l9)!x}&LJbvi-c#QbhpZT}?tRw&Y?*EgekpGja hu>Ya|>z>Dyqq}Uo4JXr0`_DPg!fOx#r@_I~4^IA{wGASFVsKDaxu{xpLhV z|M0y#hv+u&Pi|PrD9c>AQWZmdW^xn%{I;{AuG^I>57{mr zSC!Nr?OeHn%Ttn-(eO6f#J;y?Rmzff2HK$*1e_d2z7nmHW(9X6qzU6_37V5}*`o&% zI;}j_B{7Ljq4JKFKPLv~rn53%IZg%pQdQD6X>Y@HH$&2&rswr?H`o?2SZ;sOVy zAL457SdlXE$aV99vaxf7hX>7S{$|M3BR5}NQHo&UxGuS(>3-uO z7HStUIp?b*(dtCViF@34b6k~#QLQ)Bf;kY;NM#oGv2hH~meIH3eGQk`TR&-~Wxm_C z>hm+^TQKy@S1U zI6J9=`t`aSf0#7(J|V2;<5Af?6&JHK*^s*Umyz!ZQQ^~SDcqGq?& zA4Ouvy3s-2e!Ja;vY57?pn!7W7(vbUfYViow<@aQV!_-w%{$-LJLEcay1#fq_h39O zPDIxxkB7}I$80VlzkZAtJXVhg4s@1Kugs#j?PS+l&Bm$nx^>dvVYMN&ZB9)^#L}r8 zB9d2?2JTn=px!`MeceLcHtCnx*x>sOS=rKR77p{!7i{77T0*__<2ASWD>{o3_iAV= zl26h+Rvp>`(Dt4F4(&SknkDD-<583#gx4Pja%E8-)FX&P!mr{`&uVEiZji!@%~f9q zc+xh+kZ}p>$lY&8@pIvU95i+;B64W}DMZ;8%Yu&x#R#!YriGGYn>@1qb2SyWV;bO9C ztRqS$kI`9GPC+J`2zpO64ad2V|H&k4-0sWwP5^(2kB-jx&f!Wp!hjSMe;1Az=durv zu#9M6Vwlyp_PkQcx7kk``-V;K%;<%;N7|`^mDRWPK>#Ztd@XhVTrQE&|lB8Wh2jm z9El-^~<;^gsakE`jVB6FVr!d}5gFdD7Nuev20N?o{j;0hGPhyQQwR=le{V zx2nVlO7mem9QcL{2v-ci24FS(_f|lQFnASf?}axY2y(IePU~if$Z@ad+}6z%!~N$Q=o~rV;Kh(Em{NN{1|dMlVw`d_Lst z@!&fYA$n!_dTqBbRm^^`Kt~*CBK2H=rsp#~19Gu>iZ2imSZYcmPVeIvhXi2u4{wV! zO_q#vyBwqfGUa|SN(nJ~?Z{WA_j?%L_js_~pjcTHHh9Q5Vzk(+(_HfSiLOAlzJ!iS zUKN|PHEVl}vo~!3-A=A2F>B!(^V3CtOruJb->xo=k0ynbS#?~#OnrBQfzfvs++eWh z*Vm;~5D5f~Ym>=bW!n{MR%2jC2Xn|+p?A)vgYB;N7aW6Ai*GZYZ-dwp+*EgvTNs_Q zwyJ~+zvrlWRGQevqy>upT0u<$9g7be5)s;W^EHi{o?vTgW)pryTP4pw$&xMJ`b9We z!^rcIcF>NY-&ifPcVO7Y#uK{+2?_W0E=`U1d7^_JwczH|BaadTnPG*oyuh@!0@wqe zmQeTi=jcH*4-}o;1a;A}%K=lN_@l&qfPX1}lR){FQ28E5(007~qE|qBm{%P9o5uc6 z%9faH9P+;8u9E1$ZoQ4NTW$^d{%%UWQWtSX|`_RQ5600Hwa- z^*8K=ZW0`?E*O|e4U+I5^QnB&dTz0KSpG_x}~RS!$)N6t}2 z3qv@L_b8=%jN3gaon~-s=aPx>p{1MS&v10c1`@ygEV)_mS6V4Uf!1p`21zx`-`X0W zq0p5H@|Zs>QDaj~;*m;7iJ{y3n8+;EXEmXu(b?ZUMpv(`DvWd5(p8vvaI#95kd}ld zi`XCs0l{N$a+enL0p7}z=I>h60|2pcf1O39hUc_9pfBkH} z4kakg0&i{(^OD|{0J}IZO*@wN+hv6mg(zJY`&FCJ70nP#KQt9BOgQTo8&Bj~q`FIb z1phhPenNfzO{x~+C<(s#N85NH2mgX#hG2Cl8yN7 zQ`zG2bYB-;_c2kHD48^QC5~WkLo!i>V)ei##_d))JDH*Guh#cl;`#5Lgtb@7QVU+6 zYFB~CzxtKUI4#9|9k8c{0Pot^_ojCvKK3_>J8Zwo1O`{UFGYu2n&QqKkt@_vXaH^tKql1*hiZWH7*sb*~l z0W)G7?-PaXO1Heg;G~UJa-WGT8X+P`O7@H>B)o0o3FOwmn7!g4>&-QDE38t zey|c&I)LpVZ1VSC&-*JyLnK2F`l2jO!B;wDo^(#m?p_O}h!L@=2TxRsk0Gp20@h>7 z8`3$LNHcG3J6`@(bf#mdfk(-=RK@RY?z*#N0!}fzSL9_egLYL#2>jrQ`Q+Q=H_;Gh z2oG|hB`jPN_HD9ofy3=Hq5kR zd6w|Loez#upUcMF_8W=KrX9EYF%M8Z^1rI$ zINnxLhq=*y)(f9c=RAR)!`{Zx1Uy|x55U}>J6@1xwaO>QUn9$+hdWe}BcBELa<}32 z<8}TfY<Wm2-8Qo~D!i1OLp1H%0D|IlC+?d0-n`+H&eX$k1t(WTw;An|l8=kkjqf z<|J6p=L_DItZTX}gdj%9qm-@?HcBuUxOshf?Mv?ki3VGNY$p5PTwt7v99&RjXwR!0 z7w=E-0{+6Y?A6_XENx+aob)2jn)^MamF77d$8#o)JFz-$KZ9p2;_M#7%XK+h z7hzGj7)DmW%sYzi;wAEtNE3zV3r7}a-BZc>uXm?nSuZvlOWO0zzRQo1gQ+~1FFzJ$ zc}Lv!au8Ym)r$U?FAgI4vRa&0-5suum=iU+(tFqeF3|RaxRIOu!<-#{q+jB>UQhUz zIC>anFjbAdr<}X8NJu&4gYp5tH6v60j%)iM2lc;t`8BgNP;XQ&m$`z@~s0M|BquSvV-aDED6wZAF(Vu@%YQ}YI3_4I5&2d>I$Y?C5t?E1+t zBU|cYF_A!cHMc1qntLn|hnO2?W#o6-Pk#Z{<AdRb-N6P*=P4Vk4f2ncw+3wgZ$DPX+CNC>*q~#I=y+6{FLdo>;}R zEGC|4smLl7P;|-sJon`k>eAJG=EP`7V?%8|N3x{sKG%>s$=TAZTcbj}I3ihL#!#@+ zqn`7_NGCa4a52NGL6OLee^qwWTmwdq6mU^`$N$4 zr_nQ5__@-Wv)cJytEE(li+`P_$~n3VH8YKl(P)&XQ9pdp=mb0ej8zmzpK!MU{i@n}U0aOLk*kK%&-#@MYyS+FP zwQEEphyDo)&o#Zu{)OToWA2gj$J{a|iBo|=-m}vKNyb1VrlIso*8KHNl&8wx^O%(t z(eXWnDI$!=`5zVeq_-=^i8!g=&I2}$*t741w+fS|>`S@LRL-B}A4Pt4Nnmb@^Z~rK zVAzN;TGu{!40kiaIxq#CH>yx;$OBc-S%`7){#dV=Lv=aqAva0gv&*AlBxzZ(-9+9P zaL*W*tY`GF9rtssvPH5b_J=iNVNrO8u3Fditz30ZcEqE;riLkZs=9DmRx5C9=IWDo zhRbnBpY4ZWd-@lc(oVK?|KK&Uwm(BLEjQTgX^mwDdO=L5e z%3ap+qr-x!?9goeKknuOuMyb!Im^*gpj&>AuK#f}Jn7w#acNICNc3hk2JR*Mqz{C>Lb3N0GhW^8ho#!Wsn}2-fW9Szp8qHU!vxiBC(NBSgW1LZA z9Cm$lfbo$Ns;ZJSsk-}aZq-OTXitum=DT1)&L1q|P4bq5RWUCwof5=(B37L~nkQh_ z>6w7*Ubt1O;~=S}y-Vye3e3`SkCDq{EWj;uA`TQ7 zleBwBKAjNxt=Udf;8%OUw!i;`c@x`Em9TK~9WkIJRVwv12Y0-rEuzWqqu4ePn)36* zin*cDZ%O$$Sc}7AYThHygQ$JIo@VL4Q%+~#zWiVCLzL46eh3<2E6LrZL<@(CMI=yc_1k+83f5Iv@MZh(_iF@7mLYgX{&$Gxx{X%$po)=0-1?5PU09Ycar zIw|-RRKa;6y9o=T3=EbBzLLM5nG;zl_9Um(cyV)qQ_+^*O z`|08st>=9hq@H@CE8zoAqwY?d7}dSR7ame}Jsnch+dOL&yKOvAA~eSPVQC~IK9A)J zcESxM0T#Lm6L!ReEc0KjBrJBq`($Jen%L9wt;z)UO49v~IOW=P853cRF*8hPGIC$O zer}KVPpF9XEWB!-{lnZ)MQZaKMD_s!jn9{ycB0a{mfFFOiguIlwVi;n=c5?U`CY|U zo_kJ$oZXFN^YVL5-ja-S$Yn4}zIf6Qvb6e^mB+c|VHd)P<|JIym0yi#XC#(}djHp& z-8>(bY#7Y;Y>A_jSOUA_al@=&Wyq_vlvJeTGeFWrtMoSwQ^;cw`cptPUZT=A^0jc5{TE!BiDixq{fk5di2s9Z{+rn4ziZq7@o-~vvHS90Tb_K^ zqa=GN&uznf=^9vaY)p`Sa?Y-)JzCZbZVdbvkPm<5tCX-(8isCmDp8nwcI?0#gTy0X zzJDp00$Elv1FsE#q_&T!<7%cW;Yds(l}DY>(A z?(%mibyUUn%r0|7Q_$P)ppzYjLm@ERKVOn~PUQV*O;uWcQ-CMicb-%(>fi6A6==2b z;_h93*NFSl7U5qL|0nSHp9L60^ch}K1}CdgYyTP=e}ASo1y6cwT7o0Gh#p32{9_$o zS@g{Qs~`I$CqF~~%!!7-e6bwY!}rgdH1&4NSxdRjRN@;fw#Cx_oC)=f=sPA7k1jux zqx(~r^Y7gMKicyDy6*)d^Bz@eUS%%s+a?&4#UGL1RK^P2sqxZ|2*UD64Gngtf^6c1 zsLxMLlgctW&}w<}F2+qv9TWJzn| zL84rt5RcKW9r5t6^+e%MGv)_R z&9Lj=IghtPG(@ta(tWHZdRQOydyMOonr1+A5Lq>cwcLR%rU6<9YzUH1{l13` z?6YPH_>ApHD#^-%O#JB^2RJnjf@nC5i`w^k^S|GJSMngL-7?UrZ5YQeZBvoIq0NqyxBdvQ+RXocXRL$qGaP~ukpNQ(Qry|`vP({;$-N8%iwW;GQ0!Jc$&P08IIYi-{WRH;EJQVCHQG8BhU_KK34aM;Vlzu#Q<%NqZabwv+ZEcWJiM=v7z` zVQ(5QB#Ox^<{U{yV=u-!%W^1S#X#Fsot=YUbc&)e4<$f8Gk?YxI&u3 z8qdeC+L&F>wjHzhv)7;TNhGeQv@CRlxn6 zkJo#z#*$=gM4W>0#JKw0cpcT8Vs#lE+V!DQ=(UnPO9%8jZM1VWR5FLJt8FQ&;GJ5* z#)QQQtL36{q%E$_t+2+@P-HTd)Cq8K6QA5*Z0s+&_+cl@D(X@op#=A4fq>)9sAK|= zo{iL1ezd*AZTxXrj7ve8wIj?2U^Cr< z!<|`vx&W%4*g0MXL8fubZ@$j0&k}CRl5V2e_O;$Lh=ldC&9)rfQ>5^vr|dz$MPQRX zdEQO<6gMc|SZ?zV43wH2-)l&PgO55z+Au6rx}^Qnj!f;0J&U2e-sdkZ&h8om4!K{F z4x#J!xq3AgsoEK50QH{`gW$IE##R;IpYSUn%(6&ZE`p7@@qJN)ojT18s4 z8L0L3d`<;P=2$*HVco8rQTAaTj6syTvzX(4qlM@nC0o%j4X zrCjtJCv{ujt-rU@jjh}wJqp0EyUAQs5$ekPc24Pc8h8hM=}XF4*?ZWFt-ONm9fbz+ zSUzm)Ow>fxA8b2MNrPS8oz(3Do_&c=)H?l%o_EzRL&dlb7{rTfuui(m~hgjYaR9oWx+>8nSDw7pEVmrU_s5MIy1sryMwT48; z3cz1idni+KXUp-7_Cu1{JRt6}dKdcnw_FWtvcTA2&&SrP59bXqgYXH`5A5wfy3 z4q~PQb(DUjMdj})bs1=5VjKjI6z$8o`rIoTk{fvEw9k2Ie8g$^=lrU#ekk2(Qju?u z&S>6yc|M;k$DR0K*Y9f0^G%9R$E@%F_&7v$hd~SD?1m-7Bl2#t0!*HA#Oa!KZ;QKD zw=`S&SXe##Q)R#Z@>x;DW;sOB&hAV@?vSZmI$OAsd1%nrNyz^iVTbinqAW)h%fkb) z39C0mC$STOlfI#MoMvW{5jS`HiVME3AC^NIbSCJzFX^IxLPbafg#`AHshj z2k|yw57E(7P^XUr|Evym^q2VCNWz)Zk=iU6@Iw^i?`r>~sC+(+GoTNoi zmtqZYNAui|KKI6Cb;ileT#Bx(UEhqIU4o|qiqQqMvPHkkzZBqJc2qexHg~%=$2fPf zDVmOnR`;}QT0!*V=Req2p?B*MBJ{FiVkTNaE$%tl6&Zz&R)z-lV(ycRR!t0>xCp7{ z=hg};+wk4PrpkJk4fF1|81`Ls0JTp5?o-7xC#!}MW8vOl>g$4ztayKew6@plbsvtU z<6K6faVqX~JPuL%%}q}-x9aJ$%Mri8^*h@%nD#-x$ygAlJyH_(jy`g-`Vg(xYdXQ@ zR1#$B;aqA4ZM$2reg>o(@X9`E+@wd8^X^YE#++kJ!mtqLrppOq-RNsPBdOdHhXhDp zvQSr_|N5;$C*edj#(2E?yJ~vbP$WFC4Pj(2Pn*Z@h%*?N1_ z5M(eG!S9RD^J@Xz^a>^bk{`YN%XNU7CjsGgONU~1DK!tg(A2AtNDZRdK-7FrBu;vcq)4L)3VSZ?+XB@a%Uzmf3XAOkgk6 zd)~RlegA_IIKjIK))Hb{=u2g;-<50sLs%P1*hdW`s; z1MCMceK%2eF5xWO4ln8R+b!6*4zSg3u~(@X&_)zCHxT8)Fv6+E*wH z(AKEgt|eA8f|tfm2y!{sy34uZ6$E*Y3_R(e>kYARES6y?mfTf#>2;%&U5H8Y zy}jd9;;s3EuEXrROT5zTM*$~g&K_T4hi^WiUEhKS?lq33-#Nqb{GTi}YDOI!S(AGcZBJ}&ml9ZbEx0oJQJ>VT>4(rH5DU=~TDmC+ zJsR}s7CYwk8uOG{x+hLLKIr3ii{A2U(};5HOrr3PGoh~~N}gQ7)_l~qw%@r;JCjre z1mB;j{k7*#YJ-Naw2@7sc{d)uLE*g!bRRxoLd9 z*n5nGY%fM(+Pm5dTnh!v3mi|@ju#hi&+)ra=YIp1K{+i7UXb?RWcaz>Yq&VRD@~vD zbe!m+7#IlXf3SH@P7xXTZ?DddUwiwL$LsW|sSEf1kP@2ZRKs!V@y+Bio zPr+eqn3&A;)rT57?|Ew8dx10&4PBZ_PzzY93D7iNwqv=>W5fDol*2 z^lyivYQTW51JPP)*6%S&0O^_9p;HtxC}r?+k2GEEk>?7_64hgscT}GTy%I$1FWyQ< z9Q5xbxkwkK^&e2E@Jv+X3^sdw(O?Puc8-;6Y4{3n2WYlthpgs8wGU>kW-nAU* zuY`{lS(m0sG;tf1TvjV|p{+xa>FEk*MnA0&QdUF)zUjMH?_2rTn?awCE7wguB`UhX zA}<#?-iKoKLjD)-N`E4>oAGoRm^(gl90BA#KNVCkV>$wltpYboeSBB;I1ZD+V;rjD zD!i(Um!^+_q%RC>s8DD;kWK604-~4iwH)K9%U-ovV&!?q2&CQbUPqEUwy8N>@g;xNjDt51Pb!t{hmR*|e2jcq9 z&XOpz7Zhx3OAF5#^=-bzNq1{mlf$$|NdQ1^$Ft#Dd?rU4e>Z1@%guRf%9A6%cz{Xk zXtXaKLK~&`7+{kCdf(N!e^Zx#_5Rr&V?dBoxvljXDD{!xxmt%X?(lxgZfAh}&|BI7 ztWDEEE^0`X{mliN zWtWCA%(gK;MPwaB9eTJCfjJA5@JxzzKAzeOF&}Esb=gJj_^4NM=cnBXO zmBRD;>rtNTFo3;7)cFr9d>xO=bGh)<^}3Qfcg>hvu+)BdZik0(iAE0Kuz`FvvmJyd zqK4?H5p-|h z)by+N2`k0K?Y@n*YZj~vlk4fZ{jSS#mK~3}Ug~IhnRe49bt1)VO!H0j@8}V5!exbr zxOPp2^^-j`x}hPd?$WYk$4#v^$d~n`gJVGYVmw?zUhdBEHf5bc5FOd_ih#{_n4Ddyq zc-|1ch9W|UhmgfJ(yFG-tK~y3$Bn6z5$P@1$eN)Z7lS7?^>Z#MAppQ+3@G_F=;myK zu%lgt;h0eKW7NxoD^|gL2(XYg{lw_ay95r-h8Tq9x6=bZ3@O5BQz;h-vH>FA) zxBALINIL@IQD_EpLnis>1Ys$asy+^82fI#9!cKfqtHCGJ8P8@pS(=~5a)Kr~ zh?!iA49Rz=jhz7Xo?F@QNEzvL%`XsZ4A*t12rciWr|;DmD~!kp$=4*xP5%t6>)vZ0Khza5}2lJuQgYIjn>ILryhb@YrsyHLA3yX~aTd)R3h5^jQkG^bA> zd9r2cl3}@4Mxn!&jZmQFHgY8)tayplhxzq{W!V>3AscZaM^6I*$aLK^gHjMRF^lg9 zo|0*IHWwE%3SzLt_9T*|3(wX$=od^gzNS1B`}%yn-uZqxD4iVP$7hF;Dk(wL#4A^s z514gb!JK}zaK3*XP=Ta6Xr2zgdPs=e|BWgff+&FLyN~UaPD)H9jHX-3dM3-lBV=DN z;MiXR>ugpuS{&%FJ4DDFWqz*@#-M6sOy`$6N3@$$77yXOS%xeu#$T`MgU)}FD( zFLo`d4Fs+bV(lk|M+NDmBO)q+Hxkp!2Q+oi@A|2wc{4+b2tgi}s}-xRlJ&te+R1tr zZ8(^8DsfX{yMF~5YQNA1WL=bPmpz{+$Vh_asv4C5722|OF}_OXesqjz`y5uMW?*mk z2Uth9uVx=X@0TT&{3%+7?MWC2@tU2*bcNnse`*ro&@ktSZD&VTf3kO~y<1yB`kp}e z`OZ;O3Cfl_Xq$9$jkc0i8{9t>p(04Z-6aPj;1M*I-l^vu;Ejeyn6wQOd}))bVx)w4 zEH6KAw*yp={4=3my}>0^$9`6Sun;WJvin2(Dn#2PAE6<+(`UmY007g)U z1ma&m1Q9t4n-v(xjc<%j;`IVd#y@kz>wOEuGft!vSW7}>_B<1q{m39NDD4!PRnOzv zEl$)IcCoU55g1j`5FA9co81`5*@n$@>+JQwI%aI(Y&1!t=A@l14+da|Q2EB}Ixo-S zMg>zh3z>Ys?$)m06Wtp6isz;~ON&hoBMbnDojx~$%_T`-vZS9j>>u``%CKA?<*0>? z@loqS-5fkkMn+2CyJ^^dm;Rc=Pltua1W?CGoY8=oVk*ihLHOx%?>k~yPY4Y)ovAUS zHQa@qyA3i6)Fy3_J~(+hDHaJBon(F=wH>VNV$xP&`&p_9^k;Ks9nuVa*tsc=KMo5Q zOZO>;xVKX5mZnRU4Q&yFw|=1jCH#GPG_lw7b)eAkInq_Srkkn#6<8wpdd>cHv)k%p zCqJ&RyoMPsk9N(~sG}l%;r8G=JtgGPU+za9@<1Hx?;7p*mSA4QWK-kZG{tmBhSQA~ z?`Cq?>DDk?mV?S<8Y&+x{;pZ2%-?N)bJgX8fAau@K+gyKuE2x_{z|@}g1>1F!oV%1 z&wqLr2DYCDfLrd@4vo zmxJ=feAaBwgo~Hg2d7hgXfDIkFYjAhUF_vrCO+_uhD<>Sr@aVBOSUU;MqVd|Tb2Rq z`>AOwcE~>6%$P~1Otik)igt{lLxjm;=BN7ZM{UE?xyT0RTXybmGa051XZd#O-`NBO zC^U+58+84|q^4u>3$@CTR-n|6f|v6%F1J~sG8%u|g=m&Pp8dY5&GYv(uv+ei%%7;2 z(u0iWr+F(Z(ca_AS=Vlz0QQ`2CU5*&L++PlrH#$^KQUUg=8W`-G4KL1R(VbMcH9~& z$&kx%@-h~{EY=9@o$488+K51a_1d3HLqXEGA%D{pZ^;M4y9;B{#6{8r17$oX*X7Qy@|xY2u%4^hvXV2e$AujVO7~0~ddOgMPW*3OcOa%T9k^Az zF={TkjM4{{#JFJ2N3U zs&<0O|8!t+g>M_sDlH60a<`ZC)=599HnVUq0DPcBMi4Tbe47iX0?_;%y-U^IlN9|o(#C( z&p4Gt)OOY#vkR%1?WR2n_!6MH^3JAD{?Fd;*<}E= zh-1W6%}Dv-jNubS2CeypXcyEEJjsF_*b#15-DXN^vmDw+N*Hw-!cI4<*3Sc)?Ku>C zGax0o4l8Ce5JI88qox5A;`tWob|duR65pwV#EeVT=jD^{{)XhCC3aNk7aQoF%4Y;~ z!;bA`^L z2dAYr)5E7u5q8Vq^q$jK!tK!ZC^!{goI{kPzw_ChviKlM-hc?)z?fb03MZl+ZINpu zX!_{RAhr#-59kG7OoFX2Cdi}H1nP2U{l=KuJ#oaG)+-vIeuMB-J=N?{DrTu8!kdF+ zDY9Rx00Ew^r}CCgpR4a_pzxR-D7ViA^ts$?cap7H&!dkOZxv{p4@BBL(tfxsYvG#LWzVU9S+c^0-82(%NU{*n z=q%KrBtu`j+XF9epcY2YKSs?+EFN8x&+VNF7-B4Ri?HpZ(}f*tA2%HcwjC#DFP43) zvpT6few8g1Oi+l|++e?fKcH!U4Hf&h_pqse%A1*fDjOyDG-Q+5e{)#qxZov>$+MX1 zhupktZ2;Un*J70=`d6J7c@g}DqPp6&zQO;ND4TDR-{=47DXwDNPm|zhzxg0o<63MR ztydUecBQQ*VKAo{$KD(8M)6JpYV$ z&(3fwh=cIJx882GJ-W~mDUDH5vTd*8xdev@JEX}x)}GHH3fTVYaEt-QN?=A-Cuq9y z*olYu&3k*PewN&JNQ4L+*RS&}YWGN)Xfq8~X7rLnYO4Nm+G9ihZ*PV4__;)Dz@E#N zAsnduhCgFs9`BAaea%Y?+zuNiH?;scqWtkS^_T&jBiW7IldN(}cr^>l!Lr_6f>SO) zhgABwGGv9L$B6X$a$WzQSC~PY>@X*=J3AV8mZ)RD>d^fHZKqOWAPI9ea*UDLk1hl1 z*R&b>(Z-rYM=(s|!xy?(=XIKTop==h)u8K?-7-7>B8M%99_!RQI?ezhbzo4PiU^12^-JC<4iY~- z-P{ZgX77e*`4G-N1J<;wBrno*H6fSdA^XbSKgwf?JbH)BXW3w4<_#y$=veOcXyk;9e$jF1>-_N6uB8Ri*Lr+Mn#hUSur_3kws2XsibAi; z6BE`d&J$hr@Q%rvKuox(c*4yacBbPw443J9jt^@V4yGS+OXB6)?||iliKj8x$4feM9Yeg$*d@VI$GrEo zWq&wI@M>*NL75Z!glB;cp?cCBFkhF9DB zl5gI?&xFj%nWqgBWrl#(Q9*UIqrdgjGHpx0R(Ms}hO(#Z4FX zam>{Z@15+PlfVKmI4jWo`=DXDwSy+zO#l_YKkKUokHuVn(|so6>sOTX zxaNA=_yVe!qCC0Q&j$WX%}W9^ydF`3bY7BMB9JmWPF^%pa3>;{_gTpL+dIUpM`(r=s}#=ho(z zLJX+2qd*odY1-aYyBndG`*9T=tYakaxyB+fYH595-cS@V>ZJdcXyC<#`bVI2*JC-H z0{S+|mIA7*-bS+{P>T;YnNPn|7;go30_uffk7=L`z^F?c<8 z)X|yc!}Q?wtJN!$zDP8mEBjs6lvnn|m!ieifUAV${JW10l4Jn&5o#rl!G%jtHu;l1 zY3%jyw5wh!oRk?|{KzSas_i`^G8Dz0kT&ghYt2>IML08WLD$HtS*;!)u#3BH zPul5w2_{oi=Z=+eOAo}QLcqQjGq|nn!JD)F#%++n0#l{(sg12fU+$;oR^`vyVPQ11 z@->jLM>%jSbyp?+iUEhqiur|Hx`pfcFLln)9f@3m_dg~T-{!uTk!p=Wzax_ZaO9Kz zLbE=Yc(Tv{Siza_UXfX^~}rik}2Wdi)$<&r{4O4rLEmfQ`IKB^?ip~zdO+dnD& zuSkAezs*uV)-Q4F3-45&JO6a1|BDg0Yu2(W9m#k8ZwYqRwZfZsoogvR7q|o;s8F4+ z`X0GF9hi@`fWkfKc6*;J9koyYefk$t}__K#V-H%NrU0XP08RFI;@{o;uVK2 za_1iYyIZ)l+dZaFbXUHzM7|JFZ#QI47rZuj=ap;o+@h$I|7nN6=_wbfQjy4-U;#Yiy%m5S`0Ao+g=P1c_I!x$+XI zxlP19rW*A_=1$W;;_!RwbFmS4>Z}v2j%acDv1hYcO0cjWxf60N*Qla*^GBlr3Uv-7 zM?GqnDO&x+{aakQCQ37H?vaec2{rr8EzDO z3KiGU9Hy0{E8|Irgiw>eL2@>Q@KvMrlJhh}o;m&RYIb-)s)s~|cRTRIx%N!v7Dk0) z(p5Zr|FuAGT@)N|{|+tb5n%6*RN1BN6fCqj-1)W3?_ZGplsF~38MvGWIbakvtgzTH zp+Z;^MwPt5`X8gU{ws6@^sK-aGmoP3d?c;fNC!%C8+d*S_{?O?SOOaXc11Ae%|;PG zz1u(c_cp(Rb&Z6n`s5bn%ANW^+Z*|T2S!LK*M5BSR@6t^b)FATv$}MdV_M(EjHC^4 zHWDbctqPET0_u{MPl^l29JhWP5jD_xdBzmFPl!0{rQueM(Xbu+fW%U?aRZ`w&Q}V& zISZRB;z%Q;4}SIODlGAwUX310J_TC0{VhykrN+O?0~s5yW*Q+lVPpoXtc}&*jtDhD z-K;h0sIKmMXU@uWIZZ=99Uf*1Mu6n~3*SyM;PNox_h&&n3m!b1&^+GHsQkqUS~9^< zqlE`Jk7Dko9Vxig7}@1_G4vNTd<6rJklpw;s?5dG^X&F}5tF_PczrX4_QRsWM6ZU1 zI!vFBaCh)~!L4!01qNyl>G66hzI(bb5r;)N8E@6L$63At9idr%EE zS;{8kn%dNR!L}tXhCFLsN{d-LX;G*6&bi3oLXo~Cxz?rpk;A+FKaqyhWQ0YfPky)5 z&y<}_`ZXEy_%D{>khoX=hQ;BhI8~le1TI_pO9c*v`T`N3ED>{yolWRV+*+xeX<=Q9 zO3(b`D1$_-Y;d@Bsa(cM<(v4ZDvA$lA`?f^ zyaM5&VZlE9{3qkoY_xH?fIuB zv1EFvsKa#)c#Mcz!9JNC}HE~AaO6F&U8je z;rj(&)3=1U$KDZG&|x}j{e>=8BF*N0i+uT{eWei1Vf5g=f7+j-I5SWcX3z>T2`_VY z?$2nf+XK5*;*Ey~(~j{1Bo{;e zjjs3J)J{(L)^{&oaw7>GYcvSngOon)Q~YzGcKpf-Q~kxonmjGn1tiG#c^22S-AAjm zn4{saT9I6%sF#`!;rgFLd~(Z$+R?t(=9^{$cifi6iw8xn7+(#MtRi7+ABTrIgniS9 z@8yUEb9K+CtwFv7^}X2A<{#LD349YuG#_ch>}JdEgV!F7ZNC4G@)JSD6-~ON2sio- z9JRIZA5U83ITOkI_RAfh(zO+={m88v%6U=8OY-W8n*wV^QHtPu)Mo5f1+@)$9?0rS zBi;>%f5tcV&(l;d%yB8elM_@vZw{pRv4!ai9U3RiFEIH#emC5HRr3=d#(x-&V zVouX5V(GuvA4E@qll~FOElk)Lk%!@_*4DXdMY(3<+z!Of0kV&}{HfFYiwEv%N{Y}!>}wVDgf)!#J;;kstUr*U-EQsBt1weg?)gC9h#Y8k&1vE( z-iKwWDxAHAys}FGBl?Pbo2@(rN-L9A>}_i9YXOABQFjM?9fGxVC1xZ4BzYrcnuW1cy??jW4?@`_7yxF%M=j)=`L0hO4iMSjB1EK(Qq5QU zX%9<=*JZ5RM-R`%qC4I-N@NY$b%poY8c6%-=Q+x*1o6a?_zH;n2qI#;0P(;w35;dA_yo5BHhy6-IpSzFf>RjNH<6iAR! z-NJrd(I+)Y4%OEtByM-)ta@|DCosCy`!?9zzV_F^z90wC)kFbh=g7 zo3@r8AdXU$LkDEfB39a1Dr{Js1mD#{`bcc5$1~i1{j%&g7%jFVTJ@#;aVFv>YQLQ;pMNB3xFpu~ z?^ADoms60Y!(CGCxk+^BHHYTtZss`RixQ0HTYTbObJgXM89nVg>f{?rTrEN-o8WzBc<0#D zNxG^%XkKOz(hKd2w=ZXSh3kDOWLIfC5@S{{7SE9x8aJFt7&%E zqI|#b(sd!7a?F3_PloAvQ?>iXpyAKhmNwV~jO^W;33cqa5e;Gmj?F{3SPWi+ciGN4!;CP`4%b z8+H;9(;V&{ZkMG~qPK;={tMdWGdCWHDgXW5{}5RIr(NN{pTEI9E4EV%gDUOsILGz< zJSPOOD99Mz6CLF%XGgs*JZ+1sH1=3r=F2t|1gCKN_$R}b2dHGm)%d^=sRvQWES$0I zmC_J~2GYkuZvIaOhIHLssB0@@`NZVBc`PP#R8jtQ{f5q74vSyO?=))+k)yzjcPn3> z@l(}Y<6vQYCHeLN*>!;}txU@~c|>q#l_AngC+1^DH;<`0+HlKkupdD<-;W^saaVZ| zL*z&3Mx^A@SVXRTeVEFLofbmBfZq?4!dT%NLk9<;aAAL-K$k-(Z++pGg-NL>tu2zu|lS zb^6YQXB+k4+spK$IKX8V13d4N2xKJ(RmR0wV(&Q4SxLSkQqRLnhM49*c3r2F$a!f6 zQM+8*TOGoBKifZ-m?j9H^LwD2Q1z5Q;VxdG)i`6f_4B!vCc)j3wshyw?cw$w_k27B z2fiFH3DakmLhbMEYvDuhA8l0~S{m!@icCnq(uykR_ONox_XOK~OL0pB8zH*qIYql~ z`2zVCi23G@7v>g(16darx^``vThx`=a&;_k4WF86-s69`WTZk4)6n@1S78DU=Zd?& zPIJrYiM_;&O5N`zO8bnG5UO{E^LihwDRt9#LS^(Tq$plEqs7EoY5wa^vR$UFx``A9i|kxZcbB<5ug}bK0s^5E9yK$KBRjhv zh&xB?5`WFao94~36W-rADVw30{wI33&jekja44w@<(9Uu7gt-)nZ>nkZIPKD(pdVP zRywo>^vIzt(+bJkDlcr%?-kQ+Kh7|AR>9jD4?jG?SpQ;|K8V!(KH)8~;6!(Xixk7@ zseIzjkk?@@DvTY?rOyHDf|(>>qD@CyR10arjrML(K2Fhou-)RU)kRWOJ0uY8G|AUM zaCizN6c;!JX@`H*Gu`ECDbzI}A>YEb8ege^ihlRWpvRVnpF(+bHVlHv%G($cApX{ZheMZcNoW{c5wYVA)`4G$g55sPMm4Ee26DO zFq0-1D7>fU81;!7=dD3;aU?(9o1cC3cAGIDH7nc{0J8#*WV5G0q+qOSHI)eAh!|t> zRbeA&JmdLmbgBU~8?EV*QqEaKDFJHTxF_%5y|oo7EyA-^<5qO?Ab@GO7&~`4+o*^z zzI6sYw#1{~Y;f!149hi?l$w+LVRE}uxuBDnQ&748TbnJ#I#s^AazoWQl{Rpq~=@=i`(g79?cY_x^ClI8%I-ks9MLMZpq8YD^;fB zv+ppgq)LbTRyV|TsV2T#12}%bRhgieCgAq_>h4)7Q~2_YGFN`ve_j(U_=Jg}u}%A)3F(z-Kh^6qq3=#vuc;8n8&yjOF1Ej~ zBrKX-D4-ehuL~Iz(dw&Lq$^A7k+N55R>qNnb zzpVJ_Qn5RTfBo&Hlw{$g3AiVS`~@Kg?=ei*5QYd|Tbzz*qt4uCN_>7oA?=NKz^9X! z&{wEq1bMXNQGk+Pdgp+aNW>fR7vG}K!-R|iCwsub0a|++%?g}?akueJVAjo7WLq4+ zJ`ZD2K5AZ`?oBx8)f0*Nm7E-7{nN((i8 z-i93?gt&B_9=S(l)<=8r~QfZoW`LttwT$yR*A6JtKzQ@yN(Es%G(Fn z(DF;gDn={y=O524w;Vg=ei*a%AdZ<^SdP|q*6>?7f?58)*P^AVqTGfgBv`WwX`5rN zpH5l@FNP8ntR?AV({EPGOq5zUR)p6ZH!Rvt_}ZE`5?|OYI#0STC&p~OVLE!k{30~EYA*L&fK3# zTxh}LUm|+=ZitVwV(@!L*mz3$NqA(0j`6@k-n`Lo=uN@R)@IH3z0PxJf+4WQHsw-v zJ)U$dKTNw`=Oe>sh+Q5*ZV>Q89PdDY^NyQj9n$^~uR_2ff8tfE0GLkz7;)PydpA!y zYZqI=r0Jcq$b1HJnY_h0f}r27-9$an(UGEd-}$?r^6J0OE)BLAs9!8X&hN3aw8Paz zqMj3b5sq`L2G`hU;R9I9)op7z;Y_){_p>1bjTx1uduRPwqfbh=(VG3(vtAJrCXlZ$ z;7+{bc2@;nw?K?Vxlxp3jYiG<$Ft@(Q3beRGLc9%l5IUSGHT`QMVizXSB^ez@lF&8AQ^ z4#5t!;{ztoOhw(P!%d!vF@7m5itFM?fq|Fe#_Lxg^|_xiSk)pJmjVu^LMNxUa`b8M zV@xICY`U)$?5a zt|`6%{sD~j4hBKRE&2IdZZx08E#^Yq6_P5s_QXX1MTwJeqJ`7pStMI=I}s^G2T3dD`{S^z3wgvE$6%iO_#y$LVrXTmVcABRo{hbhlJ z8EFJZzMR&gxKP=?%gUdbWc#khLoky#mG5f9OfJVz1s~4I@a=dX!Fi|LVSugf>@wHd(zXq0V{hAIY1Ll@lvBwM_VD)fv+H&*5*0x2DjvtIdlj}qSS5t9RjbI(#3TIkpf|mniV8H?(X8UUM zU!^LNF!ej5#=a|oA)MREwoX8Ekf7~BCfgt^-vWp5^1>k3X8v)sda2~{$s274W9e)i z+-wOYW)`AD=$pVHPe-cfgf&NQ+Y_(d5we-;Oi1e3+eAohes&w5mlvbV0H>vhd2KB4 zHq77W)Y4#=24@FNZD=Adt6b+pVachI~5sbe$mAn5oD|tiChW1*U38ZLcspoz_6`eZ6-&%(=KgAba?$aj|#7y z&A6+_;8rma!jBsZPPU$8 zn>+{Px7vS&kQ8u8xfYd~2>JZC!m%3Z($;-<^hvdvMNFB(k6A~ickpg0yYc?}PCSXS zM?d*kzA7{yE~%}F_V|vpP&H$7R^|*Zs}79HVKkH(#5IA(aWJT<}Q% zkAy2dHJd|DRg*JDVAB6$nXdB`rEQpFd0}Z^Ocg85s2>vk1_&V+U!4AbfA{~L#Nw{Z z^3U7__=&yDmuw0wi2-TmzatlV?rKIbU=r|7m5vVS)(d^3^PKC2J{5C!HoAivb|LbM zvtmi1{HV*1pY(F}M*Yau-5H8{8Pu5L`p;n`DUp;jzlg+!t==>zPjp+2#GW+t&49(l4KNr9Xo=FgPdKTWQ7(L+fmGP1tyog+6j5p>4~l|{`u z)i(hC002NzDf?d@K0l2PDe{+lod1f8qVvl?SrYckhrS!fLaqcO$;tebfZD_dTL{zQ zz}LNDU9ouqffxzZy>Ue8Nxe!Rr?~CQ zjAwIuZOyq5#Wogq%Vt;yDH7BJ$&`K;51!5FN?J06FqIX$y>+#1+wRv9fqTUU%eRRZ zo+IRa-i6j5$%&#gtZJ+aZbL~G-2h|BhYU}r?Y_^Qic9@Y>=V*=2-D4xj@9<}egwih zO*hbHq%%q$C?jE>sX9-WsDmJR8NZDQ`|5?7mq2HZex%Wy9FJXOL+Trmgwy_}{7>Qc z#>~^>dfk$GAJ02gvE0TCq|o{rU8Tb^J#(KiR+@?7!P3rEY_f%kp>J`?iD{N1E&!Y$ zbmofHAxK=st*pyx_$2{t^d4fVZa&I$?kTMqn*;fLUf-Dm%%qgq?6i8KWww^pV#90v zk0(NCu>b6jDWU^+l5WEF7M&B8ruLc)9;e-PG~!jq^IFaagiiD!vmOE9;K=w;{rvnM z4WnVxtM;42F^+219}MM;qO3~a_OLAhDdk;7^knB6iga*XU{yPyrP9`-TT#tC`pTkq zFObAfb^8k+t8N6+StI>bH=UoQ68E-F1*^yHo#7*6^YD-pggZKGVbz*gg`cJR2mID{ z<@P6goQ8FO@jW1V=;!+wS*BvCLu7QpN8lLhn7nQCYE9vJK^)IPdC}gFh&JO~cehM; zo?fl>*D0{TaCl+dxTTMzbUke}7QtvrjM**5^SESX~xfe}HO-{>eGbVY~FnEv07Wa1d zoAHxWe)E*oT9N0-%$Z2GdVLE_+Z5*5k$jT!>lN#GcEgz{PqeJR^rKPU5lH5QU zI1+jbH_Pl_MaZB4(Vu(oibiTnR`v6g%w{NzGgXTu5M1Nh(vF6sGWzfHh69C>ZKLER z+j+V=cNm!VcHR|3mg9zses*$vb(*^uBO&BANT$w`B;i7=f`-wBMN`RA@Z z-P)ez#RG)|*DPndh?J$ev`^0>502{l;|(+CuIYMAJPcJK5M)~?6b^mC3GAzYfv~!d zeQ`Go9uB@K=gjd0Wj?QeltM&;SV5-fs_ENm}jTEE+E#z66zt=0=?AKX^H72100&RvmW^)K;gmoO_lO&;STri|jg@QTp| zzV@u)V+5W?h4xsK+5qw*wZH0_o0)HakIn8YK?}5V6vSiq))bRWDy^G%2G$E}xekDjQhMzXk9;NEiYsg#}lEN+v%x_8Z`E&%SmK|cWm zQrZ`BZ@YOQ9I{xvDfw^zlLV+9UE*8vhXiO0s|G-DEm2C&#&;l0W+v424q^hx!Z!z73rK*8>rCjm4)Ko?aY&pT1MAa>v*Jg1A z2g}uWZNc?pT@*R3dW@RV-s}?$ci<8Bn(N^w?c@T7VRVC7p_LG8lTZ175RMu9_Ag!4 zdBg+zaz3X>%ZOuQ@Scq)$ClHW#9_7+;k|^7++hA5$;UKTOt@^<-goImrg7D~3Ea&n zJ8}$YG7x^1T|m~+6=?nHa=+C(PeiVoviftywhf+0Pi@QCKGc3ZK+!dTk?=bYy}tfC z4?SXI6hKIs9&XcC@~$Ebo2^Nazg2JHyB(`+lL_hm*`qcd3PNzK{nPL4lpllg&n)#R zy%8Ys>BaHqDL8J!Y9A=(4{JbL4xKVzIAo+$fkP%`s!JSJN>T7N=?K+?PZ$r64g3Znj17(G|K883=Zsx z9Ofs=fm)aQy$9T5tGdWN_agnK#Cdr;XkntdfBF6rv32=Vuv)XQ3Hq!*)y>m#G{F9i z$GP+zVx@a7;c1Z}kbS;T*qqwM>p2vf-mn+ikXojm7+WL2qYW@D0uKAN22UG5dJnu5 zz+)o+rAW!DLZLMFq41*WXvt#Z&W%izv-YO{dDg6ZMV~lX2Adt-_J}?2HaZ*<;p$e{HAb`MwF14j+ONTYW51MMF9|UYbMi{HRB$J8BU>xN zm*P@Euvb{i)d5SaK5EuAZ3ip43@Hxu&jHt%35Me^XIHyj19(#Hf-c-TvcKFq&3$^A zfq;>l8U*CH7gSD)>!>U;uL)s5Z z@(WXtWX!=2>+8PJF4>5S8ho9G0BDF1f0r}HYYQ!g$1Z{?O~+<3Wqj673>=+1IdR_t zwXTK4A0E^WqMEP)quB7{R-4@2F_t@6xp{e_(|t3#Ab`2sJEdBMx_N%Giw=rn;{E=N+7 zBK4Y+`?ymvZ3O?Y7xHNV@5o`iVVByV0qF}`G#1|kFZ<47R69xKuXYmu5Y_$4UvOAg zr+?cAUbDK1E_IA?JlE7h0ItMi^Sz=2GB3+nJ(`t-4;B zlo#H(s_CJo8aq_h7YkFVTVhPs0xR+BmYYjyBhfX+K&gFbJ{$+vH&}>S0!N~JjKnAh z-a+kB@-RkV%k7$7xUA9BY;)4^991wtKcwF4W!V;wQdF1@q5b|eJ12!{*ItE|ro6ky zY<(Q`Ja1;wW#Ur8_=NP5}1Q%>_2Y)6vhA*X@LL?2cBT zYY`n^0be){@(gw%{Gqv?LSo=Bw#4IWm77q2~rAb6QTtcMXW!fN8`U)EtfbL z*#z#b5=O~MG`CwA=MmmA4#*Yw72>MGjp{6q||SIH~E zmX3LSfq(J!)J9itjy-kD=g5{*npEUGR#Ev-i$AbWw|8Wfyry<%*fO`zOtqWdpRwst zZyx@VB+@*2&<#s{f6(IMk6){-1o_#ec{!BfI0g=5Z~k?7eAF7-T19Vs)b+^Xl64&S z?Fyv)?Z#r?_4(s0#p~+_xLT8~MmILDQ@-}8;AWEkV>qreo}igk`hJKzC`iw}b8x!x z`E78Owa)>rTQnTMdAT~=gvbG0?y{zT3K{)m=x}50$Q>jd4fn%1{G7YOh_gWA0g+Xx z|K@5=@&y{Y|MNi(dYv*E0VdzGyl;B$_^&;B`Q~4J_nwgMSg-imSy{6;q()zruNxQm z?^I{+tIBf&pW7b=%O1U|XFy#GCoHwCs|riSp#O=J-rW&B-|yZqV+<(KsQ5n5e)0Gn z2{;W2vb28ei!Z^9Dc5l-!ZbRM!!%?y*A|enGg(PB+>- z#_`1N&}7ds2>i7;Wcx_IjR0IB1*r9-z$82EqSjj!r@vfRQRN zkRA~O;A&}~j_){ptby%)0%NC0ND_zu_IWC@X$DwynRL1@(hB(WwR^rDi_H4Uv)r>N5U77uUEi;K*QGR?KNdAoGB z$MNEi$a){9DFe2%*0njJ52FIAzyh^nc@{zq8H|Nlya^6Wce-K|%Y9p=>MCntFtQmD zJM9^y^e?LVvqvp`2}f(}<&$Su^fQmN@wCP{erkU_I!bynn_v1r1q9{B{{#d%Zad!w zqZ?kY;kdoj8dGA9IzH{>viNPzp+1?qSCQvOMNoGy^xkz&$!hbs%WPbYJIibDHMGp) zxFl9rp%M?H(x_%go!!K1uoJ~o!cmf1vulB>Y7uD$t>Kf`CL9N5D@1FwNE3x;5|nQD zm^fy^&0-C5bCTThK<)eF!FpXhxegYfV)M7|N zDX)M}6`)p?$O5w=MHb1`e-%U&GwEYI|_b~HP2hEFOF zNpP5D68Jh6KnK#hL;ldX2W~ayo<8Iq-f3wFO#h-fABaB8lgjMPxC2>1&aGT3pGsCihn%_-44b6X zteo~sZZ5eT#j&wTmGGMWYH{3rbf3lfMfXNL^fEWL6Af}>EH8oSoE!FkGMy7O0(8%? zJ<<{8UK@=RwHg=*>YlpIqX!SsU2Ey;+=2g;gAR+I3rCTkAbDqPCe z1yT-bg--2;$L=%$Fx%*h2CPfW-mbyFHiD%tc<#0ZQV~KO?9qz_(1OZJonB?)F&*@! zCQu3T#^!v?`~4CC$#75f9V=hf^Xcqbkl3D=ZMP^s7#KJvw8dq|4*S^$Oua=GWU^c}4B4q%bSD+$ycm zU4(@FGlV8T9^Ed~ot{Tv&`bi9>+N6$FIcyK$a?giZZg*@NltIxYN3+FpHaLFJuxgP-`dKEh&9hDhpPhl2)rJ+X>EYA30*i$Ww%5Q_}#t6eODqm z#>m8f8&`gOzb>Eec*o!8PwmF9QIxA7Y$AL;O&)89sC$MTt{2g^*VM%9F^+p9tS^0MZwSP|#vcV!q*@i)7VGrrf0$hyZp}*uhzL70$o-c`p=5qRRw z1PiXwUa0CaaC5^hJHab&^o~PW`6Oe1;A?T0R8DUZq3+D7KkQegU(iQ15>Y+~iX_OK zKTVqq9BU6EsmS^8;e`#Hqq+MXNrfro)lSes9D8H0XDGt-nfjNRRb=^A3=mtltBJz# zQ65OgC^rz5BY2p^wY^Ke$qtyMI7$-~X?ic_qr$X*lsl>Q+GtiXiF@p5vz?)0bmnI2 zCugX}InAMV+w$U`@|9|iF>|$f=b-=%J*$f9PG|YHg6O7_#7$`Tk-+{B1@b?iR&Ogy zXj_Q98qO}NKZL7r)eP*Wm-h@ogUF-ixscbYAv66}@HSwSN0P=lb)@L8s_7;U_CGRd z+HiG;8smO<@I3hHReJyuck-#-DmoP{$~wG~I{xyT37p&$bN|U86^Jl$J$BfpmhEds z>RDbI?71yNY+2*G(HD*`-^HM+d5G3ip45R!{?2h@j~)R3Olj#d#}(H5eu? z$H!51-snA7!~J&She70Cv(N@+pj*m6DHN~|B0%wn?j})J&(-Tj%lh56WrKPB%G~XbiVXwKBJV@*quYAJj5t`OYWD}YA^Vhr|a;hN( z094@JcNO)lpuh$x{Upm_cukFHdw%ydtcb9dKBYe%1~f+mvu78Ii`CI%Qag~to~8%S zi}vl52ny`MKX=Oh@T5Vl2SogUHxJ59`k8ma#ra41u}2l7jfH=c#X8M`v1a8%-(0Jc zzX!di$Xcy|CR@FHDKH9Z^jc7s)CYW6MHr_zI@}(n4lf&bD{!P%5s2aZWlgiDP-M55 z|1irvw%cm!sw43|QS7Bfzb(k2`?7G~nIFU?E4)!$9V=O<4|%e)^~=kjuNCr~0!Z@* zp#_~$dH@el49xmvh-2igH3-^QksvD}%oXa8sS!I1o<_i52e({@c$?h93kj0w?T1lU z2+RA7Qwcv3R zp;QM)AR+)QibS0?l0oo4on`+QVSqLIn20u&8}G8HYe*mAqvjYocjb*C5TZ|w9lMDC zS*~QE$^Rq%SITy;v7~yN9Z^K41Aj)tUa?WgUAvpYCfj5KOxO=j)>)n)gCb41uV*gm3M;2{j_}P>1iji()5^F7YD>cm@ zhRfM=73@Odt5~W@4Q1@Z&F4B+ITlTb1}pc`D@GfmE%tVUh)Qn12~gAC`NKO2W7Z$U#%y&dgGghjN=k3l zd&1_I?j^^YDf+c$qyN6o?l8lHSiI3^v(M-E zuWwG-Mx6J_TBSbxQt@_!YimeXyJ-`X)2q|i!)LL+P~Ja*!?I28FZnuJ-?UKruWyzR z)=NW{yjaHq;0m2<1}v5OPtTfV%5H55Oy@SpH-PG73LmKdeA4aUa*sCY%e)}-bLCk_ zYVuvi=YSgkHKu2IucXe(lsQMkM*RbG)MEL83G8G~@z5~svUb=s>8D{qg@GGf{l%lx_eJ`TKvWmx}K#dXWwNE zvHhj05#O+cLysjW^r+1P1q@YGJhmAOp$`(e$;TXhK)->;Z&ZOB8PXDPT}b6WE5#!7 zI^2Uk2JzbY&Vp$c(v!F%ltP)hn)f`wD^pi^W9TcixfSsO&@jRMVy-z~l7nHCs3be= zy)zr=ASmX7%W{?qq8J49Jlm3fmY&%XsHtlPHFX`H!Ofz(HEaZjvp8cDz+tMj_5m4G4x|mVJqK@jUh=_O<*_ zE|B|vOzf)*uw_lSwvVBMMY;(w11QPc!f)4agDAqC*Rldu#I)8eCcgReaXNRGuQnTO z(~0t2I-zAX`RL_XEwQ4EM;apn8M@=KQX&R6mhe$5{RYhtrrhGJGx(8?ly9rXAjxnq z`;4SEkd<_hKD`4A%V)Zd0ElV*kylV~&?DF15n3x|JfOa0n9gEzIMZl~Q67@|wYB}( zGvh2UTLwt#KnM6A{WNUStycy)%%N@icNA*C7>mVZWqI*hFg25stg^5rE!0($V2-Xv z3o^>)>WLC$F`B#g1ryN2A*+@lgKb`4SjMSbElJq7Tj?*i=-KbV7X4?6&F)t>mVjTB zHk=;RPP@R0LfGbdO*UD()95Y(5Gs!la@dy>-S)qP09lPYyakZeV&35;s`>!n&|0$A z)OQoJxdA^zk)&)ofUJiM{;Fu`AWE(RSZ|%X~PY56C0niq{HT(+%Dq?r;a!JBp#<3 zIn2qkO_}7JW}Y#z9-rn)%ZtGW6V1niI@1JXUq}^b1E8)<;@Z1M^_3wAr<3KY=bj{j zxnc)~;)sDcMJvAH#%c}*(nTe)RsTpFu7bS_s5W?n-8Qtae@E)-8P(etbNqyz2=10?;iSH8V13;5_3eN$b;Pl+Yj- zQS0-`qi;>*c{%6O)_3i`*4_5uJST7d*)krYY&uXGl7^JLROtno;wXaY3%K$Ef?VS@h@h2C|&!5mkI=CnVcBm^wgX3IO zovRJ!u{=7iSOkP6-SZoL;>Hbm0iIOiu@wcV7dqEDHN^hV(`_(6Qa;7}kgm08>Jj#IXjg_wvp11BHuCWPcwrsb~J+bgm zW2L#_75|#%KrSj@f&nDj~6_RY%+^N=*>CA)=#fo=d-IPE(c*!QhQGmDQ2iD^q z_9|U=d~Y#9K_JfTNDFJoiHLoHL{aH7I!P?wILTChRh1jKJ_SP{z@smQy?`@^oTmum zH=pcwwcHw7xqBf?cIU>9w4-DxUX)|BxiLNjrdNGf5E!pmE|{efqCQb=($W!RxZv(C zDY1BSl8mbZo_RZFt(yZ}z-AF94ujS5QNbdmTk56j-0)EYO|JE41J09=3Iq3<-o*!X z>uH=~Iq-;l-<(i37^MUtZ_Uc=QmQ76Q2RcoD(vl;YXhZN3-c;!yFKEgJNrUBAyBsM zVtzxSeJE$NT=RQzic5pfnnAhb90jTXIz%4^z4z2yY0Lf2?elQE_i)&62-PEo5YlkG zLe*0n&&#+;IRTHkY8zP#?pJvXj;r0}O|GB1X1A^vN6W=!|1)MPu&9wjnM_J^-@K)< ziB#t=&i=DU1y(C^fFaW_j*6Xuo=uLc(jpjoa&^atFU48yH4~i3v;?h_+*=L$z8REu zv}y*lSSI~Ro{lFP;Dk01NvY9bz#(YtE%@R1297_b(R#FdO_~EYx4!d*zOYce1MIf~ z%$KdP(;~)OB>eGWm@+M8%9>)Xs8#pIno@<{tQe7qlhx=nmNoxlwpcrg1Vl9)W+qg~ zA@yhVJhBI*5GNl_2OOh*6Az;;zNFfS`dVVdv-qEB%<)RA1oObWE5##IPW`*C+=iPwZx zog(^TltL7ou!7-lHmDXdEyke5w{fA?YrrE~8+wW5rZ1e_Vlt#5w-NDQN=)zOg= zRVPnqRqj>CbU+e|p|RCtA~NKKajAjvP7yK!Y!v|sP-}f4Qkva%guZyjoEO;qOfCv3 zdB|KsvyhnbYr)n_fTCddOE$Uon+ow#aLpI{pn8Qj4EW3aXbeoR)oqACunkq$=m>{| zTc>m6MRI^*3Hj8W^g*uhKSqK&G_hGrPk?szfy+tvs5*F9iSoCHU?#;V1*_aS@DhhQx zJZ$?Qy>%7UC=B=)hVbkV-&nmcuqn(#pBB4zc>3s`s1WGoVmt-8%i$UfVZMNzo89)Z zbmeve30oSI!cDWl00WH-U(Y(Sr=ro`x=>2XyV=r!r!}<{du(8M3Q5k!J8JdFx-fHl zIzP1TTZNCcsMntS-mI~=S>P-TjJsb7 za`P@!Pll;OJ+#AiI*^5c?jZsyxdaozNg**O2Y)m^*C=q>AwZr72C>vn_b`WF@$|(+ z@b}tDswfJ_eogWx#;vK+;nxg?s_;LjPKbsXqwiWab|N!wUqfi~hp#g$cQ^a5mgQpv zUem@a85kGxTO*l|+SJ(Yf8N?R2z{o$4eXW{5CjF0nzsT`NT}9^`xz*T*%I4m#7g6pBm^u<+H4>5ExU%O0n@(C3&qEjf zOSq6NaJLD{Zm;l+hQ4nEG!OjN4r|wX3R6VNtX{r<^ziuFW_g$en*wpWIflYl4B8})%7wtZhoSkV4pakY_T|7I6os60WjM&qPTcXofhbrJp5F%Ez9T( z_emW!WbUk_Fkn2m&paR+goRh%N#ZSJhB}d;WHT6cE5(H2OgtVx@t`!s-BNZ%0YrW# z3OoZ-ZgR8slilFZRTCavY_q5}QU8*fWabnuGl5^izaBP8RA#T}|7JVhXjPC}53wX$ zv7EUO7~NM*h;n<-u`k$5f)FVa|8?2K ztZ~`IJa)_C%UAOlcux1A^Vf;Y= zmiTyM$1J6>TO^0cSHx$z?NS?T1+K5gX`WsUi09JodBWWVTSeu>gSrCLy4Ne&MgI>*9hV$@7ZVb~Q3v`J~3@-LXG+guK zRSytOqwayjxF8d(9pxjutu`(wrNI4w$ql8MNP5hBQc@y=`wY6^$4XUM3V1X>AFnRo z`QzTaWkZ&Y8d}XI8}O1__zQNsKK;M69(k4EE2i}pFLW&QabLOU5FL+LT5Ef%Qk-|p zmTytnzx#Aa4H^HXAdDQJ<-RV{@zaoYf&%k=gsr$ULJ6I|(m66b$cRJZR z3UVV+oHRUfN7ENp6_l0R!q7cm-p#evRT?v35$$n#3{>>5b(T6(#uDci^+%*|_i+ah zYE1txOXt6rI~)H5nwe9MDlvYx21-y@ZM*9-7Zc`LX%1Gdor_V>WchJa9%$jY?r;#* zVm4Lj_O+9#vUP6KD3C=S8hB&Z^nw_z>zL1Af{8UaUt<3q=>#a;={J1=%L=gDJPz(7 zv-rKW{|RJQ>jTC6tz|mAW0n%$M|bP^ufy>J3-YFPQlQqA51XdkM4LX> znIxlkc(^6fQ9mkSeN7kMIIkm}g6;0)opqskoUw-liS{pU}qE(o<_ThGZu>KD=R?KJnpNmX9+T8t?cqNGvM(NNT= zP>sTy#F@fc7V;QbontKzYpEypZ{){4s13?n^dhXP&Wd4`;LwM?9*Q?AhOfls6G3km zY`M>RAyeUAUHYJ*@P+Y=wpa zzWq5*@ZAdfL z?TjgVIra7E9tNL}6}qq(JR<5N9mH_7_R z$4g!yRL%%~BUA)d`b$ywP_{R*juLD9BDVuJrXHlNQ^B2umD1ik-z1a5>93s|3ZjX} z+Ttsi3rESS0)iJMz-&vuX{8-VI`Uu5Fz#+B1s3(iW$<^|Fj%@@e8GtRiC@{VS9?ya zNr0RBe#QEmEG-G})%lf#9cu~)%tc(V)wslfEJ^23qL5EA_|G`BghV(a>8^FC)=#aI zlE8n=p(7#16d8KDlrqFR;a(;fnm8(-Z4}l3x{{z5D2|gTS{GaGzv-*%qU>iTH6~G; zbKs_KblLq9X{{g$JNK*SX-8n{T%nn~*Oe5YqK4InjnZ6CbNw&tZ{aIQe7hIK@mME& zS*jgv=@Egf9}lw%Pn)n;brt7XnQe_l~{YkJgcYpE*4 zS@t*D=sd*L8gDe4@Xnd~xSvG4hXVd6*LvFEjdpi7n{i+r)1nT8f$N3gx!k08Lj3bT zpHi+9VNsK(P-o&h9DI#)CR{%Wkb`=K!df&r|51LsL@$8+s$5|a3S(BxZLJegIPG}( ztX0El`7-l5BV2RQoG{mRI2E)lKIZ+M#$GGmC+?V zMuEa}wLpsdngzVE@QWBzZ+yzPN@s~$YqR~U%1MQwh~!@r2RCoIU&SgDvPQVr%o#mG zKAGRY*sCkR3&T;X^CN5YS2e3fPJD>` z6G-bxR=p2O17ZwX3X*TGC^4d*t50!cm1!^N`j?@2=3zYDA<1xT3*Lv+_>Q3R?=jWP-LE|O^8(vr3aAAI zAsxpm4oebkBCSLfe(%AqeW*rG6KvYy$kO52YIho` z-hlQP`|8Z6*R%xKSGAGf5Pk~le!j->$6lGVCBr#76WPfxxZr}e5{g}|af7uf6Danq z5sE!)(osX}>=C8NbcwQKs?d3`!-puP*83GQ-^>A&HkPL;kVN6Uduf)<{H&^Ye7M!M zYHUGDAOyAOScuUaNu8_t#3_7yx1B3@lQG-B50&>WCjtE;pnCLL*|Ar_Qd>yw?Lqu} z#u9Wpys!{Ho7durzhsTW$GMT&>TcuE zIyY^A#@uLub%|+PPj(5An|vJYFgxE^GY-Ly977k3%_bVC>+_@pp{OC9LVd;cgYqMC z^GS9khtOt3``a!bHaopRm%&btzQwYXI)>!MosxsoJx%@1W67g`M4t)oBr>O?Qhzapd}P{THG(yS}4c#M^_p4Y6xm$KZ@Ge z2cWr}$U6HdCCHtwLkEI#;@vbu#Bz%*xL?-{I=leZDWf8h`jzWs5(0x(A*NAsBYiO2 zzTsl2lTIT3MfY*(3cu$THo-38Nx`NI0-d(o!$KV!&-Nuy<9E zv{9N7SOz>M-nHd$D1nEZIG(XO#n^SH?iE>$-euRapVoKscgrY`&uQz<*rGv(m-4`J zDM>FxHmAfnRMvgoE-$xjS&0|8HO0wn3NdrNWf+*OmM%4Towbish76Ged)*yA!l1B1 z1D*`brvBCQA6wJbuN!4)&n*5wqi388q|fyeF1g9U6S z?5JK1B@ge-$|ld))ym>2?7w(kE&&wJ`@&kxP6wyfYO+rN3k8-ro~(J-0$wLHl*8J? zrDyXPZNWvj8#tcxc_V%{?A&hcp#NNf6?-I>*v>j%^OCCaQnHGIXc8+W1bSq5j?$o} z4+ek{));H^cu04IFag+>(Hes~PdJGYcJ6!%>~@4@s7smEk2htRZpuV_D!%ZA1a)&D z*`$GUyK+5yr>Fh}i5N7?=Eb?^Xmn#(1y(!fzmj_APq6Q~4`{l%yyNaQuOiOV(OGt+ z^*ish#^OqD>GxVcP>_(1*u(79b6jhhjxB}fT{lf9LlG4^d;h&IL+IcwpJn=X2dw}I z@Xq(8gk~w-)nGQjuLLn~y!`PuE4)kENt^=nTHhoewb+;@Y->oGA8+)3|I@e2m>8$=>d4^a zB=tXCQU8X}n}SfEnKP*V5Ms79fbU@$aKR{00A_kvf@33H={le|a&y9WXvA6P?khWH zwc^AI*yuU;lISo0GxBdg)jNk#&- zGR1f}k&CQ>&(O$$yJL4|W7Z_pD&(qCHM|&WkZ3yvWs?f^^4j}kY&NNZsyJZd0G)>V zXU-GQyAR&qz@@&hiUYbkwbkd8%$xV_wwX`%f!I#G&;YZPodRH%ny))aHBm2RgExjr zXdSz=SVDD7ZweNw035%w2l>83?&f6@P<@h}yeo+zWSo}|C=^H!|8(sqq$P|fF{Cd; zK41mJKj9LQ!uf~OU4Kp$&ECu216MnAZwvl4d+=e3U+A|&wJ>Xv|5CD9ZXzYtda3KI zKl!aLF?C`X)sVdI=S{6Ivo0TpafZX(-*dbp=O5hW*tI@*>XF-(mrmX*EHV-C<@7J1 zDHrF}oNN@a58YC-4+3N1Y)ORLG-v5ANvlFRnPAv#Y*7dxY7mnXDQ^ItR{4Et1VXZ{5I`&=f@KBO@tu1ZGPtTL9>S^r}etje=e~$ z(E+P};0s&*-ntwI26TDqi1yU*kd+*%V+8`j2yU&Z_52EvSy8FMCB>$WcisCrpX-Gt z2kAHgs<>$o4PZ>MK5Q?s+MTece8oUPl$K)^$-w@?lf??J{l>+6Mt z55+rRDe*THWY_UsK%%-qkeB@RH)H(5Yu(F*9f9B-1kT`fE@D(s1m44?_L&x!`Y^jN z>)&xjn`J!sD9u7p{r^{5(ZIIz>c906LHB=np-kU_Ccm{1FAKZu|D}cC!Nb&dlM_m4 zw|CW{edhu zR0we20Rh5O3blROrI{%*lrx1tGG|?EvKH;wZUF~DF9-f{j}cfdi}3U@ZG*QKLJXCF zq;Zrwzlze2W+W@}+@D0xJ5J>UpG?5K7B)_-N_A$5j*kEkNv){T_q}{fQys3D^p^n{@@SM0mSN& zC;5|M_BMfHHoiSobW!<7of(O&%m8nGIz%>a-X(nKE=rED-gI%=D*P4|UM*bfLsXv1 zSu$R8gpyUb54B_6__ZPhem)r$C`7-|GzKloQ|q$1)a64RwL|6gEGaz7pLtfyTEquT zihK(OFS-u_b1j97AWMz>lb`C(BmQUy|O1?>xb2Pk(L1?%Y089o? zz1BWFNVIwWgNitbe2uN6zkX07W;?9uB%x0$n70-=8|-Fc|7IZP&ewg+A#%# zNH`Fa&@)I9yWoM5^C5Msm&)z6>!`tjaAD&T60CIy=P1CeV zGm$4_T?bVHN1Uzh-+y^-83F#V6D7W6{g`~GEiFlP7}J`cm9~qeR;kLuP0oScP0m4W zveMXq!AMn5YgL`9~+Xp?3g3a=^HQ_!QS(){3%!Aa*2jgT)Gw)0ITB_Q00q84M-$M z#GRS*S*skTz%V?xE~9gS;oghV>c4_K?b<)crpPAXi98LHD&0=$G0|NT?>R}|?zY|# zln|?2xZ>xy59{fbd)L%VNhZSa1zj2iuqCi&BN;*}u_x#(nP8yOiOA^Gyj7vfc4PnQ z0kip%l)PQl=H_Ub;tBqUAm-P*_ z8~Zk(jYHy8VIH@+`23B=Fk@HhigqJUBPA95AtN-NpWq`$h`T^Lu@gh?vh|#u^4v~M zM!nDRR!{Fv#*5H{1(`q&>cXrmrDx{CYS+EXFG??k{t7W{@4|=RBJZ7WxN#!cI*?CN zD7G6AMZ1`H8uC$SuW+iLvnMD9xcjn*J?Ky>y&a?A^|#8^sNZ7n%GXT5yJ>ZATc#fI=Au21t}W2E^&i$lp?qSZPL6N*=ZbUbxh zHOfTlR4VB9E=_N{2sUnU6fE@jrN7Ea=sc+)_A1k*NoHJbW zfjk98r*V(+j1G)?HLv5P^e{*Yp=L4N^0=OB0j{U=CnZJJ*T+$DC_G@ZY9nC3WG+N* z-0sR=aZC=n-n}E}dd5AUF47=R-_tdr(LhcqpeVhu$sOm^szX)HAMuUpogi#n{h?li zVa%J(sZ6}-le14~i=7OMK4i9FQ;|%wG+hi?YOAI#+#kwE9pB=s#P-)sr#+7lffR-I z`;<*h`mz)~q*1wO6-6v|Wlf*M@fx{zYvzo~h4SVFD^IrOC^Fq1^5cIJo+&)lVKGOM z@MceUfjET|YKz$6FhZ8{3>yqIR965`zI9*pi)P{-GnmrL6p$jbfS!$7?C z-k3pN_^M$?KGnAba2$G-NEy-I_X@X;n(SfHqs`cWu#focK~3>}n@-8$x$mdtpU%CT zNN>NbcoFmAUarSpepcG(tiSVNUI79FMq~82okaizpAZ9f_%UHUep`>QvS$Vq2 znc62~q+Y|sIu&27bkjl?sNwk^_$;yu*J>nk9JN)o)Z6Dy4Lq`5rP~8i7fRA(<1JlV zq3-??<|9Y55_7NugNMJ!$cdT1ob|B$QPd=y+s3ELH?v~r+#a+wlu~qOX9enF9vd03 z!>y+dm$s|6zVHvRH=EeGf=vp4&W*1so@S@`^gVXeV1yF;&n@5mOo83w&=jYjXLKwd zsvdV8+7NUCN#~UVGnG#mZH??SEVC_?gWX?6=}GH$PaiIeAwQVknUQg75jX#)DA*-o zM36k0CECQ>Ce8bKXN8I$YL<$MRGk+kU4s6285LhuBGi7ebzd%@l0!BATLgLt|Wl}B2 zGJX6_EJI)qO&TDe)*|eWu`5CoW#eSV!HqzY4x`oMqaN4|nhp+oaYsqw3-X3-5b2WI zpQgIQ&!)c}aWAlje^dGI{-*L@UAuI5DaZ0A=xk~N!%*P|&y zn_b0egT>T3FM(VJ7Tdku^P5D}43c_(j+@l=YbyE+pJes>YvErC9AXA>WQo_iTp5an zy0J;uKa})We>ob9NjtXRQX00AF+=m8CtqIr!&BJdW*a?%9$G@};_V;otsu7M00&!{ z@f_bBr;qQ#Y^X2gKDc1O+5gqb;CczM9SCwBE<1cb$U~LJRnynZCIPpy69_Nc`k`V! z4SK-cukG)0>e-0;07k;*mxX{lu{(_;tOBINs{21Dr@i*|aNY=I1~%7h;=spyC+dZZ z;hJtHFTPXS<(bw#f1EOTO&H-5cq)8d>HQ8h1#v#e1VYeMjiNORR0f7-*2U^p2b+}3 zQzA=|fiH&N7fcTJ1%b?uB5#w>9y2=)}-o zt}$_1_|RCZ!JWwem>)WD?)xEq@exGC7-9=8`=*{#v|ha{a8$#De`-wdgJjS9bLq9B zBt*8bZ)pz5cUbwB*unlv=!lm6WxmJs7U6V65?;WM!HJj!Se6!fpDgj4%bQ_oE?dIj zX|z=EXDgKl=cU`yyaN#!Gj3m{snScgVp6xxi%l-F%2`dbtG-&FO;%iDM8*|+m>N?e zSO%*c>|2`^Co$hrlC+y>GJu;WbA{&Dr!;K@X09!?(v*50YV1|1-e2W+9I6xsD$}5x zwsUP>iK2oRkXmSp&DtsU%ZtwNkEIEG z=80^Vu}4L-_lbkZwyA`7qA42MHW%pIZgE^5-d9|IlAs2=_1!CryKTSMab}0+ZgM}w zSN6sA72fs^ma|2tmv{H(6&>MRn^K}sSHvQ+1quEva&;)_x?>yaghX5)ad>{E`!+w1 z>)UTU9ER8ebb>-H5KFD*@wcafF*E3}8z(7*8Bk0>{N_09fwV|w^qG0b1hukv4&fa^ zcK7q$oZG?FhZp#7G*X@;bvAd(6PSA)o$P9MzcSlVjYnyjW~2u0nXZ;B5-jv>t1X9IE2J}ph&17u$qPV7=!MtMFPBZ`ro9r~=Kd;33$+Ww z5TbSonun(Ew|SbD4Ji&L?a}z)3v7joL!3pTLdT=L_cdia7oJ-0vxn?to@6^~j^5Ec z!<{LtVp5W{z_92Q)_s)=AF%fB?t{;@X(f7nTujS5GQNcz+mn7tDBLNT9KnhZGTiMT z>E(9THK8uP>DO_zd{ITc{#oRctb+4ETsyk<>HE@6I-&P(cD6_}iPp=y^I~z-jN-dj zX~3uRd)ICRwlrYze5lwnBs%ykLLUB%e68u|2N|BB-`v?k94bHQ5nn?sS^dv3YsNx6 z%rKcO)%8J-PoWzPxkaNtPk+3-*VcuwRQVbPlyauBHJax*3@drlM#Zxi{;JfyLia)R zi8Y;UOr4d=irP@kh$dd&6XrwUM+_=Qn^etB%OqlhuWrmJJE$L`_oGg^IBu>}KvMTR zT)C7;R^CawOO=y?o-Fj4+u#}OjZlr(A4mOSq_v>Km_>zh@{*k+$}HLhXw)=_7-`?w z+F$hfHS`X$KXYn-e-ChD6%5?Fx@CLWksx4h1LQBUR4Pp9qK?!Cozv4%=`jEvRDUJ* zxBVL+IBHLxoHNU@tX;RTa?4@zYDc{Gx$Eth0plGY{K_qfC)k$;TaUZ9++EjWMQQPz zlvwSYEH=r`nw!|RanA~W=n0E#7AYDW77KYI_L2|1#3fjW2muKl|ld0$%*&U zA)Vppf9@-uhR%f{JS28!9>nof)D=~eXH4Yb+clAivN{>dm7iPSRW9*9v{&2eP*y_S z->vs+k~5>4evC*z?Qhh;AM}8IX|wc}T;^K{w|(ZJVObJC)Gl$iG_Bx>*Y{A-WN&5a z`a;Xojpk?{41Jz|F!i_vIZUxqO@SnN0Id>*%s8w{)Pyz1%;>>So5Swl7k7+_GA6R1 z5a@=D;8(yG1rYr-n72tR1iwiW*dYQ7QFnkNZ1++KxRk{>9Hh1h%PbylxyQNQ5pRtjF`|Sr8 z&97z>ST!dXS)LDKTy_B0xLaj+HAR>tt4KCTR^QuPMV>ez7b%x?tKVgMw?WQ1NlUWf zy+rc@hPKVrn&hLA6D9IoGSm($^J^PR9Ie}H&`4jq!H`uYm z6W0|7^FQ(47itr;T**aDc6EZ@f4QjlwDlv7*v`s)ncTy%WoJ_TYWrByn)uIy6$(p`kMNto zo;9eGdmo9Z)uXMfP|GaJxE>jLF?bGgYo?(4$g^;HSNA%5 z0g1=}b=K;7`*n+QybTaNL@Xz-yV|bN**ApVNl2TDPBt+>^u)skk&`fE{889L(_L+- z%QtH~Y=m(QiN2wxYbMuV=*gP<%f(w;St605Zz1if;2+-ODZF=WhBz<8FrIU`#S|3p z)cRg;j9mI$9r3=|)a~)~1JaJ#; zVW~ly%&JRlFgnJHy-rbfGKgHXc$XgC@2r`n7~lUD`_M$Q^xUbM$$emtp2IS6s*GjI z$r}xep;WpQZuex8yHSpB3@N*~{4(2rTdn3Ao8w|i*VY)Cz56?&nAL{G=3rEM4@q+L zlNKG2R9-&IX*)_dnfTyc7X0Cr&gZkcxmyHOx=#;2m53bMi;Nl~&j$DUuNlr(SbY4Z zuDZ?!7O&IOmwaV!86Q;$3oJUSuh+WbO1{s*W+wY)1~O=vH`N7lNeX*M}z zXBF1`cvjMa8cTQO0f04{2hebCqnGY3X`4W3`weZo`I`Zaf><@*9OD$4M;9LlVl7iu zP}|L9pwS-*tyu5!atf14A=mObb><{~f?w&O9_IJxC#p{Fla}KpS*~Xy;jxjWU z7iI7rv3A&Af@mh>lFbe|4-5o}A7;6k6vTwrWIH(#^hj%gaS;kW9v5(q6-F^Sh%h7+ zHe@!P=`*Vv#BwD$c!MTBB-n;PH{&aKHImJf<5}e@d$*a1$1YMKk+5XBs!10%9Yws( z8FxvdJgF4)>Q#5|{uJ(4-T`hBL*!m@iw|(l$tul?(~gkd`V#@5bTZY{V^x>G7^hky zLk9`wGSB%2oQ*@${4g3>#77A`oP*l*|+=A0ZeDqt`ywv^3Gg)ze+Dfk9L7s@G z4rBaE_f~sdzfUJT>*+VMN8~{EB;o+tz2mFPIq-+7Nbm-#uohoUo_Uq-bSLQPAZE#LUC4?s(W0yl?ta@X-_ z-@j>=M5Tb;hVT(woa8>c7>r+^6d_;qY5#n`i*kpWe0bn zd~M=8I(DYS=H8Neqld600R6Cq?5wfg7W4i&-^|1TJTw{cJ=1{vfm~$&SEK71qI6~F z^vW;X!Mt4`GU?#!u{ZzU@XD>&FIKOHuWzTPcm;Qx6ePPI40gME%rwO_<93f-er3zd z|7>{0w46XyNU%FgO}<^{fs z2gM=QrmR9-MI61C{Z{)8sN_iTOl}RbdQCAAHMtYzvPOa^Y)_HbL1Os!BBlIRyY;QiRfxeayb0M@lC;HSZ+ z@)3iT_Wjep;gMjF;hSv<8^s^H{R3JMbBvu;1(nm037MYf^IkU|{w4>~dux+zq%Fe`j)siaI9XHK z%*@Q8L^_$OC+~-z`&k(fo9hU!08tw(<_9fjvnkN5t3~jmN>%cv(AzTr5rb<94g9if zu$TfR#5g(vJn49q!h4ipP>p{sd!x(*#HjA~qt*qRJ zvEbsSonD9RD)sGz;oli=b#AhgM0|qXa|hT)ES6m}&+--MmR+eotI1E)-$`D%Luxc^ zXPnA6x@sBgE%152Z^UdDY_Zpsd-PyHRDdkB#dB|)&wg07tSPcH zy9i8BxO-oTr@nSfCebZlfN9S<;nb4;Z>(hI`kVIn{+8e__jp)dEaNhc+K0vnMOxHN za{XdEl=M*;*OBnJ%0y6fi9Ow)&94$40W@Ux(jbvN9L|A<71n>JgIYv#{pjole?d`5 z>Pt@@4p$?gx)tFr3y8Y-UQ5$KePf@S;w*$~gz^Cj29 zGcGb{6XWH^>1|`fw!seSgmgug99D2u0WIW#W%Gl#4zESnjDVb=x%LUk{1EqFjvnWU zP6a8EG+q%96&*E+W(p6k+HlA3q3+GqBKiB_h!?=2{jNrfm-?nsmL((Oy4Jx)HV7zm z55e1}eZ8Md*N9?6;?>&E&86ktH_ybRw$r~W7ti&Tgxgbw75k^rxJa7d%9x;%+im+T z@ApoJCYn?=2zsiMj`-%zQfyAaHxF4z??EXSqS^E zh$5L9?$x?RXcy1?Va3T$lKEzvi^N!Tpqu9_yPW8=vZ{db7DK?I!yRxrP9Asr(0JuR zu18@44)Gcxx@1{{OK^XZ#U6~tshQNBoGf|PXEoJw29@WX^~5W^+Sf7s43%{3t}809wz02IObvJ9 z=vP~Gcp(y9rCXyR$+xIOU~@>4&hwzrz9B63G;JlB@S=ErT(`HWM9=xeT9AWQW88jN zy0}8cM| zg=GaGAC^%d@Q7l@g{x=AxHn4v-zRZKpMB)S9xC6+=)VWRb;%cY_EE zAzSu3P|f~o$pN5T06ElaEWo4~N%okMVN5=rCK?%Qie6Rb-R8i5>F;HdA)LGE8M=LJH9d-Gg%gz8=t+rBa z>s>5o+5DVcE5txTUd>JFK_VBI*s2TCUh{RzhOmTAO0f%LJ0()ftx`dQz*I{iRZUNV z(Z)E5Y{Z`5BFA=5P#H78z{^fT?li=|m?KkxN#GuTF$~$a>7W{*T>uJnPZ(ufS42wtKonvbw)32J0J3aVwr?l3`cC zIWq6Om#&rP$<*~G94kO%@S8piYw8HHF(NT-9~cVR-pwKu7nXg>IqsmVRX)9XEEUueWB#MWOPn%TFX9VmW ztW)d!p+tGA$E7T)u8bU&!j9==)qRBs$v@P92g7zDnT+rJT-?J=6J8qwvXT*yBH!gN zn%D+kres=*>;_&rwO^KZz`Xy;?lhZU)}yW6K_OL$A>j{^%Mw5PB_+?Qb9CU_0d+o* zERUvhgz&^@j^gZZIioOct<4EL3gdRO{5k|NC({Uh^~H&7mY!Rjiq!nv=RdseR4;=L zJD_B?1J;nNoi}U9PYk!ao;_xY@3FqZ*s(MXJLD-`bQ|0YS+`j2{G+YVqlbXOtOvg} z8#^mltxk$|pj*}t7o%WU`9qplNp9UryXT8SG-Y%A)3U0nAQ2}k;#0x6M81L*Wh0Wr z;x_|%<`?C-bAfp(=Gsg14Yz<`_Z#_I2NbC*QWpulIXQImlEi17eys4vzVrgJa-@=)?@PK|uIS`ysl zWBeeG(@4zfituc8TS<^x$sdKKFH^f{6bp~gxhedA9h@sp=DAkju_ipIIG9}A4W4L!#LlDTWStK8rUp~LT#0+QWxkNniEgcMoK zC5-{m9+lW!1X;a6+*6w}UDU)^&)G#*&-Xl?x!wsAt%*_|-MU&Ev2;Ci5oxD@ zt0-Q7to1e+z$VW9^uB)wwHf{C{(1r{N9foQn#R1@<+HLipYTgmA!3vK2lCJ{n%cnqn%yiRrA&xS1vSrN znl4w?rA>PO3b7=E`a(}H6WNc$R=&|YF3_gf#DlL}#P)NG-KVy&l^^F)}o2xaG;~(UQ!*J9g+_9@+THgy9RHS7kJP z%gafe;rIM=k$cLy@^ER-ghk%?%?wro0pHGItfBOwem-pc%0`O}+T9}(v5O49%66xY zqC>@1XOPr(W|>9GX~7c!I&`l~pwTrYy|Gs)iD~gE{Ma8elfSo8h~pEu)=Wj*V%~ux zSGu`+vRpinm!~3jP^_7Ps9s0+-w}TOeLGhQ<%vI5nD!}#0 z0@)8`2i~k^SyD;S`qVOsK3F#WkTX!6x%@a-kohuTDku~u{E=}rmX z>u;6zFGh%WMwGlSsYYs9XC?8h9s(*6O7pC0A+^D`2-eHuNIH)&s@Vs%=gl@GGRAWb zGf3F-z{^ADt#i)+iJ4jn0!LTCJfKT9d|WBB#&>|K z>!C`IKs4P}oW;w&l-&u$8612?pbMJ#d8X?SHGXD^p?kF+aWIQ>g?-O~I4!^bu%gbf z&h%x%R^8&x*&k>#4qiTyOw~K&nVGj(&xCZY8UK3Sw?4ALa&JkvEEcBT7S5VK5S!9_SiXj(R3OFc_qCzrrJ_40Knvw zoU~_;L81<2orDz20Wu^#pn@Y}X`pP9jhm`+y6Ocy`>;Ax$f-{;wOnv8c}!^ky$Oqb zH*2Zm8?iXAVrw$5grso2m1*9&4Vs<2c?oiR`|F=R8I-kq2TThN>&7A{9qr{EE8bRa zwktn)`%C`b9dDtUH}zOcLh^n_VB>8iI@EA){AbD|~^V#||`CJS$K{u(pswGG|HT^KkS-Fc6XS}nid$LJK zIb9)rzFZ6#uQs^(fc{OaE~iJ25tAA*!sA}i3#0s(#rhq<&(Mz;LU6+f5mXismcBnx z(ufEtEl|eEv!sh_8DN^BTpUs(D!v7@=%v@Z*Q*^gGm(~ z8blPp`J3dIJNV&=O6><;c%Oka_|5D8Kxh9h75Fdv>YJ*rK(n@+Iqemy`TL&*byq;_ z6tIr|DUX#{QBHpH0X`zYW`0hFx1#E^J{idzqflCFE4immfg1F7eg8d)?XAw2S@}fo@v{)B&Rw_=vpA34TiOpTpINj5V+(KVncm4k4ybFT6JPt@{on zv(|HhWV1}w-Om2NA%6-?PnLWw08^85!$7-C+7e}6G}e(xsy`8@3E0WjbI>Z-w|Nb_ zgL)gP>pMMwpsg<-G7rKIGTuG%sJU;!KyI*>n7G>FUh_G?8rDQBBeuyH9pFw6@rP~g zZHRv!ySQFHz&Ti0_n9ocnU&YL0sh?h4YyY|AnlCt^gfaq8$iU33rSy@JvPm@II3uO z=Zi2Jw|&8R_M7vCoA9Hy(sAOFib{8`{F#iH3-V4iO4K;Yy;l2+1%ZYufKN`~SjXAg zjkBC*$*F0dA0jH?*Lh;9MR|s2uB{w49Ls^h(Y!Rf#=R#KUH*tW$Dc=YY`_eXX#$GV z8tPH=7LPWqvDT5~v$a|8}wkMLSo#B)&f5yt(xUd@8-?Th^|AVLup;i}vBC zDH|opilXRqvh_JC zx<(wu%jMS_5sn4xopIpU1=-yqU=}Hc)XZB@vKWaqY3V?%ORBX!Izk5u?G#DZhi`_F ze8Q;L+#kq<<72YFA2Ua{#t9T5iO&n6#%@HFScIm_Mb_;xO-xhs52qr@_#En0A#_2W zAZJ>#@gpsE9jR^Ir+X|XVuONQhL;09bDiF&f;jrI#iM;Ie?02vo!XOIlRe__3K;@T z0n^6C{)Wrq*0~&t2bU2rOEvn9pRw@6@od?eTvoA+?P{uDnyeltc6urNWa???v8^86 zTkX&I`Zl=ZwbU7$6O2ytu+v{oiy$#!%)XEcoQ_L5LwOu9*%368u{*)KH;4Oh2NU9x z7cbs5P#77I^;JWOL)^Q2@vD){sGnCK()JFC8<^;%aB1xmE`QL^nJM3|(dM9_ zFS^(B@YURLP1#oXcTHY=SO|xGgD#_0Dp4xsOud@3U{r8MZjbZ_kq# z{nxthQ=8o~lZ1z1Q*trK*!G9sFXkD|3JJVyLp?F0A=YE5ZPIgAO`83&*!!1el7?ga zT1tP;3}UWq#Y1Wnoihz$cew4S8bj?%gbl~p_L9QqfAy28dKV*A2CIs#&753|!I>bO z7+ra?`Ucq=J!d`s^(O zjG+q({oCp?3p2isPIQ43<+6s7kJ+*X;rY6%~Itjz4$f&sGGAb; zd(Pg|T7hqww8M&gmr|czJ%5%8}MCF&%b^RLNDl^Qfrc6U!w@pr4mnis^x4sKB==B266^6<@~CCFng65yUW%>Lq@b8QFp-1{zPs_S!Q-rrf` zDH#gGAjgNh!U5VE$Bxl`(^zXaOk&vf2s_PWc;vlXP`8l?^XIbCFWOs>@P2mM{<1B1 zpC|b26u)%Io4*A3oN^!)(r1xqO>jKJ-Mp=br~{g>v6hUl|7MB5^eSQYh$HjmI4GVkGUHOyl^NSMgQvIb;H{{3oweaU)ldC?WM`P)hVYudN zQ^FQ&dTY2(+@Fb~6(gOmb$H56!dLTnh1G0+luc@wuN^?`cJg9DTMfAv`~M=s2R*S= zr)rPCe$P?VWON?*Gq0&tkGK0$i2Bs(UO$P3_M~RJ9Vh)8Qd>z}S*Q6uXU~tm+k7QP znp#^X7XX9(F@B->uf;w?>K)(tj{dUwbyp7*DIH9#WSl1~%*!=&l0U+X^TowMTW*rF zdA^HAE}~I#kCceT2@-vJ0Q0$IYH2F?e(=BB_QQreNYE~@^0~=6qRvrP>A(w*XQ+yB z5V1q=ZF>@ZPPz17u{^XF-|w8hu6Xv02T)s5U46J$JADu3XG>B)y&~t!cmZpXoUz>J z3g(?Qq1}~BoHJB$TFxre4n~zCQBlPMto1I~=+^7>!*XRKQyUChZ{F5n(u5D?vP9h% zi5OqH)^06Fre_|xAyH54Dj*2hpaHTz=mUIR{Zi}7fBrl@G(KHM2lvU50-tRp;Xi@^ z6d#UynYESuUyB5yZJ2{RQQ1<50+bHRPm`;VQJ?0*Q2$90fTeQD+ZdJGOaDhOr4aaU zg@EPM+SFLhQ`@cYQ!bi3UpARxGj(J#(BC-g#0Q{yXUhG6|NliFQ_4**`Zb}#$hC{T z%|KO~MH9qSsP7x-&H3_OL=Z00q>s6qF9l{_yoBV;riDz;QZn~BjZ2PXkiPM5e!A8G z$Ls$#U++bhY2~dqFb{VgD-npB|NQgegL$_%LsOm*9qHaNPS-O?cBzicU~&ifSjN zR832KyDQ{DbeD}{@l_u$_U9j?2q)v;JSAt0-Hj8C0z6YfY~2xW%IT=ct-CM35^#^JnhRv7$8TU4@plzY0TmF7M%UTCb{W!(p6|_ znpdC;2*&_EewHo#)TiM3)Z6ymAGS>hjFu~z=6X;8Y0Kpywcx{~w@Igzz0>FC-+?5|Yhd0^WXPJAKtpYFCXsN(bl)2@w z`>ZKu@0pX=jp}jjLPdsmE~1x@0B3G+r3FJH*fPK^23CV~79abg`>_v|Z&X7-vG=FT zJU%=0`IKIG3)8%PImH~7^E|2%@ok2t><#Vli z*NElUKCf#E;G7IzjUcyw^a|XgaHb-HnfE;LmTTXiAD$PaP35O8Zb{7zv7r`vv8Ec~ zsr}_OAw#9>P7aNb68S=2+xV>cS$CTV_q}XSp>d}tSAJ3g1SN_D6)Yw>@D|AYPBLY= z(uSJBmlE(2WzkOQbZy~!pmEAnt`Z<<2+g(D4}pc#l$;oHG>z;2ndKKvRO@QKwtx0n z^zM668xM?DG#p%Q{#Ob*7HgP>Gu+=m|58QHXx^wIRc1HQRR!)VBt956oCP*Yt@Lf5 z(9r$TU!`M3_lMcyur5oRQRIiQdWJC=4K@+GO}E!;m&h~w*mifyA1|(szs2a~Z(mtk zNa{X2NM4M;R@?6e)ODqoVF!ueYY~xlw8YzeP#TNr6l>@##wgQ&UND{0_mp74_^lcRI)Ep}t)epN{|& zgO87XHhMhL~Easg7l@#`;+vL;3Oo8_vpj+h?H@z8QAV;;1*; za*aXSC))9kek(I8o5@|~?dmBQ+WAp3iIHiPN&>`ty|ri{U^s%zZ)9Z0@R_rJOxvXq zqUc_3-Jqmyo(%TX>Mzy}yfj1DmwTHaD|Bvv=3?na$YxZE5}_%KtY0~j_Ypl|m&TJq zEcet@^UJCbUx(@Gwy=DxF4)@w<_)ra* z-%d7}1=b^44U_IO!wYsxNH7`P(y7~vH=jm}xUpXeiF8BQALu`F*KYcFib#z+{(&wmenM~UqYKDC z=?R4w-|c4FuiWS`lF|QDhhe+>xPDONd-He^2VW%=aSO{$%XP`S(I23muNioUh2yUy zKKCCwX-%yhb>)S`YgoB#i-|3nEOJVIPYJf7uBHy0n{2 zZGNwN#qQ?8Rv^g?*Dh6HFfBLF+3x_{F)v99`}OaBIru^Afp#$2$yz+8a{|kqNBm7d zd!qYMED>HG(J zs0i`U{o|$=Fx9C4f@*afl`{JirpW4BkM?H(-4NJojS}Q>Y>8CM`6w;MeSh8Oll+iy zryFM_t^jkrJ(6DM0@+Hod{+r-k9>dDXolhT0^k}#{v1+ZIN`fc& za*J*BPJ(Vr@7cP8l(0^mOeC{|d*3hmmqx-rz=H1BIM=(TXPGUEFpB+2`Otc~E^{fr z5^H^-mzvHAuiZbJGY44{id~;-@|@1?XgJ^|ZJwWG=P&KK*gDdsdZcZ+k1$s1-R%`1 z4p?x_bH=XU*;_%Bde+X=pY675G+lz$jkBVS)w@%#F7~?H`EH)Wx__{IXcR0Vd9!oe?PG+dGWUP0I|`1LqD1^QE+~ik_^dXPljwVP zHHRaQmU+%Hj_(PdpQbN|l}*%Rpa8O05ZQalmC}nhArqoe#x6}y{Nt@~!ji2OIEI)h z>p~%1v6B(+mvQ~)zt~YE;1R;0#*Jj@u*MTy&>&SkZ)RDLDc{T&VG5hqe8rW6imL57FYh3r}kVpk^rn{_L}h)dU> zD{^ME5d{qc)u7ie*pSw!oQU>yKw-P%&!wotQuAoLDO7QK{ahYsP~ET_d~});%Mmo0 z_lY@;VS<=$gypf9+K^@~tnV9&<{dD0A8bb~TRJ2~U-(>03~2USODJ!A+9R!sng>_naeO0hTSM}`}UmD%X6I?Ax39Yorwymv-#@~GGf@W;DhggzSmZ@MaM~} zGX*&(M6qI`RV!MP9O5+wj^&Y{a8f3m7)_LN4p-k|D+1>`PJO!3s5D!JMDBExZHuzG*_@%0rSb>#0!)53M@c8oMjSSU|a8t zZ544wP)%5Gcqzzn6F4?}*Yk#~JsbBFNf7V|Pnoh_N{YX9En5Lb1t`aL%;vMWfq39U z1A1E!$jKg! zFrn*%-*-e?rg^{bEm>abi#!jPpo^nhQ5WH8{aGjYO7PIZQ8)r6C+@-otUn`67xzVU zgMYoHpR%LK8aMl9?-o3cw*r!Cc-Q5XH`C19R$76QCUau^Ge7JDavaoa1h4}AKh6{b zfS989wjVBgUr)#JUHoH@PZezX9R@uyVPI2~E9hNqcL8Rt`q>s`x38`3Wa_8+b76Vl z9Xvj)`wv@?apm_Zk$*F;m7sPkgI=r$^f;>LQ?QqW>{4AO1Du>+(>>kad9kdFr6-sR zk>u`7nx<3mi4fF`HjozC7pvW%%EzeDt3l*HbT7Naf9hU3rG(o1+Rt`W?w4KQ8eOpVN*aX|c=&%HZkeJeNizOa2~T=SK!vo|LOs_cIo-Y} zPH1|Qt$99Hm;mX>W@hE;=!qD4RzQg59Mi&N)K-o}FMZY=Nf`Eox_MZRwSEojE}1#p ztE{wLN#x7Fu{ka7`Oqc%=wl{^SR5UK0roj-$Vz}^PCZ+Qp*k+V?^!iI>w40~e6A@( z-X$7Q_XR{dh%691&wShLJ!tF_GxKb2P|I7#X64q28!#Iv>M&O_!^{BP^0#VQnS{9O zDf_v=CI`RLE5^m9v-^@F>782#v7W#h+*6AN<$G!%>^Kuw>v`8(QSJkte7i25iWJK=drN@4%8^NvKCj?=IR2~=Yw zrgG7s8&;@T|8T`5F(GXXJqqFcRmMMbL#%y2upqF>-@m0S&?ouG3Lrd?qa<2q(Tx{Gil z!ooinYt1XPzo_mjfq5!94GzZ*m^5o1ixhV*bo(Y$-a5x4c%c@t)l({UYibv{;Se6mVDSzvdG5aaiY?0T2nbYgH z+{z&~%? zMr2&mmyj&Y-tDPUS)EHmz=+=6r*$=cR>dEEVa7mIHhb;~Q~zC#P1u(nM9=(XG>mvp zS)etJESD%slMrr(FO)=w!EB5xLX~x1_)FkK``nvbq5*6ilkfP=)->k%Gp2wN54hq z?h?W&d8Zf734AY^x4QbMRZYm|YJc(^$Q3RS{x*h~QpF^GReH;h1kUoMt1oXk3TJ%G z-4NQ7?rd?|o$IdLzIH=;RGm|@K)~zcFM8qTTJI8P5t;>7D&Q}U*hut`VC~yuRlIdI zN-&$)mAcrnMYk;vJdJ()!WXx4E%YTW?ob$v4GQ+mt$-N!fcX|4HzRqf&iURGo!J(D zfL_AXiB3PbgjZR&li|I&-%n~!p`qK=j7CLZ{{3;ASmS9@M+5%v3VY*YE{#itbS>w6)6=f64Qk1RT2bqZ(MZgJ!?F^2!U813$^%i8l+ zo#cBea%)NdmQVcJN{eUAU+xQCMO3yuec0G9cE89X=Awdz751!n3Ym2SOG3rjH{GGu zwR6+IV%vPK+&kKI;1*uvLhF!$#Z&thtv@LISC-NmJanV52 zJguCGCTd&>S^Gs}kRw_>Xr;MOdtMGpMThSlx{I24czCTrCZrOI&Tmf_1}r1BaFfoP zWe_#6Ivef~P(SMPI}fCwY0PJ~r&kGhGFTgPv9;i7bY*}(&iCEmY72;88C~SQ@b^La zjK7Ih4(b_P88yelQ<%l7;=4NUqcm@oM7X|_ybG_o^eU|GJ&K4u!{P=KQga;px5BpW zjo)ED1)_2WF(Z=^e6vG?Svnnyw)*bLFJA$1)j+ImQIPMpVuGInVHRNf!j5Ul;LMf+ z*1E4O8B71z%4;9Fv*gswM~dL#pSyUxw5 zx7glQ6t!)rr)nM?LgqpMgRQu?$r(!zjnK~N#{mL**CaPg>#p6OG#$lb-QqSs69j-(mT`Gk5=+eBD0`3E;wNsvVW<ZeF4d}csKm=H{dNc zHdevwx6gEwtz@F#pj_f^qiLZWrUP65w2_0;?XnPuPTpzMHb%hzxa40Gb;S=lO^ljJ z_bu+4`dLP^hs&0gi)w#EWMS1-qGS|rU&Zoix>`4qMG-=+`(EsQ{$Pu#Z}Y_6poHv8 z4INx*xq6(B?*`MZUdx-EtE*C%Ap}x_yZc zi*7>oKaC4xYAiweKhTnpPPFi0J4FVHeX5Tu&nLcm0^u0DwGHby90{w(2ooTgSqMq( zL_VoI-{6KfvpP1_2tA$;MI&VVeO;HX1_{Zu*)w=JM03y8~QV(Gi-%G<;StW)aQ=*X!TMk%~1)P6R{k_p_ZLzD{JY0M?t4vw#P$LDhA~ zw-3_b&2jG%(69h`0*H;=pg3wQ8(tSMlVlaYE~7QVz*3c^4VWEp6{Y z`WckDB6jjTc>X94@KylCwJ4i+GQc4?^+amYyqPVPL5sH}Wtf$j{H>@&PT;Ak<*|0j z(@dURsB!xpSN3(3mAiWdW#wj1uwo#@sol9oP88@CX|)IHD(#6{haI>MvlSZX71W*{ ze=c7J#L3;#dX#q?^b%MriZ$A1aN=o0s#q$dG6C~-cG=B5t(lN-{UQg(urgKyT=Tes z9hF%wh>6=FsI5~}YQg=Rjv!=6d*i9W5K+3?6rrq(I=5w7^%%2&P2lWioK%XU>aJ_G z2^Y$R!6^DH#2gGUHf{U;m_b_)b?L%0TGnbnyP}(ZA>as`j=vFM4{mUS_=C$to0> zjJMXMJJ#Q^eI}*4 zbz|8krGMUo0 z4#eJwQ`+5)E_ho^IQc@3kp}-I)w=*?D)h9R)dWcZ$l`fcuC3NE^D8^=W^0n?$L?@@ z1ax<+qk3s96aE#cLXvY~f&hA^#x zEp!qL#AcFoQW()YKe;=ju9yy#U{F--fCvsfI2=B zH9>64F7w|;lXcce(}l8J2Gyp*x%D(W_$_^@q%S)_Y>;)6w^-cb?rL3lPo~5*1(c-% zxW4}aJUAi{_lkNrO!MT@rH$VRxU^fxzP>=fd{hNmzvNFw`10m_?8zisgC_uzJE$Vv zrnc>s#OoxddU8C})i7LHxuq+*@w;O;X@>lVyHutKW*ap4C09jH0Py*Nc?dhekZ~)3 z*mNEmeYejc9z?IND4o-SqMy7+Sw2vPxdkf^K6`k&>xV5I;#|w~j3{GD8gK!9q`=W% zdiY@I>2E`J0m_h_#X>!~SV=+Dx_a?k26Vt*bL;KA#<^NG8=54l;f(8!^cGF%bCcqF zVu=@~{<=<-6Woj42989GJD!EtNv1ML49+|w*_bLHh|RIo*n6$DL*|tdI;WQ0?g8h= zu<&Aj%EP(1knMvKS3TLM!I?UuH2{`@=x~sybuA-CF8kkk45)k~PxoK>#_d^Zh`4rk zWYSvu=cw^bYlI1x(#-*uw#c=IKL#Jl`RmYJ%I^wyqh95A#~o%8%&zi!h|Z^P^qR?b zH}Li!pPIZD<&$R2R?MyH+NP*rfQ_-_Du=f;wzZMPY=b996l=(%Tlj>MiQb% z^Vjg^OKlI>#*ZyA+$azx0@NpV*q=N(7Zf+0v?EbRra>F4%`o?ay-@-B${_1f9D6Dv zff`;?;Z|{z`+aX9HhupRiTsI&ibS$71?QlgAR-mLFzLLH&{3WH9hd=RDb3{fsxdqZ zJHZ;@zIViJS_(X-6P{j4n;Ef`*KHPv1$$)jdFIe8HJ!Fr z%b1?669A!;cjtrn1clL4DmZBK7E=$D*t%lnSpEu6`nqRpGEc8|FJqkX+NZIUoEZik z$O5y6w_cs)WG*QlwFV~Pu$)#F@fyt3}9x#-6OW&WR=+0%b}H-`(O3Y$FP@^uyO^?0^t50 za^s0faN}={CROT{LdL53PC>^@z`k{HM0&~`%oJV5=n!qND8Irqpx_$?+AY#^8OKc< zBa4Y>9)d){mP@A9N*T9SX8fs^wEy6chHE}mMv}c!22Z^ev~>bV<~5@{Do)Q z|JTrfLC_tFD9GcspVgdi0&tj-5zp+(KKi|^h7Cw7uidu>DuShFJA7Ru*ITev8?mj( z@Fw~>fgU!JX6(eNW;J-(Pv9C&QAYc@5|fjY9FIy$^o+goq{<)CQv~(3-of!iY2(bT z<};47xT~9OXqgh8Z_;!~uWo+L^i7~|0#JRO-!f^uu%QfUUBRi_p)Sltp=J@_eF9#J zRCj9=%z(2Sa>g{>e~#b4v*w4&SK4TmTqEbVWqdLgqtzHkwo~#N^@Lu2YeNPoQzXWm z!@kU8w&VPLivHWE@;@Y3!1)1Bj0n2_<#86_04D~13GhWIozHGBM0R7A=b(h38Fp#= z1diEW4ZBv0ry$^UT!eiZsSs!%(0=`nW z2e?K%mLg)2Ur>?+pqW3B%)jJa0j!N+lIrXqsegS()?ISr^xhNX%-#+uCJy-#I2(A2 z0$&^wr0ow|rCUP8`26Z!9xB1V%}w6~1O?lxM_ld(>1b-?4)(qYA%A-HON$4m!?Y%w zrdtJWlmoztCUk*cW0&qAid4G+;9K_$HP4+RCR*HkAV2RL(V?VxV8@5ura*5Q(bJ{& z``6kK|DkwsH2jBK8eI{r&GC>$@9L-fs@VAL*#Q)+p|b{P0id1}D50FefKq%a;BVYH zr|$eqMy*Z#{CvX2rs2=M>8~j(>3gwwdTsmJRlF9sKVvru8eM+h*6{afswnUWARPS9 z*<$~P3x)q3s_f6hd7uHqk;n@kF>>>a5|;cA<`^=T`kFTf2&0F8l-P zO$~B$x#X~be|Xf~p6h5~0^|28v|KPgH!G@4Ot4Pu#DqbKbWW(m-(1Beg8ni1E=RC# z$tJQoK|qeX5&c#McJB#@IS;~dL-&x|`{BTcYmM^3cCqp7H2u&GepR0e=Wku#2Tj%= z;w|#6rX4l%chA;k=nlT~itP{Aea(PoE1^NNNndE}Gy<|ut=N8GctRuL)$)99z+O=w zu>HBGzdzu7V~)bZY0U`k^L2jasKC8*vF=J;5fUC)a(Xg+s6jH+PXO3|OupbUo3D`i zXV}#VhGa`%yF+c~=7r-1;s9TekGBDa9}OPu1j3HjCz^NWS6ibh;q7W|df9r-#xXCM z^A@?Z*V2^SUySwxDf1XMQ$_*!W|%nj&s}?}j)XHpcJ5=t2-K+T`3 z?_qX|aDBWZ;~p}f&g-i_QOh6~Uy+}AoZHC!XyyLwQGmTfd$2b9dOX9tu5={Wi`DtQ zIYH$^n}hW0z}=k_8`jQtqaHr%Hpgd{_gMPrgT^9qu(SBM-TN?hKv`fA^}#i%KI!@8 zs0=IXiCq!lOMs;LCEm;RAs0l=q}ZJ5_Hd#hC&Pd$5HH81)b~2PwWJnSV|5J}uDEf# znx_Ga>Dxn9RKpbk6V`_@E>hCrjAa*(q1UUsdJc=+_8Q~I=d#aVqnMh_K3gdt zpi0%Sbk|#5Zl}Ly?}mV}7lkny50}5d&qWi@!Z~Z$!dbJ9;j~sZH=nEL(QL7i zvl+`q=Q>D*E4#(S)Yp7x@giD2P49Rx!HfpPDZ+q!xc6Ch)Gh_V`nifFbp`Xz;;^mQ zzMBRRs}MahHj`*R=n>1d&~hrL0$_lK8H@>fV$N)-`cNNO9_?EvvB7hC-)fsh8JVLr zDLd7i)x*~lH5$h6Fv^K7$Ijn~0NO%DT_@~Izeb55mY^55(<$eqwU_m*jaIa4FXU-w ziS#(Mim4OXEucr%rMK@Kzl88N-Yb-Db;nxl#dda=uxSS=O1?m4E#?rAK`lsGXU#4U zwg><~LtWQE{nAwhkeh>2%(Flo^b4DV77f@a>v(dqJBH;oU{0tIX-s-`-?e?PGe&He zy`aZwTU$208!zcG08jzy|o_v0jI%FK%4=TSw39o)=!5=e_G)-#B2LY zT_*5rac>3tv*6ih`AVZZw(EGR1R)c}nttW8+TK0xC&4OE>kAKr`eZo-!+k2Ym|AYH z!G-+5J$|LU1d(&j73F*uGr>ujl9iZ$e=Of34o?;lJIs)#kiP#IN5#9I%zLvAY&O9> zS&NSR*dAG;y|(g$W;8K3}A-IX@LBcvo3l~@Pi zsEV!`3NP^J`JI1_{}nt*yZSvy5^^#e-U>RqP!eLb2!5vNZK=Rby?*kMakwW4Qpl8|UBsz< zdVlUsrE&qUmkY+OA7!+A4yn6(IBu*Rl*tH(7y^R0NyL$D>@Jl_$6RMbpyRT*1dR>N8eSF7WCmLMVKyuf?Gae4kaezNt z2eE$T3uv2Dsvj*mYJw9P9=Nx%>7KPEeK{09(eyZTFI6(cin@CF`>cuDG%B6dC$J%O zob!ybz7t+&2Xc~=1tpy1n0O|!B-{x0#1H_`j#_WR321op-$g%kU~gqJfg4hobD5xx zOXgvQDs~03>)dtosC-I?8OK^eH@qgMEbv?71vJ;w5zl-=>jst}G=>x+#ckOSoKZ2W|DY_{@xV`FgP^(pD$fs?~ z(HD>`r1Ph~ie)<=dv+1S8J^U3&#V*u^{9mV^C!GUGNt)iOL$I8HJnXda^p04iw71| z`!)=nTcLUY8D=3xK_%SWKJp} zERehaQ|YKv)yrz*y9N=rwdWjni3D3VTKqH~?+dQ+DFkX)Mg%W96~vjI(>k%;229nn z{>I-U?`S6`1fF76FfxTroZ^f}oj#z)8tR%Tg}X-yLHfD1pu#uKjuv`Limg2i81l34 z+Ox}KYiDV7(Db&iE}$K)2hfFIJ6~~r_U(SsTw0f8^jRY7;V=-c5}o#|8=7H#UOLXJ zNHz}r^=K@!YZh}H{Ojmf15CvK*3iY1c+({4g&(42SGMl_HQ-FXnPvlp5Nl7r$Z`1` zxTo0`y3DCe_XM9a-I$Iiq`l56^+7nZ|Ioa2{5pfS@cV$MvNP?(xuqWdU@S6RDl--%9*b4^kk*~=nr-^L(i82vDv()Qu@mJ$wC7S??s*7PzGS$vw+@MSTNXG=yB4zlPJ?w^jV%dV@Pn?zG{3#G zx!Y?p4okJA<>~#k8zno?3pb%UB~>q-6G_;mGxf-ViYp-{N&#DK^}Yk$`{YyRJ*toT z^NOV203*n1Zy_UdPj#q}rW+lxu<62{{q5Q{`4}m&m&*SIfV#b}w@SMt+-Rf{oyPTH z|F9b>6Q=iL9fJlroozqqioDb1_f+lOP+F3!1F#wo%Nw=dC#)8;U!k-oI)?@m@!Y2$#z4E%z z`e-wX)bcvG#@U98%s8kQuY)MSWpb+j?y!A&5x~X&Rh@CJ zx)*~}jm7(!O%~PIc*rfYuewo|GD(*}t5A6Ce@c2c6g-ptIs(57^uidz7S;r!VMv>-$*UU?qEWh8(CIA+5@#ZecZ8AT(kN`RYArC1KvWm{78sl(`k*W$gMP&1jxieM4(%Lpzpn#y7Av zKdMX@CaA+k7zQu4B@Q0ia1}^Qh-;H_EgFd$)dKLj!z0(HN#{@6X%KZ#Qyg6-Z}~;% z_mATBHm7OQT1~E|(L0NQESB7fXh^I^x2e}N`agCC`F zmsrof?B;pq_oKB$U<)ryx}%cJ#BMse(c|=P#$wnj5`XG`;FI%TB-@lriXB^m;*~Sm zk8h=AVQ^;qIXkmJL}B2m+w;n5O7uW%Ho3&F90cLMRV9DdhuT@AGv(4gA zfV9T~9+Ulx&1poLw|zYhP+BStCXGA-6Bh>;!+torRM#twE##kjIXvaRz2mL-7O%SL z7Toc+Dxxw(gs$K)EqB+56C35&Ad+uWqFtj2VpH0mEqeb=NKh|qe@!sL@vS-9PRYp3 z%b?TRmJqP(lz5x*MtigvGo!--j%9O_r9{3X=jt~-s=V2c#2RTl7!MuTlH9VWXet(u zak{Vr``smD$?MC1 zJhA*5kzf2lOZ27tb3b4*AWX{&2mE%{a?Xkun=}4n0MuL?HR7b7W0ql6-(}u+7Bhy| zY?OtNE|m$FOUNQ1lLb50zH!!TDX>#S{*ugC_L3+G;l$ucRz!Z^oLh;oH=Wz)`D7*& z8$^e)(diV!&uxSdyITsN%fatRBc2^IsacnPvM#G;MpM{{u&a_&M8**}b3AJ)Y@8*t0U^2ywP2+S~oq~2{QV4hz4t|HRIH^62~ZkK>r zHfWi&8jnZwu8}Ku;9QYyE6Vk81xS``$dFjShcY>9aj!#u7athz;_0=#!jp7yDxGH| zEliwWe-;z6`=zFG_;-(jIn*pov3c9+*3WN3h2Hlisu(A0^6()tQZ17V?ALTmQbXb`CqEwnyA}JU2q=!GRBql4YH=A(2vc1o7}6a43Nf;8Fl`yW}xax zG;jyq%pQ=|=;@M*g$3pyvT6Kfpo>}&XGs3&5G#aU`}#?UOi-@&J$Z`Rg0Q*4nNdNm z?rY1XH!@oZLJ%AlPqY(rjPGn8*PcPH*L~lYi1evWXrhU=RjC-uMgoGWOTB~jQCh7U8C;}@!t$vD`>K*nXz*fkzr;h~LO~Sk zvh_jx&JWX0ZMG?kEw$O)L2geiIqKK0Jm5d|CmCQ%5|Kb#h26Peh!CWTeS%H7!}OQ43Qewr>JT^2?8{Mi~}QCVyeFr;@w-(oAS5 z4+<*E%bz?@ZaJ1VGBLr()&XHT+#Xw}Sw1<^bbEd&08+AH>_@kE4pk!)%>?RrG=J{s zVq*xtQ6cS~Uo1NB$5-f?gpue!?|orsJ2v|jAeCMgK2w$ijGoh1wVk>QYmd?5}_ed=wcCDGwAR81;UB3X>cSh8&)%FrD{vohjP#a zRZBrPvs@Vc0BeiosyN0{=5xVIHQVelaZfuk;|Ac*`&Fg>!oEBHmCqkHcX0jhANqHw z;ib~rl*w-&VWrI_q;gYP;vMPsIzs`Wy)SbR4H`32gW&2??I^$7Q&SI0yC048i0O1a zzU`nX^R|<(*#9SUY6rVQ4&n1pG8)}9;)62{K{2BZ?NRw0Y%28(_f|lxrqV`Yf2k>5 zkmp0Wb3jYOqYxi%DFmbTBDY5Gu5t|EZoZOo>f`Y`vLK98AU^1{PK@ge?nvtkWQ4an z4duOx(@v3xpJBm=keMg!6cx65%+<>lQt|6;%`#eiQLgx7PVAN9ej@z`mHF@D(6ltG zlMjsB{bRh}71cET0oviE5PBqFh>)CrUu%3$Lc*)?20YFWisCf4z zahIRQ$?eoy)`<nWYBNv+JMoEGZVY=1A}0nH^R zWoa;McXI*kn_~5VXkeTuZ>TXvT`xXt;LOkf0W*v4^v#kZ0x*Neo>FfsaJ$%Py|7?#+EO+lt!Q~VO944&EcIGu^ZydM@g4?f4M9c6`iqWb2nUjsHcXIqiDC9sb?TnJTb8+gkJ)_6 z4=^GU%^QbFm1WAuRgPeLgk-5^TNXqwq zTburM1@6Xn{R$21v#eN@<2DJi1(Zt^Sf1xjrjp%SQ@`DX`jdXWJ_)xXL-vi(9JLcE z%Zopmll9VWke?qoL^Q)u*}mD&$nGuFWT^kV^mt0~o#y%F460dxLMuyJBR#Gs;2vFr z2xhlm+&s#hiFm{0@g;SR!^8*Q(C{V< zIU-SATizFrrS6Wccw{CD%Hr6)0d)aAlzF}Zbuh!)G>-|4Xg_k>$`3)}Q$WfWi21^| zjz0V=qgit0@IoN4@~d8|@-F#9uTOfXZJ7Wb2J~(Bk__{9=WC?Iv#0!bb|9TkzO;VA zd@{JVJ9vjhFx~G&4ODb-?VJ*J$=T_PMtGh6@Y$S;*n|XE&L9K^=2ZZ5aJdYCR&I{G zCv>tHvQ=3q&}EMVk&R`#SY@!eNFhE)od$REEd0cnUkl@#cyft= zv*-=iityDvR{r7I!AJ>f5{vzIML=%)b@XB@j!tzjJM z^zG<15?FB`(O}z zI69M&Gb7cAZh`kz{0=Ln%X%=O`Yox7=M2CT;`ekPrIeONeM)nQ*t?y+a4wS&mEr5I z^wXn)h3&_WCEY&wr(0mrO$zZ$U}2=m>|?(FJ;9=6A5~3eRJp{1M@%~i`DoX7PHCo5 zUC+8^j}k^Ze@c@|lusEF#H5|anhP$bjLZ}S2HrQ4pwEx0VSlB*-?b2Wp&CTT`1@Vm zL`um^iT00vi9|PdGRXPJ%p5eAknlf1m3JeD?=vGwnjPxufmOfjZTPQGm=XzS%-Rcw zfA;zc#m_7T3qtw*DLukJ*f)$fTdAL)0X|*Up|=d~Hz#^vchg`#aFbf_m(xqyv#}0$ z<|QUWY-=@}@4|$8wPyE0ZCk5`aJ#odX4`Q@sY3eY2DcWCO*!OhRp?LM?BCt~dlj7Z z-~4(0zun{pHBfR#i8atY6?=kA2;~jixK-J5)`s$BitQ=ldrC5q{yhEW#`+nVt|Az) z(Jo!aXc$wn219@R75*uzg{9K2BpLdq&hhiB_hkIYn)8>x-gd>Ko^GQ>ev!w&CS{~k zlL_tY&%po)SyzeKf=5_(MQX6^4-LWvUa@8JZNgA_(q`UHo!c8dVBs#)9)Z{gduo&J z<%P=~Sd89OF#!6Cd{;r%6cm$c+}~gG7@BOw1SNH=zBJNyd}{wTR7XTQA}U`juz9mU z&Tgxi7sbJ74LlXW+qtio6}2Ar&Eea}CV|#=3iEF@v{VU8?Aqco6((Rq$HYy#jopfO zr8a4r7ct_+5lsH}Q|fi%P7A~XJslp7RMuZf6v+8mapHzS&1{WXechT+@ZGf4nYAiX z+1$^AKniD*=XW%43Jr~)JXPz-_-K=jK+t=vtOPRs%`(GoyN9y#E|d?*2&-iB4TS)V z*bRd`(#I)s0>_Q=MU{(5ureRojoF_!t7QnToU}X4*^8~kQ;1I)rj{-xk3)%Q{03{8 zVdlVn<#4JyvnP58U>yQbAgy8M?){vj187L|eDYc8aAD&*aZfN67?SD*K9mff%TpfO zjBw*+{@T~A_i3ql+(7pmqTXv4mt>{BImmxKDL}Eje9i6O)>OjjZ22`47L&#GZRYQnM`b^;q>&)WL#=|&%z;%<)Sf^DL`nwnJdfR8CrK84 zSH4qY^{fjxIXdsS@kb3P_#tf|H?KMif&}V3W`&QZD&4+>@0f;IC+$zWX6b43=F<@lZM4t7x^y((!JRJ;I^TSuJ0?JnuLd(%4qS$G3OCPEAvKw_bzM>$-drrl={_ z<(M{stII@Qy7LC$85^SxT~WX&xcIUdb$y7qEaM{US*BC?4FDh(ybD^xHxD{YTW=qd zzCBxI={V^3GR;}CTeA=de60@{6ELp%v**$c^-!}|pPX9Gj|Xe(EL0A<(_{HKEu@O* zsXS+D_R4Z^IN7{*6^f$7I@CJ~X~{I9T*QjA^#{5XR{pWxIGNU)^W0Rku+)xh85>R& zI^is>Vh$3D8+s9Dz-hAjER1#FC)uNbvyZ*j1fH#JG6>c@fgIx`DjbUML|IqXdN{`F4HZjpC2O? zoxn};92-;$x0(=H0w5g2L1kShmU*q|SKP5xs~{A2EM|hkHe>%`U)dVrDpp{lfe5S% zf4~%2sl;$|`FaWpMveJbiub4s4}f4R4^-G;b-Z1OT5vw_=Cs~Vp}Pl1s$WDm z`xkB`=G8fx_2avX&lmLDEf>*xbDOuURtm736VS$f$(HHmM6eVR&;cgaepUJ5@%}OI zyN8ozs7*G$0WvW=$)#el)-_zytpSegrlB~nl^I`GoEl1!q1X1%60#mSU%UL{7c}eV_fziD4x4=Izt~~HPf)yI zFC)*i6q|W805ze{@ayy*9hy>@HE?1Fr_>ESgr7|K-&#Nbn1`h70MeEv?1PRA=F-uP zcG22rpE8Fo014_;LcZ92+W=QQV)4D);GD@+-Od$4%@)J1fTEn^*Up;ug7fpN;XYIV zZhaH+it%Oo4suYUxK_+&SKdr-2SEBL`*6czH>d8AKT?LGqG^-SjtL48V?|LX$Ouw= zQQTy0>E~rugZz5<(s1_r8%h>qo_FpNP-~D)pC0wViJHKOLYm(jg3p9Lq8N?ESE)6( z~P#^TMggp&N-*w6^c`5@Xxr?}V>E6ZY?d9Lr z5j5Dhh@z_Ufa0dH?jpT$>_>gTs`yPV}ENezZ0##N z+5MqictbXrM4Rqx7bg0I-Oq3K(!7>nK$&}2qrAqdpJ3*XBU_iD&mpIjf?gV z{O6c}T`!e-EG!&j)_=xhVs0i3thnD;T&(`DR$)-u?$uE}tps3rj;e{;oSYn;)6ZCQ zMMF;B;o3q*Tssoc#OJ@t-lBZf4X{TR-em_;`nLy*##pzc6v#A2@L9V!OnLu&$RQ`* z!8L-aP01O0)BGUAHjU=_6Hp-Md*osk>+G;#Q~I=7$$58W)HmUB=wZ*k;HhxJH=xgpP%5n~y5_m(0(~br1`5wK^Zc@9U z^m&YlEX|tW{rTZZIi9OHBB7 zl}((h80~=@c8e<#TLQcKo5zU(?h^PptSw1jGeIDmNADNniyx>~8W5^$5@oN1YLA?C z5A_$XlkVmJa_p%}cI)rQY%0xcgKJb9TOr7zblbbXkC)hlAYMP7fR?zA@U(49Ku%;g z&-vd2CrB&U_4)V+>mIR7SVzfkSVvmc9+5%UATp0Gvu~GAveXjeZ1X!)PI~E2GDU$X z4nJjQLn4fUBo@if4#Nkh99W3qFIlW2DLy9SLW^2}ulXBKsx`S*CPg1)XH?>0y$x0U z^(M%)8&Eo-bDkjTU?qgN*sEgFg}+m=^$1Rh&QUG+7Dq>3PuNnWAMOCJvzkX)q(7_{ z2EGfM8J=0w>*)G*8PeMr5|@Ck{-Bf`(1gLq|d?`4_z-fydg<%z_4kez_H0% z2Vxd##){$!tyf-p@$C*>i;8*vWe_fT5<|ihzB@<1G!(>7n9^)?_SCNYBNZnFem6`ns!c&<( zbG`=5PUQep3aqDY`fxQhG#;pbLh(OtFP&O3qK;mUVjR}-E48C|5j8JK@E{>oC}z4!uF_FQtJT9watB9WR&^w_ChSpE#;D2 zmn!?W4OiuWHQvi4^a7v|{-|4G6pf=GbV^r(XA3|+x1)C(ftUjg)5!;V^N%35 zvnh1$BxK3SG`L$Y9mYlL_PzJTQn^yVf@`f!Koqvx$?JXnz!%=OmmJ`E0LNwq)PsLP zCg*8gqCVcxkb2J2j85#h%U`M@mCz%Fab(nqi8>@+uc?9fa?GluRk4OFjpPCd=f?^V zPb6!YLT2h7^Sl?fY~q-Z65e86%(Me3Y|)99YTbL{fy3Bp>A9I=d_>N1y(06HINR#x z5iDMv9~Nj|KT>_KFKpVfj=5o28mU>g$uZ;Lb#o4=!ofyW5c1VhRHDjos7TS)SAwDg z)&uL-_vGqzaX;_5wT(q7SaUy_-f`DyhJAT6YL{3@8QEtl20mm$1pjkv8-gG6+Hyx> zkK^4&BF{#HylnGr-D3!goeT#fR>x{Wb&4un`y8cuO1nc{r4W2~vao1_4*J&o9glGu+(q%1CgIiXnU(nYVOOof!7K3JcSis2bwt`RnvfcE>hL6xgc?d z@F^DH=>Wv+B`6WXwRngjDRgwjnKvgJVe4|wnS|FFdDT!zFohyBYgL>`uK-F>-QtMs zQI~-Bnji5JVwANXe^YWIEH~<2>Vk4R$%J(;Fj$lh=Q8vwoH%Mo+~=QzjR)z|CdUqWLzL^8OZFj6R-WsZoA4oV{5;=xqZeJ2P_~=SLOjLM8xfV(8=E)=l z$EPrK!|bCqCh;Va@|kwDOf+|4U@LH7kc#ekC{RrL$!5aoyixc~6#&>M=wK!dln41j z=YEfc1OHUfwJ15tm>oTf3gf12q{z85W61&CT_X*6Zn2OcA|S%&Fg{gW{5gg@)729Z z{KRHB-?~;s+(3BPv=)Q3p5NYNN!+R752GVWUiznzre#ChI~B4zV&HBh1P8}^zjVR} zb0QiJZEu0TUhyvGGg6qkEQM1PQ7tZgk5}ztqM)s6g|DKcEXxU7RQ-~fG8rAU8;!dV zW(=62XuvZzMk`ZRSQ#+`5d0Xe_uu9-CY(Kx$Ti?Kt6FcbZfEv-)^J2dxlRUX>*?!3 z;-1yoK!B0o>ZCaUK>3zhxs7L4#GRbh1hRB}jRyh2mq^;}#U^i+H`AzqEGHfe4uOYZch6A*g z`RMsR@^xGdjdo2(-GNI0STy2KX^Z~7ze-!45-s~&*2N@i+hS+|^Uim&&c$Ex zAt;4jffw`N@qO!&9|v~y$SB++Dy%ao%c(4VH48MQY7K0;50RktU3x(tKbXKCWxXgA z9if6@WG*Wk>TUfxUnl9Mh_94QCAaW-DYCVuF#>1I6i z3<7-cQqCQ#v%LbkBcnP*FpdXlHw?_pal9=GVg2Z?P9Dx+ zv=%$NJtHy~x;2l+Bil_NRrfoMm?zP{8-ueMU|QR*+j-$Rpgt|wl5U}_`sJ12T|}_l zRo%<{{Qq(nz#-wAG(%CK%P zN3?EY*u5BJ29%WC4rzPT1Cn%t&r4uESwcg@OyFtyzK&`$bi9Zm;f?#74$|v!Ne2-` z7o2JZ8bUzeuv9~7aN3QJl=mAs4)7G zdcVR;<+n#=jI*8+*;*GCL{D)HfWJna)@;L;+iz#EVhO7*`ItRc8l@j*;e-TnGEgMD z&#Lk5pQ(totmej=4(ocJ7;*Gq_`XF`+pMGu14?n`&(!CNH#oYB#yIX}0*#EcOu zw0!8RLxb9*+GNyHn!4$-5=nV_-QFBpxVx%aY;kc}9is^rhUshSHF62u)H~))Misd= z{9Wv#fV?Vp>6U)bCVTrc4DBdNvT$~G=Inv@U_#tgi6kxvDtI~27<`(vt~^KX&rPCC zGpTN*n!wt?{phI7zjaU`awH?jLg;(&r1gl@VQ^?IhnL6Y08@JD`(cj+&t;#ENRP)6 zofkKIPMH(u>$_6Y2xDJ1&Is~5bZ%X}x@0|;*4~j6e}0oozKCT&UL4YBp$^FhaSg)U zn;!4mlf>2YO{O#h=Wld3xwgd$IaU)_y4I-@dZ7(@MV0^OiPQO;$bU3x=gC>q zUWc7Oy=Ejm*msoc^#L`2RI&USKnmk>*Wp4C-Gv~)er3f#8AM_K9C^^h&`qQi9U}a* z>{O}zwL&IIJISyV^R)Eh9#>*;=9^J@e5CTB3n^}Be`W(6V8~&@JoxJLR8%3m(bsz=hvB$c}*2uP8y_Zr{VI29kv=C$2jcyey0@@KO9vrtuOGU zGYSK*>6if{O5ZvZZAvscJFw4i49)E!FreqL>s_%;Vnv+a)eHdvLxCCM z7En}#7GOYj`N7_XwOo{Mt22z?wLJD;rMg<8v|`Nh1I`X*t3$Wz7=v_CJhFl>fyp8G zC3gC6n)f}}hl3hHr6@XMyOnoX8Z4Ya&=Ktg12Nr&VDgK+VY9(Emh}8&85xwLJfz)= zCQaLadM!CQ&PU>@IL|d3qb`s}bq7A)qCev^?$q;MIbsacSwAY=owDL)M(+PAF^oS8 zL!JMh6#?h}K0M=k$gu>35H>X=Wjn|fe0ly4SqfX<(FZPwb`M;m~&0F~nFY8goI6MR>m!!~7K2s#(&;Qs{{=@l0owWVUs$3+x!)>>A z)6o;Z2f6!>+aSz2-c$>SuLjs{q98uNhicZ}QMTFt8>7bMqx^rL>HB|qPxXKFaFPE; za+&udsdi`fmC@jQJ&wY*;9$$@b%&_fvg$2fiil*sH z`h>8GAQ9@jnQ+YKhkNRCH5=-}lfZtB4%n{=Yq8A8C&%D_1qjX+WX-FKH~JCQ?x8B9AN@MH>qWQTr`Q5`YJ zlU0X}-JQAu*OYi*Qev{wXf^&6b5+HCb;n(bE0TqM;7b(JruDVsoTgBsTIoth?*q;@RhpGa_z4!=XNIQoXOgspq0uFtQaWcHD@J zHtA`)<&EcMO1XBEP_5ktKytVM1o*eNmWpel#Ebhw&HXn%lxM1|fa2uPP+6FO1py%S0RAwYlt5ds7V;oIz5>Gk%oVNAe8JYiZnHo5k4Gc;AGYqHxx z09~r-E`~I~ENZdh#r4Zx?KR|}{&y26W)@aOCfW;bO8kyf!-3lJXEfk6RNsW68Z?u6Ye!m1lJ)6b)ZY;q0wvv`3l<1EN} zM*D9lWeQ8{e7N-!Pz5pM5PHM^1%?uC1j70+Qn#hX=WgjPe!K5z@iwB`T5N8+a)7}* z^kp~Hv(*o;lgCU(YzDpqxW78&M@Q9k_+lc{R%UUPCMZAzB9M`Ki} zk?fAfmpdxSU?5kAU1T)nsA;u+^V)cP5i?DHM-farpra-oIZim#{a`S4+jmi6>Dz78 zcKr#JtxCg_BP+_#sQv!jBbHYVIbz~*v*y0dDSL?G%GGmyPP_)f`Z zv3x2}rMH9B_yT;sDP8w!l8Ao>G&@l@eQ1NF;ss0s|T z1tFxXV?We~Xak3v?5&qSuMxTICF&y6pL=%HhxGK+(;3qj6UcB1ZjnkHNv=h`5AffI zk41+nrgr%LeIh^tpJ0>EPx6{-1AhqB#JuC`GT1f~Zy)KkJWmN%6e)0{nh34iHnN?z zD~y)DdOrnX5kg;l88RY!VOu) zOa^i1rrLRLJJLuyUlNi>!abWEqc4iM&C1!*(|RRS_ZXESS@=FGF-PM~P}mInE3D7&T|U%D~Z2qu>w zpe5%TeyXbu&tG$vB5rz*ZXG+cw?K#Tp?)R#q3Vmf0~HP+?-_@yT*GXy4M)#%l-%uU^7Yl0oxPGyp7L1ljHGQt;f^(}L;@)n|EOq<6h~+v0#bQ{oGx zr{ua{u9z(C)z%6*R>Q9i_y3$MsvfiAEZ_^gnBW6h8-2OpFvGvPf6s-CEDdhOEuITW zRuZ8;MNxc6_Hplt7#+Jk1gZ2;67>(C$O%(@wS+Uas#Q>TvAcTsIBbDy!IO&c2Z}fc zcER`{YcK(L{{8_8<`81~LG-cUy-xD9drIPQ--XsCjBj?pO9A=~3{@P?#GQBkkw^&_ zk4Z1jP}O08RViTX?vM*r^W6I_l}jNGlICt7)3Z=sU167#;F0P0F|hqR@-IVa9=V7c`$rDA4{g#sC< z4bpaP?X}b?=4OsA8oG<82seq>nA}Ru>M*MrY#wCkGt#TacO~Z#AG5-4s!F;Ss}LB= zSs}s&*KgxKJw`IM+Sr!5SJ$TlgTy{gbN%an!?y6&kQ1;bo$~a=P{ChEKCD(6E#Jp! zyhr9-E{g&nJc*ojuevcyM-(<=$R?CNfvQ*_L@YjPIbjv%ca3OvM6Vd2>&HhL^=pAv zZq&beHRd4T@SuF-Itd&SQri+>wiZ+*BtL*I!R5fKahxSXhbp@|>l0UMp4v!-v_r}h z3)_Uf3)mXKuo3Q9px$9SMpQAtk>e0swWrTyW@Q4ly- zjxEl@aBbvr2IHKpyrsI^?NM{h&_8G+A&ka;e##}J&+bweTRTR`Hkg6q&VmI?I1gLy=eWb|b% zuiaa#ey+a8N{@#`?bFqEAZA}y6Egnh+KV!8sm1)tJwVR&NND`FSOry4?X&XNZsn_q z$e%?U6vh@}$3e;BJnnSOOSd=l_beZrJHKUTX^;AI!=y`bgY=q{+Z02r(dQCqN`4cx zXDyUZ?pqC@2|s>Q!O$c9XrcV&XysHs70L+K?Mt3A^ z)|1ZHX(M5UqVTGu*K+9`yfv9q-i1}c#re|I{4^V6$=Jhc;MdigV@pN1;gwSmyQc$3 zS92U@GcLx^8`}HdKel*cRUJ|P)8L+kFZE%Iv%Kq@iCpb=98-h?H$F$oI zuE;|4vcxN+ur}v?f?5isW7lyx3za#XsOh`Ic=}*Lc|~A9n`WK`iP1h|=w+c1ZYpN8 z=c%O#3o)v!&slfv^qBqrG)m`A@ko)mpeQrvZ~z0#LDMo9^(rPyF^u-Xo~A2E&d&{D zY@D{NXQ{%V8fz;xS-K0>cZ9*8V9f$1#e>Gmeye-jiFM<-{4;W5vA&3L@f*kf(Wq+c zarg4GmRG91u(W2OURzk*KdlkdF?vFAluh)ig|E}MOfl2@jRw^Ql7^M^;KtjgS-6M4 zU>3q=4YDSwYihtx*2SjQlj6sK0(qgd=IJ#DeGSjw zg=0TZ#Md&+KolGLV3tinJ;I5M6)E3H&tvQCXE|ifQkCT{JG#AfbG<7MbJBHB&@4iu z0-iV5k{6r9>HLr{_@ee(n6R(a{m$^9p;`@Q9z(mT+K4Mvsmm%^L#whAT}}4^`DIU} zJr7!p#M*vEw^2=#s)J|Zqa3>1FDPZa*?m$M({sVi&6MHjAO9&G@@X^&+Y7_@ottgf zp}Wg1DZj-xGf4O{*FWkT$^xIvKVfga=>JdgjpVpp@GpF0@^c}aR>M>Dt7qN|P~v!9 z{5aE6bV~XPDxiQsjd4-gzQ}U8p70CskRgc|&;MLJ?=Zb>q)0q1kY}8Fbh{=ZK;~S= zK$`S5YAhUPG>WZX&md^Hr!6+Tq}t=AB*6^%rs_Dk_>~?1$48TeMX138Ma!176di5m z`e9b*9x9FI<+6!w+Jwx$$jGfg4%T6U6&{)%U7ZG7vtl^-OXr(6dt3KF-ufO$dDUNj zI~^e9+EOQDO6EB{v*nFT$CF_P(DQw*alMRBQO5y!gvp@k+3}63pyk|Bc1ws8-KRO% zm_5owqWz;ywWbe%$0vfjBuC+dN;aWzd&*8~`e%uD->8UQ0oQu;l}0wA?5xAB|o61-dMI*y-O=>V&J-3x`505+8Ku#u)-RtcU&kYr;dd zS8~=cnQ<*g@^o-2#DL*o6EU7ydC1lK@9@jA*H7OJ|1uDzkaHsAlW8g(4KM2}S`b|{ z)Jp)Laif!<7th(_?-7vh4arRH&PqSaGEzEdgD+5Ev3!ouB7w-#z!Q`o>rcv)2i{|8 z2}fy0r&oxbbh(=%pAg?b4L82}DUv4QtK8K?B?YO$hK^Q6J$3;SQ-L~MBg6-jk(i>5 z>RFGq6heJz9^Jfr5fEAyqYvd~xV3ykHA@eNp4@MEt7!L&`Cob21KDZt>?`<1<>#?$ z2J{otuwRy~H(Q0s)B#4h*4@{1^+TpHwPDpIysir6Ol{ZHh3b?{Z zL2}Q-wacQD1Zt5~hj@DimApF{HlF~5n0eeu< zx@K9(P0!*+XM7qaBN@7go-l#GrSlGXVYOzgrM^T-^2ksuVMMZpYts~F+CkCBih3I}L!5TI%TjO6leb=OA+!&~&-Z9pS@Sd@ zC;XHPQL<52sHx-?CX#tfWNJirK<##KvVasD6Ju4dY0R7JgQN?8l;wF%#sR4KPE6P7 z{|(=9{9o`Lk6_mMm!G&>hy9sNgv$O8AP+27+i>UQ#fST8YJZ4ZuO3nI@|Mun!+SsG zzVB656yr8xW1Q{md?~8y&snydGm5X6$jn$s5z32Qd)PG)CeMM@gz8L4j`a7RUA~hW zd>2!9!3+|tA!j=>@j%=sxF35l$EJxDnO|B-6h8IULG+!@^h#{|*9%==kevL9{|5dT zW8P)5od!wAuD(3dTP7aW-B+C%M1O4lYUIIwT`?hlvC29+|359HCyNodiM9Z#lbFDZ zV^Q5nP$lM$1S(urT#2K#y916qf?ms{2B-H^;|V1!x@^g-4^B__`ngasi`QCw3M}jI zFld0D@L2I3u(3JcwY-y`)i3zvmdsE3tDi4w{LOAM_~_5CZU6F(fAiSuoYBS4Rvfo3 z)((o@sK5TjaOd_{{emx&ALS3@!mi|){!5S_&;X#wH^^5lCTJf*USbmbBM9^B59W>r z%7MMd$^}p@F78S=Bv157` z(JL?$$y%wiGKA5eS#5r|XYHa$1_bQ^xn5|U?m3%*LL;?ei1dDW?c3q8Lzj|5gdz|( znrH1S0&~maJcyvJB{~}m6NqQkg@<}6WyBBC?)ll8rl+U#1)bR-wFBO7&Af`LxgP;Z z9~8lH(&68DimNokRU_zBYwH0fvusjrQi%#cp40NDeNJdi#g|#6d#{QWcMf_04!g&9 zMThk~V0uhVqqgQ2&Sjcy-t?D+JL=uH$c9^!OoGlI#y<_F&#_#6eRc7IJOf=?fzvgo z(U)_=@5BX-oGtDbIZ1Ep(Mj(xY#P>F-Kfo0B*8izsyI`?mJ{-X@n_wijHt<unn3!q90(@miJk_p$q?GwGo&C%%(NDt1Iii(vS zlURCBg0$p>w)5_RuITK|V-*_3KKv{ts#lj80Yhg26>7CTAwW)PliYTb;(S|HRBq$k zXJwF*mtxrt(^Q()6@vtyq)uPStLz`AHEie$yj*b{&iJT{l=m{X%;I$9d<7V#d0&@H z&_wPpI3?g|aoo%$vg;2Det6BbiBxZWeU!MTx-rg%?tB%RK=Cw+6#==*2}@YTZhrK0C!;i3&%Acc9sned-{xr$TkQFM$)y^jg`)yJ>X z*4l+DP7oq2V{w495{31ylp{@g3zBSj{XbUR&fl5gE%uai+3K#LaleL;xkS>tEI(4c zd(d56yU!++za2myF6K7&BA5rfa20(qPo?Fix5dI1wI&Gsl+Z{+s7!X*c{;G;X!d?v zdfi`A&BGOKqEovPAwPnwSB0x(ljzlRU83muXV2So3%QMeGEnlmE#EWDbiN-NZOA(3 znYUVTI4}P$&UIttIoaQpx%jIx3*6pMjVVurWYWOb4FacEp9Vks=Jsck$+^J1;%2nS z@2W`fH3G;JHJbW5DM+m@nxvmBxd=N?#HM650X4j3>gz9+)s$B_Uv3Lrr~!r;pXzGD6<3+uMEgADEs{Q!@n%SI$!bpbHxld0-&*qYy*F$= zU{g)heLmVd(SOZNF*t>ZdrqV~TOnP!JBpg1!amNVC8?mk>7N>s+{lGxmP8GX1b94k z2qI(;tgwV0x65bP95OZKUrT-c3`Y=sXSwsvGH++B5iRIF+*vcI_$bomI2-iJN9TRv zhmiQ^!0T7;Ff$2EW(mJ8*JZ3^9OVy$ww>5SYE|v#gk=lny^FT^Mt~VIMJ{xny-W@V zU42^xv-Bae8t;kC#dnz?Rf(LAHM|22?03DczP?}fcS$?EQ_i$n!ZOQG)-&En<2XaV zi^!c*vi3R1xRKdOUh~AoVHgFNd|H>)bm6)f&%8lNJPG^^qUZ7TrZv>gb!;gW4Et25 zZ|~y7k4i7;)q)XurSt;RjOOf4{|Y>5x8~C9jA8HBy9Cmvsp;tt8z=U2C+cNDpPaa# zwoUR9XQD0E*RGSXJf5Akr@`Aj4cu|y(4T;9FxSjBLszVl|EAbYzmS2h+$N8p)b$4T z2LT^GsV_?FO=0%@0b1Kyb20hD{CfK|W{69jf;O)C856|S29m+{iYusMFlR9e-v8J# zz3c+P*Gx{KvBji_@@JHP*WN>C0P)kiM-#Ncxn3#QhsAO%)%UwdZCea=wzdQs>vD4Y zWb@3s!&H})CO);WSRsj@iFpcq_&u?E>q%&t+vpQ@uZGB}Y~|qBF9}gB{oz^LWmgs} znhY*hy=sYQ9qmyuixHok^FP`m!1XlBR}MZZ9Fs0pkS%IiwI?9 zCr#gQhoo0te~pq{AfzL1$aq1bxN5J&2{BtNCpBjd2Vhiu+t|f8A1mOY{nDp8axJgI|zaa?0fed?WWu{g6%U3q+fs~ z^Ay2`eLTeqM~S(VoVlE_+L$D_l*I$L6Pqe`#oQ}T_dbxow;8sO?%#zkG}7_B&#k^* z=diC?8na#CF`G67%HLeHfqtoK*esYZn6<2Hp3cht_)}c%j&~86&wKHeQV~Yx&pX}N zj3C!nqj$U=Prm6Nj&^HVJd7=~F;MW-ot`%kX16*BWpuk7{R&Z6HF=&GLrE7)D(%=U z7>?XR`d4ys$*3T5kqv^T|LU$u0JlCxNjbX611kLzC4}ul4BQnzU;5Z#=Ad*RRNgcemSZIb`fbX8xAtw)|mCZQl1oJbuUcM+(gH&b;OB$}8UJI?099N;PG7 zQ(E1*H{~~y9@QoByj_FdzZ)^sQXV~8@OE4w`HkP*k(b2JU+RGzDT`4u6kA=;0``wa z;(L)VhHq#bH_B%xC0vedo-|uXpO%AArSbSC8qMv7PGeJXb!WOd?9rkcWz;@6d5?+x zbIG%9tJ=MFO|GXK#^++#yf6La8!KJ$je32cSz|ZV7(y#la$A5%%ed-pFE2q7N~uuO zH(v_ulBlTq5X7zhN0~JunLble_~nzs45lb=p)ZEf2-eAZXiAc3vm7ejBrr{X=Gz-x zr;{nTs?*3-PT$y7>zwNX)kfKfp$}ynv_BpsXl3gOG~>-jDylx4-YTv9`2^yT0^KiC z8UjEMk55~lyxq+(*;$VzuTbXknwNx<&FIfX$E(Rr$Zze0HRPF93CpdIo_Cc#Z*G6+ zSnT`LnuFrQJV!4RP$skO#NVTf(O24Bxt3V2;|gHwa7Y#xqMIU%4kO+3ztQy9zNfG0 zm}lB;h%{v%r?vo}(rj-kb8cXGyQeKfr?fo;R7t)9+CXmTShQ z?LFvZ`5_kgVd1LE_6IZLB$3#@UD&<@&gLK-i@yn*qq?#ap(^hKIE2rgeFA7-#9m!u z8i~5O-CuHLf%lwatA~H(eK#YGCIElNM3LInK*-6(7@1!epZjWFHAGiu9;&snq`kd} zZ+Ju0_op_Qn{%O?*o(g}c`4;UQeW(ps)PDGN=I$0kC2g_dULXnX?h*pw z4ZZLFo@Zv>nKd*2yld8)vyhXs&)zxvo2{SgN`#tINUdGihp`TB{ooW2_h3K9MN?*n-a zx+4@6kxqFjaV;;C{R}Y&T6xdA#Wxe2WU^BatP>Sf{NSG%ubcpGsS`wo55NS-Ct}>b4t*q>nlwx~?e8>-0YL4Se zJ=7x2@K6&GNP*bZ+Ds|(Itt3^75lkZvxioRJvW!ERf8563JUb`fX9v=pMVMvkxA68 zas0Ods)LE(Fjc6s`t!gC$ii%g*J8vuvjqS9f1{k`3aA6hf*ZR(u zU!)Tjhn*29XxX3Jyt%j;I?&PnLHCmp;!he)5%_jKAof#UTq|Yq~Lr&J<59STZ9XWE)`q5g+RrM@z;Z>EMkSQl`zo1a= z?Y=U2Rt=K;BgOh`C;Da?tHZ}-#j(|xz@}*2r4OewD_VBSNmu&OFv&E>99UP3I2cep9pKhEIH1Y{}hl3#V`3oZgXoN^fbp3vS~kqEuO5 z_FCwu!OrEm6+%E|)q3WrUxNKiKfMrJ96zpdQAsSb9q>!B2cN}l5N}!tt8H-QMp|qV zPg%yiAs13rh787+-}RKGxgI`k{3+JCE0p|#L{Tx^L2_zX7j=FUxP8VWsTEou?K5(i zxXkP%pC=VufQ3cMG4BA$5*OM!)IUB9&l^x%vNmLPcFvHLSnRo3RN2(GJgJ~Vyf3cZ zsw$LG7!Qm1(R}R2s@}jV>?0VzI(>V@Lmp+gKGvyQF$BJ0GyKs2_M6aqZT&5+$t`|% z)O|j3H47S6mdtcKuxhoNo4@%cI*WZLaYc`YilEbkcaB~?jW5Yl*qfDbQO^!Xn^M(zu>{=AX(WAhny2vbLOJ@#U-cah7R6hMy%q>;LwQ} zMyHY$GLIraXCh(3)8D5Uhq90Rbb#OUY6RcmSr6p}M6q65vQ?YrDhC`Ua$Z61+>=%@ zy8}S*nbE7`tEObVxutjh6wVNO(ne1`KI4Lj88x1>q#ALz*HAh<%3j=Dp95!!Z9 zhhj^f)4OlZxw>y1V>`$w_<-htb>D|SUK&>Xl{egcWRQ0#i^ za4o>*+Atq`RlrT@0y5@xSLz2uP4nSM0Di>-iZ%J6Ir8{a6MYEm`{mbyWM!!WVY{xqx-;Ms5pO(UF&g&? zD0p7Yp?%B?(*~Br^Jcp&rAbrEZ`rNH&TBQFyPH*J;2wBW%#jT_^{f4cWmhuu`U3;y z!vjkmhoWK5abIEa>S3&y2bW!e2o*rI#obMfQ%Zyem6QIP>_|BV_YP}q&|`Xvm#|K1 zjJtU&8z0xnGt^oxvocnem>192yL4_AUNrv*gbIa2Hnbujah|pLPfE8Q2|6CWH_zpk zdzb#6^j+FjwH#Z2t+8d5*>?-d=OF~7mazUlL0GFO!aMv$xmcob;m!k++3#WS=A0$+fP zJaL?RM>VYiybfVSud4JSZk3vHY&UzqWyi1&l0z5@1*@Qpn&-r}H*6KEk2QT|Ga|1< z!i^PG)hqx^>s}|x1I=<1x}z%F5{PP8xC%$;l0}_^$%uJKe@eCU)zJ>US$0 z*k;GX))LKIWB|M2lmlIUr;(jX)g#)=M<4BEtL7KoC=@H_HtJ}!*h@d_ETChOCV(%x4MHQ@FFlv(d%ID%g=#7%i+5gkr-fcJ z4YxG8j*{3H5b>o8n(lD}-)V~Jv8UPsnC87s_$-Eu*0nxvDT|(yOWF>wZ;}AD6N(Er z-gH;KWCS0^!qx*7Y10FbgOw#=Sat`;$+PJ`98^Iurt^uDpP*?N#y@~xv~OAHJA$$b z&bYd(#?Uk=zp3-<4M~m6q>M`0i+Sua;57c=fo)qle>pHv7!Q4aWxhvFl(wgxKHT9w z>8&yA69st#ts>jATd0#C$#1|EL0h`z}=XeqmT`M^B^JdGHk(K=|ve+@wO%>?l!N z@QyMl@iwT_=kJhT^yO5!Ue-I4##p!qaiP zAr%1`duIAMLvmgm8)B4J9nBn4VG63lpfF9lic8l^Xc;g%^j-7-50uu#{I(jp-H2I4 zFVCy8N2_$;0D7Qu@!}i<1ty-@#TxeIFkh{T^3U6T{qb__21aOOU_^}Cmv&-h>h^Hd zQfR=GOXpTlD@3SnLCZI0A-JU_FuNMzKpc~7f;Qe~jT_*M0*sHc&3%AfD0Y<*u|er{_SCIi7(*p~Uw^tvgYvQ5^^4C>O4V{E))rpr zp?v81Fy7b-weyWozH%#TJXe`XdaG+!=Zo(TjY_G|dh&0Gtn3Yb(G(IiUO#`2C(y}r zOwCwBry26Nw97NM4XekMm*>SZKVK35dCjGPjg$1q67O)(U_7O;{TkYS@Yu?G&Fdy@ z1snqHcBUlkpv|TI2!5g$sIgtE;~#{gogWr`DblNL=W|M^ub|rfl1A){;MQh)(x7b3 zbSUu!O2#76VO|Oyg-Uxlsv)N*8(Kw0HQIeZgQ)jBf+jjE)nPqIwbo~q*d{q8JCwH! ztANCJL4$-}MY|x6CP>Wct?hf-V}kb1_rLlYwrVFdg|;5SqwNw81CJ~adz*`o4`=E@ z8+|g6XFQi)!C`qR{^%Y#*UEYU_!E6`jp{y&LiKSy&*qZ=lFEzKX)cCtMe&Towvya_ zT%Op|K^S#6zjdD)9zG}9mYe7fBkW5UB4`g}-+s$m-tX2v(n*QzYd3}FcBBwLR=s$h zW_wbW8Pu_M&IB#IfHJV3B}zFt!|ivM=^D!xKtS@&0?PZ3f(pcnXL>xDHU!Oun_r?1 zNgYgU@ZhN`NixtmO;6ksALqvlhjqQ7KFb`wEAd>qWyk$if94>EGJk<5h5qcNJOHNQ z*;7EWOMJe*pWC)5i*kL<@~u;LHX_T?e$w#8^6(t@^^Z+Z?wxaBBEj~;JS>Vq3F4Hb zSlcR=2f8_epN$;eh6ga?08eqYRS{6u4*8)zUm4;9(x-;?yPPX{YBqb5sQL|6^H!yw zEww@R@-5PguF{|AFrPuQ_oLjLaz0m}pI^aB9TJRWEq@D`u)BfBSPvfrkf73xUPk$N zU60+qf3Wi|5DYFzejzInM;Ylk>jmU-nufH zymLFEZE0=s91z*Q3EG2Hdx`6u3mwmS>mJql$r_%pDy{hLPdAUNZ;n<}MKEucHBJMc zc6;7gogZ+|i<3Pin*0^4QBQrV!nqvPfl5NVb}4vK^+++ut(X`M|1-O2rTrpdR>>61 z%gm(@gqikJ2b6F8+o|ct7u%?&76p7NqA2>^qW}c~dKFdX^oyH0Ht)%TdQccq3UYUc z!*htequi}kBHX=L(C?IP(Fo?P!iqYU91djgXwlrNWS`7nXTCc~?g}o9pH;?IzJi)Am13>^ z>EyLU#BfKet+NPMBhM7DR8K=dhghMA`uYR8STL#1(CCH;oRTtlRM=^P2fA=F1}fOT z-yPA2lKgIe#QX7%qW~+lH?c|QIJ&1pkm@qjA-0RQ=aFJKaT%0y_C#P2<6RiXOq=kt z{h1neCzl5v=FzAjE%5oZOTz*ow1UssV8XK>C)i&0%iE zh^g&^Gh^aL8#|F=GMMA_ga>-r$n3_u!>>3DS*-32DxH*afx{)psgB`(s^-@uYyoE; zp&L8NzzOYSR-Qxm)yuF|qnufba-6dZFiYl>}!3m)*~S~z!k<0or^4Nb0_{@I6bBz{bGM)z3eOR^O9hP%t& zI@{wSq{3Vi5bMnQpwkBxbF3Fg4ugX79guH@J1D*f!<}!rs{vztzfSat&uDKiI8sFv%+P|pid=sR3g7gy-ZP^6qZ-fgkV309 zw`|Z&Py}4G51iy|!~Q1;#jFK-ZLRj_eUVqzf(`x93I9!coB1~A@0+|Nekp#>#qN(d z%((1_|D2-yLX-Qi%n#}AA=~%Y%uP10-kVcSX6tK^-IpBqh_1LPnZ*Mj@F8-*uEZP# zr5P(}cdEw0^_vY_I}yC?Y^m~QnM1_us(YRQ?U)#uE+Gp z?k7~laIsx_#o{nc;5U?i&9JsloCd_(+SIEMlmT|I_RWU+u%l)D?M&fO5yzHos(CKI zs4T@6XK^!M%acL~6K8>EXv|SVw9Q2N2iEN8@H7o3^@{1d93kIN{h5R}b+yV$2`{WV z<6b1rYhRen{iRIQcBGyuA-+;b$~3I_zoSfq|4^n5K2;!hSjBs0b5kOZSHnhh2W*1D z4GkgLO_FGpC3-9G>Ru?m*gMJT7?GoRpGD>?oj0s(gWUE@R%q{)d4{B@FuJy{_zrj1 zG;3q;`&MYJ%S}eV1iMt2T`A!Wld47rbZVQ7@u4g13AH+g1S%bLX)7jqtsmF&s=36H zQAF)WXfopUr`IW$SaR9vq+?LK(o8OXsI0i^)$rZYZslHa%==jo#KM}~@_VP&$|EjY zWist|m%?MYkTjbci+f1K>Koi8QPSHdNyzt;Sb~M(A~XRTC)VDGV_-C;`FEpNc_R*K zDXKBQA%>5lR&mLLbU@AeZQSmohV3wIH<Y3?1~&cHI>e- zv*ic2Ug!FE6aBrxCdI%}Jh-Nv*89nAx zDBG7$7%}Quw71(g&!X->(y}<$4m!;xXP{i{ZYjCcZpUCGaS~^n(+u{W9BOF+TO1}q zXc&}|37ZAfcz-AKza@qApAa(F9Of&jNe1W?*Efri!V#;psE*nUyJkHBI(AVtdmkX$ zhcaDfE^k8{nd_5YXxmipCb<5V>Q}>NmpqOJKe2pUI^1f|@b)3^DQzCME)n!F?CvH5 zOxlNlSuAqk7li0uYX5<0Yw*yeR&n#zAhUh6Q?qKJITu3DH0X@>_SwuB zpFyVry`v^rFDPYy7Dj_#A0(XN!DjdwOmov-PXr{?q})dlljIIoGM=L!-KGxtv*X ztz;|VQq&n0IevuqUBozFQLQi8Dn=Jyv;TC%+GkN735ECF*%@WFr97cRuaYHaQjlxx zs?3aukehd>xEV&zN+xHyIUSCU{af8OV~XPPch>#U<& zKPDoTb>HGR_L8?&r5e8|WLwM)Q&rt=5Y|yY9F6I&W-Pnzcx+u%)vbaiecoX2N>m&kR} zh6-9ACY;k@*6Y_l1a(8Y&`TG6_7Ru47F5j5l0s1U$d z=r%xcvuggZ)#Wntia#0HxgN|D0O(P3L(>e^DkOn{uiN*J`B#-t-jv$b?ywuYv`88N~(S$5D zhisnc)9C?1>X$w&FeHyzA00Jc{XjA>;MrP9mFIkU)@unZ)>_i2=rJC=ApI28)uqBN zI!$Z)P`lWBS2MBxisgt_F@%Zd3#OhqL@|s2A@t=lC>-MND{|jCtYA_h6SG_AmEx)0CpTX$_#V?m(A&Rk84DF&O+-EY-ZvvG-jVaQ z_4=xft>WF@qRLBnhJMYG)3;sl^Dg{A=$3bOAIVT$F9r}|ekt?lpp^cj|$ZbCouz9?U z{>VQjHxZyY>l0S}>jSg0pPmbwKI-;q#-qti-HLk=gP%}Smn<-)g!i*QzI#DEX&3pI2^Gbwac{vkv;X*oQN{Ds|}d5M|0z>6efDHdDTKSadWhl>Mp zb};OBrB52zf8VHa^L_$VXDc&8{9+QVEqVj3PeGt3t|WGh+K-os+~EWF%G-En*}%=P@^bGvt#NI;@9 zH~%_=pmFoSjx_yjNxcUW_Z8VS#A+UuhcIe1C`gE=}Z`a_z0aE*<< z?>N!MO}`1_F2q?598Vv?>93!F$UD|J5f@=M3ylGCMkeytWC7a&S3-!D z+y2q#DQT!q;xyLX^WK=vblO3y=Zkf8ca=_>Ya(}6i>^=4yB{j(Pak$$ZyNtF-D#_n zs3M3^#r-z+vFRxKNEiti4&j5utnkt2pAHHu(g7SvxmeqmD-nldLUCLYqGbVlro73I zbl;rkng!ML^m**Jt#E%4q{3l4xH^yf`Mb(AENuRCbT>;Ft=(~Hc8~IZlA(rx~bUYh&M^Ly^l7|^T*ElX+V}>zE9m2B+sL`t( z@;vt3+Lu$~jw%rd2hG_In`em%qdU*8#Xx?9c_PHm*wPUbrEPw)XLPV^F zHStF6Yuh4Hw5>u!n8x((-NdpGytzB40NsT3-5jhT>S=nNvmc$m4WV#!&t;Vq zT*bYFO#gCI!DX)tz~}MP981uhhmH!kZo_Q!4MI@Yv}i{430lAhr@zi_CE&)Y5N%c~ zGM1SZGJ{_~Z%sV7KBV$}NbH1AxfHV$!hOvl4|UUw8y)(@Vm>&VC;dYr<~SCxJLvzR z4(P}Hh8602lbb(z;-*LQo?u>H+8z%V^G4CPa(!~{<-_sq^LqvRW+Hcbm>rs^f?Fod zMup@dwXdQ9*h#&>d?o*Mi@IrBslMq@x8>hqHCXH4NAbG3K{2(pSj= zLOWrGQQ@fWOpIrynG*;hs#PUA&Ovxp` z8@D3h^#bF&b@+5ef9^$s1PMp0AcK8yH*wY0S{@)__mzpUa8Xy6Q@g~!cc8E?Uo40h zu(q}e7ft5*g9B#H?C}4l@%L8*KK>6~5N+-O{ueuV@`oM#xzqIlp4Q(iEhtY|{yqO- z^x@HeGIRXDLKFXg@&8k96GZaFF21yaL%&fHo4Y1yH4flWqRq}i_V+_D6M*8HANIYn zveUl@?l}QjOD9Pei?9!!8lb-gqRjMop*Kv49w$te&A4Bm;R2i%a)f}N8Y#yT^E3rP z?Hb8{i~D{O2UMfAGuSf+metgLH5iz+>lr9DhOnPpOq$y=2XgSkg*_E}p-xH7YP&~c zke37Y%zzG%Hq&(TG{uq4o>$1fwv3P?7wtI_wzffS7UzO#9RJ>TzS(=1g2Jv%SS`j+ z15I{6_#U{-*3?Q=4AQnJ%KA0pu?N4z2>R!zkfl?dG5K{wnRJ3sum(f%>PI=6`HIMQ zS@4}v@6Q@wpFl;b(0h{t!lmSqwx8!KwbX-0BiYn@3Q$TP5DtX??(nMgQd)4AsCVGz z8lO(#g!*sMFZooCZ+GUHjek+`QH}Ta#0f@=82ql415ycR`=%6~S?Mh9*W z!=6xxLS6TPS()PnOmnjVbckDCf1m5fb}=~amo-_5DJqd{EcNT1GtCD2B_%(VgRno_ zJui)WvUYzYm=76Yej$=|dKKe6YwuE_6%HsjeXZ32OGP&5r&1fYaf=GjtI9 zp#M3JanFsQ<_~(^Ckl;l}!xZJO8(tFI^AGt4ZGU z>7E_KL5gtGR#n@Hi#$muUu-7->m*7*Bo#8$YyGHT*DUe#`oJAgtkyS+!g-pow+Dqj zF%8agZ4ff|^PMEojAT93f1g`U`Q(xI@o<5{)mg@XZdC``$L_=UkWT~bKG$mRqvz@x zwv|`?-7Y={9Kou##Gs3G(yc%sm|!t~t0#eP`$vHGT2Whl$8qS0ifHOr%4h$Ux+M4l zZ;Hhuly-+|rleK#X(lgwl1Ec&-A^q71!wa+Ej07Ztlo|Fr_PS{ zqWZi%IgOgM=GonzoR`Jf${dQ~Z`@M9x#j!Y5S}5cUbVHIh(r@E;wer)6$y;T(+4qq zs1v5<_i?t|0t0sW&x+t-?mox8rej+Qbakeb2NP|a$?@b2OJz7) zsQpFlS2#Gl&?dp%j&It=1|zCwGwe|hXm@=r2~ z9v^ZxZS^1+)Ur1`lb|ai)7?C~VNTHeH~H5?sCb6VAPtec?e_vX4XO!vU@UO(-^8~> zOV~R`m0QER+&-P4s5OFrufKlu-)2o@0sl9t{GZ(at7g_$BH|UE{qGt0e%UdTVL6DH z?LIKXnf3Yp8?}+L`usx$`ahRq%N-u*;XD7A0Kw5r+r1F`Z^co*?|i5D|IWhTgEn%b zW;WCJAAOQf%wsBf ztJnEXLX_$tW5NZ&{?@sN&mZp71SX|fW>AbHE*Jm~#el)3L2jRO8N^YjNyi%({&|ky zzo<%$Yp1zF*C`K=A4nTm4@S;;H}dJv6Qzc#w`8m38kEUOURH`G&R3KMJ<;f4;>vWm zwB^Abso~GuQ?n?_cHnU_1cIU|mYEfE)i90EYHUwfiT)8y_6GlmCY#6k^cV8}IfFE( zOtsR6H3 z*tUxM1bgD(KOS2h>*9u!FuRlvFh9P4$#KW~6+I|R*hPmO;brr9jUL@MT&W<^CS}6B zjn9m<=dT8J_L`822~eG|xey!|HcTUq^+i`egIs*}_fu*JIa7`5&LRDduParhL2fr| zY)VD&#J48>#vr+v#NPYrkQUfVwp^b7(Mc$>{!euh5u{E+{;y7g+WAK(nQs0W-7@jc z$!qKAsJVAN_r@>69uU=M2hYwSootDwF31vN~BxsnA0-tNx>O+zfrqE{sq|7dbQKP7aRCKb`9DLtetE4}`!f0@s{%3}@Sl6Rixb-Ikb{W~7jSAGHCX6F0nC8}ke_`l zqa6tB7B%xMKREu>+NScfG~K&zxde#x`G7=LW3qvcsy_amnAsO!e@^_Ppoo{>uja~G z-mZN1o^o=L)&)O=(}UM8MPWgpTUA+Jg^#m`z`JV_v4sgf65E_rcIN`-gxjNag}(P? zkaisrx>D2N1Z*EmXP}U-^{@TNxeYL0Fp&pOz)O)W@2)Q{AWHjJg#Ol&Xj>k2!?Adc z)cYx+t1|%vu@uskjc{C$doS%lQ<>4{*@8ND9f&YS1GQ{pj>^3A485|S9F^i2$HIo^ zGPAR#eNnv(su??Ax?pI_T=!*SpPPqq-(FipXyp` zuX1)p%C32twzK;#vBa-?6Sc&%&mP*2#Vhf({!~eXx3Xj)NWn6Lx+UEJIib{dOE%&#)K_xY(UdF0C-c$6F zmi`azt7U(MlqMD@m%bN+n|7~do@`qhspvzWV133E@+)_|cm{D*aOOtLRZnH$7n#PU z&}+PE08W*JFQVQlCS`|?+^+Q`eL;p~=TN91pop&6V({cbtiPLJ3VI)o!W|mn z>la8rzLuh$B<$FutJgJM`xfJn+_k92x_OW*ha~uSbsDO7N_9^Ig}-9k_X04NFE9z~ zBh7dK)#;2Q0DKb_ySNHpJZ%KQL4m)-ZedL~`**zjF-l2GUYOAzH@~iU!4U*IG>0LD zh*?JzEPsx&Yi$L=t$5vbBSq_9eeyxqG!s}ezflDV-}JmKIDinsvhxbru6})Qb!=?) zoBm_S%(Ycp1xk#B`&Oi#0GCt#p-i7{m}&s>JxrHek0`S8tD5w99_W7$F2ue@%2wtz zkM>vC9f(^KGi8~?hXoM|>nu8^iuM~g8ljeNRU+&SS<)$^4s$to%HG(LdJ(7DJzIjS zAXZ|SlSj4LWaPE4W;-ZoNlvqk*O6w{HiVh%BF6ZW={N}e?Oa?TgL(hj%yhNLvC>BS zqXs0COYhKRb2zi8Ui&=oGQwNgljPDC@`|Yh5FUN3UT5=!h8GvNV zsmH3!Wpcn7Lzd4%HqZJ8d%dCRE*TEte@M`sr%+QVn_?s<1^fIRTQzBeV&306bS(xpC_wKGzz%A8LbdPG74iSd z31jziLQ4caaz;GK{=PrFUg`J}u|ccDDT$2JWWock7v&|=GJeBPG!kQ}*Vqrb&0$K) zQR)i!aE$TrGiERT=<5-MMxM|B>&CMwlhilqIMofWH$SzP6cv9oSw3eg}UzT_C~u9mO*#6wSO>>wT>xS>zq`X zD>MGyX87+GRovX1XN6+f_ZHQvgQSkK-s6*(;ZlvrF9s--QJsAfd=sB7RYke|y(FGk z9$R8^q|2kxvC+qn5~-CBAN9;;%gm(_Jq$;Bc11s>O2u#@U4!y$E+L-r#AuFA9H5e` zwrjl(wu&6FtshyD?5?eOcSA@G#S_&c&h;M+h4gBj`QU{)Olvq&T_VSG`PsU0MuP8Z zUXkw8FHg+3M%;2H2&{et3GamqR^Jd zV>yqrGk7X{JneYlMAwGhQ+(3zMHvG5Z1z`Rp4-JbR&t)!SQ1pE>1Z1j>LI- zwXh-DA>g&AbI$ZuP}y#d>z%ihH?PyYgCxW)PvDQr^qBYBdzWsXKcoVP5%p-4=lER@ za;TxveF|ML3eY?THq`i}8b}6ym3wUTrQ6K7C+t@)!@#=<2CcGKp-l4{Xt6gJ%M0#a z{O*S{XWtx;=Z>tEPQbc0xTT*a7HOXpj)r|HS8>#f@Yi50rajnWZVT6%*nZZ&XdNwZ zPGfq}oo7>dvJ84xAmHTTgmM7k82r0H5;*o)?cJVG5!(JrZJp_RNjutK(Q)HRmV5qeqT! zYL?u;AT&*vO1KVRj;bwS!+GApja`#$f+80qGrpvGJzMiEIL)L|xL>hIb9Tr2+B_H5&R8v!tO+Y*&irGT71G&QY4ekAw z*obK3!?MDy7z^xD2v`WRe$%kX+4HB96gWr<9G~}N{nb^bO(WEb)mA71Js9VnP)Ugu zkwskb>!tFQX8$<5LP{#~l`jZ83jka0_H5M z)W$Gj#sfw2P~U1;99I?SB)XYy9f-9Nw5B7wT8mmFUp~J4F@+EMYZ))rFFR{mc+c$4 z{-dOXe(|21y*}SPs)j5L)b~J)kfTpj4_-ZHKV+8UA=)Z0($CXvTJoiPr@Y<~@rs@V z<3KOu@!i0?1o~oua3TDOfcL@(0xkv9PjP*-C1E;7RiAX&co&%el~G8GB3hAHtx(I+ zmJ9~{HpfuuuIabickLA3nhC5qXZZ4y@s=bm-i>-S$;4LJy+#gQ7{*pMf@TSE*xfEg zdO@Y1o^FCP`bX1?gG?U~uKl-F`@%&WNACYp`QI_j7%JKbS>FkRiF) zcbL4+x8vEe7_XxA|AQga4?X^~V7qm-eAS~qvNT`EpX5g=Mj&nn-oluEs!vap)@=zE zX0&ct<$eeaDb3Cw{WRWvpN@{)7fkx8(?v;Ey<8#75h`PnM2gko=+^L5=+yr&5rraHUUCe-H z=~%uJ-v4oomXu8ioo*8xpQg+>4u|jCt<4pLC+mYSv3=GEIWOH}j6wwsl6AHpBfras zT&@eh_6Lmx%uISt|Mh_0(e#QinKUfx*O*?GVV-s)l zGK5IKoKI0zRttF@@h6IQ(Kqj8UN4Dpv$8=Ki+UvTbf|y{SE+~vTZ<&W5H;)P(c3h| zr^SIo=<(LEUBULaGtyA1Uzbluzfsq%2_eH6_D7sa>`TKhIF@JDyxW;|@E{$p>Bymk zx|utq3mh$KZL()}%NxS5cX!t8pb}BAsy^2XGMmn-A{$A8%kw{y%o{QHX7+$);euPB zXm(Zm@IRmfDr!JfLr$JWHJ$;dDvL&el7k8mApd_Lk`zNx(2O;soXWqBO|uZ_z@r9m zLjV52Ws>9utCIi31Yl?w?y;T1Bc-!Yt^203K$C ADF6Tf diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/benchmarkTemplate.json b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/benchmarkTemplate.json deleted file mode 100644 index 13bb3070da..0000000000 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/benchmarkTemplate.json +++ /dev/null @@ -1,154 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "endpoint": { - "type": "string", - "metadata": { - "description": "Your account endpoint" - } - }, - "key": { - "type": "securestring", - "metadata": { - "description": "Your account key" - } - }, - "throughput": { - "type": "string", - "metadata": { - "description": "The throughput for the container." - } - }, - "documents": { - "type": "string", - "metadata": { - "description": "The amount of items to insert." - } - }, - "parallelism": { - "type": "string", - "metadata": { - "description": "The degree of parallelism." - }, - "defaultValue": "-1" - }, - "cleanUpOnFinish": { - "type": "string", - "metadata": { - "description": "Whether to delete the container after the benchmark is run." - }, - "defaultValue": "false" - }, - "containerGroupName": { - "type": "string", - "metadata": { - "description": "Name for the container group" - }, - "defaultValue": "CosmosDBBenchmark" - }, - "containerName": { - "type": "string", - "metadata": { - "description": "Name for the container" - }, - "defaultValue": "cosmosdbsdkperf" - }, - "volumeName": { - "type": "string", - "metadata": { - "description": "Name for the gitRepo volume" - }, - "defaultValue": "cosmosdbsdk" - }, - "port": { - "type": "string", - "metadata": { - "description": "Port to open on the container and the public IP address." - }, - "defaultValue": "80" - }, - "cpuCores": { - "type": "string", - "metadata": { - "description": "The number of CPU cores to allocate to the container." - }, - "defaultValue": "4" - }, - "memoryInGb": { - "type": "string", - "metadata": { - "description": "The amount of memory to allocate to the container in gigabytes." - }, - "defaultValue": "8" - }, - "location": { - "type": "string", - "defaultValue": "[resourceGroup().location]", - "metadata": { - "description": "Location for all resources." - } - } - }, - "variables": {}, - "resources": [ - { - "name": "[parameters('containerGroupName')]", - "type": "Microsoft.ContainerInstance/containerGroups", - "apiVersion": "2020-11-01", - "location": "[parameters('location')]", - "properties": { - "containers": [ - { - "name": "[parameters('containerName')]", - "properties": { - "image": "mcr.microsoft.com/dotnet/sdk:6.0", - "ports": [ - { - "port": "[parameters('port')]" - } - ], - "resources": { - "requests": { - "cpu": "[parameters('cpuCores')]", - "memoryInGB": "[parameters('memoryInGb')]" - } - }, - "volumeMounts": [ - { - "name": "[parameters('volumeName')]", - "mountPath": "/mnt/gitrepos/", - "readOnly": false - } - ], - "command": [ - "/bin/bash", - "-c", - "[concat('cd /mnt/gitrepos/azure-cosmos-dotnet-v3/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate;export ENDPOINT=\"', parameters('endpoint'),'\";export KEY=\"', parameters('key'),'\";export THROUGHPUT=\"', parameters('throughput'),'\";export DOCUMENTS=\"', parameters('documents'),'\";export PARALLELISM=\"', parameters('parallelism'),'\";export CLEANUPFINISH=\"', parameters('cleanUpOnFinish'),'\";chmod +x run.sh;./run.sh')]" - ] - } - } - ], - "osType": "Linux", - "restartPolicy": "Never", - "ipAddress": { - "type": "Public", - "ports": [ - { - "protocol": "TCP", - "port": "[parameters('port')]" - } - ] - }, - "volumes": [ - { - "name": "[parameters('volumeName')]", - "gitRepo": { - "repository": "https://github.com/Azure/azure-cosmos-dotnet-v3" - } - } - ] - } - } - ] -} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/parameters.json b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/parameters.json deleted file mode 100644 index f8b1983b33..0000000000 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/parameters.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "endpoint": { - "value": "" - }, - "key": { - "value": "" - }, - "throughput": { - "value": "" - }, - "documents": { - "value": "" - }, - "parallelism": { - "value": "-1" - }, - "cleanUpOnFinish": { - "value": "false" - }, - "containergroupname": { - "value": "CosmosDBBenchmark" - }, - "containername": { - "value": "cosmosdbsdkperf" - }, - "volumename": { - "value": "cosmosdbsdk" - }, - "cpuCores": { - "value": "4" - }, - "memoryInGb": { - "value": "8" - } - } -} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/run.sh b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/run.sh deleted file mode 100644 index 3b8855a95f..0000000000 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/ARMTemplate/run.sh +++ /dev/null @@ -1,2 +0,0 @@ -cd .. -dotnet run -c Release -e ${ENDPOINT} -k ${KEY} -t ${THROUGHPUT} -n ${DOCUMENTS} --pl ${PARALLELISM} --CleanupOnFinish ${CLEANUPFINISH} -w InsertV2BenchmarkOperation \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/README.md b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/README.md new file mode 100644 index 0000000000..cd9ad834fc --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/README.md @@ -0,0 +1,111 @@ +# Running benchmarks on Azure Virtual Machines + +[Azure Arm Template](https://azure.microsoft.com/products/arm-templates/) makes executing the Azure Cosmos DB SDK Benchmark extremely easy. And reaching following abilities: + +- Ability to execute benchmarking on multiple machines with one ARM Template +- Capturing diagnostics data for requests that exceed the latency threshold +- AppInsights: Live metrics (10s) + - Success rate + - Error + - P90, P99, P999, P9999 + +| Parameter name | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | +| projectName | Specifies a name for generating resource names. | +| location | Specifies the location for all resources. | +| adminUsername | Specifies a username for the Virtual Machine. | +| adminPassword | Specifies a password for the Virtual Machine. | +| vmSize | Specifies a Virtual Machine size | +| vNetName | Specifies a Virtual Network name | +| vNetAddressPrefixes | Specifies a Virtual Network Address Prefix | +| vNetSubnetName | Specifies a Virtual Network Subnet name | +| vNetSubnetAddressPrefix | Specifies a Virtual Network Subnet Address Prefix | +| cosmosURI | Specifies the URI of the Cosmos DB account | +| cosmosKey | Specifies the key for the Cosmos DB account | +| throughput | Specifies Collection throughput use | +| operationsCount | Specifies the number of operations to execute | +| parallelism | Specifies the degree of parallelism | +| resultsContainer | Specifies the name of the container to which the results to be saved | +| vmCount | Specifies the number of Virtual Machines that will part of the test bench | +| workloadType | Specifies the workload | +| benchmarkingToolsBranchName | Specifies the GitHub branch for the benchmark tool source code repository | +| diagnosticsLatencyThresholdInMS | Specifies request latency threshold for capturing diagnostic data | +| storageAccountName | Specifies Storage Account Nmae | +| metricsReportingIntervalInSec | Specifies metrics reporting interval in seconds | +| applicationInsightsName | Specifies Application Insights Account Name | +| startDate | Specifies Diagnostic Blob storage container folder prefix | + + [![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-cosmos-dotnet-v3%2Fmaster%2FMicrosoft.Azure.Cosmos.Samples%2FTools%2FBenchmark%2FAzureVmBenchmark%2Fazuredeploy.json) + +After benchmark was launched use Shared Dashboard for viewing charts with + +## Workload types + +| Workload Type | Description | +| ------------------------------------------------------ | ------------------------------------------------------ | +| InsertV3BenchmarkOperation | Inserts single document | +| QueryStreamCrossPkDistinctFullDrainV3BenchmarkOperation | Execute a `DISTINCT` query cross partitions and access data using a steram | +| QueryStreamCrossPkDistinctWithPaginationV3BenchmarkOperation | Execute a `DISTINCT` query cross partitions and access data using a steram and pagination | +| QueryStreamCrossPkGroupByFullDrainV3BenchmarkOperation | Execute a `GROUP BY` query cross partitions and access data using a steram | +| QueryStreamCrossPkGroupByWithPaginationV3BenchmarkOperation | Execute a `GROUP BY` query cross partitions and access data using a steram and pagination | +| QueryStreamCrossPkOrderByFullDrainV3BenchmarkOperation | Execute a `ORDER BY` query cross partitions and access data using a steram | +| QueryStreamCrossPkOrderByWithPaginationV3BenchmarkOperation | Execute a `ORDER BY` query cross partitions and access data using a steram and pagination | +| QueryStreamCrossPkV3BenchmarkOperation | Execute `select * from T where T.id = @id` query cross partitions and access data using a steram | +| QueryStreamCrossPkWithPaginationV3BenchmarkOperation | Execute `select * from T where T.id = @id` query cross partitions and access data using a steram and pagination | +| QueryStreamSinglePkDistinctFullDrainV3BenchmarkOperation | Execute a `DISTINCT` query on a single partition and access data using a steram | +| QueryStreamSinglePkDistinctWithPaginationV3BenchmarkOperation | Execute a `DISTINCT` query on a single partition and access data using a steram and pagination | +| QueryStreamSinglePkGroupByFullDrainV3BenchmarkOperation | Execute a `GROUP BY` query on a single partition and access data using a steram | +| QueryStreamSinglePkGroupByWithPaginationV3BenchmarkOperation | Execute a `GROUP BY` query on a single partition and access data using a steram and pagination | +| QueryStreamSinglePkOrderByFullDrainV3BenchmarkOperation | Execute a `ORDER BY` query on a single partition and access data using a stream | +| QueryStreamSinglePkOrderByWithPaginationV3BenchmarkOperation | Execute a `ORDER BY` query on a single partition and access data using a steram and pagination | +| QueryStreamSinglePkV3BenchmarkOperation | Execute `select * from T where T.id = @id` query on a single partition and access data using a steram | +| QueryStreamSinglePkWithPaginationV3BenchmarkOperation | Execute `select * from T where T.id = @id` query on a single partition and access data using a steram and pagination | +| QueryTCrossPkDistinctFullDrainV3BenchmarkOperation | Execute a `DISTINCT` query cross partitions and access data | +| QueryTCrossPkDistinctWithPaginationV3BenchmarkOperation | Execute a `DISTINCT` query cross partitions and access data using a pagination | +| QueryTCrossPkGroupByFullDrainV3BenchmarkOperation | Execute a `GROUP BY` query cross partitions and access data | +| QueryTCrossPkGroupByWithPaginationV3BenchmarkOperation | Execute a `GROUP BY` query cross partitions and access data using a pagination | +| QueryTCrossPkOrderByFullDrainV3BenchmarkOperation | Execute a `ORDER BY` query cross partitions and access data | +| QueryTCrossPkOrderByWithPaginationV3BenchmarkOperation | Execute a `ORDER BY` query cross partitions and access data using a pagination | +| QueryTCrossPkV3BenchmarkOperation | Execute `select * from T where T.id = @id` query cross partitions partition and access data | +| QueryTCrossPkWithPaginationV3BenchmarkOperation | Execute `select * from T where T.id = @id` query cross partitions partition and access data using a pagination | +| QueryTSinglePkDistinctFullDrainV3BenchmarkOperation | Execute a `DISTINCT` query on a single partition and access data | +| QueryTSinglePkDistinctWithPaginationV3BenchmarkOperation | Execute a `DISTINCT` query on a single partition and access data using a pagination | +| QueryTSinglePkGroupByFullDrainV3BenchmarkOperation | Execute a `GROUP BY` query on a single partition and access data | +| QueryTSinglePkGroupByWithPaginationV3BenchmarkOperation | Execute a `GROUP BY` query on a single partition and access data using a pagination | +| QueryTSinglePkOrderByFullDrainV3BenchmarkOperation | Execute a `ORDER BY` query on a single partition and access data | +| QueryTSinglePkOrderByWithPaginationV3BenchmarkOperation | Execute a `ORDER BY` query on a single partition and access data using a pagination | +| QueryTSinglePkV3BenchmarkOperation | Execute `select * from T where T.id = @id` query on a single partition and access data | +| QueryTSinglePkWithPaginationV3BenchmarkOperation | Execute `select * from T where T.id = @id` query on a single partition and access data using a pagination | +| ReadFeedStreamV3BenchmarkOperation | Execute Read Feed query | +| ReadNotExistsV3BenchmarkOperation | Execute query for not existing item | +| ReadStreamExistsV3BenchmarkOperation | Read item stream | +| ReadStreamExistsWithDiagnosticsV3BenchmarkOperation | Read item stream with diagnostics data | +| ReadTExistsV3BenchmarkOperation | Read single item | + + +## Diagnose and troubleshooting +The Benchmark tool output logs may be found on the each Virtual Machine in user home directory. + +- Connect to VM using serial console +- Enter login and password + +```bash +benchmarking@Benchmarking-dotnet-SDK-vm1:~$ ls + +agent.err agent.out +``` + +```bash +benchmarking@Benchmarking-dotnet-SDK-vm1:~$ cat agent.out + +CSC : warning CS8002: Referenced assembly 'MathNet.Numerics, Version=4.15.0.0, Culture=neutral, PublicKeyToken=null' does not have a strong name. [/var/lib/waagent/custom-script/download/2/azure-cosmos-dotnet-v3/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmark.csproj] +Azure VM Location:eastus +BenchmarkConfig arguments +IsServerGC: True +--------------------------------------------------------------------- +{ + "WorkloadType": "ReadTExistsV3BenchmarkOperation", + "EndPoint": "https://cosmosdb-benchmark-dotnet-test-thr.documents.azure.com:443/", + "Database": "db", + "Container": "data", +``` diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json new file mode 100644 index 0000000000..347857cf82 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json @@ -0,0 +1,1160 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "projectName": { + "type": "string", + "defaultValue": "Benchmarking-dotnet-SDK", + "metadata": { + "description": "Specifies a name for generating resource names." + } + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]", + "metadata": { + "description": "Specifies the location for all resources." + } + }, + "adminUsername": { + "type": "string", + "defaultValue": "benchmarking", + "metadata": { + "description": "Specifies a username for the Virtual Machine." + } + }, + "adminPassword": { + "type": "securestring", + "metadata": { + "description": "Specifies a password for the Virtual Machine." + } + }, + "vmSize": { + "type": "string", + "defaultValue": "Standard_D4s_v3", + "metadata": { + "description": "Specifies a Virtual Machine size" + } + }, + "vNetName": { + "type": "string", + "defaultValue": "Benchmarking-dotnet-SDK-vnet", + "metadata": { + "description": "Specifies a Virtual Network name" + } + }, + "vNetAddressPrefixes": { + "type": "string", + "defaultValue": "10.2.0.0/16", + "metadata": { + "description": "Specifies a Virtual Network Address Prefix" + } + }, + "vNetSubnetName": { + "type": "string", + "defaultValue": "default", + "metadata": { + "description": "Specifies a Virtual Network Subnet name" + } + }, + "vNetSubnetAddressPrefix": { + "type": "string", + "defaultValue": "10.2.0.0/24", + "metadata": { + "description": "Specifies a Virtual Network Subnet Address Prefix " + } + }, + "cosmosURI": { + "type": "string", + "metadata": { + "description": "Specifies the URI of the Cosmos DB account" + } + }, + "cosmosKey": { + "type": "securestring", + "metadata": { + "description": "Specifies the key for the Cosmos DB account" + } + }, + "throughput": { + "type": "int", + "defaultValue": 100000, + "metadata": { + "description": "Specifies Collection throughput use" + } + }, + "operationsCount": { + "type": "int", + "metadata": { + "description": "Specifies the number of operations to execute" + } + }, + "parallelism": { + "type": "int", + "defaultValue": -1, + "metadata": { + "description": "Specifies the degree of parallelism" + } + }, + "resultsContainer": { + "type": "string", + "defaultValue": "BenchmarkResult", + "metadata": { + "description": "Specifies the name of the container to which the results to be saved" + } + }, + "vmCount": { + "type": "int", + "defaultValue": 1, + "metadata": { + "description": "Specifies the number of Virtual Machines that will part of the test bench" + } + }, + "workloadType": { + "type": "string", + "allowedValues": [ + "InsertV3BenchmarkOperation", + "QueryStreamCrossPkDistinctFullDrainV3BenchmarkOperation", + "QueryStreamCrossPkDistinctWithPaginationV3BenchmarkOperation", + "QueryStreamCrossPkGroupByFullDrainV3BenchmarkOperation", + "QueryStreamCrossPkGroupByWithPaginationV3BenchmarkOperation", + "QueryStreamCrossPkOrderByFullDrainV3BenchmarkOperation", + "QueryStreamCrossPkOrderByWithPaginationV3BenchmarkOperation", + "QueryStreamCrossPkV3BenchmarkOperation", + "QueryStreamCrossPkWithPaginationV3BenchmarkOperation", + "QueryStreamSinglePkDistinctFullDrainV3BenchmarkOperation", + "QueryStreamSinglePkDistinctWithPaginationV3BenchmarkOperation", + "QueryStreamSinglePkGroupByFullDrainV3BenchmarkOperation", + "QueryStreamSinglePkGroupByWithPaginationV3BenchmarkOperation", + "QueryStreamSinglePkGroupByWithPaginationV3BenchmarkOperation", + "QueryStreamSinglePkOrderByWithPaginationV3BenchmarkOperation", + "QueryStreamSinglePkV3BenchmarkOperation", + "QueryStreamSinglePkWithPaginationV3BenchmarkOperation", + "QueryTCrossPkDistinctFullDrainV3BenchmarkOperation", + "QueryTCrossPkDistinctWithPaginationV3BenchmarkOperation", + "QueryTCrossPkGroupByFullDrainV3BenchmarkOperation", + "QueryTCrossPkGroupByWithPaginationV3BenchmarkOperation", + "QueryTCrossPkOrderByFullDrainV3BenchmarkOperation", + "QueryTCrossPkOrderByWithPaginationV3BenchmarkOperation", + "QueryTCrossPkV3BenchmarkOperation", + "QueryTCrossPkWithPaginationV3BenchmarkOperation", + "QueryTSinglePkDistinctFullDrainV3BenchmarkOperation", + "QueryTSinglePkDistinctWithPaginationV3BenchmarkOperation", + "QueryTSinglePkGroupByFullDrainV3BenchmarkOperation", + "QueryTSinglePkGroupByWithPaginationV3BenchmarkOperation", + "QueryTSinglePkOrderByFullDrainV3BenchmarkOperation", + "QueryTSinglePkOrderByWithPaginationV3BenchmarkOperation", + "QueryTSinglePkV3BenchmarkOperation", + "QueryTSinglePkWithPaginationV3BenchmarkOperation", + "ReadFeedStreamV3BenchmarkOperation", + "ReadNotExistsV3BenchmarkOperation", + "ReadStreamExistsV3BenchmarkOperation", + "ReadStreamExistsWithDiagnosticsV3BenchmarkOperation", + "ReadTExistsV3BenchmarkOperation" + ], + "defaultValue": "ReadTExistsV3BenchmarkOperation", + "metadata": { + "description": "Specifies the workload" + } + }, + "benchmarkingToolsBranchName": { + "type": "string", + "defaultValue": "master", + "metadata": { + "description": "Specifies the GitHub branch for the benchmark tool source code repository" + } + }, + "diagnosticsLatencyThresholdInMS": { + "type": "int", + "defaultValue": 100 + }, + "storageAccountName": { + "type": "string", + "defaultValue": "dotnetbenchmark", + "metadata": { + "description": "Specifies Storage Account Nmae" + } + }, + "metricsReportingIntervalInSec": { + "type": "int", + "defaultValue": 5 + }, + "applicationInsightsName": { + "type": "string", + "defaultValue": "CosmosDBBenchmarkTestAppInsights", + "metadata": { + "description": "Specifies Application Insights Account Name" + } + }, + "startDate": { + "type": "int", + "defaultValue": "[dateTimeToEpoch(utcNow())]" + }, + "dashboardName": { + "type": "string", + "defaultValue": "Cosmos Benchmark Statistics", + "metadata": { + "description": "Specifies Application Insights Dashboard Name" + } + } + }, + "variables": { + "vmName": "[concat(parameters('projectName'), '-vm')]", + "publicIPAddressName": "[concat(parameters('projectName'), '-ip')]", + "networkInterfaceName": "[concat(parameters('projectName'), '-nic')]", + "networkSecurityGroupName": "[concat(parameters('projectName'), '-nsg')]", + "benchmarkingToolsURL": "https://github.com/Azure/azure-cosmos-dotnet-v3.git", + "cloudInitScriptUrl": "[concat('https://raw.githubusercontent.com/Azure/azure-cosmos-dotnet-v3/',parameters('benchmarkingToolsBranchName'),'/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/system/cloud-init.txt')]", + "vmScriptExtensionScriptUrl": "[concat('https://raw.githubusercontent.com/Azure/azure-cosmos-dotnet-v3/',parameters('benchmarkingToolsBranchName'),'/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/execute.sh')]", + "customScriptUrl": "[concat('https://raw.githubusercontent.com/Azure/azure-cosmos-dotnet-v3/',parameters('benchmarkingToolsBranchName'),'/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/custom-script.sh')]", + "vmScriptExtensionScriptName": "execute.sh", + "convertedDatetime": "[dateTimeFromEpoch(parameters('startDate'))]", + "appInsightsResourceIds": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', resourceGroup().name, '/providers/microsoft.insights/components/', parameters('applicationInsightsName'))]", + "chart0Expression": "[concat('customMetrics\n| where name == \"ReadOperationLatencyInMs\" and timestamp > ago(1d)\n| summarize\n percentile(value, 50),\n percentile(value, 75),\n percentile(value, 90),\n percentile(value, 95)\n by ts = bin(timestamp, ', parameters('metricsReportingIntervalInSec'), 's)\n| render timechart \n\n')]", + "chart1Expression": "[concat('customMetrics\n| where name == \"ReadOperationLatencyInMs\" and timestamp > ago(1d)\n| summarize\n percentile(value, 99),\n percentile(value, 99.9),\n percentile(value, 99.99)\n by ts = bin(timestamp, ', parameters('metricsReportingIntervalInSec'), 's)\n| render timechart \n\n')]", + "chart2Expression": "[concat('customMetrics\n| where name == \"ReadOperationRps\" and timestamp > ago(1d)\n| summarize\n avg(value)\n by ts = bin(timestamp, ', parameters('metricsReportingIntervalInSec'), 's)\n| render timechart \n\n')]" + + }, + "resources": [ + { + "type": "Microsoft.Storage/storageAccounts", + "apiVersion": "2021-04-01", + "name": "[parameters('storageAccountName')]", + "location": "[resourceGroup().location]", + "sku": { + "name": "Standard_LRS" + }, + "kind": "StorageV2", + "properties": { + "accessTier": "Hot" + } + }, + { + "name": "[parameters('applicationInsightsName')]", + "type": "Microsoft.Insights/components", + "apiVersion": "2015-05-01", + "location": "[resourceGroup().location]", + "properties": { + "ApplicationId": "[parameters('applicationInsightsName')]", + "Application_Type": "web" + } + }, + { + "type": "Microsoft.Network/networkSecurityGroups", + "apiVersion": "2020-11-01", + "name": "[variables('networkSecurityGroupName')]", + "location": "[parameters('location')]", + "properties": { + "securityRules": [] + } + }, + { + "type": "Microsoft.Network/publicIPAddresses", + "apiVersion": "2020-11-01", + "name": "[concat(variables('publicIPAddressName'),copyIndex(1))]", + "location": "[parameters('location')]", + "sku": { + "name": "Basic", + "tier": "Regional" + }, + "properties": { + "publicIPAddressVersion": "IPv4", + "publicIPAllocationMethod": "Dynamic", + "idleTimeoutInMinutes": 4 + }, + "copy": { + "name": "publicIPcopy", + "count": "[parameters('vmCount')]" + } + }, + { + "type": "Microsoft.Network/virtualNetworks", + "apiVersion": "2020-11-01", + "name": "[parameters('vNetName')]", + "location": "[parameters('location')]", + "properties": { + "addressSpace": { + "addressPrefixes": [ + "[parameters('vNetAddressPrefixes')]" + ] + }, + "subnets": [ + { + "name": "[parameters('vNetSubnetName')]", + "properties": { + "addressPrefix": "[parameters('vNetSubnetAddressPrefix')]", + "privateEndpointNetworkPolicies": "Enabled", + "privateLinkServiceNetworkPolicies": "Enabled" + } + } + ], + "enableDdosProtection": false + } + }, + { + "type": "Microsoft.Network/virtualNetworks/subnets", + "apiVersion": "2020-11-01", + "name": "[concat(parameters('vNetName'), '/',parameters('vNetSubnetName'))]", + "dependsOn": [ + "[resourceId('Microsoft.Network/virtualNetworks', parameters('vNetName'))]", + "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" + ], + "properties": { + "addressPrefix": "[parameters('vNetSubnetAddressPrefix')]", + "privateEndpointNetworkPolicies": "Enabled", + "privateLinkServiceNetworkPolicies": "Enabled", + "networkSecurityGroup": { + "id": "[resourceId('Microsoft.Network/networkSecurityGroups', variables('networkSecurityGroupName'))]" + } + } + }, + { + "type": "Microsoft.Network/networkInterfaces", + "apiVersion": "2020-11-01", + "name": "[concat(variables('networkInterfaceName'),copyIndex(1))]", + "location": "[parameters('location')]", + "dependsOn": [ + "[resourceId('Microsoft.Network/publicIPAddresses', concat(variables('publicIPAddressName'),copyIndex(1)))]", + "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vNetName'), parameters('vNetSubnetName'))]" + ], + "properties": { + "ipConfigurations": [ + { + "name": "ipconfig1", + "properties": { + "privateIPAddress": "10.0.0.4", + "privateIPAllocationMethod": "Dynamic", + "publicIPAddress": { + "id": "[resourceId('Microsoft.Network/publicIPAddresses', concat(variables('publicIPAddressName'),copyIndex(1)))]" + }, + "subnet": { + "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('vNetName'), parameters('vNetSubnetName'))]" + }, + "primary": true, + "privateIPAddressVersion": "IPv4" + } + } + ], + "enableAcceleratedNetworking": true, + "enableIPForwarding": false + }, + "copy": { + "name": "networkInterfacecopy", + "count": "[parameters('vmCount')]" + } + }, + { + "type": "Microsoft.Compute/virtualMachines", + "apiVersion": "2021-11-01", + "name": "[concat(variables('vmName'),copyIndex(1))]", + "location": "[parameters('location')]", + "dependsOn": [ + "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('networkInterfaceName'),copyIndex(1)))]", + "[concat('Microsoft.Storage/storageAccounts/', parameters('storageAccountName'))]", + "[resourceId('Microsoft.Insights/components', parameters('applicationInsightsName'))]" + ], + "tags": { + "azsecpack": "prod", + "platformsettings.host_environment.service.platform_optedin_for_rootcerts": "true" + }, + "properties": { + "hardwareProfile": { + "vmSize": "[parameters('vmSize')]" + }, + "storageProfile": { + "imageReference": { + "publisher": "canonical", + "offer": "0001-com-ubuntu-server-focal", + "sku": "20_04-lts-gen2", + "version": "latest" + }, + "osDisk": { + "osType": "Linux", + "name": "[concat(variables('vmName'),copyIndex(1),'_OsDisk')]", + "createOption": "FromImage", + "caching": "ReadWrite", + "managedDisk": { + "storageAccountType": "Premium_LRS" + }, + "deleteOption": "Delete", + "diskSizeGB": 30 + } + }, + "osProfile": { + "computerName": "[concat(variables('vmName'),copyIndex(1))]", + "adminUsername": "[parameters('adminUsername')]", + "adminPassword": "[parameters('adminPassword')]", + "customData": "[base64(concat('#include\n',variables('cloudInitScriptUrl')))]", + "linuxConfiguration": { + "disablePasswordAuthentication": false, + "provisionVMAgent": true, + "patchSettings": { + "patchMode": "ImageDefault", + "assessmentMode": "ImageDefault" + } + }, + "allowExtensionOperations": true + }, + "networkProfile": { + "networkInterfaces": [ + { + "id": "[resourceId('Microsoft.Network/networkInterfaces', concat(variables('networkInterfaceName'),copyIndex(1)))]", + "properties": { + "deleteOption": "Delete" + } + } + ] + }, + "diagnosticsProfile": { + "bootDiagnostics": { + "enabled": true + } + } + }, + "copy": { + "name": "vmcopy", + "count": "[parameters('vmCount')]" + } + }, + { + "type": "Microsoft.Compute/virtualMachines/extensions", + "apiVersion": "2019-03-01", + "name": "[concat(variables('vmName'),copyIndex(1),'/CustomScript')]", + "location": "[parameters('location')]", + "dependsOn": [ + "[resourceId('Microsoft.Compute/virtualMachines', concat(variables('vmName'),copyIndex(1)))]" + ], + "properties": { + "publisher": "Microsoft.Azure.Extensions", + "type": "CustomScript", + "typeHandlerVersion": "2.1", + "autoUpgradeMinorVersion": true, + "settings": { + }, + "protectedSettings": { + "commandToExecute": "[concat('ADMIN_USER_NAME=',parameters('adminUsername'),' ','BENCHMARKING_TOOLS_URL=',variables('benchmarkingToolsURL'),' ','BENCHMARKING_TOOLS_BRANCH_NAME=',parameters('benchmarkingToolsBranchName'),' ','WORKLOAD_TYPE=',parameters('workloadType'),' ','VM_NAME=',variables('vmName'),copyIndex(1), ' ','DIAGNOSTICS_STORAGE_CONNECTION_STRING=','\"',concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value),'\"',' ','COSMOS_URI=','\"',parameters('cosmosURI'),'\"', ' ', 'COSMOS_KEY=',parameters('cosmosKey'), ' ', 'THROUGHPUT=',parameters('throughput'), ' ', 'DOCUMENTS=',parameters('operationsCount'), ' ','PARALLELISM=',parameters('parallelism'), ' ','RESULTS_CONTAINER=',parameters('resultsContainer'), ' ','VM_COUNT=',parameters('vmCount'), ' ','DIAGNOSTICS_LATENCY_THRESHOLD_IN_MS=',parameters('diagnosticsLatencyThresholdInMS'),' ','DIAGNOSTICS_STORAGE_CONTAINER_PREFIX=',variables('convertedDatetime'),' ','METRICS_REPORTINT_INTERVAL_SEC=',parameters('metricsReportingIntervalInSec'), ' ','CUSTOM_SCRIPT_URL=',variables('customScriptUrl'), ' ','MACHINE_INDEX=',copyIndex(1), ' ','APP_INSIGHT_CONN_STR=','\"', reference(resourceId('Microsoft.Insights/components', parameters('applicationInsightsName'))).ConnectionString,'\"',' ', 'bash ',variables('vmScriptExtensionScriptName'))]", + "fileUris": [ "[concat(variables('vmScriptExtensionScriptURL'))]" ] + } + }, + "copy": { + "name": "vmextensioncopy", + "count": "[parameters('vmCount')]" + } + }, + { + "name": "CosmosDBBenchmarkDashboard", + "type": "Microsoft.Portal/dashboards", + "location": "[resourceGroup().location]", + "apiVersion": "2015-08-01-preview", + "dependsOn": [ + "[resourceId('Microsoft.Insights/components', parameters('applicationInsightsName'))]" + ], + "tags": { + "hidden-title": "[parameters('dashboardName')]" + }, + + "properties": { + "lenses": { + "0": { + "order": 0, + "parts": { + "0": { + "position": { + "x": 0, + "y": 0, + "colSpan": 10, + "rowSpan": 6 + }, + "metadata": { + "inputs": [ + { + "name": "resourceTypeMode", + "isOptional": true + }, + { + "name": "ComponentId", + "isOptional": true + }, + { + "name": "Scope", + "value": { + "resourceIds": [ + "[variables('appInsightsResourceIds')]" + ] + }, + "isOptional": true + }, + { + "name": "PartId", + "value": "104528fc-0216-49c6-bf70-fffe9d37f93d", + "isOptional": true + }, + { + "name": "Version", + "value": "2.0", + "isOptional": true + }, + { + "name": "TimeRange", + "isOptional": true + }, + { + "name": "DashboardId", + "isOptional": true + }, + { + "name": "DraftRequestParameters", + "isOptional": true + }, + { + "name": "Query", + "value": "[variables('chart0Expression')]", + "isOptional": true + }, + { + "name": "ControlType", + "value": "FrameControlChart", + "isOptional": true + }, + { + "name": "SpecificChart", + "value": "Line", + "isOptional": true + }, + { + "name": "PartTitle", + "value": "Request latencies P50, P75, P90, P95 in ms", + "isOptional": true + }, + { + "name": "PartSubTitle", + "value": "A Latency Percentiles dashboard provides a concise overview of the distribution of response times or latencies for a system or application. It helps monitor and analyze the performance of the system, identify bottlenecks or outliers, and ensure optimal user experience.", + "isOptional": true + }, + { + "name": "Dimensions", + "value": { + "xAxis": { + "name": "ts", + "type": "datetime" + }, + "yAxis": [ + { + "name": "percentile_value_50", + "type": "real" + }, + { + "name": "percentile_value_75", + "type": "real" + }, + { + "name": "percentile_value_90", + "type": "real" + }, + { + "name": "percentile_value_95", + "type": "real" + } + ], + "splitBy": [], + "aggregation": "Sum" + }, + "isOptional": true + }, + { + "name": "LegendOptions", + "value": { + "isEnabled": true, + "position": "Bottom" + }, + "isOptional": true + }, + { + "name": "IsQueryContainTimeRange", + "value": true, + "isOptional": true + } + ], + "type": "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart", + "settings": { + "content": { + "Dimensions": { + "xAxis": { + "name": "ts", + "type": "datetime" + }, + "yAxis": [ + { + "name": "percentile_value_50", + "type": "real" + }, + { + "name": "percentile_value_75", + "type": "real" + }, + { + "name": "percentile_value_90", + "type": "real" + }, + { + "name": "percentile_value_95", + "type": "real" + } + ], + "splitBy": [], + "aggregation": "Sum" + }, + "IsQueryContainTimeRange": true + } + } + } + }, + "1": { + "position": { + "x": 10, + "y": 0, + "colSpan": 10, + "rowSpan": 6 + }, + "metadata": { + "inputs": [ + { + "name": "resourceTypeMode", + "isOptional": true + }, + { + "name": "ComponentId", + "isOptional": true + }, + { + "name": "Scope", + "value": { + "resourceIds": [ + "[variables('appInsightsResourceIds')]" + ] + }, + "isOptional": true + }, + { + "name": "PartId", + "value": "104528fc-0216-49c6-bf70-fffe9d37f93e", + "isOptional": true + }, + { + "name": "Version", + "value": "2.0", + "isOptional": true + }, + { + "name": "TimeRange", + "isOptional": true + }, + { + "name": "DashboardId", + "isOptional": true + }, + { + "name": "DraftRequestParameters", + "isOptional": true + }, + { + "name": "Query", + "value": "[variables('chart1Expression')]", + "isOptional": true + }, + { + "name": "ControlType", + "value": "FrameControlChart", + "isOptional": true + }, + { + "name": "SpecificChart", + "value": "Line", + "isOptional": true + }, + { + "name": "PartTitle", + "value": "Request latencies P99, P99.9, P99.99 in ms", + "isOptional": true + }, + { + "name": "PartSubTitle", + "value": "A Latency Percentiles dashboard provides a concise overview of the distribution of response times or latencies for a system or application. It helps monitor and analyze the performance of the system, identify bottlenecks or outliers, and ensure optimal user experience.", + "isOptional": true + }, + { + "name": "Dimensions", + "value": { + "xAxis": { + "name": "ts", + "type": "datetime" + }, + "yAxis": [ + { + "name": "percentile_value_99", + "type": "real" + }, + { + "name": "percentile_value_99_9", + "type": "real" + }, + { + "name": "percentile_value_99_99", + "type": "real" + } + ], + "splitBy": [], + "aggregation": "Sum" + }, + "isOptional": true + }, + { + "name": "LegendOptions", + "value": { + "isEnabled": true, + "position": "Bottom" + }, + "isOptional": true + }, + { + "name": "IsQueryContainTimeRange", + "value": true, + "isOptional": true + } + ], + "type": "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart", + "settings": {} + } + }, + "2": { + "position": { + "x": 0, + "y": 6, + "colSpan": 5, + "rowSpan": 6 + }, + "metadata": { + "inputs": [ + { + "name": "resourceTypeMode", + "isOptional": true + }, + { + "name": "ComponentId", + "isOptional": true + }, + { + "name": "Scope", + "value": { + "resourceIds": [ + "[variables('appInsightsResourceIds')]" + ] + }, + "isOptional": true + }, + { + "name": "PartId", + "value": "104528fc-0216-49c6-bf70-fffe9d37f93e", + "isOptional": true + }, + { + "name": "Version", + "value": "2.0", + "isOptional": true + }, + { + "name": "TimeRange", + "isOptional": true + }, + { + "name": "DashboardId", + "isOptional": true + }, + { + "name": "DraftRequestParameters", + "isOptional": true + }, + { + "name": "Query", + "value": "customMetrics\n| where name == \"ReadOperationFailure\" and timestamp > ago(1d)\n| summarize\n sum(value)\n by ts = bin(timestamp, 1s)\n | render timechart\n", + "isOptional": true + }, + { + "name": "ControlType", + "value": "FrameControlChart", + "isOptional": true + }, + { + "name": "SpecificChart", + "value": "Line", + "isOptional": true + }, + { + "name": "PartTitle", + "value": "Failed operations", + "isOptional": true + }, + { + "name": "PartSubTitle", + "value": "Provides the number of failed operations. (most likely related to some error or inavailability)", + "isOptional": true + }, + { + "name": "Dimensions", + "value": { + "xAxis": { + "name": "ts", + "type": "datetime" + }, + "yAxis": [ + { + "name": "sum_value", + "type": "real" + } + ], + "splitBy": [], + "aggregation": "Sum" + }, + "isOptional": true + }, + { + "name": "LegendOptions", + "value": { + "isEnabled": true, + "position": "Bottom" + }, + "isOptional": true + }, + { + "name": "IsQueryContainTimeRange", + "value": true, + "isOptional": true + } + ], + "type": "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart", + "settings": { + "content": { + "Query": "customMetrics\n| where name == \"ReadOperationFailure\" and timestamp > ago(1d)\n| summarize\n sum(value)\n by ts = bin(timestamp, 1s)\n | render timechart\n\n", + "Dimensions": { + "xAxis": { + "name": "ts", + "type": "datetime" + }, + "yAxis": [ + { + "name": "sum_value", + "type": "real" + } + ], + "splitBy": [], + "aggregation": "Sum" + } + } + } + } + }, + "3": { + "position": { + "x": 5, + "y": 6, + "colSpan": 5, + "rowSpan": 6 + }, + "metadata": { + "inputs": [ + { + "name": "resourceTypeMode", + "isOptional": true + }, + { + "name": "ComponentId", + "isOptional": true + }, + { + "name": "Scope", + "value": { + "resourceIds": [ + "[variables('appInsightsResourceIds')]" + ] + }, + "isOptional": true + }, + { + "name": "PartId", + "value": "104528fc-0216-49c6-bf70-fffe9d37f93e", + "isOptional": true + }, + { + "name": "Version", + "value": "2.0", + "isOptional": true + }, + { + "name": "TimeRange", + "isOptional": true + }, + { + "name": "DashboardId", + "isOptional": true + }, + { + "name": "DraftRequestParameters", + "isOptional": true + }, + { + "name": "Query", + "value": "customMetrics\n| where name == \"ReadOperationSuccess\" and timestamp > ago(1d)\n| summarize\n sum(value)\n by ts = bin(timestamp, 1s)\n | render timechart\n", + "isOptional": true + }, + { + "name": "ControlType", + "value": "FrameControlChart", + "isOptional": true + }, + { + "name": "SpecificChart", + "value": "Line", + "isOptional": true + }, + { + "name": "PartTitle", + "value": "Success operations", + "isOptional": true + }, + { + "name": "PartSubTitle", + "value": "Provides the number of successful operations.", + "isOptional": true + }, + { + "name": "Dimensions", + "value": { + "xAxis": { + "name": "ts", + "type": "datetime" + }, + "yAxis": [ + { + "name": "sum_value", + "type": "real" + } + ], + "splitBy": [], + "aggregation": "Sum" + }, + "isOptional": true + }, + { + "name": "LegendOptions", + "value": { + "isEnabled": true, + "position": "Bottom" + }, + "isOptional": true + }, + { + "name": "IsQueryContainTimeRange", + "value": true, + "isOptional": true + } + ], + "type": "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart", + "settings": { + "content": { + "Query": "customMetrics\n| where name == \"ReadOperationSuccess\" and timestamp > ago(1d)\n| summarize\n sum(value)\n by ts = bin(timestamp, 1s)\n | render timechart\n\n", + "Dimensions": { + "xAxis": { + "name": "ts", + "type": "datetime" + }, + "yAxis": [ + { + "name": "sum_value", + "type": "real" + } + ], + "splitBy": [], + "aggregation": "Sum" + } + } + } + } + }, + "4": { + "position": { + "x": 10, + "y": 6, + "colSpan": 10, + "rowSpan": 6 + }, + "metadata": { + "inputs": [ + { + "name": "resourceTypeMode", + "isOptional": true + }, + { + "name": "ComponentId", + "isOptional": true + }, + { + "name": "Scope", + "value": { + "resourceIds": [ + "[variables('appInsightsResourceIds')]" + ] + }, + "isOptional": true + }, + { + "name": "PartId", + "value": "104528fc-0216-49c6-bf70-fffe9d37f93e", + "isOptional": true + }, + { + "name": "Version", + "value": "2.0", + "isOptional": true + }, + { + "name": "TimeRange", + "isOptional": true + }, + { + "name": "DashboardId", + "isOptional": true + }, + { + "name": "DraftRequestParameters", + "isOptional": true + }, + { + "name": "Query", + "value": "[variables('chart2Expression')]", + "isOptional": true + }, + { + "name": "ControlType", + "value": "FrameControlChart", + "isOptional": true + }, + { + "name": "SpecificChart", + "value": "Line", + "isOptional": true + }, + { + "name": "PartTitle", + "value": "Requests per Second (RPS)", + "isOptional": true + }, + { + "name": "PartSubTitle", + "value": "A Requests per Second (RPS) dashboard provides a concise overview of the number of requests being processed by a system or application per second.", + "isOptional": true + }, + { + "name": "Dimensions", + "value": { + "xAxis": { + "name": "ts", + "type": "datetime" + }, + "yAxis": [ + { + "name": "RPs", + "type": "real" + } + ], + "splitBy": [], + "aggregation": "Sum" + }, + "isOptional": true + }, + { + "name": "LegendOptions", + "value": { + "isEnabled": true, + "position": "Bottom" + }, + "isOptional": true + }, + { + "name": "IsQueryContainTimeRange", + "value": true, + "isOptional": true + } + ], + "type": "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart", + "settings": { + "content": { + "Dimensions": { + "xAxis": { + "name": "ts", + "type": "datetime" + }, + "yAxis": [ + { + "name": "avg_value", + "type": "real" + } + ], + "splitBy": [], + "aggregation": "Sum" + }, + "IsQueryContainTimeRange": false + } + } + } + } + } + } + }, + "metadata": { + "model": { + "timeRange": { + "value": { + "relative": { + "duration": 24, + "timeUnit": 1 + } + }, + "type": "MsPortalFx.Composition.Configuration.ValueTypes.TimeRange" + }, + "filterLocale": { + "value": "en-us" + }, + "filters": { + "value": { + "MsPortalFx_TimeRange": { + "model": { + "format": "utc", + "granularity": "auto", + "relative": "24h" + }, + "displayCache": { + "name": "UTC Time", + "value": "Past 24 hours" + }, + "filteredPartIds": [ + "StartboardPart-LogsDashboardPart-6d2eff36-636b-406d-8390-12e2135e700a", + "StartboardPart-LogsDashboardPart-6d2eff36-636b-406d-8390-12e2135e700c", + "StartboardPart-LogsDashboardPart-6d2eff36-636b-406d-8390-12e2135e700d", + "StartboardPart-LogsDashboardPart-6d2eff36-636b-406d-8390-12e2135e700e", + "StartboardPart-LogsDashboardPart-6d2eff36-636b-406d-8390-12e2135e700f" + ] + } + } + } + } + } + } + } + ], + "outputs": { + "results": { + "type": "string", + "value": "The Benchmarking job has been triggered successfully. Please check the storage account you provided for Job Status and Results. The jobs status will be available in a storage table within a few minutes and results will be available once the job finishes." + } + } +} diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/custom-script.sh b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/custom-script.sh new file mode 100644 index 0000000000..2b41d4d0e4 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/custom-script.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +#Cloning Test Bench Repo +echo "########## Cloning Test Bench repository ##########" +git clone https://github.com/Azure/azure-cosmos-dotnet-v3.git + +# Build Benchmark Project +cd 'azure-cosmos-dotnet-v3/' +git checkout ${BENCHMARKING_TOOLS_BRANCH_NAME} + +cd 'Microsoft.Azure.Cosmos.Samples/Tools/Benchmark' + +echo "########## Build benckmark tool ##########" +dotnet build --configuration Release -p:"OSSProjectRef=true;ShouldUnsetParentConfigurationAndPlatform=false" + +echo "########## Run benchmark ##########" +nohup dotnet run -c Release -e ${COSMOS_URI} -k ${COSMOS_KEY} -t ${THROUGHPUT} -n ${DOCUMENTS} --pl ${PARALLELISM} \ +--enablelatencypercentiles true --resultscontainer ${RESULTS_CONTAINER} --resultspartitionkeyvalue "pk" \ +--DiagnosticsStorageConnectionString ${DIAGNOSTICS_STORAGE_CONNECTION_STRING} \ +--DiagnosticLatencyThresholdInMs ${DIAGNOSTICS_LATENCY_THRESHOLD_IN_MS} \ +--DiagnosticsStorageContainerPrefix ${DIAGNOSTICS_STORAGE_CONTAINER_PREFIX} \ +--MetricsReportingIntervalInSec ${METRICS_REPORTINT_INTERVAL_SEC} \ +--AppInsightsConnectionString ${APP_INSIGHT_CONN_STR} \ +-w ${WORKLOAD_TYPE} \ +> "/home/${ADMIN_USER_NAME}/agent.out" 2> "/home/${ADMIN_USER_NAME}/agent.err" & diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/execute.sh b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/execute.sh new file mode 100644 index 0000000000..cf86202002 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/execute.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +export DOTNET_CLI_HOME=/temp + +cloud-init status --wait +curl -o custom-script.sh $CUSTOM_SCRIPT_URL +bash -x custom-script.sh \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/system/cloud-init.txt b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/system/cloud-init.txt new file mode 100644 index 0000000000..6821dcaa15 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/system/cloud-init.txt @@ -0,0 +1,16 @@ +#cloud-config +package_upgrade: true +packages: + - azure-cli + +runcmd: + - wget https://aka.ms/downloadazcopy-v10-linux + - tar -xvf downloadazcopy-v10-linux + - sudo cp ./azcopy_linux_amd64_*/azcopy /usr/bin/ + - wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb + - sudo dpkg -i packages-microsoft-prod.deb + - sudo apt update + - sudo apt install apt-transport-https -y + - sudo apt install dotnet-sdk-6.0 -y + - sudo apt install dotnet-runtime-6.0 + - sudo apt-get install git \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs index f5ff091b28..f69c305096 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs @@ -126,6 +126,16 @@ public class BenchmarkConfig [Option(Required = false, HelpText = "Container to publish results to")] public string ResultsContainer { get; set; } = "runsummary"; + + [Option(Required = false, HelpText = "Request latency threshold for capturing diagnostic data")] + public int DiagnosticLatencyThresholdInMs { get; set; } = 100; + + [Option(Required = false, HelpText = "Blob storage account connection string")] + [JsonIgnore] + public string DiagnosticsStorageConnectionString { get; set; } + + [Option(Required = false, HelpText = "Blob storage container folder prefix")] + public string DiagnosticsStorageContainerPrefix { get; set; } [Option(Required = false, HelpText = "Metrics reporting interval in seconds")] public int MetricsReportingIntervalInSec { get; set; } = 5; diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkLatencyEventSource.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkLatencyEventSource.cs index 309eb58c15..5a945d21da 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkLatencyEventSource.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkLatencyEventSource.cs @@ -36,9 +36,10 @@ public void LatencyDiagnostics( string dbName, string containerName, int durationInMs, - Func lazyDiagnostics) + Func lazyDiagnostics, + int latencyThreshold) { - if (durationInMs > BenchmarkLatencyEventSource.TraceLatencyThreshold + if (durationInMs > latencyThreshold && this.IsEnabled()) { this.WriteEvent(1, dbName, containerName, durationInMs, lazyDiagnostics()); diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkProgress.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkProgress.cs new file mode 100644 index 0000000000..6a7650a5cd --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkProgress.cs @@ -0,0 +1,50 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace CosmosBenchmark +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + using System.Threading.Tasks; + using Newtonsoft.Json; + + /// + /// Represents a class that is used as an item in CosmosDB to track benchmark progress. + /// + public class BenchmarkProgress + { + + /// + /// Record item id + /// + [JsonProperty] + public string id { get; set; } + + /// + /// Machine name + /// + [JsonProperty] + public string MachineName { get; set; } + + /// + /// Job status STARTED|COMPLETED + /// + [JsonProperty] + public string JobStatus { get; set; } + + /// + /// Job start time . + /// + [JsonProperty] + public DateTime JobStartTime { get; set; } + + /// + /// Job end time . + /// + [JsonProperty] + public DateTime JobEndTime { get; set; } + + } +} diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmark.csproj b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmark.csproj index 2506e48102..073e8daa7a 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmark.csproj +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmark.csproj @@ -17,6 +17,7 @@ + diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/DiagnosticDataListener.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/DiagnosticDataListener.cs new file mode 100644 index 0000000000..1171a05faa --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/DiagnosticDataListener.cs @@ -0,0 +1,224 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace CosmosBenchmark.Fx +{ + using System; + using System.Collections.Generic; + using System.Diagnostics.Tracing; + using System.IO; + using System.Threading; + using System.Threading.Tasks; + using Azure.Storage.Blobs; + + public class DiagnosticDataListener : EventListener + { + /// + /// A constant string representing the container name in Azure Blob Storage. + /// + private const string BlobContainerName = "diagnostics"; + + /// + /// A constant string representing the diagnostics file path. + /// + public const string DiagnosticsFileName = "BenchmarkDiagnostics.out"; + + /// + /// A constant int representing the maximum file size. + /// + private readonly int MaxDIagnosticFileSize = 100_000_000; + + /// + /// A constant int representing the interval at which the file size is checked. + /// + private readonly TimeSpan FileSizeCheckInterval = TimeSpan.FromSeconds(5); + + /// + /// string representing filename prefix in blob storage + /// + private readonly string BlobPrefix = $"{Environment.MachineName}/{Environment.MachineName}"; + + /// + /// Number of files + /// + private int filesCount = 0; + + /// + /// Represents a Blob storage container client instance + /// + private readonly Lazy BlobContainerClient; + + /// + /// Represents a Benchmark Configs + /// + private readonly BenchmarkConfig config; + + /// + /// Current diagnostics optput StreamWriter + /// + private volatile TextWriter Writer; + + /// + /// Current diagnostics optput filename + /// + public volatile string WriterFileName; + + /// + /// List of all previously opened StreamWriters + /// should be stored for later closing, as they may be + /// concurrently accessed by other threads for appending to a file. + /// + private readonly List TextWriters = new List(); + + /// + /// Represents a class that performs writing diagnostic data to a file and uploading it to Azure Blob Storage + /// + public DiagnosticDataListener(BenchmarkConfig config) + { + this.config = config; + this.EnableEvents(BenchmarkLatencyEventSource.Instance, EventLevel.Informational); + this.BlobContainerClient = new Lazy(() => this.GetBlobServiceClient()); + this.Writer = TextWriter.Synchronized(File.AppendText(DiagnosticsFileName)); + this.WriterFileName = DiagnosticsFileName; + + /// + /// Checks the file size every milliseconds for diagnostics and creates a new one if the maximum limit is exceeded. + /// + ThreadPool.QueueUserWorkItem(async state => + { + while (true) + { + try + { + if (File.Exists(this.WriterFileName)) + { + FileInfo fileInfo = new FileInfo(this.WriterFileName); + long fileSize = fileInfo.Length; + + if (fileSize > this.MaxDIagnosticFileSize) + { + string newFilePath = Path.Combine(fileInfo.DirectoryName, $"{DiagnosticsFileName}-{this.filesCount}"); + + File.Create(newFilePath).Close(); + + this.TextWriters.Add(this.Writer); + + this.Writer = TextWriter.Synchronized(File.AppendText($"{newFilePath}")); + this.WriterFileName = newFilePath; + this.filesCount++; + + Utility.TeeTraceInformation("File size exceeded 100MB. Created a new one."); + } + } + + await Task.Delay(this.FileSizeCheckInterval); + + this.CloseStreamWriters(); + } + catch (Exception ex) + { + Utility.TraceError("Exception in file size check loop", ex); + } + } + }); + } + + + /// + /// Listening for events generated by BenchmarkLatencyEventSource + /// + /// An instance of containing the request latency and diagnostics. + protected override void OnEventWritten(EventWrittenEventArgs eventData) + { + try + { + this.Writer.WriteLine($"{eventData.Payload[2]} ; {eventData.Payload[3]}"); + } + catch (Exception ex) + { + Utility.TraceError("An exception ocured while writing diagnostic data to the file", ex); + } + } + + /// + /// Uploading all files with diagnostic data to blob storage + /// + public void UploadDiagnostcs() + { + Utility.TeeTraceInformation("Uploading diagnostics"); + string[] diagnosticFiles = Directory.GetFiles(".", $"{DiagnosticsFileName}*"); + string containerPrefix = this.config.DiagnosticsStorageContainerPrefix; + + this.CloseStreamWriters(); + this.SafeCloseCurrentStreamWriter(); + + BlobContainerClient blobContainerClient = this.BlobContainerClient.Value; + for (int i = 0; i < diagnosticFiles.Length; i++) + { + try + { + string diagnosticFile = diagnosticFiles[i]; + Utility.TeeTraceInformation($"Uploading {i + 1} of {diagnosticFiles.Length} file: {diagnosticFile} "); + + string blobName = string.IsNullOrEmpty(containerPrefix) ? + $"{this.BlobPrefix}-{i}.out" : $"{containerPrefix}/{this.BlobPrefix}-{i}.out"; + + BlobClient blobClient = blobContainerClient.GetBlobClient(blobName); + + blobClient.Upload(diagnosticFile, overwrite: true); + } + catch (Exception ex) + { + Utility.TraceError($"An exception ocured while uploading file {this.WriterFileName} to the blob storage", ex); + } + } + } + + /// + /// Closes all unclosed StreamWriters + /// + private void CloseStreamWriters() + { + + this.TextWriters.ForEach(t => + { + try + { + t.Close(); + } + catch (Exception ex) + { + Utility.TraceError("An exception ocured while closing StreamWriters", ex); + } + }); + } + + /// + /// Safe close current StreamWriter + /// + private void SafeCloseCurrentStreamWriter() + { + try + { + this.Writer.Close(); + } + catch (Exception ex) + { + Utility.TraceError("An exception ocured while closing StreamWriters.", ex); + } + } + + /// + /// Creating an instance of BlobClient using configs + /// + private BlobContainerClient GetBlobServiceClient() + { + BlobContainerClient blobContainerClient = new BlobContainerClient( + this.config.DiagnosticsStorageConnectionString, + BlobContainerName); + blobContainerClient.CreateIfNotExists(); + return blobContainerClient; + } + } +} diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollector.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollector.cs index 866e400870..1676dd0052 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollector.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollector.cs @@ -107,7 +107,7 @@ public MetricsCollector(Meter meter, string prefix) this.successOperationCounter = meter.CreateCounter($"{prefix}OperationSuccess"); this.failureOperationCounter = meter.CreateCounter($"{prefix}OperationFailure"); - + this.latencyInMsMetricNameGauge = this.meter.CreateObservableGauge($"{prefix}OperationLatencyInMs", () => new Measurement(this.latencyInMs)); @@ -140,25 +140,25 @@ public void CollectMetricsOnFailure() /// /// Records success operation latency in milliseconds. /// - /// The number of milliseconds to record. + /// The number of milliseconds to record. public void RecordSuccessOpLatencyAndRps( TimeSpan timeSpan) { - this.rps = 1000 / timeSpan.Milliseconds; - this.latencyInMs = timeSpan.Milliseconds; + this.rps = timeSpan.TotalMilliseconds != 0 ? 1000 / timeSpan.TotalMilliseconds : 0; + this.latencyInMs = timeSpan.TotalMilliseconds; this.rpsMetricNameHistogram.Record(this.rps); this.operationLatencyHistogram.Record(this.latencyInMs); } - + /// /// Records failed operation latency in milliseconds. /// - /// The number of milliseconds to record. + /// The number of milliseconds to record. public void RecordFailedOpLatencyAndRps( TimeSpan timeSpan) { - this.rpsFailed = 1000 / timeSpan.Milliseconds; - this.latencyFailedInMs = timeSpan.Milliseconds; + this.rpsFailed = timeSpan.TotalMilliseconds != 0 ? 1000 / timeSpan.TotalMilliseconds : 0; + this.latencyFailedInMs = timeSpan.TotalMilliseconds; this.rpsFailedMetricNameHistogram.Record(this.rpsFailed); this.operationFailedLatencyHistogram.Record(this.latencyFailedInMs); } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollectorProvider.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollectorProvider.cs index 4de7009be1..f49d9ec571 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollectorProvider.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollectorProvider.cs @@ -6,6 +6,8 @@ namespace CosmosBenchmark { using System; using System.Diagnostics.Metrics; + using System.Threading; + using System.Threading.Tasks; using OpenTelemetry.Metrics; /// @@ -13,7 +15,10 @@ namespace CosmosBenchmark /// internal class MetricsCollectorProvider { - private readonly MetricCollectionWindow metricCollectionWindow; + private const int WindowCheckInterval = 10; + private MetricCollectionWindow metricCollectionWindow; + + private static readonly object metricCollectionWindowLock = new object(); private readonly MetricsCollector insertOperationMetricsCollector; @@ -36,6 +41,38 @@ public MetricsCollectorProvider(BenchmarkConfig config, MeterProvider meterProvi this.queryOperationMetricsCollector ??= new MetricsCollector(this.queryOperationMeter, "Query"); this.readOperationMetricsCollector ??= new MetricsCollector(this.readOperationMeter, "Read"); this.metricCollectionWindow ??= new MetricCollectionWindow(config); + + /// + /// Flush metrics every + /// + ThreadPool.QueueUserWorkItem(async state => + { + while (true) + { + MetricCollectionWindow metricCollectionWindow = this.GetCurrentMetricCollectionWindow(config); + + // Reset metricCollectionWindow and flush. + if (!metricCollectionWindow.IsValid) + { + this.meterProvider.ForceFlush(); + this.metricCollectionWindow.Reset(config); + } + await Task.Delay(TimeSpan.FromMilliseconds(MetricsCollectorProvider.WindowCheckInterval)); + } + }); + } + + private MetricCollectionWindow GetCurrentMetricCollectionWindow(BenchmarkConfig config) + { + if (this.metricCollectionWindow is null || !this.metricCollectionWindow.IsValid) + { + lock (metricCollectionWindowLock) + { + this.metricCollectionWindow ??= new MetricCollectionWindow(config); + } + } + + return this.metricCollectionWindow; } /// /// The response headers - /// The encoding of the IndexMetrics response + /// The encoding of the IndexMetrics response /// Lazy implementation of the pretty-printed IndexMetrics - static internal Lazy DecodeIndexMetrics(Headers responseMessageHeaders, bool isBse64Encoded) + static internal Lazy DecodeIndexMetrics(Headers responseMessageHeaders, bool isBase64Encoded) { if (responseMessageHeaders?.IndexUtilizationText != null) { return new Lazy(() => { - IndexUtilizationInfo parsedIndexUtilizationInfo = IndexUtilizationInfo.CreateFromString(responseMessageHeaders.IndexUtilizationText, isBse64Encoded); - - StringBuilder stringBuilder = new StringBuilder(); - IndexMetricWriter indexMetricWriter = new IndexMetricWriter(stringBuilder); - indexMetricWriter.WriteIndexMetrics(parsedIndexUtilizationInfo); + if (isBase64Encoded) + { + IndexUtilizationInfo parsedIndexUtilizationInfo = IndexUtilizationInfo.CreateFromString(responseMessageHeaders.IndexUtilizationText); - return stringBuilder.ToString(); + StringBuilder stringBuilder = new StringBuilder(); + IndexMetricsWriter indexMetricWriter = new IndexMetricsWriter(stringBuilder); + indexMetricWriter.WriteIndexMetrics(parsedIndexUtilizationInfo); + + return stringBuilder.ToString(); + } + + // Return the JSON from the response header + return responseMessageHeaders.IndexUtilizationText; }); } diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/CompositeIndexIndexMetrics.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/CompositeIndexIndexMetrics.cs new file mode 100644 index 0000000000..5ee147dc87 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/CompositeIndexIndexMetrics.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace Microsoft.Azure.Cosmos.Query.Core.Metrics +{ + using System; + using System.Collections.Generic; + using Newtonsoft.Json; + + /// + /// Query index utilization data for composite indexes (sub-structure of the Index Metrics class) in the Azure Cosmos database service. + /// + #if INTERNAL +#pragma warning disable SA1600 +#pragma warning disable CS1591 + public +#else + internal +#endif + sealed class CompositeIndexIndexMetrics + { + /// + /// Initialized a new instance of an Index Metrics' Composite Index class. + /// + /// The string list representation of the composite index. + /// The index impact score. + [JsonConstructor] + private CompositeIndexIndexMetrics( + IReadOnlyList indexDocumentExpressions, + string indexImpactScore) + { + this.IndexSpecs = indexDocumentExpressions; + this.IndexImpactScore = indexImpactScore; + } + + /// + /// String list representation of index paths of a composite index. + /// + [JsonProperty(PropertyName = "IndexSpecs")] + public IReadOnlyList IndexSpecs { get; } + + /// + /// The index impact score of the composite index. + /// + [JsonProperty(PropertyName = "IndexImpactScore")] + public string IndexImpactScore { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexMetricsInfo.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexMetricsInfo.cs new file mode 100644 index 0000000000..4156e520a7 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexMetricsInfo.cs @@ -0,0 +1,83 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace Microsoft.Azure.Cosmos.Query.Core.Metrics +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + using Microsoft.Azure.Cosmos.Core; + using Microsoft.Azure.Cosmos.Core.Utf8; + using Newtonsoft.Json; + + /// + /// Query index utilization data for composite indexes (sub-structure of the Index Metrics class) in the Azure Cosmos database service. + /// +#if INTERNAL +#pragma warning disable SA1600 +#pragma warning disable CS1591 + public +#else + internal +#endif + sealed class IndexMetricsInfo + { + /// + /// Initializes a new instance of the Index Metrics class. + /// + /// The utilized indexes + /// The potential indexes + [JsonConstructor] + public IndexMetricsInfo( + IndexMetricsInfoEntity utilizedEntity, + IndexMetricsInfoEntity potentialEntity) + { + this.UtilizedEntity = utilizedEntity; + this.PotentialEntity = potentialEntity; + } + + [JsonProperty("Utilized")] + public IndexMetricsInfoEntity UtilizedEntity { get; } + + [JsonProperty("Potential")] + public IndexMetricsInfoEntity PotentialEntity { get; } + + /// + /// Creates a new IndexMetricsInfo from the backend delimited string. + /// + /// The backend delimited string to deserialize from. + /// The parsed index utilization info + /// A new IndexMetricsInfo from the backend delimited string. + public static bool TryCreateFromString(string delimitedString, out IndexMetricsInfo result) + { + if (delimitedString == null) + { + result = null; + return false; + } + + try + { + // Decode and deserialize the response string + string decodedString = System.Web.HttpUtility.UrlDecode(delimitedString, Encoding.UTF8); + + result = JsonConvert.DeserializeObject(decodedString, new JsonSerializerSettings() + { + // Allowing null values to be resilient to Json structure change + MissingMemberHandling = MissingMemberHandling.Ignore, + NullValueHandling = NullValueHandling.Ignore, + // Ignore parsing error encountered in deserialization + Error = (sender, parsingErrorEvent) => parsingErrorEvent.ErrorContext.Handled = true + }) ?? null; + + return true; + } + catch (JsonException) + { + result = null; + return false; + } + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexMetricsInfoEntity.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexMetricsInfoEntity.cs new file mode 100644 index 0000000000..69a0f3270a --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexMetricsInfoEntity.cs @@ -0,0 +1,43 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace Microsoft.Azure.Cosmos.Query.Core.Metrics +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Text; + using Microsoft.Azure.Cosmos.Core; + using Microsoft.Azure.Cosmos.Core.Utf8; + using Newtonsoft.Json; + + /// + /// Query index utilization metrics in the Azure Cosmos database service. + /// +#if INTERNAL +#pragma warning disable SA1600 +#pragma warning disable CS1591 + public +#else + internal +#endif + sealed class IndexMetricsInfoEntity + { + /// + /// Initializes a new instance of the Index Utilization class. This is the legacy class of IndexMetricsInfoEntity. + /// + /// The utilized single indexes list + /// The potential single indexes list + [JsonConstructor] + public IndexMetricsInfoEntity( + IReadOnlyList singleIndexes, + IReadOnlyList compositeIndexes) + { + this.SingleIndexes = (singleIndexes ?? Enumerable.Empty()).Where(item => item != null).ToList(); + this.CompositeIndexes = (compositeIndexes ?? Enumerable.Empty()).Where(item => item != null).ToList(); + } + + public IReadOnlyList SingleIndexes { get; } + public IReadOnlyList CompositeIndexes { get; } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexMetricWriter.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexMetricsWriter.cs similarity index 65% rename from Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexMetricWriter.cs rename to Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexMetricsWriter.cs index 7deb1f767b..138275fda9 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexMetricWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexMetricsWriter.cs @@ -9,7 +9,7 @@ namespace Microsoft.Azure.Cosmos.Query.Core.Metrics using System.Text; /// - /// Base class for visiting and serializing a . + /// Base class for visiting and serializing a . /// #if INTERNAL #pragma warning disable SA1600 @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Cosmos.Query.Core.Metrics #else internal #endif - class IndexMetricWriter + class IndexMetricsWriter { private const string IndexUtilizationInfo = "Index Utilization Information"; private const string UtilizedSingleIndexes = "Utilized Single Indexes"; @@ -32,7 +32,7 @@ class IndexMetricWriter private readonly StringBuilder stringBuilder; - public IndexMetricWriter(StringBuilder stringBuilder) + public IndexMetricsWriter(StringBuilder stringBuilder) { this.stringBuilder = stringBuilder ?? throw new ArgumentNullException($"{nameof(stringBuilder)} must not be null."); } @@ -50,37 +50,37 @@ public void WriteIndexMetrics(IndexUtilizationInfo indexUtilizationInfo) #region IndexUtilizationInfo protected void WriteBeforeIndexUtilizationInfo() { - IndexMetricWriter.AppendNewlineToStringBuilder(this.stringBuilder); - IndexMetricWriter.AppendHeaderToStringBuilder( + IndexMetricsWriter.AppendNewlineToStringBuilder(this.stringBuilder); + IndexMetricsWriter.AppendHeaderToStringBuilder( this.stringBuilder, - IndexMetricWriter.IndexUtilizationInfo, + IndexMetricsWriter.IndexUtilizationInfo, indentLevel: 0); } protected void WriteIndexUtilizationInfo(IndexUtilizationInfo indexUtilizationInfo) { - IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricWriter.UtilizedSingleIndexes, indentLevel: 1); + IndexMetricsWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricsWriter.UtilizedSingleIndexes, indentLevel: 1); foreach (SingleIndexUtilizationEntity indexUtilizationEntity in indexUtilizationInfo.UtilizedSingleIndexes) { WriteSingleIndexUtilizationEntity(indexUtilizationEntity); } - IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricWriter.PotentialSingleIndexes, indentLevel: 1); + IndexMetricsWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricsWriter.PotentialSingleIndexes, indentLevel: 1); foreach (SingleIndexUtilizationEntity indexUtilizationEntity in indexUtilizationInfo.PotentialSingleIndexes) { WriteSingleIndexUtilizationEntity(indexUtilizationEntity); } - IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricWriter.UtilizedCompositeIndexes, indentLevel: 1); + IndexMetricsWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricsWriter.UtilizedCompositeIndexes, indentLevel: 1); foreach (CompositeIndexUtilizationEntity indexUtilizationEntity in indexUtilizationInfo.UtilizedCompositeIndexes) { WriteCompositeIndexUtilizationEntity(indexUtilizationEntity); } - IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricWriter.PotentialCompositeIndexes, indentLevel: 1); + IndexMetricsWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricsWriter.PotentialCompositeIndexes, indentLevel: 1); foreach (CompositeIndexUtilizationEntity indexUtilizationEntity in indexUtilizationInfo.PotentialCompositeIndexes) { @@ -89,16 +89,16 @@ protected void WriteIndexUtilizationInfo(IndexUtilizationInfo indexUtilizationIn void WriteSingleIndexUtilizationEntity(SingleIndexUtilizationEntity indexUtilizationEntity) { - IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, $"{IndexMetricWriter.IndexExpression}: {indexUtilizationEntity.IndexDocumentExpression}", indentLevel: 2); - IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, $"{IndexMetricWriter.IndexImpactScore}: {indexUtilizationEntity.IndexImpactScore}", indentLevel: 2); - IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricWriter.IndexUtilizationSeparator, indentLevel: 2); + IndexMetricsWriter.AppendHeaderToStringBuilder(this.stringBuilder, $"{IndexMetricsWriter.IndexExpression}: {indexUtilizationEntity.IndexDocumentExpression}", indentLevel: 2); + IndexMetricsWriter.AppendHeaderToStringBuilder(this.stringBuilder, $"{IndexMetricsWriter.IndexImpactScore}: {indexUtilizationEntity.IndexImpactScore}", indentLevel: 2); + IndexMetricsWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricsWriter.IndexUtilizationSeparator, indentLevel: 2); } void WriteCompositeIndexUtilizationEntity(CompositeIndexUtilizationEntity indexUtilizationEntity) { - IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, $"{IndexMetricWriter.IndexExpression}: {String.Join(", ", indexUtilizationEntity.IndexDocumentExpressions)}", indentLevel: 2); - IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, $"{IndexMetricWriter.IndexImpactScore}: {indexUtilizationEntity.IndexImpactScore}", indentLevel: 2); - IndexMetricWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricWriter.IndexUtilizationSeparator, indentLevel: 2); + IndexMetricsWriter.AppendHeaderToStringBuilder(this.stringBuilder, $"{IndexMetricsWriter.IndexExpression}: {String.Join(", ", indexUtilizationEntity.IndexDocumentExpressions)}", indentLevel: 2); + IndexMetricsWriter.AppendHeaderToStringBuilder(this.stringBuilder, $"{IndexMetricsWriter.IndexImpactScore}: {indexUtilizationEntity.IndexImpactScore}", indentLevel: 2); + IndexMetricsWriter.AppendHeaderToStringBuilder(this.stringBuilder, IndexMetricsWriter.IndexUtilizationSeparator, indentLevel: 2); } } @@ -123,7 +123,7 @@ private static void AppendHeaderToStringBuilder(StringBuilder stringBuilder, str private static void AppendNewlineToStringBuilder(StringBuilder stringBuilder) { - IndexMetricWriter.AppendHeaderToStringBuilder( + IndexMetricsWriter.AppendHeaderToStringBuilder( stringBuilder, string.Empty, indentLevel: 0); diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexUtilizationInfo.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexUtilizationInfo.cs index e34a7902ad..a9ef4569b5 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexUtilizationInfo.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexUtilizationInfo.cs @@ -8,6 +8,7 @@ namespace Microsoft.Azure.Cosmos.Query.Core.Metrics using System.Linq; using System.Text; using Microsoft.Azure.Cosmos.Core; + using Microsoft.Azure.Cosmos.Core.Utf8; using Newtonsoft.Json; /// @@ -29,7 +30,7 @@ sealed class IndexUtilizationInfo potentialCompositeIndexes: new List()); /// - /// Initializes a new instance of the Index Utilization class. + /// Initializes a new instance of the Index Utilization class. This is the legacy class of IndexMetricsInfo. /// /// The utilized single indexes list /// The potential single indexes list @@ -60,23 +61,6 @@ public IndexUtilizationInfo( /// The parsed index utilization info /// A new IndexUtilizationInfo from the backend delimited string. internal static bool TryCreateFromDelimitedBase64String(string delimitedString, out IndexUtilizationInfo result) - { - if (delimitedString == null) - { - result = IndexUtilizationInfo.Empty; - return true; - } - - return TryCreateFromDelimitedString(System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(delimitedString)), out result); - } - - /// - /// Creates a new IndexUtilizationInfo from the backend delimited string. - /// - /// The backend delimited string to deserialize from. - /// The parsed index utilization info - /// A new IndexUtilizationInfo from the backend delimited string. - internal static bool TryCreateFromDelimitedString(string delimitedString, out IndexUtilizationInfo result) { if (delimitedString == null) { @@ -84,9 +68,15 @@ internal static bool TryCreateFromDelimitedString(string delimitedString, out In return true; } + // Even though this parsing is resilient, older version of the SDK doesn't have such lenient parsing. + // As such, it is right not not possible to remove some of the field in the IndexUtilizationInfo class. + // However, in newer version of the SDKs, the code base is going to start returning IndexMetricsInfo, + // so this class exists solely for legacy support. try { - result = JsonConvert.DeserializeObject(delimitedString, new JsonSerializerSettings() + string decodedString = System.Text.Encoding.UTF8.GetString(Convert.FromBase64String(delimitedString)); + + result = JsonConvert.DeserializeObject(decodedString, new JsonSerializerSettings() { // Allowing null values to be resilient to Json structure change MissingMemberHandling = MissingMemberHandling.Ignore, @@ -108,20 +98,10 @@ internal static bool TryCreateFromDelimitedString(string delimitedString, out In /// Materialize the Index Utilization String into Concrete objects. /// /// The index utilization response string as sent by the back end. - /// The encoding of the string. /// Cpncrete Index utilization object. - public static IndexUtilizationInfo CreateFromString(string delimitedString, bool isBse64Encoded) + public static IndexUtilizationInfo CreateFromString(string delimitedString) { - IndexUtilizationInfo indexUtilizationInfo; - - if (isBse64Encoded) - { - TryCreateFromDelimitedBase64String(delimitedString, out indexUtilizationInfo); - } - else - { - TryCreateFromDelimitedString(delimitedString, out indexUtilizationInfo); - } + TryCreateFromDelimitedBase64String(delimitedString, out IndexUtilizationInfo indexUtilizationInfo); return indexUtilizationInfo; } diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/SingleIndexIndexMetrics.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/SingleIndexIndexMetrics.cs new file mode 100644 index 0000000000..2c8826c3ea --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/SingleIndexIndexMetrics.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace Microsoft.Azure.Cosmos.Query.Core.Metrics +{ + using System; + using Newtonsoft.Json; + + /// + /// Query index utilization data for single indexes (sub-structure of the Index Metrics class) in the Azure Cosmos database service. + /// + #if INTERNAL +#pragma warning disable SA1600 +#pragma warning disable CS1591 + public +#else + internal +#endif + sealed class SingleIndexIndexMetrics + { + /// + /// Initialized a new instance of an Index Metrics' Single Index class. + /// + /// The string representation of the single index. + /// The index impact score. + [JsonConstructor] + public SingleIndexIndexMetrics( + string indexDocumentExpression, + string indexImpactScore) + { + this.IndexDocumentExpression = indexDocumentExpression; + this.IndexImpactScore = indexImpactScore; + } + + /// + /// String representation of index paths of a composite index. + /// + [JsonProperty(PropertyName = "IndexSpec")] + public string IndexDocumentExpression { get; } + + /// + /// The index impact score of the single index. + /// + [JsonProperty(PropertyName = "IndexImpactScore")] + public string IndexImpactScore { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/v2Query/DefaultDocumentQueryExecutionContext.cs b/Microsoft.Azure.Cosmos/src/Query/v2Query/DefaultDocumentQueryExecutionContext.cs index b53c3c5c71..9895bd5f5a 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v2Query/DefaultDocumentQueryExecutionContext.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v2Query/DefaultDocumentQueryExecutionContext.cs @@ -108,7 +108,7 @@ protected override async Task> ExecuteIntern partitionIdentifier, new QueryMetrics( response.ResponseHeaders[HttpConstants.HttpHeaders.QueryMetrics], - IndexUtilizationInfo.CreateFromString(response.ResponseHeaders[HttpConstants.HttpHeaders.IndexUtilization], true), + IndexUtilizationInfo.CreateFromString(response.ResponseHeaders[HttpConstants.HttpHeaders.IndexUtilization]), new ClientSideMetrics( this.retries, response.RequestCharge, diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryResponse.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryResponse.cs index 6c7777ebff..47c9136a8f 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryResponse.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryResponse.cs @@ -12,6 +12,7 @@ namespace Microsoft.Azure.Cosmos using Microsoft.Azure.Cosmos.Query.Core.Metrics; using Microsoft.Azure.Cosmos.Serializer; using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Documents; /// /// Represents the template class used by feed methods (enumeration operations) for the Azure Cosmos DB service. @@ -183,7 +184,13 @@ private QueryResponse( cosmosArray: cosmosElements, serializerCore: serializerCore); - this.IndexUtilizationText = ResponseMessage.DecodeIndexMetrics(responseMessageHeaders, true); + // Chose how to decode depending on which PopulateIndexMetrics request header was sent + // If none was sent, we currently default to V1 + // TODO: Switch the flag to false once V2 is deployed + this.IndexUtilizationText = ResponseMessage.DecodeIndexMetrics( + responseMessageHeaders, + isBase64Encoded: true); + this.RequestMessage = requestMessage; } diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs index f723107ede..2b4aba5ac0 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs @@ -269,6 +269,7 @@ internal override void PopulateRequestOptions(RequestMessage request) if (this.PopulateIndexMetrics.HasValue) { + // TODO: Switch to V2 request.Headers.CosmosMessageHeaders.Add(HttpConstants.HttpHeaders.PopulateIndexMetrics, this.PopulateIndexMetrics.ToString()); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/IndexMetricsParserBaselineTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/IndexMetricsParserBaselineTest.cs index 6ae91f1375..598ee51c9d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/IndexMetricsParserBaselineTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/IndexMetricsParserBaselineTest.cs @@ -133,6 +133,7 @@ public void IndexUtilizationParse() public override IndexMetricsParserTestOutput ExecuteTest(IndexMetricsParserTestInput input) { + // V2 QueryRequestOptions requestOptions = new QueryRequestOptions() { PopulateIndexMetrics = true }; FeedIterator itemQuery = testContainer.GetItemQueryIterator( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/PopulateIndexMetricsTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/PopulateIndexMetricsTest.cs index 29f1944643..084e7738a5 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/PopulateIndexMetricsTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/PopulateIndexMetricsTest.cs @@ -35,14 +35,6 @@ static async Task ImplementationAsync(Container container, IReadOnlyList 12"); - // Build the expected string - Assert.IsTrue(IndexUtilizationInfo.TryCreateFromDelimitedBase64String("eyJVdGlsaXplZFNpbmdsZUluZGV4ZXMiOlt7IkZpbHRlckV4cHJlc3Npb24iOiIoUk9PVC5uYW1lID0gXCJBQkNcIikiLCJJbmRleFNwZWMiOiJcL25hbWVcLz8iLCJGaWx0ZXJQcmVjaXNlU2V0Ijp0cnVlLCJJbmRleFByZWNpc2VTZXQiOnRydWUsIkluZGV4SW1wYWN0U2NvcmUiOiJIaWdoIn0seyJGaWx0ZXJFeHByZXNzaW9uIjoiKFJPT1QuYWdlID4gMTIpIiwiSW5kZXhTcGVjIjoiXC9hZ2VcLz8iLCJGaWx0ZXJQcmVjaXNlU2V0Ijp0cnVlLCJJbmRleFByZWNpc2VTZXQiOnRydWUsIkluZGV4SW1wYWN0U2NvcmUiOiJIaWdoIn1dLCJQb3RlbnRpYWxTaW5nbGVJbmRleGVzIjpbXSwiVXRpbGl6ZWRDb21wb3NpdGVJbmRleGVzIjpbXSwiUG90ZW50aWFsQ29tcG9zaXRlSW5kZXhlcyI6W3siSW5kZXhTcGVjcyI6WyJcL25hbWUgQVNDIiwiXC9hZ2UgQVNDIl0sIkluZGV4UHJlY2lzZVNldCI6ZmFsc2UsIkluZGV4SW1wYWN0U2NvcmUiOiJIaWdoIn1dfQ==", - out IndexUtilizationInfo parsedInfo)); - StringBuilder stringBuilder = new StringBuilder(); - IndexMetricWriter indexMetricWriter = new IndexMetricWriter(stringBuilder); - indexMetricWriter.WriteIndexMetrics(parsedInfo); - string expectedIndexMetricsString = stringBuilder.ToString(); - // Test using GetItemQueryIterator QueryRequestOptions requestOptions = new QueryRequestOptions() { PopulateIndexMetrics = true }; @@ -56,7 +48,6 @@ static async Task ImplementationAsync(Container container, IReadOnlyList 1); Assert.IsNotNull(page.Headers.Get(HttpConstants.HttpHeaders.IndexUtilization), "Expected index utilization headers for query"); Assert.IsNotNull(page.IndexMetrics, "Expected index metrics response for query"); - Assert.AreEqual(expectedIndexMetricsString, page.IndexMetrics); } // Test using Stream API @@ -73,7 +64,6 @@ static async Task ImplementationAsync(Container container, IReadOnlyList 1); Assert.IsNotNull(response.Headers.Get(HttpConstants.HttpHeaders.IndexUtilization), "Expected index utilization headers for query"); - Assert.AreEqual(expectedIndexMetricsString, response.IndexMetrics); } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs index d971223f09..762bbbd945 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs @@ -2292,7 +2292,7 @@ private async Task ValidateQueryMetricsHeadersOverContinuations( QueryMetrics queryMetrics = new QueryMetrics( responseQueryMetrics, - IndexUtilizationInfo.CreateFromString(indexUtilization, true), + IndexUtilizationInfo.CreateFromString(indexUtilization), ClientSideMetrics.Empty); this.ValidateQueryMetrics(queryMetrics); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/IndexUtilizationInfoTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/IndexUtilizationInfoTests.cs index 9fe272a6bd..b3bce119dd 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/IndexUtilizationInfoTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/IndexUtilizationInfoTests.cs @@ -97,9 +97,7 @@ private static void TestParses(bool isBase64Encoded) } else { - Assert.IsTrue(IndexUtilizationInfo.TryCreateFromDelimitedString(testString, - out IndexUtilizationInfo parsedInfo)); - Assert.IsNotNull(parsedInfo); + Assert.IsTrue(IndexMetricsInfo.TryCreateFromString(testString, out _)); } } } From 08e7f54730f01452ebb05ed255285e91668a17e3 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 26 Sep 2023 19:38:47 +0530 Subject: [PATCH 196/240] Distributed Tracing: Fixes dependency failure on appinsights (#4098) * first draft * refactor * fix tests * fixed condition --- .../OpenTelemetry/CosmosDbEventSource.cs | 2 +- .../Filters/DiagnosticsFilterHelper.cs | 16 ++--- .../OpenTelemetryCoreRecorder.cs | 15 +++- .../Tracing/AssertActivity.cs | 68 +++++++++++-------- .../Telemetry/DiagnosticsFilterHelperTest.cs | 3 +- 5 files changed, 61 insertions(+), 43 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs index 9e8028c0d8..8898cea96d 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs @@ -36,7 +36,7 @@ public static void RecordDiagnosticsForRequests( OpenTelemetryAttributes response) { if (!DiagnosticsFilterHelper.IsSuccessfulResponse( - response: response) && CosmosDbEventSource.IsEnabled(EventLevel.Warning)) + response.StatusCode, response.SubStatusCode) && CosmosDbEventSource.IsEnabled(EventLevel.Warning)) { CosmosDbEventSource.Singleton.FailedRequest(response.Diagnostics.ToString()); } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs index a5ca0215cb..d48392bb3e 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs @@ -5,8 +5,8 @@ namespace Microsoft.Azure.Cosmos.Telemetry.Diagnostics { using System; + using System.Net; using Documents; - using static Antlr4.Runtime.TokenStreamRewriter; internal static class DiagnosticsFilterHelper { @@ -39,13 +39,13 @@ public static bool IsLatencyThresholdCrossed( /// Check if response HTTP status code is returning successful /// /// true or false - public static bool IsSuccessfulResponse(OpenTelemetryAttributes response) - { - return response.StatusCode.IsSuccess() - || (response.StatusCode == System.Net.HttpStatusCode.NotFound && response.SubStatusCode == 0) - || (response.StatusCode == System.Net.HttpStatusCode.NotModified && response.SubStatusCode == 0) - || (response.StatusCode == System.Net.HttpStatusCode.Conflict && response.SubStatusCode == 0) - || (response.StatusCode == System.Net.HttpStatusCode.PreconditionFailed && response.SubStatusCode == 0); + public static bool IsSuccessfulResponse(HttpStatusCode statusCode, int substatusCode) + { + return statusCode.IsSuccess() + || (statusCode == System.Net.HttpStatusCode.NotFound && substatusCode == 0) + || (statusCode == System.Net.HttpStatusCode.NotModified && substatusCode == 0) + || (statusCode == System.Net.HttpStatusCode.Conflict && substatusCode == 0) + || (statusCode == System.Net.HttpStatusCode.PreconditionFailed && substatusCode == 0); } /// diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs index 2ef929ca8c..ced441d368 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs @@ -8,6 +8,7 @@ namespace Microsoft.Azure.Cosmos.Telemetry using System.Collections.Generic; using System.Diagnostics; using global::Azure.Core; + using Microsoft.Azure.Cosmos.Telemetry.Diagnostics; /// /// This class is used to add information in an Activity tags ref. https://github.com/Azure/azure-cosmos-dotnet-v3/issues/3058 @@ -177,7 +178,12 @@ public void MarkFailed(Exception exception) this.scope.AddAttribute(OpenTelemetryAttributeKeys.ExceptionMessage, exception.Message); } - this.scope.Failed(exception); + if (exception is not CosmosException || (exception is CosmosException cosmosException + && !DiagnosticsFilterHelper + .IsSuccessfulResponse(cosmosException.StatusCode, cosmosException.SubStatusCode))) + { + this.scope.Failed(exception); + } } } @@ -205,7 +211,7 @@ internal static bool IsExceptionRegistered(Exception exception, DiagnosticScope public void Dispose() { - if (this.scope.IsEnabled) + if (this.IsEnabled) { Documents.OperationType operationType = (this.response == null || this.response?.OperationType == Documents.OperationType.Invalid) ? this.operationType : this.response.OperationType; @@ -228,6 +234,11 @@ Documents.OperationType operationType this.scope.AddAttribute(OpenTelemetryAttributeKeys.Region, ClientTelemetryHelper.GetContactedRegions(this.response.Diagnostics.GetContactedRegions())); CosmosDbEventSource.RecordDiagnosticsForRequests(this.config, operationType, this.response); } + + if (!DiagnosticsFilterHelper.IsSuccessfulResponse(this.response.StatusCode, this.response.SubStatusCode)) + { + this.scope.Failed(); + } } this.scope.Dispose(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs index 75153d3b88..9b9be4479a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs @@ -8,8 +8,9 @@ namespace Microsoft.Azure.Cosmos.Tracing using System.Collections.Generic; using System.Diagnostics; using System.Linq; - using global::Azure; + using System.Net; using Microsoft.Azure.Cosmos.Telemetry; + using Microsoft.Azure.Cosmos.Telemetry.Diagnostics; using Microsoft.Azure.Cosmos.Tests; using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; @@ -32,35 +33,35 @@ public static void IsValidOperationActivity(Activity activity) } IList expectedTags = new List - { - "az.namespace", - "az.schema_url", - "kind", - "db.system", - "db.name", - "db.operation", - "net.peer.name", - "db.cosmosdb.client_id", - "db.cosmosdb.machine_id", - "user_agent.original", - "db.cosmosdb.connection_mode", - "db.cosmosdb.operation_type", - "db.cosmosdb.container", - "db.cosmosdb.request_content_length_bytes", - "db.cosmosdb.response_content_length_bytes", - "db.cosmosdb.status_code", - "db.cosmosdb.sub_status_code", - "db.cosmosdb.request_charge", - "db.cosmosdb.regions_contacted", - "db.cosmosdb.retry_count", - "db.cosmosdb.item_count", - "db.cosmosdb.request_diagnostics", - "exception.type", - "exception.message", - "exception.stacktrace", - "db.cosmosdb.activity_id", - "db.cosmosdb.correlated_activity_id" - }; + { + "az.namespace", + "az.schema_url", + "kind", + "db.system", + "db.name", + "db.operation", + "net.peer.name", + "db.cosmosdb.client_id", + "db.cosmosdb.machine_id", + "user_agent.original", + "db.cosmosdb.connection_mode", + "db.cosmosdb.operation_type", + "db.cosmosdb.container", + "db.cosmosdb.request_content_length_bytes", + "db.cosmosdb.response_content_length_bytes", + "db.cosmosdb.status_code", + "db.cosmosdb.sub_status_code", + "db.cosmosdb.request_charge", + "db.cosmosdb.regions_contacted", + "db.cosmosdb.retry_count", + "db.cosmosdb.item_count", + "db.cosmosdb.request_diagnostics", + "exception.type", + "exception.message", + "exception.stacktrace", + "db.cosmosdb.activity_id", + "db.cosmosdb.correlated_activity_id" + }; foreach (KeyValuePair actualTag in activity.Tags) { @@ -68,6 +69,13 @@ public static void IsValidOperationActivity(Activity activity) AssertActivity.AssertDatabaseAndContainerName(activity.OperationName, actualTag); } + + HttpStatusCode statusCode = (HttpStatusCode)Convert.ToInt32(activity.GetTagItem("db.cosmosdb.status_code")); + int subStatusCode = Convert.ToInt32(activity.GetTagItem("db.cosmosdb.sub_status_code")); + if (!DiagnosticsFilterHelper.IsSuccessfulResponse(statusCode, subStatusCode)) + { + Assert.AreEqual(ActivityStatusCode.Error, activity.Status); + } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs index e345394265..5e32b26da1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs @@ -71,11 +71,10 @@ public void CheckReturnTrueOnFailedStatusCode() Assert.IsTrue( !DiagnosticsFilterHelper - .IsSuccessfulResponse(response), + .IsSuccessfulResponse(response.StatusCode, response.SubStatusCode), $" Response time is {response.Diagnostics.GetClientElapsedTime().Milliseconds}ms " + $"and Configured threshold value is {distributedTracingOptions.LatencyThresholdForDiagnosticEvent.Value.Milliseconds}ms " + $"and Is response Success : {response.StatusCode.IsSuccess()}"); - } } From 455656753e115d1667bbaa0ae8689a2f3686a6d2 Mon Sep 17 00:00:00 2001 From: Aditya Kotalwar <94020786+akotalwar@users.noreply.github.com> Date: Tue, 26 Sep 2023 13:38:58 -0700 Subject: [PATCH 197/240] [Internal] Query: Adds deserializing logic for ClientQL Coordinator Distribution Plan (#3988) * First commit. * Added remaining classes for ClientQL structure * Added ClientQLDeserializing class and added CoordinatorDistributionPlan folder * Added support for all Enumerable and Scalar Expressions * Added baseline tests for testing CoordinatorDistributionPlan deserializing * Made ClientQL objects immutable * Added error and null checks for Value calls * Updated List<> with IReadOnlyList<> * Made most functions in the Deserializing class private and static * Added static constant class for Enumerable expressions * Added null checking for arrays * Removed null checks from deserializing array functions * Removed support for JavaScript * Removed support for Unwind * Function names changed * Removed few functions. * Updated constants class * Function Formatting for ClientQL Deserializing (#4062) * Adding error handling for Deserializing functions * Finished updating code to remove all dependency on Newtonsoft.Json * Removed try catch for all upper level functions * Resolved comments * Resolved comments pt2 * Updated error message * Resolved comments pt3 * Changed parameter types from int to long * Removed ClientQLDelegate * Syntax Fixes * Removed ClientQLFlattenEnumerable file. This is JS. * Fixed List helper functions * Made singleton constructors from public to private * Updated the DeserializeClientQLBinaryLiteral function * Renamed ClientQL to QL * Fixed variable names * Updated more variable names * Removed support for Type * Removed all extra newlines * Added null checks * Updated the name CoordinatorDistributionPlan to ClientDistributionPlan * Removed all support for Cassandra, Mongo and Binary Literal * Updaed ClientQL to Cql * Updated baseline test class property. --- .../ClientDistributionPlanDeserializer.cs | 561 ++++++++++++++++ .../Cql/ClientDistributionPlan.cs | 18 + .../Cql/CqlAggregate.cs | 16 + .../Cql/CqlAggregateEnumerableExpression.cs | 22 + .../Cql/CqlAggregateKind.cs | 12 + .../Cql/CqlAggregateOperatorKind.cs | 19 + .../Cql/CqlArrayCreateScalarExpression.cs | 25 + .../Cql/CqlArrayIndexerScalarExpression.cs | 22 + .../Cql/CqlArrayLiteral.cs | 20 + .../Cql/CqlBinaryScalarExpression.cs | 25 + .../Cql/CqlBinaryScalarOperatorKind.cs | 29 + .../Cql/CqlBooleanLiteral.cs | 17 + .../Cql/CqlBuiltinAggregate.cs | 17 + .../Cql/CqlBuiltinScalarFunctionKind.cs | 126 ++++ .../Cql/CqlDistinctEnumerableExpression.cs | 26 + .../Cql/CqlEnumerableExpression.cs | 16 + .../Cql/CqlEnumerableExpressionKind.cs | 20 + .../Cql/CqlEnumerationKind.cs | 14 + .../Cql/CqlFunctionIdentifier.cs | 18 + .../Cql/CqlGroupByEnumerableExpression.cs | 26 + .../Cql/CqlInputEnumerableExpression.cs | 19 + .../Cql/CqlIsOperatorKind.cs | 11 + .../Cql/CqlIsOperatorScalarExpression.cs | 23 + .../Cql/CqlLetScalarExpression.cs | 25 + .../ClientDistributionPlan/Cql/CqlLiteral.cs | 16 + .../Cql/CqlLiteralKind.cs | 17 + .../Cql/CqlLiteralScalarExpression.cs | 19 + .../Cql/CqlMuxScalarExpression.cs | 25 + .../Cql/CqlNullLiteral.cs | 16 + .../Cql/CqlNumberLiteral.cs | 19 + .../Cql/CqlObjectCreateScalarExpression.cs | 25 + .../Cql/CqlObjectLiteral.cs | 20 + .../Cql/CqlObjectLiteralProperty.cs | 21 + .../Cql/CqlObjectProperty.cs | 21 + .../Cql/CqlOrderByEnumerableExpression.cs | 26 + .../Cql/CqlOrderByItem.cs | 21 + .../Cql/CqlPropertyRefScalarExpression.cs | 23 + .../Cql/CqlScalarAsEnumerableExpression.cs | 22 + .../Cql/CqlScalarExpression.cs | 16 + .../Cql/CqlScalarExpressionKind.cs | 25 + .../Cql/CqlSelectEnumerableExpression.cs | 25 + .../Cql/CqlSelectManyEnumerableExpression.cs | 25 + .../Cql/CqlSortOrder.cs | 12 + .../Cql/CqlStringLiteral.cs | 19 + .../CqlSystemFunctionCallScalarExpression.cs | 23 + .../Cql/CqlTakeEnumerableExpression.cs | 25 + .../Cql/CqlTupleAggregate.cs | 20 + .../Cql/CqlTupleCreateScalarExpression.cs | 20 + .../Cql/CqlTupleItemRefScalarExpression.cs | 22 + .../Cql/CqlUnaryScalarExpression.cs | 22 + .../Cql/CqlUnaryScalarOperatorKind.cs | 14 + .../Cql/CqlUndefinedLiteral.cs | 16 + ...UserDefinedFunctionCallScalarExpression.cs | 26 + .../ClientDistributionPlan/Cql/CqlVariable.cs | 21 + .../Cql/CqlVariableRefScalarExpression.cs | 19 + .../Cql/CqlWhereEnumerableExpression.cs | 25 + ...tClientDistributionPlanDeserialization.xml | 606 ++++++++++++++++++ .../Microsoft.Azure.Cosmos.Tests.csproj | 3 + .../ClientDistributionPlanBaselineTests.cs | 100 +++ 59 files changed, 2502 insertions(+) create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/ClientDistributionPlanDeserializer.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/ClientDistributionPlan.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlAggregate.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlAggregateEnumerableExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlAggregateKind.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlAggregateOperatorKind.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlArrayCreateScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlArrayIndexerScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlArrayLiteral.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBinaryScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBinaryScalarOperatorKind.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBooleanLiteral.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBuiltinAggregate.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBuiltinScalarFunctionKind.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlDistinctEnumerableExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlEnumerableExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlEnumerableExpressionKind.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlEnumerationKind.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlFunctionIdentifier.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlGroupByEnumerableExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlInputEnumerableExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlIsOperatorKind.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlIsOperatorScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlLetScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlLiteral.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlLiteralKind.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlLiteralScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlMuxScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlNullLiteral.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlNumberLiteral.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlObjectCreateScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlObjectLiteral.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlObjectLiteralProperty.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlObjectProperty.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlOrderByEnumerableExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlOrderByItem.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlPropertyRefScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlScalarAsEnumerableExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlScalarExpressionKind.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlSelectEnumerableExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlSelectManyEnumerableExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlSortOrder.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlStringLiteral.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlSystemFunctionCallScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlTakeEnumerableExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlTupleAggregate.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlTupleCreateScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlTupleItemRefScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlUnaryScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlUnaryScalarOperatorKind.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlUndefinedLiteral.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlUserDefinedFunctionCallScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlVariable.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlVariableRefScalarExpression.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlWhereEnumerableExpression.cs create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ClientDistributionPlanBaselineTests.TestClientDistributionPlanDeserialization.xml create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/ClientDistributionPlanBaselineTests.cs diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/ClientDistributionPlanDeserializer.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/ClientDistributionPlanDeserializer.cs new file mode 100644 index 0000000000..df19b88b3d --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/ClientDistributionPlanDeserializer.cs @@ -0,0 +1,561 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan +{ + using System; + using System.Collections.Generic; + using System.Reflection; + using Cql; + using Microsoft.Azure.Cosmos.CosmosElements; + + internal static class ClientDistributionPlanDeserializer + { + private static class Constants + { + public const string Arguments = "Arguments"; + public const string ArrayKind = "ArrayKind"; + public const string Aggregate = "Aggregate"; + public const string Aggregates = "Aggregates"; + public const string Builtin = "Builtin"; + public const string Cql = "Cql"; + public const string ConditionExpression = "ConditionExpression"; + public const string ClientDistributionPlan = "clientDistributionPlan"; + public const string DeclaredVariable = "DeclaredVariable"; + public const string DeclaredVariableExpression = "DeclaredVariableExpression"; + public const string Distinct = "Distinct"; + public const string EnumerationKind = "EnumerationKind"; + public const string Expression = "Expression"; + public const string FunctionKind = "FunctionKind"; + public const string GroupBy = "GroupBy"; + public const string Identifier = "Identifier"; + public const string Index = "Index"; + public const string Input = "Input"; + public const string Items = "Items"; + public const string KeyCount = "KeyCount"; + public const string Kind = "Kind"; + public const string LeftExpression = "LeftExpression"; + public const string Literal = "Literal"; + public const string MaxDepth = "MaxDepth"; + public const string Name = "Name"; + public const string ObjectKind = "ObjectKind"; + public const string OperatorKind = "OperatorKind"; + public const string Options = "Options"; + public const string OrderBy = "OrderBy"; + public const string Pattern = "Pattern"; + public const string Properties = "Properties"; + public const string PropertyName = "PropertyName"; + public const string RightExpression = "RightExpression"; + public const string ScalarAsEnumerable = "ScalarAsEnumerable"; + public const string Select = "Select"; + public const string SelectorExpression = "SelectorExpression"; + public const string SelectMany = "SelectMany"; + public const string SingletonKind = "SingletonKind"; + public const string SkipValue = "SkipValue"; + public const string SortOrder = "SortOrder"; + public const string SourceExpression = "SourceExpression"; + public const string Take = "Take"; + public const string TakeValue = "TakeValue"; + public const string Tuple = "Tuple"; + public const string Type = "Type"; + public const string UniqueId = "UniqueId"; + public const string Value = "Value"; + public const string Variable = "Variable"; + public const string Where = "Where"; + } + + public static ClientDistributionPlan DeserializeClientDistributionPlan(string jsonString) + { + CosmosObject cosmosObject = CosmosObject.Parse(jsonString); + CosmosObject clientDistributionPlanElement = GetValue(cosmosObject, Constants.ClientDistributionPlan); + CosmosObject cqlElement = GetValue(clientDistributionPlanElement, Constants.Cql); + CqlEnumerableExpression expression = DeserializeCqlEnumerableExpression(cqlElement); + + return new ClientDistributionPlan(expression); + } + + #region Enumerable Expressions + + private static CqlEnumerableExpression DeserializeCqlEnumerableExpression(CosmosObject cosmosObject) + { + CosmosString kindProperty = GetValue(cosmosObject, Constants.Kind); + switch (kindProperty.Value) + { + case Constants.Aggregate: + return DeserializeAggregateEnumerableExpression(cosmosObject); + case Constants.Distinct: + return DeserializeDistinctEnumerableExpression(cosmosObject); + case Constants.GroupBy: + return DeserializeGroupByEnumerableExpression(cosmosObject); + case Constants.Input: + return DeserializeInputEnumerableExpression(cosmosObject); + case Constants.OrderBy: + return DeserializeOrderByEnumerableExpression(cosmosObject); + case Constants.ScalarAsEnumerable: + return DeserializeScalarAsEnumerableExpression(cosmosObject); + case Constants.Select: + return DeserializeSelectEnumerableExpression(cosmosObject); + case Constants.SelectMany: + return DeserializeSelectManyEnumerableExpression(cosmosObject); + case Constants.Take: + return DeserializeTakeEnumerableExpression(cosmosObject); + case Constants.Where: + return DeserializeWhereEnumerableExpression(cosmosObject); + default: + throw new NotSupportedException($"Invalid CqlExpression kind: {kindProperty.Value}"); + } + } + + private static CqlAggregateEnumerableExpression DeserializeAggregateEnumerableExpression(CosmosObject cosmosObject) + { + CqlEnumerableExpression sourceExpression = DeserializeCqlEnumerableExpression(GetValue(cosmosObject, Constants.SourceExpression)); + CqlAggregate aggregate = DeserializeAggregate(GetValue(cosmosObject, Constants.Aggregate)); + return new CqlAggregateEnumerableExpression(sourceExpression, aggregate); + } + + private static CqlDistinctEnumerableExpression DeserializeDistinctEnumerableExpression(CosmosObject cosmosObject) + { + CqlEnumerableExpression sourceExpression = DeserializeCqlEnumerableExpression(GetValue(cosmosObject, Constants.SourceExpression)); + CqlVariable declaredVariable = DeserializeCqlVariable(GetValue(cosmosObject, Constants.DeclaredVariable)); + IReadOnlyList expressions = DeserializeScalarExpressionArray(GetValue(cosmosObject, Constants.Expression)); + return new CqlDistinctEnumerableExpression(sourceExpression, declaredVariable, expressions); + } + + private static CqlGroupByEnumerableExpression DeserializeGroupByEnumerableExpression(CosmosObject cosmosObject) + { + CqlEnumerableExpression sourceExpression = DeserializeCqlEnumerableExpression(GetValue(cosmosObject, Constants.SourceExpression)); + long keyCount = Number64.ToLong(GetValue(cosmosObject, Constants.KeyCount).Value); + IReadOnlyList aggregates = DeserializeAggregateArray(GetValue(cosmosObject, Constants.Aggregates)); + return new CqlGroupByEnumerableExpression(sourceExpression, Convert.ToUInt64(keyCount), aggregates); + } + + private static CqlInputEnumerableExpression DeserializeInputEnumerableExpression(CosmosObject cosmosObject) + { + return new CqlInputEnumerableExpression(GetValue(cosmosObject, Constants.Name).Value); + } + + private static CqlOrderByEnumerableExpression DeserializeOrderByEnumerableExpression(CosmosObject cosmosObject) + { + CqlEnumerableExpression sourceExpression = DeserializeCqlEnumerableExpression(GetValue(cosmosObject, Constants.SourceExpression)); + CqlVariable declaredVariable = DeserializeCqlVariable(GetValue(cosmosObject, Constants.DeclaredVariable)); + IReadOnlyList orderByItems = DeserializeOrderByItemArray(GetValue(cosmosObject, Constants.Items)); + return new CqlOrderByEnumerableExpression(sourceExpression, declaredVariable, orderByItems); + } + + private static CqlScalarAsEnumerableExpression DeserializeScalarAsEnumerableExpression(CosmosObject cosmosObject) + { + CqlScalarExpression expression = DeserializeScalarExpression(GetValue(cosmosObject, Constants.Expression)); + CqlEnumerationKind enumerationKind = GetEnumValue(GetValue(cosmosObject, Constants.EnumerationKind).Value); + return new CqlScalarAsEnumerableExpression(expression, enumerationKind); + } + + private static CqlSelectEnumerableExpression DeserializeSelectEnumerableExpression(CosmosObject cosmosObject) + { + CqlEnumerableExpression sourceExpression = DeserializeCqlEnumerableExpression(GetValue(cosmosObject, Constants.SourceExpression)); + CqlVariable declaredVariable = DeserializeCqlVariable(GetValue(cosmosObject, Constants.DeclaredVariable)); + CqlScalarExpression expression = DeserializeScalarExpression(GetValue(cosmosObject, Constants.Expression)); + return new CqlSelectEnumerableExpression(sourceExpression, declaredVariable, expression); + } + + private static CqlSelectManyEnumerableExpression DeserializeSelectManyEnumerableExpression(CosmosObject cosmosObject) + { + CqlEnumerableExpression sourceExpression = DeserializeCqlEnumerableExpression(GetValue(cosmosObject, Constants.SourceExpression)); + CqlVariable declaredVariable = DeserializeCqlVariable(GetValue(cosmosObject, Constants.DeclaredVariable)); + CqlEnumerableExpression selectorExpression = DeserializeCqlEnumerableExpression(GetValue(cosmosObject, Constants.SelectorExpression)); + return new CqlSelectManyEnumerableExpression(sourceExpression, declaredVariable, selectorExpression); + } + + private static CqlTakeEnumerableExpression DeserializeTakeEnumerableExpression(CosmosObject cosmosObject) + { + CqlEnumerableExpression sourceExpression = DeserializeCqlEnumerableExpression(GetValue(cosmosObject, Constants.SourceExpression)); + long skipValue = Number64.ToLong(GetValue(cosmosObject, Constants.SkipValue).Value); + long takeExpression = Number64.ToLong(GetValue(cosmosObject, Constants.TakeValue).Value); + return new CqlTakeEnumerableExpression(sourceExpression, Convert.ToUInt64(skipValue), Convert.ToUInt64(takeExpression)); + } + + private static CqlWhereEnumerableExpression DeserializeWhereEnumerableExpression(CosmosObject cosmosObject) + { + CqlEnumerableExpression sourceExpression = DeserializeCqlEnumerableExpression(GetValue(cosmosObject, Constants.SourceExpression)); + CqlVariable declaredVariable = DeserializeCqlVariable(GetValue(cosmosObject, Constants.DeclaredVariable)); + CqlScalarExpression expression = DeserializeScalarExpression(GetValue(cosmosObject, Constants.Expression)); + return new CqlWhereEnumerableExpression(sourceExpression, declaredVariable, expression); + } + + #endregion + + #region Scalar Expressions + + private static CqlScalarExpression DeserializeScalarExpression(CosmosObject cosmosObject) + { + CqlScalarExpressionKind scalarExpressionKind = GetEnumValue(GetValue(cosmosObject, Constants.Kind).Value); + switch (scalarExpressionKind) + { + case CqlScalarExpressionKind.ArrayCreate: + return DeserializeArrayCreateScalarExpression(cosmosObject); + case CqlScalarExpressionKind.ArrayIndexer: + return DeserializeArrayIndexerScalarExpression(cosmosObject); + case CqlScalarExpressionKind.BinaryOperator: + return DeserializeBinaryOperatorScalarExpression(cosmosObject); + case CqlScalarExpressionKind.IsOperator: + return DeserializeIsOperatorScalarExpression(cosmosObject); + case CqlScalarExpressionKind.Let: + return DeserializeLetScalarExpression(cosmosObject); + case CqlScalarExpressionKind.Literal: + return DeserializeLiteralScalarExpression(cosmosObject); + case CqlScalarExpressionKind.Mux: + return DeserializeMuxScalarExpression(cosmosObject); + case CqlScalarExpressionKind.ObjectCreate: + return DeserializeObjectCreateScalarExpression(cosmosObject); + case CqlScalarExpressionKind.PropertyRef: + return DeserializePropertyRefScalarExpression(cosmosObject); + case CqlScalarExpressionKind.SystemFunctionCall: + return DeserializeSystemFunctionCallScalarExpression(cosmosObject); + case CqlScalarExpressionKind.TupleCreate: + return DeserializeTupleCreateScalarExpression(cosmosObject); + case CqlScalarExpressionKind.TupleItemRef: + return DeserializeTupleItemRefScalarExpression(cosmosObject); + case CqlScalarExpressionKind.UnaryOperator: + return DeserializeUnaryScalarExpression(cosmosObject); + case CqlScalarExpressionKind.UserDefinedFunctionCall: + return DeserializeUserDefinedFunctionCallScalarExpression(cosmosObject); + case CqlScalarExpressionKind.VariableRef: + return DeserializeVariableRefScalarExpression(cosmosObject); + default: + throw new NotSupportedException($"Invalid CqlExpression kind: {scalarExpressionKind}"); + } + } + + private static CqlArrayCreateScalarExpression DeserializeArrayCreateScalarExpression(CosmosObject cosmosObject) + { + IReadOnlyList items = DeserializeScalarExpressionArray(GetValue(cosmosObject, Constants.Items)); + return new CqlArrayCreateScalarExpression(items); + } + + private static CqlArrayIndexerScalarExpression DeserializeArrayIndexerScalarExpression(CosmosObject cosmosObject) + { + CqlScalarExpression expression = DeserializeScalarExpression(GetValue(cosmosObject, Constants.Expression)); + long index = Number64.ToLong(GetValue(cosmosObject, Constants.Index).Value); + return new CqlArrayIndexerScalarExpression(expression, Convert.ToUInt64(index)); + } + + private static CqlBinaryScalarExpression DeserializeBinaryOperatorScalarExpression(CosmosObject cosmosObject) + { + CqlBinaryScalarOperatorKind operatorKind = GetEnumValue(GetValue(cosmosObject, Constants.OperatorKind).Value); + CqlScalarExpression leftExpression = DeserializeScalarExpression(GetValue(cosmosObject, Constants.LeftExpression)); + CqlScalarExpression rightExpression = DeserializeScalarExpression(GetValue(cosmosObject, Constants.RightExpression)); + return new CqlBinaryScalarExpression(operatorKind, leftExpression, rightExpression); + } + + private static CqlIsOperatorScalarExpression DeserializeIsOperatorScalarExpression(CosmosObject cosmosObject) + { + CqlIsOperatorKind operatorKind = GetEnumValue(GetValue(cosmosObject, Constants.OperatorKind).Value); + CqlScalarExpression expression = DeserializeScalarExpression(GetValue(cosmosObject, Constants.Expression)); + return new CqlIsOperatorScalarExpression(operatorKind, expression); + } + + private static CqlLetScalarExpression DeserializeLetScalarExpression(CosmosObject cosmosObject) + { + CqlVariable declaredVariable = DeserializeCqlVariable(GetValue(cosmosObject, Constants.DeclaredVariable)); + CqlScalarExpression declaredVariableExpression = DeserializeScalarExpression(GetValue(cosmosObject, Constants.DeclaredVariableExpression)); + CqlScalarExpression expression = DeserializeScalarExpression(GetValue(cosmosObject, Constants.Expression)); + return new CqlLetScalarExpression(declaredVariable, declaredVariableExpression, expression); + } + + private static CqlLiteralScalarExpression DeserializeLiteralScalarExpression(CosmosObject cosmosObject) + { + CosmosObject literalObject = GetValue(cosmosObject, Constants.Literal); + return new CqlLiteralScalarExpression(DeserializeLiteral(literalObject)); + } + + private static CqlMuxScalarExpression DeserializeMuxScalarExpression(CosmosObject cosmosObject) + { + CqlScalarExpression conditionExpression = DeserializeScalarExpression(GetValue(cosmosObject, Constants.ConditionExpression)); + CqlScalarExpression leftExpression = DeserializeScalarExpression(GetValue(cosmosObject, Constants.LeftExpression)); + CqlScalarExpression rightExpression = DeserializeScalarExpression(GetValue(cosmosObject, Constants.RightExpression)); + return new CqlMuxScalarExpression(conditionExpression, leftExpression, rightExpression); + } + + private static CqlObjectCreateScalarExpression DeserializeObjectCreateScalarExpression(CosmosObject cosmosObject) + { + IReadOnlyList properties = DeserializeObjectProperties(GetValue(cosmosObject, Constants.Properties)); + return new CqlObjectCreateScalarExpression(properties); + } + + private static CqlPropertyRefScalarExpression DeserializePropertyRefScalarExpression(CosmosObject cosmosObject) + { + CqlScalarExpression expression = DeserializeScalarExpression(GetValue(cosmosObject, Constants.Expression)); + string propertyName = GetValue(cosmosObject, Constants.PropertyName).Value; + return new CqlPropertyRefScalarExpression(expression, propertyName); + } + + private static CqlSystemFunctionCallScalarExpression DeserializeSystemFunctionCallScalarExpression(CosmosObject cosmosObject) + { + CqlBuiltinScalarFunctionKind functionKind = GetEnumValue(GetValue(cosmosObject, Constants.FunctionKind).Value); + IReadOnlyList arguments = DeserializeScalarExpressionArray(GetValue(cosmosObject, Constants.Arguments)); + return new CqlSystemFunctionCallScalarExpression(functionKind, arguments); + } + + private static CqlTupleCreateScalarExpression DeserializeTupleCreateScalarExpression(CosmosObject cosmosObject) + { + IReadOnlyList items = DeserializeScalarExpressionArray(GetValue(cosmosObject, Constants.Items)); + return new CqlTupleCreateScalarExpression(items); + } + + private static CqlTupleItemRefScalarExpression DeserializeTupleItemRefScalarExpression(CosmosObject cosmosObject) + { + CqlScalarExpression expression = DeserializeScalarExpression(GetValue(cosmosObject, Constants.Expression)); + long index = Number64.ToLong(GetValue(cosmosObject, Constants.Index).Value); + return new CqlTupleItemRefScalarExpression(expression, Convert.ToUInt64(index)); + } + + private static CqlUnaryScalarExpression DeserializeUnaryScalarExpression(CosmosObject cosmosObject) + { + CqlUnaryScalarOperatorKind operatorKind = GetEnumValue(GetValue(cosmosObject, Constants.OperatorKind).Value); + CqlScalarExpression scalarExpression = DeserializeScalarExpression(GetValue(cosmosObject, Constants.Expression)); + return new CqlUnaryScalarExpression(operatorKind, scalarExpression); + } + + private static CqlUserDefinedFunctionCallScalarExpression DeserializeUserDefinedFunctionCallScalarExpression(CosmosObject cosmosObject) + { + string identifierString = GetValue(cosmosObject, Constants.Identifier).Value; + CqlFunctionIdentifier functionIdentifier = new CqlFunctionIdentifier(identifierString); + IReadOnlyList arguments = DeserializeScalarExpressionArray(GetValue(cosmosObject, Constants.Arguments)); + bool builtin = GetValue(cosmosObject, Constants.Builtin).Value; + return new CqlUserDefinedFunctionCallScalarExpression(functionIdentifier, arguments, builtin); + } + + private static CqlVariableRefScalarExpression DeserializeVariableRefScalarExpression(CosmosObject cosmosObject) + { + CqlVariable variable = DeserializeCqlVariable(GetValue(cosmosObject, Constants.Variable)); + return new CqlVariableRefScalarExpression(variable); + } + + #endregion + + #region Aggregate + + private static IReadOnlyList DeserializeAggregateArray(CosmosArray cosmosArray) + { + List aggregates = new List(cosmosArray.Count); + foreach (CosmosElement aggregateElement in cosmosArray) + { + CosmosObject aggregateObject = CastToCosmosObject(aggregateElement); + aggregates.Add(DeserializeAggregate(aggregateObject)); + } + + return aggregates; + } + + private static CqlAggregate DeserializeAggregate(CosmosObject cosmosObject) + { + CqlAggregateKind aggregateKind = GetEnumValue(GetValue(cosmosObject, Constants.Kind).Value); + switch (aggregateKind) + { + case CqlAggregateKind.Builtin: + return DeserializeBuiltInAggregateExpression(cosmosObject); + case CqlAggregateKind.Tuple: + return DeserializeTupleAggregateExpression(cosmosObject); + default: + throw new NotSupportedException($"Invalid CqlExpression kind: {aggregateKind}"); + } + } + + private static CqlBuiltinAggregate DeserializeBuiltInAggregateExpression(CosmosObject cosmosObject) + { + CqlAggregateOperatorKind aggregateOperatorKind = GetEnumValue(GetValue(cosmosObject, Constants.OperatorKind).Value); + return new CqlBuiltinAggregate(aggregateOperatorKind); + } + + private static CqlTupleAggregate DeserializeTupleAggregateExpression(CosmosObject cosmosObject) + { + CosmosArray tupleArray = GetValue(cosmosObject, Constants.Items); + List aggregates = new List(tupleArray.Count); + + foreach (CosmosElement tupleElement in tupleArray) + { + CosmosObject tupleObject = CastToCosmosObject(tupleElement); + CqlAggregate aggregate = DeserializeAggregate(tupleObject); + aggregates.Add(aggregate); + } + + return new CqlTupleAggregate(aggregates); + } + + #endregion + + #region Literal + + private static CqlLiteral DeserializeLiteral(CosmosObject cosmosObject) + { + CqlLiteralKind literalKind = GetEnumValue(GetValue(cosmosObject, Constants.Kind).Value); + switch (literalKind) + { + case CqlLiteralKind.Array: + return new CqlArrayLiteral(DeserializeLiteralArray(GetValue(cosmosObject, Constants.Items))); + case CqlLiteralKind.Boolean: + return new CqlBooleanLiteral(GetValue(cosmosObject, Constants.Value).Value); + case CqlLiteralKind.Null: + return CqlNullLiteral.Singleton; + case CqlLiteralKind.Number: + return new CqlNumberLiteral(GetValue(cosmosObject, Constants.Value).Value); + case CqlLiteralKind.Object: + return new CqlObjectLiteral(DeserializeObjectLiteralArray(GetValue(cosmosObject, Constants.Properties))); + case CqlLiteralKind.String: + return new CqlStringLiteral(GetValue(cosmosObject, Constants.Value).Value); + case CqlLiteralKind.Undefined: + return CqlUndefinedLiteral.Singleton; + default: + throw new NotSupportedException($"Invalid CqlExpression kind: {literalKind}"); + } + } + + private static IReadOnlyList DeserializeLiteralArray(CosmosArray cosmosArray) + { + List literals = new List(cosmosArray.Count); + foreach (CosmosElement literalElement in cosmosArray) + { + CosmosObject literalObject = CastToCosmosObject(literalElement); + literals.Add(DeserializeLiteral(literalObject)); + } + + return literals; + } + + private static IReadOnlyList DeserializeObjectLiteralArray(CosmosArray cosmosArray) + { + List objectLiterals = new List(cosmosArray.Count); + foreach (CosmosElement objectLiteralElement in cosmosArray) + { + CosmosObject propertyObject = CastToCosmosObject(objectLiteralElement); + string name = GetValue(propertyObject, Constants.Name).Value; + CqlLiteral literal = DeserializeLiteral(propertyObject); + CqlObjectLiteralProperty objectLiteralProperty = new CqlObjectLiteralProperty(name, literal); + objectLiterals.Add(objectLiteralProperty); + } + + return objectLiterals; + } + + #endregion + + #region Helper Functions + + private static CqlVariable DeserializeCqlVariable(CosmosObject cosmosObject) + { + string name = GetValue(cosmosObject, Constants.Name).Value; + long uniqueId = Number64.ToLong(GetValue(cosmosObject, Constants.UniqueId).Value); + + return new CqlVariable(name, uniqueId); + } + + private static IReadOnlyList DeserializeObjectProperties(CosmosArray cosmosArray) + { + List properties = new List(cosmosArray.Count); + foreach (CosmosElement propertyElement in cosmosArray) + { + CosmosObject propertyObject = CastToCosmosObject(propertyElement); + string objectPropertyName = GetValue(propertyObject, Constants.Name).Value; + CqlScalarExpression expression = DeserializeScalarExpression(GetValue(propertyObject, Constants.Expression)); + properties.Add(new CqlObjectProperty(objectPropertyName, expression)); + } + + return properties; + } + + private static IReadOnlyList DeserializeScalarExpressionArray(CosmosArray cosmosArray) + { + List expressions = new List(cosmosArray.Count); + foreach (CosmosElement itemElement in cosmosArray) + { + CosmosObject itemObject = CastToCosmosObject(itemElement); + CqlScalarExpression expression = DeserializeScalarExpression(itemObject); + expressions.Add(expression); + } + + return expressions; + } + + private static IReadOnlyList DeserializeOrderByItemArray(CosmosArray cosmosArray) + { + List expressions = new List(cosmosArray.Count); + foreach (CosmosElement itemElement in cosmosArray) + { + CosmosObject itemObject = CastToCosmosObject(itemElement); + CqlSortOrder sortOrder = GetEnumValue(GetValue(itemObject, Constants.SortOrder).Value); + CqlScalarExpression scalarExpression = DeserializeScalarExpression(itemObject); + expressions.Add(new CqlOrderByItem(scalarExpression, sortOrder)); + } + + return expressions; + } + + private static T GetValue(CosmosObject cosmosObject, string propertyName) + where T : CosmosElement + { + bool found = TryGetValue(cosmosObject, propertyName, out T value); + + if (!found) + { + throw new InvalidOperationException($"{GetExceptionMessage()} The required property {propertyName} was not found in {cosmosObject}"); + } + + return value; + } + + private static bool TryGetValue(CosmosObject cosmosObject, string propertyName, out T result) + where T : CosmosElement + { + bool found = cosmosObject.TryGetValue(propertyName, out CosmosElement value); + + if (found && value != null) + { + result = value as T; + if (result == null) + { + throw new InvalidOperationException($"{GetExceptionMessage()} Type mismatch for property {propertyName}. Expected {typeof(T)}, Actual {value?.GetType()}"); + } + + return found; + } + + result = default(T); + return found; + } + + private static TEnum GetEnumValue(string propertyName) + where TEnum : struct + { + bool success = Enum.TryParse(propertyName, ignoreCase: true, out TEnum result); + if (!success) + { + throw new InvalidOperationException($"{GetExceptionMessage()} The string representation of {propertyName} enumerated constant was not able to be converted to an equivalent enumerated object"); + } + + return result; + } + + private static string GetExceptionMessage() + { + Version sdkVersion = Assembly.GetAssembly(typeof(CosmosClient)).GetName().Version; + string clientSDKVersion = $"{sdkVersion.Major}.{sdkVersion.Minor}.{sdkVersion.Build}"; + + return $"Exception occurred while deserializing query plan. Version : '{clientSDKVersion}', Exception/Reason : "; + } + + private static CosmosObject CastToCosmosObject(CosmosElement cosmosElement) + { + CosmosObject propertyObject = cosmosElement as CosmosObject; + if (propertyObject != null) + { + return propertyObject; + } + else + { + throw new InvalidOperationException("Unable to cast CosmosElement to CosmosObject."); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/ClientDistributionPlan.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/ClientDistributionPlan.cs new file mode 100644 index 0000000000..51da84c03e --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/ClientDistributionPlan.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class ClientDistributionPlan + { + public ClientDistributionPlan(CqlEnumerableExpression cql) + { + this.Cql = cql ?? throw new ArgumentNullException(nameof(cql)); + } + + public CqlEnumerableExpression Cql { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlAggregate.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlAggregate.cs new file mode 100644 index 0000000000..3df9af326f --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlAggregate.cs @@ -0,0 +1,16 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal abstract class CqlAggregate + { + protected CqlAggregate(CqlAggregateKind kind) + { + this.Kind = kind; + } + + public CqlAggregateKind Kind { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlAggregateEnumerableExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlAggregateEnumerableExpression.cs new file mode 100644 index 0000000000..eb4a09a966 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlAggregateEnumerableExpression.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlAggregateEnumerableExpression : CqlEnumerableExpression + { + public CqlAggregateEnumerableExpression(CqlEnumerableExpression sourceExpression, CqlAggregate aggregate) + : base(CqlEnumerableExpressionKind.Aggregate) + { + this.SourceExpression = sourceExpression ?? throw new ArgumentNullException(nameof(sourceExpression)); + this.Aggregate = aggregate ?? throw new ArgumentNullException(nameof(aggregate)); + } + + public CqlEnumerableExpression SourceExpression { get; } + + public CqlAggregate Aggregate { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlAggregateKind.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlAggregateKind.cs new file mode 100644 index 0000000000..c25ae41bb8 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlAggregateKind.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal enum CqlAggregateKind + { + Builtin, + Tuple, + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlAggregateOperatorKind.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlAggregateOperatorKind.cs new file mode 100644 index 0000000000..57c1955b74 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlAggregateOperatorKind.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal enum CqlAggregateOperatorKind + { + All, + Any, + Array, + Count, + First, + Last, + Max, + Min, + Sum, + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlArrayCreateScalarExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlArrayCreateScalarExpression.cs new file mode 100644 index 0000000000..84b829179c --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlArrayCreateScalarExpression.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + using System.Collections.Generic; + + internal class CqlArrayCreateScalarExpression : CqlScalarExpression + { + private const string Array = "Array"; + + public CqlArrayCreateScalarExpression(IReadOnlyList items) + : base(CqlScalarExpressionKind.ArrayCreate) + { + this.ArrayKind = Array; + this.Items = items ?? throw new ArgumentNullException(nameof(items)); + } + + public string ArrayKind { get; } + + public IReadOnlyList Items { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlArrayIndexerScalarExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlArrayIndexerScalarExpression.cs new file mode 100644 index 0000000000..65d280a02e --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlArrayIndexerScalarExpression.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlArrayIndexerScalarExpression : CqlScalarExpression + { + public CqlArrayIndexerScalarExpression(CqlScalarExpression expression, ulong index) + : base(CqlScalarExpressionKind.ArrayIndexer) + { + this.Expression = expression ?? throw new ArgumentNullException(nameof(expression)); + this.Index = index; + } + + public CqlScalarExpression Expression { get; } + + public ulong Index { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlArrayLiteral.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlArrayLiteral.cs new file mode 100644 index 0000000000..a50036123d --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlArrayLiteral.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + using System.Collections.Generic; + + internal class CqlArrayLiteral : CqlLiteral + { + public CqlArrayLiteral(IReadOnlyList items) + : base(CqlLiteralKind.Array) + { + this.Items = items ?? throw new ArgumentNullException(nameof(items)); + } + + public IReadOnlyList Items { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBinaryScalarExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBinaryScalarExpression.cs new file mode 100644 index 0000000000..9f3a382fd0 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBinaryScalarExpression.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlBinaryScalarExpression : CqlScalarExpression + { + public CqlBinaryScalarExpression(CqlBinaryScalarOperatorKind operatorKind, CqlScalarExpression leftExpression, CqlScalarExpression rightExpression) + : base(CqlScalarExpressionKind.BinaryOperator) + { + this.OperatorKind = operatorKind; + this.LeftExpression = leftExpression ?? throw new ArgumentNullException(nameof(leftExpression)); + this.RightExpression = rightExpression ?? throw new ArgumentNullException(nameof(rightExpression)); + } + + public CqlBinaryScalarOperatorKind OperatorKind { get; } + + public CqlScalarExpression LeftExpression { get; } + + public CqlScalarExpression RightExpression { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBinaryScalarOperatorKind.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBinaryScalarOperatorKind.cs new file mode 100644 index 0000000000..c41a740994 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBinaryScalarOperatorKind.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal enum CqlBinaryScalarOperatorKind + { + Add, + And, + BitwiseAnd, + BitwiseOr, + BitwiseXor, + Divide, + Equal, + GreaterThan, + GreaterThanOrEqual, + LeftShift, + LessThan, + LessThanOrEqual, + Modulo, + Multiply, + NotEqual, + Or, + RightShift, + Subtract, + ZeroFillRightShift + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBooleanLiteral.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBooleanLiteral.cs new file mode 100644 index 0000000000..06f06b4e64 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBooleanLiteral.cs @@ -0,0 +1,17 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal class CqlBooleanLiteral : CqlLiteral + { + public CqlBooleanLiteral(bool value) + : base(CqlLiteralKind.Boolean) + { + this.Value = value; + } + + public bool Value { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBuiltinAggregate.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBuiltinAggregate.cs new file mode 100644 index 0000000000..8dcebf5bb8 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBuiltinAggregate.cs @@ -0,0 +1,17 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal class CqlBuiltinAggregate : CqlAggregate + { + public CqlBuiltinAggregate(CqlAggregateOperatorKind operatorKind) + : base(CqlAggregateKind.Builtin) + { + this.OperatorKind = operatorKind; + } + + public CqlAggregateOperatorKind OperatorKind { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBuiltinScalarFunctionKind.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBuiltinScalarFunctionKind.cs new file mode 100644 index 0000000000..ae59e55cf1 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlBuiltinScalarFunctionKind.cs @@ -0,0 +1,126 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal enum CqlBuiltinScalarFunctionKind + { + Abs, + Acos, + All, + Any, + Array, + Array_Concat, + Array_Contains, + Array_Length, + Array_Slice, + Asin, + Atan, + Atn2, + Avg, + Ceiling, + Choose, + Concat, + Contains, + Cos, + Cot, + Count, + DateTimeAdd, + DateTimeBin, + DateTimeDiff, + DateTimeFromParts, + DateTimePart, + DateTimeToTicks, + DateTimeToTimestamp, + Degrees, + DocumentId, + EndsWith, + Exp, + First, + Floor, + GetCurrentDateTime, + GetCurrentDateTimeStatic, + GetCurrentTicks, + GetCurrentTicksStatic, + GetCurrentTimestamp, + GetCurrentTimestampStatic, + Iif, + Index_Of, + IntAdd, + IntBitAnd, + IntBitLeftShift, + IntBitNot, + IntBitOr, + IntBitRightShift, + IntBitXor, + IntDiv, + IntMod, + IntMul, + IntSub, + Is_Array, + Is_Bool, + Is_DateTime, + Is_Defined, + Is_Finite_Number, + Is_Integer, + Is_Null, + Is_Number, + Is_Object, + Is_Primitive, + Is_String, + Last, + LastIndexOf, + Left, + Length, + Like, + Log, + Log10, + Lower, + Ltrim, + Max, + Min, + NumberBin, + ObjectToArray, + Pi, + Power, + Radians, + Rand, + RegexMatch, + Replace, + Replicate, + Reverse, + Right, + Round, + Rtrim, + SetDifference, + SetIntersect, + SetUnion, + Sign, + Sin, + Sqrt, + Square, + ST_Area, + ST_Distance, + ST_Intersects, + ST_IsValid, + ST_IsValidDetailed, + ST_Within, + StartsWith, + StringEquals, + StringToArray, + StringToBoolean, + StringToNull, + StringToNumber, + StringToObject, + Substring, + Sum, + Tan, + TicksToDateTime, + TimestampToDateTime, + ToString, + Trim, + Trunc, + Upper + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlDistinctEnumerableExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlDistinctEnumerableExpression.cs new file mode 100644 index 0000000000..8fa7515235 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlDistinctEnumerableExpression.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + using System.Collections.Generic; + + internal class CqlDistinctEnumerableExpression : CqlEnumerableExpression + { + public CqlDistinctEnumerableExpression(CqlEnumerableExpression sourceExpression, CqlVariable declaredVariable, IReadOnlyList expression) + : base(CqlEnumerableExpressionKind.Distinct) + { + this.SourceExpression = sourceExpression ?? throw new ArgumentNullException(nameof(sourceExpression)); + this.DeclaredVariable = declaredVariable ?? throw new ArgumentNullException(nameof(declaredVariable)); + this.Expression = expression ?? throw new ArgumentNullException(nameof(expression)); + } + + public CqlEnumerableExpression SourceExpression { get; } + + public CqlVariable DeclaredVariable { get; } + + public IReadOnlyList Expression { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlEnumerableExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlEnumerableExpression.cs new file mode 100644 index 0000000000..7b30bdc629 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlEnumerableExpression.cs @@ -0,0 +1,16 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal abstract class CqlEnumerableExpression + { + protected CqlEnumerableExpression(CqlEnumerableExpressionKind kind) + { + this.Kind = kind; + } + + public CqlEnumerableExpressionKind Kind { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlEnumerableExpressionKind.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlEnumerableExpressionKind.cs new file mode 100644 index 0000000000..11b135895d --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlEnumerableExpressionKind.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal enum CqlEnumerableExpressionKind + { + Aggregate, + Distinct, + GroupBy, + Input, + OrderBy, + ScalarAsEnumerable, + Select, + SelectMany, + Take, + Where, + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlEnumerationKind.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlEnumerationKind.cs new file mode 100644 index 0000000000..60d96d2703 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlEnumerationKind.cs @@ -0,0 +1,14 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal enum CqlEnumerationKind + { + ArrayItems, + PropertyValues, + Children, + Descendants, + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlFunctionIdentifier.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlFunctionIdentifier.cs new file mode 100644 index 0000000000..16a717bdfe --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlFunctionIdentifier.cs @@ -0,0 +1,18 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlFunctionIdentifier + { + public CqlFunctionIdentifier(string name) + { + this.Name = name ?? throw new ArgumentNullException(nameof(name)); + } + + public string Name { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlGroupByEnumerableExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlGroupByEnumerableExpression.cs new file mode 100644 index 0000000000..b3efe8cb5d --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlGroupByEnumerableExpression.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + using System.Collections.Generic; + + internal class CqlGroupByEnumerableExpression : CqlEnumerableExpression + { + public CqlGroupByEnumerableExpression(CqlEnumerableExpression sourceExpression, ulong keyCount, IReadOnlyList aggregates) + : base(CqlEnumerableExpressionKind.GroupBy) + { + this.SourceExpression = sourceExpression ?? throw new ArgumentNullException(nameof(sourceExpression)); + this.KeyCount = keyCount; + this.Aggregates = aggregates ?? throw new ArgumentNullException(nameof(aggregates)); + } + + public CqlEnumerableExpression SourceExpression { get; } + + public ulong KeyCount { get; } + + public IReadOnlyList Aggregates { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlInputEnumerableExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlInputEnumerableExpression.cs new file mode 100644 index 0000000000..a9a1ba8d6f --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlInputEnumerableExpression.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlInputEnumerableExpression : CqlEnumerableExpression + { + public CqlInputEnumerableExpression(string name) + : base(CqlEnumerableExpressionKind.Input) + { + this.Name = name ?? throw new ArgumentNullException(nameof(name)); + } + + public string Name { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlIsOperatorKind.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlIsOperatorKind.cs new file mode 100644 index 0000000000..84a8e17601 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlIsOperatorKind.cs @@ -0,0 +1,11 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal enum CqlIsOperatorKind + { + Defined, + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlIsOperatorScalarExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlIsOperatorScalarExpression.cs new file mode 100644 index 0000000000..c1aa03907d --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlIsOperatorScalarExpression.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + using System.Collections.Generic; + + internal class CqlIsOperatorScalarExpression : CqlScalarExpression + { + public CqlIsOperatorScalarExpression(CqlIsOperatorKind operatorKind, CqlScalarExpression expression) + : base(CqlScalarExpressionKind.IsOperator) + { + this.OperatorKind = operatorKind; + this.Expression = expression ?? throw new ArgumentNullException(nameof(expression)); + } + + public CqlIsOperatorKind OperatorKind { get; } + + public CqlScalarExpression Expression { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlLetScalarExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlLetScalarExpression.cs new file mode 100644 index 0000000000..329e2f36cd --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlLetScalarExpression.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlLetScalarExpression : CqlScalarExpression + { + public CqlLetScalarExpression(CqlVariable declaredVariable, CqlScalarExpression declaredVariableExpression, CqlScalarExpression expression) + : base(CqlScalarExpressionKind.Let) + { + this.DeclaredVariable = declaredVariable ?? throw new ArgumentNullException(nameof(declaredVariable)); + this.DeclaredVariableExpression = declaredVariableExpression ?? throw new ArgumentNullException(nameof(declaredVariableExpression)); + this.Expression = expression ?? throw new ArgumentNullException(nameof(expression)); + } + + public CqlVariable DeclaredVariable { get; } + + public CqlScalarExpression DeclaredVariableExpression { get; } + + public CqlScalarExpression Expression { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlLiteral.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlLiteral.cs new file mode 100644 index 0000000000..d5b17b06ac --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlLiteral.cs @@ -0,0 +1,16 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal abstract class CqlLiteral + { + protected CqlLiteral(CqlLiteralKind kind) + { + this.Kind = kind; + } + + public CqlLiteralKind Kind { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlLiteralKind.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlLiteralKind.cs new file mode 100644 index 0000000000..e03b18a28a --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlLiteralKind.cs @@ -0,0 +1,17 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal enum CqlLiteralKind + { + Undefined, + Array, + Boolean, + Null, + Number, + Object, + String, + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlLiteralScalarExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlLiteralScalarExpression.cs new file mode 100644 index 0000000000..ebc82d9048 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlLiteralScalarExpression.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlLiteralScalarExpression : CqlScalarExpression + { + public CqlLiteralScalarExpression(CqlLiteral literal) + : base(CqlScalarExpressionKind.Literal) + { + this.Literal = literal ?? throw new ArgumentNullException(nameof(literal)); + } + + public CqlLiteral Literal { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlMuxScalarExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlMuxScalarExpression.cs new file mode 100644 index 0000000000..0ebb3cab53 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlMuxScalarExpression.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlMuxScalarExpression : CqlScalarExpression + { + public CqlMuxScalarExpression(CqlScalarExpression conditionExpression, CqlScalarExpression leftExpression, CqlScalarExpression rightExpression) + : base(CqlScalarExpressionKind.Mux) + { + this.ConditionExpression = conditionExpression ?? throw new ArgumentNullException(nameof(conditionExpression)); + this.LeftExpression = leftExpression ?? throw new ArgumentNullException(nameof(leftExpression)); + this.RightExpression = rightExpression ?? throw new ArgumentNullException(nameof(rightExpression)); + } + + public CqlScalarExpression ConditionExpression { get; } + + public CqlScalarExpression LeftExpression { get; } + + public CqlScalarExpression RightExpression { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlNullLiteral.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlNullLiteral.cs new file mode 100644 index 0000000000..53696840b1 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlNullLiteral.cs @@ -0,0 +1,16 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal class CqlNullLiteral : CqlLiteral + { + public static readonly CqlNullLiteral Singleton = new CqlNullLiteral(); + + private CqlNullLiteral() + : base(CqlLiteralKind.Null) + { + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlNumberLiteral.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlNumberLiteral.cs new file mode 100644 index 0000000000..28769462d7 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlNumberLiteral.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System.Collections.Generic; + + internal class CqlNumberLiteral : CqlLiteral + { + public CqlNumberLiteral(Number64 value) + : base(CqlLiteralKind.Number) + { + this.Value = value; + } + + public Number64 Value { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlObjectCreateScalarExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlObjectCreateScalarExpression.cs new file mode 100644 index 0000000000..1bcd44e106 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlObjectCreateScalarExpression.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + using System.Collections.Generic; + + internal class CqlObjectCreateScalarExpression : CqlScalarExpression + { + private const string Object = "Object"; + + public CqlObjectCreateScalarExpression(IReadOnlyList properties) + : base(CqlScalarExpressionKind.ObjectCreate) + { + this.Properties = properties ?? throw new ArgumentNullException(nameof(properties)); + this.ObjectKind = Object; + } + + public IReadOnlyList Properties { get; } + + public string ObjectKind { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlObjectLiteral.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlObjectLiteral.cs new file mode 100644 index 0000000000..e5ba8ff343 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlObjectLiteral.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + using System.Collections.Generic; + + internal class CqlObjectLiteral : CqlLiteral + { + public CqlObjectLiteral(IReadOnlyList properties) + : base(CqlLiteralKind.Object) + { + this.Properties = properties ?? throw new ArgumentNullException(nameof(properties)); + } + + public IReadOnlyList Properties { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlObjectLiteralProperty.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlObjectLiteralProperty.cs new file mode 100644 index 0000000000..4a063d4449 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlObjectLiteralProperty.cs @@ -0,0 +1,21 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlObjectLiteralProperty + { + public CqlObjectLiteralProperty(string name, CqlLiteral literal) + { + this.Name = name ?? throw new ArgumentNullException(nameof(name)); + this.Literal = literal ?? throw new ArgumentNullException(nameof(literal)); + } + + public string Name { get; } + + public CqlLiteral Literal { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlObjectProperty.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlObjectProperty.cs new file mode 100644 index 0000000000..7b97de1620 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlObjectProperty.cs @@ -0,0 +1,21 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlObjectProperty + { + public CqlObjectProperty(string name, CqlScalarExpression expression) + { + this.Name = name ?? throw new ArgumentNullException(nameof(name)); + this.Expression = expression ?? throw new ArgumentNullException(nameof(expression)); + } + + public string Name { get; } + + public CqlScalarExpression Expression { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlOrderByEnumerableExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlOrderByEnumerableExpression.cs new file mode 100644 index 0000000000..b4b9603841 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlOrderByEnumerableExpression.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + using System.Collections.Generic; + + internal class CqlOrderByEnumerableExpression : CqlEnumerableExpression + { + public CqlOrderByEnumerableExpression(CqlEnumerableExpression sourceExpression, CqlVariable declaredVariable, IReadOnlyList items) + : base(CqlEnumerableExpressionKind.OrderBy) + { + this.SourceExpression = sourceExpression ?? throw new ArgumentNullException(nameof(sourceExpression)); + this.DeclaredVariable = declaredVariable ?? throw new ArgumentNullException(nameof(declaredVariable)); + this.Items = items ?? throw new ArgumentNullException(nameof(items)); + } + + public CqlEnumerableExpression SourceExpression { get; } + + public CqlVariable DeclaredVariable { get; } + + public IReadOnlyList Items { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlOrderByItem.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlOrderByItem.cs new file mode 100644 index 0000000000..8fb4a73810 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlOrderByItem.cs @@ -0,0 +1,21 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlOrderByItem + { + public CqlOrderByItem(CqlScalarExpression expression, CqlSortOrder sortOrder) + { + this.Expression = expression ?? throw new ArgumentNullException(nameof(expression)); + this.SortOrder = sortOrder; + } + + public CqlScalarExpression Expression { get; } + + public CqlSortOrder SortOrder { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlPropertyRefScalarExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlPropertyRefScalarExpression.cs new file mode 100644 index 0000000000..e93a31fe3e --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlPropertyRefScalarExpression.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + using System.Collections.Generic; + + internal class CqlPropertyRefScalarExpression : CqlScalarExpression + { + public CqlPropertyRefScalarExpression(CqlScalarExpression expression, string propertyName) + : base(CqlScalarExpressionKind.PropertyRef) + { + this.Expression = expression ?? throw new ArgumentNullException(nameof(expression)); + this.PropertyName = propertyName ?? throw new ArgumentNullException(nameof(propertyName)); + } + + public CqlScalarExpression Expression { get; } + + public string PropertyName { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlScalarAsEnumerableExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlScalarAsEnumerableExpression.cs new file mode 100644 index 0000000000..0d69d8b424 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlScalarAsEnumerableExpression.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlScalarAsEnumerableExpression : CqlEnumerableExpression + { + public CqlScalarAsEnumerableExpression(CqlScalarExpression expression, CqlEnumerationKind enumerationKind) + : base(CqlEnumerableExpressionKind.ScalarAsEnumerable) + { + this.Expression = expression ?? throw new ArgumentNullException(nameof(expression)); + this.EnumerationKind = enumerationKind; + } + + public CqlScalarExpression Expression { get; } + + public CqlEnumerationKind EnumerationKind { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlScalarExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlScalarExpression.cs new file mode 100644 index 0000000000..659bdc5f58 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlScalarExpression.cs @@ -0,0 +1,16 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal abstract class CqlScalarExpression + { + protected CqlScalarExpression(CqlScalarExpressionKind kind) + { + this.Kind = kind; + } + + public CqlScalarExpressionKind Kind { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlScalarExpressionKind.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlScalarExpressionKind.cs new file mode 100644 index 0000000000..fede841576 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlScalarExpressionKind.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal enum CqlScalarExpressionKind + { + ArrayCreate, + ArrayIndexer, + BinaryOperator, + IsOperator, + Let, + Literal, + Mux, + ObjectCreate, + PropertyRef, + SystemFunctionCall, + TupleCreate, + TupleItemRef, + UnaryOperator, + UserDefinedFunctionCall, + VariableRef, + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlSelectEnumerableExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlSelectEnumerableExpression.cs new file mode 100644 index 0000000000..0d052e980b --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlSelectEnumerableExpression.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlSelectEnumerableExpression : CqlEnumerableExpression + { + public CqlSelectEnumerableExpression(CqlEnumerableExpression sourceExpression, CqlVariable declaredVariable, CqlScalarExpression expression) + : base(CqlEnumerableExpressionKind.Select) + { + this.SourceExpression = sourceExpression ?? throw new ArgumentNullException(nameof(sourceExpression)); + this.DeclaredVariable = declaredVariable ?? throw new ArgumentNullException(nameof(declaredVariable)); + this.Expression = expression ?? throw new ArgumentNullException(nameof(expression)); + } + + public CqlEnumerableExpression SourceExpression { get; } + + public CqlVariable DeclaredVariable { get; } + + public CqlScalarExpression Expression { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlSelectManyEnumerableExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlSelectManyEnumerableExpression.cs new file mode 100644 index 0000000000..e34d4ba874 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlSelectManyEnumerableExpression.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlSelectManyEnumerableExpression : CqlEnumerableExpression + { + public CqlSelectManyEnumerableExpression(CqlEnumerableExpression sourceExpression, CqlVariable declaredVariable, CqlEnumerableExpression selectorExpression) + : base(CqlEnumerableExpressionKind.SelectMany) + { + this.SourceExpression = sourceExpression ?? throw new ArgumentNullException(nameof(sourceExpression)); + this.DeclaredVariable = declaredVariable ?? throw new ArgumentNullException(nameof(declaredVariable)); + this.SelectorExpression = selectorExpression ?? throw new ArgumentNullException(nameof(selectorExpression)); + } + + public CqlEnumerableExpression SourceExpression { get; } + + public CqlVariable DeclaredVariable { get; } + + public CqlEnumerableExpression SelectorExpression { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlSortOrder.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlSortOrder.cs new file mode 100644 index 0000000000..efd5aaeb42 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlSortOrder.cs @@ -0,0 +1,12 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal enum CqlSortOrder + { + Ascending, + Descending + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlStringLiteral.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlStringLiteral.cs new file mode 100644 index 0000000000..a20947b0dd --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlStringLiteral.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlStringLiteral : CqlLiteral + { + public CqlStringLiteral(string value) + : base(CqlLiteralKind.String) + { + this.Value = value ?? throw new ArgumentNullException(nameof(value)); + } + + public string Value { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlSystemFunctionCallScalarExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlSystemFunctionCallScalarExpression.cs new file mode 100644 index 0000000000..d42ee09f15 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlSystemFunctionCallScalarExpression.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + using System.Collections.Generic; + + internal class CqlSystemFunctionCallScalarExpression : CqlScalarExpression + { + public CqlSystemFunctionCallScalarExpression(CqlBuiltinScalarFunctionKind functionKind, IReadOnlyList arguments) + : base(CqlScalarExpressionKind.SystemFunctionCall) + { + this.FunctionKind = functionKind; + this.Arguments = arguments ?? throw new ArgumentNullException(nameof(arguments)); + } + + public CqlBuiltinScalarFunctionKind FunctionKind { get; } + + public IReadOnlyList Arguments { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlTakeEnumerableExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlTakeEnumerableExpression.cs new file mode 100644 index 0000000000..0391db64fd --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlTakeEnumerableExpression.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlTakeEnumerableExpression : CqlEnumerableExpression + { + public CqlTakeEnumerableExpression(CqlEnumerableExpression sourceExpression, ulong skipValue, ulong takeValue) + : base(CqlEnumerableExpressionKind.Take) + { + this.SourceExpression = sourceExpression ?? throw new ArgumentNullException(nameof(sourceExpression)); + this.SkipValue = skipValue; + this.TakeValue = takeValue; + } + + public CqlEnumerableExpression SourceExpression { get; } + + public ulong SkipValue { get; } + + public ulong TakeValue { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlTupleAggregate.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlTupleAggregate.cs new file mode 100644 index 0000000000..6f553c1ec8 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlTupleAggregate.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + using System.Collections.Generic; + + internal class CqlTupleAggregate : CqlAggregate + { + public CqlTupleAggregate(IReadOnlyList items) + : base(CqlAggregateKind.Tuple) + { + this.Items = items ?? throw new ArgumentNullException(nameof(items)); + } + + public IReadOnlyList Items { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlTupleCreateScalarExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlTupleCreateScalarExpression.cs new file mode 100644 index 0000000000..0c30e79d33 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlTupleCreateScalarExpression.cs @@ -0,0 +1,20 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + using System.Collections.Generic; + + internal class CqlTupleCreateScalarExpression : CqlScalarExpression + { + public CqlTupleCreateScalarExpression(IReadOnlyList items) + : base(CqlScalarExpressionKind.TupleCreate) + { + this.Items = items ?? throw new ArgumentNullException(nameof(items)); + } + + public IReadOnlyList Items { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlTupleItemRefScalarExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlTupleItemRefScalarExpression.cs new file mode 100644 index 0000000000..bc011cecf7 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlTupleItemRefScalarExpression.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlTupleItemRefScalarExpression : CqlScalarExpression + { + public CqlTupleItemRefScalarExpression(CqlScalarExpression expression, ulong index) + : base(CqlScalarExpressionKind.TupleItemRef) + { + this.Expression = expression ?? throw new ArgumentNullException(nameof(expression)); + this.Index = index; + } + + public CqlScalarExpression Expression { get; } + + public ulong Index { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlUnaryScalarExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlUnaryScalarExpression.cs new file mode 100644 index 0000000000..8131ea618d --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlUnaryScalarExpression.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlUnaryScalarExpression : CqlScalarExpression + { + public CqlUnaryScalarExpression(CqlUnaryScalarOperatorKind operatorKind, CqlScalarExpression expression) + : base(CqlScalarExpressionKind.UnaryOperator) + { + this.OperatorKind = operatorKind; + this.Expression = expression ?? throw new ArgumentNullException(nameof(expression)); + } + + public CqlUnaryScalarOperatorKind OperatorKind { get; } + + public CqlScalarExpression Expression { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlUnaryScalarOperatorKind.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlUnaryScalarOperatorKind.cs new file mode 100644 index 0000000000..30c0cedc54 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlUnaryScalarOperatorKind.cs @@ -0,0 +1,14 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal enum CqlUnaryScalarOperatorKind + { + BitwiseNot, + Minus, + Not, + Plus + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlUndefinedLiteral.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlUndefinedLiteral.cs new file mode 100644 index 0000000000..ecc8d556b2 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlUndefinedLiteral.cs @@ -0,0 +1,16 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + internal class CqlUndefinedLiteral : CqlLiteral + { + public static readonly CqlUndefinedLiteral Singleton = new CqlUndefinedLiteral(); + + private CqlUndefinedLiteral() + : base(CqlLiteralKind.Undefined) + { + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlUserDefinedFunctionCallScalarExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlUserDefinedFunctionCallScalarExpression.cs new file mode 100644 index 0000000000..fda301a6a1 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlUserDefinedFunctionCallScalarExpression.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + using System.Collections.Generic; + + internal class CqlUserDefinedFunctionCallScalarExpression : CqlScalarExpression + { + public CqlUserDefinedFunctionCallScalarExpression(CqlFunctionIdentifier identifier, IReadOnlyList arguments, bool builtin) + : base(CqlScalarExpressionKind.UserDefinedFunctionCall) + { + this.Identifier = identifier ?? throw new ArgumentNullException(nameof(identifier)); + this.Arguments = arguments ?? throw new ArgumentNullException(nameof(arguments)); + this.Builtin = builtin; + } + + public CqlFunctionIdentifier Identifier { get; } + + public IReadOnlyList Arguments { get; } + + public bool Builtin { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlVariable.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlVariable.cs new file mode 100644 index 0000000000..73cbac8324 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlVariable.cs @@ -0,0 +1,21 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlVariable + { + public CqlVariable(string name, long uniqueId) + { + this.Name = name ?? throw new ArgumentNullException(nameof(name)); + this.UniqueId = uniqueId; + } + + public string Name { get; } + + public long UniqueId { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlVariableRefScalarExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlVariableRefScalarExpression.cs new file mode 100644 index 0000000000..a909fb39a1 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlVariableRefScalarExpression.cs @@ -0,0 +1,19 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlVariableRefScalarExpression : CqlScalarExpression + { + public CqlVariableRefScalarExpression(CqlVariable variable) + : base(CqlScalarExpressionKind.VariableRef) + { + this.Variable = variable ?? throw new ArgumentNullException(nameof(variable)); + } + + public CqlVariable Variable { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlWhereEnumerableExpression.cs b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlWhereEnumerableExpression.cs new file mode 100644 index 0000000000..3f6db64aa2 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/ClientDistributionPlan/Cql/CqlWhereEnumerableExpression.cs @@ -0,0 +1,25 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql +{ + using System; + + internal class CqlWhereEnumerableExpression : CqlEnumerableExpression + { + public CqlWhereEnumerableExpression(CqlEnumerableExpression sourceExpression, CqlVariable declaredVariable, CqlScalarExpression expression) + : base(CqlEnumerableExpressionKind.Where) + { + this.SourceExpression = sourceExpression ?? throw new ArgumentNullException(nameof(sourceExpression)); + this.DeclaredVariable = declaredVariable ?? throw new ArgumentNullException(nameof(declaredVariable)); + this.Expression = expression ?? throw new ArgumentNullException(nameof(expression)); + } + + public CqlEnumerableExpression SourceExpression { get; } + + public CqlVariable DeclaredVariable { get; } + + public CqlScalarExpression Expression { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ClientDistributionPlanBaselineTests.TestClientDistributionPlanDeserialization.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ClientDistributionPlanBaselineTests.TestClientDistributionPlanDeserialization.xml new file mode 100644 index 0000000000..c59b58aef1 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ClientDistributionPlanBaselineTests.TestClientDistributionPlanDeserialization.xml @@ -0,0 +1,606 @@ + + + + Input Expression + {"clientDistributionPlan": {"Cql": {"Kind": "Input","Name": "root"}}} + + + { + "Cql": { + "Name": "root", + "Kind": 3 + } +} + + + + + Aggregate and ObjectCreate Expressions + {"clientDistributionPlan": {"Cql": {"Kind": "Select","DeclaredVariable": {"Name": "v0","UniqueId": 6},"Expression": {"Kind": "ObjectCreate","ObjectKind": "Object","Properties": [{"Name": "count_a","Expression": {"Kind": "VariableRef","Variable": {"Name": "v0","UniqueId": 6}}}]},"SourceExpression": {"Kind": "Aggregate","Aggregate": {"Kind": "Builtin","OperatorKind": "Sum"},"SourceExpression": {"Kind": "Input","Name": "root"}}}}} + + + { + "Cql": { + "SourceExpression": { + "SourceExpression": { + "Name": "root", + "Kind": 3 + }, + "Aggregate": { + "OperatorKind": 8, + "Kind": 0 + }, + "Kind": 0 + }, + "DeclaredVariable": { + "Name": "v0", + "UniqueId": 6 + }, + "Expression": { + "Properties": [ + { + "Name": "count_a", + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 6 + }, + "Kind": 14 + } + } + ], + "ObjectKind": "Object", + "Kind": 7 + }, + "Kind": 6 + } +} + + + + + Select, Aggregate and BinaryOperator Expressions + {"clientDistributionPlan": {"Cql": { "Kind": "Select", "DeclaredVariable": {"Name": "v0","UniqueId": 10 }, "Expression": {"Kind": "ObjectCreate","ObjectKind": "Object","Properties": [ {"Name": "F1","Expression": { "Kind": "ObjectCreate", "ObjectKind": "Object", "Properties": [{ "Name": "FieldA", "Expression": {"Kind": "TupleItemRef","Expression": { "Kind": "VariableRef", "Variable": {"Name": "v0","UniqueId": 10 }},"Index": 0 }},{ "Name": "FieldSum", "Expression": {"Kind": "TupleItemRef","Expression": { "Kind": "VariableRef", "Variable": {"Name": "v0","UniqueId": 10 }},"Index": 1 }},{ "Name": "FieldAvg", "Expression": {"Kind": "Mux","ConditionExpression": { "Kind": "BinaryOperator", "OperatorKind": "Equal", "LeftExpression": {"Kind": "TupleItemRef","Expression": { "Kind": "TupleItemRef", "Expression": {"Kind": "VariableRef","Variable": { "Name": "v0", "UniqueId": 10} }, "Index": 2},"Index": 1 }, "RightExpression": {"Kind": "Literal","Literal": { "Kind": "Number", "Value": 0} }},"LeftExpression": { "Kind": "Literal", "Literal": {"Kind": "Undefined" }},"RightExpression": { "Kind": "BinaryOperator", "OperatorKind": "Divide", "LeftExpression": {"Kind": "TupleItemRef","Expression": { "Kind": "TupleItemRef", "Expression": {"Kind": "VariableRef","Variable": { "Name": "v0", "UniqueId": 10} }, "Index": 2},"Index": 0 }, "RightExpression": {"Kind": "TupleItemRef","Expression": { "Kind": "TupleItemRef", "Expression": {"Kind": "VariableRef","Variable": { "Name": "v0", "UniqueId": 10} }, "Index": 2},"Index": 1 }}}}]}}, {"Name": "F2","Expression": { "Kind": "ObjectCreate", "ObjectKind": "Object", "Properties": [{ "Name": "OtherFieldA", "Expression": {"Kind": "TupleItemRef","Expression": { "Kind": "VariableRef", "Variable": {"Name": "v0","UniqueId": 10 }},"Index": 0 }},{ "Name": "OtherFieldMax", "Expression": {"Kind": "TupleItemRef","Expression": { "Kind": "VariableRef", "Variable": {"Name": "v0","UniqueId": 10 }},"Index": 3 }} ]} }] }, "SourceExpression": {"Kind": "GroupBy","KeyCount": 1,"Aggregates": [ {"Kind": "Builtin","OperatorKind": "Sum" }, {"Kind": "Tuple","Items": [ {"Kind": "Builtin","OperatorKind": "Sum" }, {"Kind": "Builtin","OperatorKind": "Sum" }] }, {"Kind": "Builtin","OperatorKind": "Max" }],"SourceExpression": { "Kind": "Select", "DeclaredVariable": {"Name": "v0","UniqueId": 16 }, "Expression": {"Kind": "TupleCreate","Items": [ {"Kind": "TupleItemRef","Expression": { "Kind": "VariableRef", "Variable": {"Name": "v0","UniqueId": 16 }},"Index": 0 }, {"Kind": "Mux","ConditionExpression": { "Kind": "BinaryOperator", "OperatorKind": "And", "LeftExpression": {"Kind": "BinaryOperator","OperatorKind": "NotEqual","LeftExpression": { "Kind": "TupleItemRef", "Expression": {"Kind": "TupleItemRef","Expression": { "Kind": "VariableRef", "Variable": {"Name": "v0","UniqueId": 16 }},"Index": 1 }, "Index": 1},"RightExpression": { "Kind": "Literal", "Literal": {"Kind": "Number","Value": 0 }} }, "RightExpression": {"Kind": "UnaryOperator","OperatorKind": "Not","Expression": { "Kind": "SystemFunctionCall", "FunctionKind": "Is_Defined", "Arguments": [{ "Kind": "TupleItemRef", "Expression": {"Kind": "TupleItemRef","Expression": { "Kind": "VariableRef", "Variable": {"Name": "v0","UniqueId": 16 }},"Index": 1 }, "Index": 0} ]} }},"LeftExpression": { "Kind": "Literal", "Literal": {"Kind": "Array","Items": [] }},"RightExpression": { "Kind": "TupleItemRef", "Expression": {"Kind": "TupleItemRef","Expression": { "Kind": "VariableRef", "Variable": {"Name": "v0","UniqueId": 16 }},"Index": 1 }, "Index": 0} }, {"Kind": "TupleCreate","Items": [ {"Kind": "Mux","ConditionExpression": { "Kind": "BinaryOperator", "OperatorKind": "And", "LeftExpression": {"Kind": "BinaryOperator","OperatorKind": "NotEqual","LeftExpression": { "Kind": "TupleItemRef", "Expression": {"Kind": "TupleItemRef","Expression": { "Kind": "TupleItemRef", "Expression": {"Kind": "VariableRef","Variable": { "Name": "v0", "UniqueId": 16} }, "Index": 2},"Index": 0 }, "Index": 1},"RightExpression": { "Kind": "Literal", "Literal": {"Kind": "Number","Value": 0 }} }, "RightExpression": {"Kind": "UnaryOperator","OperatorKind": "Not","Expression": { "Kind": "SystemFunctionCall", "FunctionKind": "Is_Defined", "Arguments": [{ "Kind": "TupleItemRef", "Expression": {"Kind": "TupleItemRef","Expression": { "Kind": "TupleItemRef", "Expression": {"Kind": "VariableRef","Variable": { "Name": "v0", "UniqueId": 16} }, "Index": 2},"Index": 0 }, "Index": 0} ]} }},"LeftExpression": { "Kind": "Literal", "Literal": {"Kind": "Array","Items": [] }},"RightExpression": { "Kind": "TupleItemRef", "Expression": {"Kind": "TupleItemRef","Expression": { "Kind": "VariableRef", "Variable": {"Name": "v0","UniqueId": 16 }},"Index": 2 }, "Index": 0} }, {"Kind": "TupleItemRef","Expression": { "Kind": "TupleItemRef", "Expression": {"Kind": "VariableRef","Variable": { "Name": "v0", "UniqueId": 16} }, "Index": 2},"Index": 1 }] }, {"Kind": "Mux","ConditionExpression": { "Kind": "BinaryOperator", "OperatorKind": "And", "LeftExpression": {"Kind": "BinaryOperator","OperatorKind": "NotEqual","LeftExpression": { "Kind": "TupleItemRef", "Expression": {"Kind": "TupleItemRef","Expression": { "Kind": "VariableRef", "Variable": {"Name": "v0","UniqueId": 16 }},"Index": 3 }, "Index": 1},"RightExpression": { "Kind": "Literal", "Literal": {"Kind": "Number","Value": 0 }} }, "RightExpression": {"Kind": "UnaryOperator","OperatorKind": "Not","Expression": { "Kind": "SystemFunctionCall", "FunctionKind": "Is_Defined", "Arguments": [{ "Kind": "TupleItemRef", "Expression": {"Kind": "TupleItemRef","Expression": { "Kind": "VariableRef", "Variable": {"Name": "v0","UniqueId": 16 }},"Index": 3 }, "Index": 0} ]} }},"LeftExpression": { "Kind": "Literal", "Literal": {"Kind": "Array","Items": [] }},"RightExpression": { "Kind": "TupleItemRef", "Expression": {"Kind": "TupleItemRef","Expression": { "Kind": "VariableRef", "Variable": {"Name": "v0","UniqueId": 16}},"Index": 3}, "Index": 0}}]}, "SourceExpression": {"Kind": "Input","Name": "root"}}}}}} + + + { + "Cql": { + "SourceExpression": { + "SourceExpression": { + "SourceExpression": { + "Name": "root", + "Kind": 3 + }, + "DeclaredVariable": { + "Name": "v0", + "UniqueId": 16 + }, + "Expression": { + "Items": [ + { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 16 + }, + "Kind": 14 + }, + "Index": 0, + "Kind": 11 + }, + { + "ConditionExpression": { + "OperatorKind": 1, + "LeftExpression": { + "OperatorKind": 14, + "LeftExpression": { + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 16 + }, + "Kind": 14 + }, + "Index": 1, + "Kind": 11 + }, + "Index": 1, + "Kind": 11 + }, + "RightExpression": { + "Literal": { + "Value": 0, + "Kind": 4 + }, + "Kind": 5 + }, + "Kind": 2 + }, + "RightExpression": { + "OperatorKind": 2, + "Expression": { + "FunctionKind": 55, + "Arguments": [ + { + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 16 + }, + "Kind": 14 + }, + "Index": 1, + "Kind": 11 + }, + "Index": 0, + "Kind": 11 + } + ], + "Kind": 9 + }, + "Kind": 12 + }, + "Kind": 2 + }, + "LeftExpression": { + "Literal": { + "Items": [], + "Kind": 1 + }, + "Kind": 5 + }, + "RightExpression": { + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 16 + }, + "Kind": 14 + }, + "Index": 1, + "Kind": 11 + }, + "Index": 0, + "Kind": 11 + }, + "Kind": 6 + }, + { + "Items": [ + { + "ConditionExpression": { + "OperatorKind": 1, + "LeftExpression": { + "OperatorKind": 14, + "LeftExpression": { + "Expression": { + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 16 + }, + "Kind": 14 + }, + "Index": 2, + "Kind": 11 + }, + "Index": 0, + "Kind": 11 + }, + "Index": 1, + "Kind": 11 + }, + "RightExpression": { + "Literal": { + "Value": 0, + "Kind": 4 + }, + "Kind": 5 + }, + "Kind": 2 + }, + "RightExpression": { + "OperatorKind": 2, + "Expression": { + "FunctionKind": 55, + "Arguments": [ + { + "Expression": { + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 16 + }, + "Kind": 14 + }, + "Index": 2, + "Kind": 11 + }, + "Index": 0, + "Kind": 11 + }, + "Index": 0, + "Kind": 11 + } + ], + "Kind": 9 + }, + "Kind": 12 + }, + "Kind": 2 + }, + "LeftExpression": { + "Literal": { + "Items": [], + "Kind": 1 + }, + "Kind": 5 + }, + "RightExpression": { + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 16 + }, + "Kind": 14 + }, + "Index": 2, + "Kind": 11 + }, + "Index": 0, + "Kind": 11 + }, + "Kind": 6 + }, + { + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 16 + }, + "Kind": 14 + }, + "Index": 2, + "Kind": 11 + }, + "Index": 1, + "Kind": 11 + } + ], + "Kind": 10 + }, + { + "ConditionExpression": { + "OperatorKind": 1, + "LeftExpression": { + "OperatorKind": 14, + "LeftExpression": { + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 16 + }, + "Kind": 14 + }, + "Index": 3, + "Kind": 11 + }, + "Index": 1, + "Kind": 11 + }, + "RightExpression": { + "Literal": { + "Value": 0, + "Kind": 4 + }, + "Kind": 5 + }, + "Kind": 2 + }, + "RightExpression": { + "OperatorKind": 2, + "Expression": { + "FunctionKind": 55, + "Arguments": [ + { + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 16 + }, + "Kind": 14 + }, + "Index": 3, + "Kind": 11 + }, + "Index": 0, + "Kind": 11 + } + ], + "Kind": 9 + }, + "Kind": 12 + }, + "Kind": 2 + }, + "LeftExpression": { + "Literal": { + "Items": [], + "Kind": 1 + }, + "Kind": 5 + }, + "RightExpression": { + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 16 + }, + "Kind": 14 + }, + "Index": 3, + "Kind": 11 + }, + "Index": 0, + "Kind": 11 + }, + "Kind": 6 + } + ], + "Kind": 10 + }, + "Kind": 6 + }, + "KeyCount": 1, + "Aggregates": [ + { + "OperatorKind": 8, + "Kind": 0 + }, + { + "Items": [ + { + "OperatorKind": 8, + "Kind": 0 + }, + { + "OperatorKind": 8, + "Kind": 0 + } + ], + "Kind": 1 + }, + { + "OperatorKind": 6, + "Kind": 0 + } + ], + "Kind": 2 + }, + "DeclaredVariable": { + "Name": "v0", + "UniqueId": 10 + }, + "Expression": { + "Properties": [ + { + "Name": "F1", + "Expression": { + "Properties": [ + { + "Name": "FieldA", + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 10 + }, + "Kind": 14 + }, + "Index": 0, + "Kind": 11 + } + }, + { + "Name": "FieldSum", + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 10 + }, + "Kind": 14 + }, + "Index": 1, + "Kind": 11 + } + }, + { + "Name": "FieldAvg", + "Expression": { + "ConditionExpression": { + "OperatorKind": 6, + "LeftExpression": { + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 10 + }, + "Kind": 14 + }, + "Index": 2, + "Kind": 11 + }, + "Index": 1, + "Kind": 11 + }, + "RightExpression": { + "Literal": { + "Value": 0, + "Kind": 4 + }, + "Kind": 5 + }, + "Kind": 2 + }, + "LeftExpression": { + "Literal": { + "Kind": 0 + }, + "Kind": 5 + }, + "RightExpression": { + "OperatorKind": 5, + "LeftExpression": { + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 10 + }, + "Kind": 14 + }, + "Index": 2, + "Kind": 11 + }, + "Index": 0, + "Kind": 11 + }, + "RightExpression": { + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 10 + }, + "Kind": 14 + }, + "Index": 2, + "Kind": 11 + }, + "Index": 1, + "Kind": 11 + }, + "Kind": 2 + }, + "Kind": 6 + } + } + ], + "ObjectKind": "Object", + "Kind": 7 + } + }, + { + "Name": "F2", + "Expression": { + "Properties": [ + { + "Name": "OtherFieldA", + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 10 + }, + "Kind": 14 + }, + "Index": 0, + "Kind": 11 + } + }, + { + "Name": "OtherFieldMax", + "Expression": { + "Expression": { + "Variable": { + "Name": "v0", + "UniqueId": 10 + }, + "Kind": 14 + }, + "Index": 3, + "Kind": 11 + } + } + ], + "ObjectKind": "Object", + "Kind": 7 + } + } + ], + "ObjectKind": "Object", + "Kind": 7 + }, + "Kind": 6 + } +} + + + + + Select, Sum and VariableRef Expressions + {"clientDistributionPlan": {"Cql": {"Kind": "Select","DeclaredVariable": {"Name": "v0","UniqueId": 6},"Expression": {"Kind": "ObjectCreate","ObjectKind": "Object","Properties": [{"Name": "count_a_plus_five","Expression": {"Kind": "BinaryOperator","OperatorKind": "Add","LeftExpression": {"Kind": "VariableRef","Variable": {"Name": "v0","UniqueId": 6 }}, "RightExpression": { "Kind": "Literal", "Literal": { "Kind": "Number", "Value": 5 }}}}]}, "SourceExpression": { "Kind": "Aggregate", "Aggregate": { "Kind": "Builtin", "OperatorKind": "Sum" }, "SourceExpression": { "Kind": "Input", "Name": "root" }}}}} + + + { + "Cql": { + "SourceExpression": { + "SourceExpression": { + "Name": "root", + "Kind": 3 + }, + "Aggregate": { + "OperatorKind": 8, + "Kind": 0 + }, + "Kind": 0 + }, + "DeclaredVariable": { + "Name": "v0", + "UniqueId": 6 + }, + "Expression": { + "Properties": [ + { + "Name": "count_a_plus_five", + "Expression": { + "OperatorKind": 0, + "LeftExpression": { + "Variable": { + "Name": "v0", + "UniqueId": 6 + }, + "Kind": 14 + }, + "RightExpression": { + "Literal": { + "Value": 5, + "Kind": 4 + }, + "Kind": 5 + }, + "Kind": 2 + } + } + ], + "ObjectKind": "Object", + "Kind": 7 + }, + "Kind": 6 + } +} + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj index 88450d8984..6f1657f37c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj @@ -79,6 +79,9 @@ + + PreserveNewest + PreserveNewest diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/ClientDistributionPlanBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/ClientDistributionPlanBaselineTests.cs new file mode 100644 index 0000000000..845f71d25e --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/ClientDistributionPlanBaselineTests.cs @@ -0,0 +1,100 @@ +namespace Microsoft.Azure.Cosmos.Tests.Query +{ + using System.Collections.Generic; + using System.Xml; + using Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan; + using Microsoft.Azure.Cosmos.Query.Core.ClientDistributionPlan.Cql; + using Microsoft.Azure.Cosmos.Test.BaselineTest; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + + [TestClass] + public class ClientDistributionPlanBaselineTests : BaselineTests + { + [TestMethod] + [Owner("akotalwar")] + public void TestClientDistributionPlanDeserialization() + { + List testVariations = new List + { + CreateInput( + description: @"Input Expression", + clientPlanJson: "{\"clientDistributionPlan\": {\"Cql\": {\"Kind\": \"Input\",\"Name\": \"root\"}}}"), + + CreateInput( + description: @"Aggregate and ObjectCreate Expressions", + clientPlanJson: "{\"clientDistributionPlan\": {\"Cql\": {\"Kind\": \"Select\",\"DeclaredVariable\": {\"Name\": \"v0\",\"UniqueId\": 6},\"Expression\": {\"Kind\": \"ObjectCreate\",\"ObjectKind\": \"Object\",\"Properties\": [{\"Name\": \"count_a\",\"Expression\": {\"Kind\": \"VariableRef\",\"Variable\": {\"Name\": \"v0\",\"UniqueId\": 6}}}]},\"SourceExpression\": {\"Kind\": \"Aggregate\",\"Aggregate\": {\"Kind\": \"Builtin\",\"OperatorKind\": \"Sum\"},\"SourceExpression\": {\"Kind\": \"Input\",\"Name\": \"root\"}}}}}"), + + CreateInput( + description: @"Select, Aggregate and BinaryOperator Expressions", + clientPlanJson: "{\"clientDistributionPlan\": {\"Cql\": { \"Kind\": \"Select\", \"DeclaredVariable\": {\"Name\": \"v0\",\"UniqueId\": 10 }, \"Expression\": {\"Kind\": \"ObjectCreate\",\"ObjectKind\": \"Object\",\"Properties\": [ {\"Name\": \"F1\",\"Expression\": { \"Kind\": \"ObjectCreate\", \"ObjectKind\": \"Object\", \"Properties\": [{ \"Name\": \"FieldA\", \"Expression\": {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"VariableRef\", \"Variable\": {\"Name\": \"v0\",\"UniqueId\": 10 }},\"Index\": 0 }},{ \"Name\": \"FieldSum\", \"Expression\": {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"VariableRef\", \"Variable\": {\"Name\": \"v0\",\"UniqueId\": 10 }},\"Index\": 1 }},{ \"Name\": \"FieldAvg\", \"Expression\": {\"Kind\": \"Mux\",\"ConditionExpression\": { \"Kind\": \"BinaryOperator\", \"OperatorKind\": \"Equal\", \"LeftExpression\": {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"TupleItemRef\", \"Expression\": {\"Kind\": \"VariableRef\",\"Variable\": { \"Name\": \"v0\", \"UniqueId\": 10} }, \"Index\": 2},\"Index\": 1 }, \"RightExpression\": {\"Kind\": \"Literal\",\"Literal\": { \"Kind\": \"Number\", \"Value\": 0} }},\"LeftExpression\": { \"Kind\": \"Literal\", \"Literal\": {\"Kind\": \"Undefined\" }},\"RightExpression\": { \"Kind\": \"BinaryOperator\", \"OperatorKind\": \"Divide\", \"LeftExpression\": {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"TupleItemRef\", \"Expression\": {\"Kind\": \"VariableRef\",\"Variable\": { \"Name\": \"v0\", \"UniqueId\": 10} }, \"Index\": 2},\"Index\": 0 }, \"RightExpression\": {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"TupleItemRef\", \"Expression\": {\"Kind\": \"VariableRef\",\"Variable\": { \"Name\": \"v0\", \"UniqueId\": 10} }, \"Index\": 2},\"Index\": 1 }}}}]}}, {\"Name\": \"F2\",\"Expression\": { \"Kind\": \"ObjectCreate\", \"ObjectKind\": \"Object\", \"Properties\": [{ \"Name\": \"OtherFieldA\", \"Expression\": {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"VariableRef\", \"Variable\": {\"Name\": \"v0\",\"UniqueId\": 10 }},\"Index\": 0 }},{ \"Name\": \"OtherFieldMax\", \"Expression\": {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"VariableRef\", \"Variable\": {\"Name\": \"v0\",\"UniqueId\": 10 }},\"Index\": 3 }} ]} }] }, \"SourceExpression\": {\"Kind\": \"GroupBy\",\"KeyCount\": 1,\"Aggregates\": [ {\"Kind\": \"Builtin\",\"OperatorKind\": \"Sum\" }, {\"Kind\": \"Tuple\",\"Items\": [ {\"Kind\": \"Builtin\",\"OperatorKind\": \"Sum\" }, {\"Kind\": \"Builtin\",\"OperatorKind\": \"Sum\" }] }, {\"Kind\": \"Builtin\",\"OperatorKind\": \"Max\" }],\"SourceExpression\": { \"Kind\": \"Select\", \"DeclaredVariable\": {\"Name\": \"v0\",\"UniqueId\": 16 }, \"Expression\": {\"Kind\": \"TupleCreate\",\"Items\": [ {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"VariableRef\", \"Variable\": {\"Name\": \"v0\",\"UniqueId\": 16 }},\"Index\": 0 }, {\"Kind\": \"Mux\",\"ConditionExpression\": { \"Kind\": \"BinaryOperator\", \"OperatorKind\": \"And\", \"LeftExpression\": {\"Kind\": \"BinaryOperator\",\"OperatorKind\": \"NotEqual\",\"LeftExpression\": { \"Kind\": \"TupleItemRef\", \"Expression\": {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"VariableRef\", \"Variable\": {\"Name\": \"v0\",\"UniqueId\": 16 }},\"Index\": 1 }, \"Index\": 1},\"RightExpression\": { \"Kind\": \"Literal\", \"Literal\": {\"Kind\": \"Number\",\"Value\": 0 }} }, \"RightExpression\": {\"Kind\": \"UnaryOperator\",\"OperatorKind\": \"Not\",\"Expression\": { \"Kind\": \"SystemFunctionCall\", \"FunctionKind\": \"Is_Defined\", \"Arguments\": [{ \"Kind\": \"TupleItemRef\", \"Expression\": {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"VariableRef\", \"Variable\": {\"Name\": \"v0\",\"UniqueId\": 16 }},\"Index\": 1 }, \"Index\": 0} ]} }},\"LeftExpression\": { \"Kind\": \"Literal\", \"Literal\": {\"Kind\": \"Array\",\"Items\": [] }},\"RightExpression\": { \"Kind\": \"TupleItemRef\", \"Expression\": {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"VariableRef\", \"Variable\": {\"Name\": \"v0\",\"UniqueId\": 16 }},\"Index\": 1 }, \"Index\": 0} }, {\"Kind\": \"TupleCreate\",\"Items\": [ {\"Kind\": \"Mux\",\"ConditionExpression\": { \"Kind\": \"BinaryOperator\", \"OperatorKind\": \"And\", \"LeftExpression\": {\"Kind\": \"BinaryOperator\",\"OperatorKind\": \"NotEqual\",\"LeftExpression\": { \"Kind\": \"TupleItemRef\", \"Expression\": {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"TupleItemRef\", \"Expression\": {\"Kind\": \"VariableRef\",\"Variable\": { \"Name\": \"v0\", \"UniqueId\": 16} }, \"Index\": 2},\"Index\": 0 }, \"Index\": 1},\"RightExpression\": { \"Kind\": \"Literal\", \"Literal\": {\"Kind\": \"Number\",\"Value\": 0 }} }, \"RightExpression\": {\"Kind\": \"UnaryOperator\",\"OperatorKind\": \"Not\",\"Expression\": { \"Kind\": \"SystemFunctionCall\", \"FunctionKind\": \"Is_Defined\", \"Arguments\": [{ \"Kind\": \"TupleItemRef\", \"Expression\": {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"TupleItemRef\", \"Expression\": {\"Kind\": \"VariableRef\",\"Variable\": { \"Name\": \"v0\", \"UniqueId\": 16} }, \"Index\": 2},\"Index\": 0 }, \"Index\": 0} ]} }},\"LeftExpression\": { \"Kind\": \"Literal\", \"Literal\": {\"Kind\": \"Array\",\"Items\": [] }},\"RightExpression\": { \"Kind\": \"TupleItemRef\", \"Expression\": {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"VariableRef\", \"Variable\": {\"Name\": \"v0\",\"UniqueId\": 16 }},\"Index\": 2 }, \"Index\": 0} }, {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"TupleItemRef\", \"Expression\": {\"Kind\": \"VariableRef\",\"Variable\": { \"Name\": \"v0\", \"UniqueId\": 16} }, \"Index\": 2},\"Index\": 1 }] }, {\"Kind\": \"Mux\",\"ConditionExpression\": { \"Kind\": \"BinaryOperator\", \"OperatorKind\": \"And\", \"LeftExpression\": {\"Kind\": \"BinaryOperator\",\"OperatorKind\": \"NotEqual\",\"LeftExpression\": { \"Kind\": \"TupleItemRef\", \"Expression\": {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"VariableRef\", \"Variable\": {\"Name\": \"v0\",\"UniqueId\": 16 }},\"Index\": 3 }, \"Index\": 1},\"RightExpression\": { \"Kind\": \"Literal\", \"Literal\": {\"Kind\": \"Number\",\"Value\": 0 }} }, \"RightExpression\": {\"Kind\": \"UnaryOperator\",\"OperatorKind\": \"Not\",\"Expression\": { \"Kind\": \"SystemFunctionCall\", \"FunctionKind\": \"Is_Defined\", \"Arguments\": [{ \"Kind\": \"TupleItemRef\", \"Expression\": {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"VariableRef\", \"Variable\": {\"Name\": \"v0\",\"UniqueId\": 16 }},\"Index\": 3 }, \"Index\": 0} ]} }},\"LeftExpression\": { \"Kind\": \"Literal\", \"Literal\": {\"Kind\": \"Array\",\"Items\": [] }},\"RightExpression\": { \"Kind\": \"TupleItemRef\", \"Expression\": {\"Kind\": \"TupleItemRef\",\"Expression\": { \"Kind\": \"VariableRef\", \"Variable\": {\"Name\": \"v0\",\"UniqueId\": 16}},\"Index\": 3}, \"Index\": 0}}]}, \"SourceExpression\": {\"Kind\": \"Input\",\"Name\": \"root\"}}}}}}"), + + CreateInput( + description: @"Select, Sum and VariableRef Expressions", + clientPlanJson: "{\"clientDistributionPlan\": {\"Cql\": {\"Kind\": \"Select\",\"DeclaredVariable\": {\"Name\": \"v0\",\"UniqueId\": 6},\"Expression\": {\"Kind\": \"ObjectCreate\",\"ObjectKind\": \"Object\",\"Properties\": [{\"Name\": \"count_a_plus_five\",\"Expression\": {\"Kind\": \"BinaryOperator\",\"OperatorKind\": \"Add\",\"LeftExpression\": {\"Kind\": \"VariableRef\",\"Variable\": {\"Name\": \"v0\",\"UniqueId\": 6 }}, \"RightExpression\": { \"Kind\": \"Literal\", \"Literal\": { \"Kind\": \"Number\", \"Value\": 5 }}}}]}, \"SourceExpression\": { \"Kind\": \"Aggregate\", \"Aggregate\": { \"Kind\": \"Builtin\", \"OperatorKind\": \"Sum\" }, \"SourceExpression\": { \"Kind\": \"Input\", \"Name\": \"root\" }}}}}"), + }; + + this.ExecuteTestSuite(testVariations); + } + + + private static ClientDistributionPlanTestInput CreateInput( + string description, + string clientPlanJson) + { + return new ClientDistributionPlanTestInput(description, clientPlanJson); + } + + public override ClientDistributionPlanTestOutput ExecuteTest(ClientDistributionPlanTestInput input) + { + JsonSerializerSettings settings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented + }; + + ClientDistributionPlan distributionPlan = ClientDistributionPlanDeserializer.DeserializeClientDistributionPlan(input.ClientPlanJson); + string serializedDistributionPlan = JsonConvert.SerializeObject(distributionPlan, settings); + + return new ClientDistributionPlanTestOutput(serializedDistributionPlan); + } + + public sealed class ClientDistributionPlanTestOutput : BaselineTestOutput + { + public ClientDistributionPlanTestOutput(string serializedclientPlanJson) + { + this.SerializedclientPlanJson = serializedclientPlanJson; + } + + public string SerializedclientPlanJson { get; } + + public override void SerializeAsXml(XmlWriter xmlWriter) + { + JObject jObject = JObject.Parse(this.SerializedclientPlanJson); + string jsonString = jObject.ToString(); + xmlWriter.WriteStartElement("SerializedClientPlanJson"); + xmlWriter.WriteString(jsonString); + xmlWriter.WriteEndElement(); + } + } + + public sealed class ClientDistributionPlanTestInput : BaselineTestInput + { + internal string ClientPlanJson { get; set; } + + internal ClientDistributionPlanTestInput( + string description, + string clientPlanJson) + : base(description) + { + this.ClientPlanJson = clientPlanJson; + } + + public override void SerializeAsXml(XmlWriter xmlWriter) + { + xmlWriter.WriteElementString("Description", this.Description); + xmlWriter.WriteElementString("ClientDistributionPlanJson", this.ClientPlanJson); + } + } + } +} From f312f6a4c36472ca489cd50c6cee5078a2207840 Mon Sep 17 00:00:00 2001 From: Aditya Kotalwar <94020786+akotalwar@users.noreply.github.com> Date: Thu, 28 Sep 2023 12:03:44 -0700 Subject: [PATCH 198/240] [Internal] Query: Adds check to detect unsupported queries for Optimistic Direct Execution code path (#4090) * Added query validity function on Ode code path * Fixed syntax * Updated to use string search instead of query parsing * Updated string search to now be regex * Changed location of caller for QueryValidityCheck() * Updated regex string * Added extra test coverage * Added const string to error messages * Added compile flag to Regex * Fixed comments * Added missing null reference coverage * Removed extra foreach loop in test * Removed useQueryPlan bool in test code --- .../CosmosQueryExecutionContextFactory.cs | 23 ++++-- ...misticDirectExecutionQueryBaselineTests.cs | 79 ++++++++++++++++--- 2 files changed, 87 insertions(+), 15 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs index 01ed10a627..adb19c303f 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs @@ -7,9 +7,9 @@ namespace Microsoft.Azure.Cosmos.Query.Core.ExecutionContext using System.Collections.Generic; using System.Diagnostics; using System.Linq; + using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; - using global::Azure; using Microsoft.Azure.Cosmos; using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.Pagination; @@ -33,10 +33,12 @@ namespace Microsoft.Azure.Cosmos.Query.Core.ExecutionContext internal static class CosmosQueryExecutionContextFactory { private const string InternalPartitionKeyDefinitionProperty = "x-ms-query-partitionkey-definition"; + private const string QueryInspectionPattern = @"\s+(GROUP\s+BY\s+|COUNT\s*\(|MIN\s*\(|MAX\s*\(|AVG\s*\(|SUM\s*\(|DISTINCT\s+)"; private const string OptimisticDirectExecution = "OptimisticDirectExecution"; private const string Passthrough = "Passthrough"; private const string Specialized = "Specialized"; private const int PageSizeFactorForTop = 5; + private static readonly Regex QueryInspectionRegex = new Regex(QueryInspectionPattern, RegexOptions.IgnoreCase | RegexOptions.Compiled); public static IQueryPipelineStage Create( DocumentContainer documentContainer, @@ -147,14 +149,14 @@ private static async Task> TryCreateCoreContextAsy if (targetRange != null) { - return await TryCreateExecutionContextAsync( + return await TryCreateSinglePartitionExecutionContextAsync( documentContainer, partitionedQueryExecutionInfo: null, cosmosQueryContext, containerQueryProperties, inputParameters, targetRange, - trace, + createQueryPipelineTrace, cancellationToken); } @@ -297,7 +299,7 @@ private static async Task> TryCreateFromPartitione if (targetRange != null) { - tryCreatePipelineStage = await TryCreateExecutionContextAsync( + tryCreatePipelineStage = await TryCreateSinglePartitionExecutionContextAsync( documentContainer, partitionedQueryExecutionInfo, cosmosQueryContext, @@ -328,7 +330,7 @@ private static async Task> TryCreateFromPartitione return tryCreatePipelineStage; } - private static async Task> TryCreateExecutionContextAsync( + private static async Task> TryCreateSinglePartitionExecutionContextAsync( DocumentContainer documentContainer, PartitionedQueryExecutionInfo partitionedQueryExecutionInfo, CosmosQueryContext cosmosQueryContext, @@ -338,6 +340,17 @@ private static async Task> TryCreateExecutionConte ITrace trace, CancellationToken cancellationToken) { + // Retrieve the query plan in a subset of cases to ensure the query is valid before creating the Ode pipeline + if (partitionedQueryExecutionInfo == null && QueryInspectionRegex.IsMatch(inputParameters.SqlQuerySpec.QueryText)) + { + partitionedQueryExecutionInfo = await GetPartitionedQueryExecutionInfoAsync( + cosmosQueryContext, + inputParameters, + containerQueryProperties, + trace, + cancellationToken); + } + // Test code added to confirm the correct pipeline is being utilized SetTestInjectionPipelineType(inputParameters, OptimisticDirectExecution); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs index cc4a2c7718..a09a31d0ca 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs @@ -95,6 +95,7 @@ public void PositiveOptimisticDirectExecutionOutput() partitionKeyPath: @"/pk", partitionKeyValue: null), }; + this.ExecuteTestSuite(testVariations); } @@ -379,11 +380,11 @@ public async Task TestPipelineForContinuationTokenOnSinglePartitionAsync() { int numItems = 100; OptimisticDirectExecutionTestInput input = CreateInput( - description: @"Single Partition Key and Value Field", + description: @"Single Partition Key and Value Field", query: "SELECT * FROM c", - expectedOptimisticDirectExecution: true, - partitionKeyPath: @"/pk", - partitionKeyValue: "a"); + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: "a"); int result = await this.GetPipelineAndDrainAsync( input, @@ -394,6 +395,64 @@ public async Task TestPipelineForContinuationTokenOnSinglePartitionAsync() Assert.AreEqual(numItems, result); } + // test checks that the Ode code path ensures that a query is valid before sending it to the backend + // these queries with previous ODE implementation would have succedded. However, with the new query validity check, they should all throw an exception + [TestMethod] + public async Task TestQueryValidityCheckWithODEAsync() + { + const string UnsupportedSelectStarInGroupBy = $"'SELECT *' is not allowed with GROUP BY"; + const string UnsupportedCompositeAggregate = $"Compositions of aggregates and other expressions are not allowed."; + const string UnsupportedNestedAggregateExpression = $"Cannot perform an aggregate function on an expression containing an aggregate or a subquery."; + const string UnsupportedSelectLisWithAggregateOrGroupByExpression = $"invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause"; + + List<(string Query, string ExpectedMessage)> testVariations = new List<(string Query, string ExpectedMessage)> + { + ("SELECT COUNT (1) + 5 FROM c", UnsupportedCompositeAggregate), + ("SELECT MIN(c.price) + 10 FROM c", UnsupportedCompositeAggregate), + ("SELECT MAX(c.price) - 4 FROM c", UnsupportedCompositeAggregate), + ("SELECT SUM (c.price) + 20 FROM c",UnsupportedCompositeAggregate), + ("SELECT AVG(c.price) * 50 FROM c", UnsupportedCompositeAggregate), + ("SELECT * from c GROUP BY c.name", UnsupportedSelectStarInGroupBy), + ("SELECT SUM(c.sales) AS totalSales, AVG(SUM(c.salesAmount)) AS averageTotalSales\n\n\nFROM c", UnsupportedNestedAggregateExpression), + ("SELECT c.category, c.price, COUNT(c) FROM c GROUP BY c.category\r\n", UnsupportedSelectLisWithAggregateOrGroupByExpression) + }; + + List<(string, string)> testVariationsWithCaseSensitivity = new List<(string, string)>(); + foreach ((string Query, string ExpectedMessage) testCase in testVariations) + { + testVariationsWithCaseSensitivity.Add((testCase.Query, testCase.ExpectedMessage)); + testVariationsWithCaseSensitivity.Add((testCase.Query.ToLower(), testCase.ExpectedMessage)); + testVariationsWithCaseSensitivity.Add((testCase.Query.ToUpper(), testCase.ExpectedMessage)); + } + + foreach ((string Query, string ExpectedMessage) testCase in testVariationsWithCaseSensitivity) + { + OptimisticDirectExecutionTestInput input = CreateInput( + description: @"Unsupported queries in CosmosDB that were previousely supported by Ode pipeline and returning wrong resutls", + query: testCase.Query, + expectedOptimisticDirectExecution: true, + partitionKeyPath: @"/pk", + partitionKeyValue: "a"); + + try + { + int result = await this.GetPipelineAndDrainAsync( + input, + numItems: 100, + isMultiPartition: false, + expectedContinuationTokenCount: 0, + requiresDist: true); + } + catch (Exception ex) + { + Assert.IsTrue(ex.InnerException.Message.Contains(testCase.ExpectedMessage)); + continue; + } + + Assert.Fail(); + } + } + // test to check if pipeline handles a 410 exception properly and returns all the documents. [TestMethod] public async Task TestPipelineForGoneExceptionOnSingleAndMultiplePartitionAsync() @@ -570,7 +629,7 @@ private async Task GetPipelineAndDrainAsync(OptimisticDirectExecutionTestIn return documents.Count; } - internal static PartitionedQueryExecutionInfo GetPartitionedQueryExecutionInfo(string querySpecJsonString, PartitionKeyDefinition pkDefinition) + internal static TryCatch TryGetPartitionedQueryExecutionInfo(string querySpecJsonString, PartitionKeyDefinition pkDefinition) { TryCatch tryGetQueryPlan = QueryPartitionProviderTestInstance.Object.TryGetPartitionedQueryExecutionInfo( querySpecJsonString: querySpecJsonString, @@ -583,7 +642,7 @@ internal static PartitionedQueryExecutionInfo GetPartitionedQueryExecutionInfo(s useSystemPrefix: false, geospatialType: Cosmos.GeospatialType.Geography); - return tryGetQueryPlan.Result; + return tryGetQueryPlan; } private static async Task GetOdePipelineAsync(OptimisticDirectExecutionTestInput input, DocumentContainer documentContainer, QueryRequestOptions queryRequestOptions) @@ -731,7 +790,6 @@ public override OptimisticDirectExecutionTestOutput ExecuteTest(OptimisticDirect using StreamReader streamReader = new(serializerCore.ToStreamSqlQuerySpec(new SqlQuerySpec(input.Query), Documents.ResourceType.Document)); string sqlQuerySpecJsonString = streamReader.ReadToEnd(); - PartitionedQueryExecutionInfo partitionedQueryExecutionInfo = GetPartitionedQueryExecutionInfo(sqlQuerySpecJsonString, input.PartitionKeyDefinition); CosmosQueryExecutionContextFactory.InputParameters inputParameters = new CosmosQueryExecutionContextFactory.InputParameters( sqlQuerySpec: new SqlQuerySpec(input.Query), initialUserContinuationToken: input.ContinuationToken, @@ -740,8 +798,8 @@ public override OptimisticDirectExecutionTestOutput ExecuteTest(OptimisticDirect maxItemCount: queryRequestOptions.MaxItemCount, maxBufferedItemCount: queryRequestOptions.MaxBufferedItemCount, partitionKey: input.PartitionKeyValue, - properties: queryRequestOptions.Properties, - partitionedQueryExecutionInfo: partitionedQueryExecutionInfo, + properties: new Dictionary() { { "x-ms-query-partitionkey-definition", input.PartitionKeyDefinition } }, + partitionedQueryExecutionInfo: null, executionEnvironment: null, returnResultsInDeterministicOrder: null, forcePassthrough: false, @@ -1043,7 +1101,8 @@ public override async Task> TryGetPartit using StreamReader streamReader = new(serializerCore.ToStreamSqlQuerySpec(sqlQuerySpec, Documents.ResourceType.Document)); string sqlQuerySpecJsonString = streamReader.ReadToEnd(); - PartitionedQueryExecutionInfo partitionedQueryExecutionInfo = OptimisticDirectExecutionQueryBaselineTests.GetPartitionedQueryExecutionInfo(sqlQuerySpecJsonString, partitionKeyDefinition); + TryCatch queryPlan = OptimisticDirectExecutionQueryBaselineTests.TryGetPartitionedQueryExecutionInfo(sqlQuerySpecJsonString, partitionKeyDefinition); + PartitionedQueryExecutionInfo partitionedQueryExecutionInfo = queryPlan.Succeeded ? queryPlan.Result : throw queryPlan.Exception; return TryCatch.FromResult(partitionedQueryExecutionInfo); } } From 101b9b1ad59d65f4687cf383afdb9b22b873b0dc Mon Sep 17 00:00:00 2001 From: Aditya Kotalwar <94020786+akotalwar@users.noreply.github.com> Date: Thu, 28 Sep 2023 15:35:21 -0700 Subject: [PATCH 199/240] [Internal] Query: Fixes minor issues with TestQueryValidityCheckWithODEAsync (#4105) * Fixed typos and made test more readable * Another typo --- ...OptimisticDirectExecutionQueryBaselineTests.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs index a09a31d0ca..9076506e64 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs @@ -396,14 +396,14 @@ public async Task TestPipelineForContinuationTokenOnSinglePartitionAsync() } // test checks that the Ode code path ensures that a query is valid before sending it to the backend - // these queries with previous ODE implementation would have succedded. However, with the new query validity check, they should all throw an exception + // these queries with previous ODE implementation would have succeeded. However, with the new query validity check, they should all throw an exception [TestMethod] public async Task TestQueryValidityCheckWithODEAsync() { - const string UnsupportedSelectStarInGroupBy = $"'SELECT *' is not allowed with GROUP BY"; - const string UnsupportedCompositeAggregate = $"Compositions of aggregates and other expressions are not allowed."; - const string UnsupportedNestedAggregateExpression = $"Cannot perform an aggregate function on an expression containing an aggregate or a subquery."; - const string UnsupportedSelectLisWithAggregateOrGroupByExpression = $"invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause"; + const string UnsupportedSelectStarInGroupBy = "'SELECT *' is not allowed with GROUP BY"; + const string UnsupportedCompositeAggregate = "Compositions of aggregates and other expressions are not allowed."; + const string UnsupportedNestedAggregateExpression = "Cannot perform an aggregate function on an expression containing an aggregate or a subquery."; + const string UnsupportedSelectLisWithAggregateOrGroupByExpression = "invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause"; List<(string Query, string ExpectedMessage)> testVariations = new List<(string Query, string ExpectedMessage)> { @@ -428,7 +428,7 @@ public async Task TestQueryValidityCheckWithODEAsync() foreach ((string Query, string ExpectedMessage) testCase in testVariationsWithCaseSensitivity) { OptimisticDirectExecutionTestInput input = CreateInput( - description: @"Unsupported queries in CosmosDB that were previousely supported by Ode pipeline and returning wrong resutls", + description: @"Unsupported queries in CosmosDB that were previously supported by Ode pipeline and returning wrong results", query: testCase.Query, expectedOptimisticDirectExecution: true, partitionKeyPath: @"/pk", @@ -442,14 +442,13 @@ public async Task TestQueryValidityCheckWithODEAsync() isMultiPartition: false, expectedContinuationTokenCount: 0, requiresDist: true); + Assert.Fail("Invalid query being executed did not result in an exception"); } catch (Exception ex) { Assert.IsTrue(ex.InnerException.Message.Contains(testCase.ExpectedMessage)); continue; } - - Assert.Fail(); } } From 11fa17b6e91c243ce25bd57ce511bd3dfbfccad5 Mon Sep 17 00:00:00 2001 From: leminh98 Date: Tue, 3 Oct 2023 15:37:11 -0700 Subject: [PATCH 200/240] Query: Adds LINQ RegexMatch Extension method (#4078) * Add support for translation to REgexmatch * Add test and fix some indexing issues * remove visit explicit, add some comment. Update public contract and added the baseline for the test * add the missing baseline * added test * address code review * update csproj --------- Co-authored-by: Minh Le --- .../BuiltinFunctionVisitor.cs | 7 + .../StringBuiltinFunctions.cs | 41 +++++ .../src/Linq/CosmosLinqExtensions.cs | 44 +++++ .../SqlFunctionCallScalarExpression.cs | 3 + ...onBaselineTests.TestRegexMatchFunction.xml | 170 ++++++++++++++++++ ...slationBaselineTests.TestStringCompare.xml | 120 +++++-------- .../Linq/LinqTranslationBaselineTests.cs | 32 ++++ ...icrosoft.Azure.Cosmos.EmulatorTests.csproj | 3 + .../Contracts/DotNetSDKAPI.json | 14 ++ 9 files changed, 359 insertions(+), 75 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestRegexMatchFunction.xml diff --git a/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/BuiltinFunctionVisitor.cs b/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/BuiltinFunctionVisitor.cs index e3814ba1fd..d7e79b5c50 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/BuiltinFunctionVisitor.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/BuiltinFunctionVisitor.cs @@ -5,6 +5,7 @@ namespace Microsoft.Azure.Cosmos.Linq { using System; + using System.Collections.Generic; using System.Globalization; using System.Linq.Expressions; using Microsoft.Azure.Cosmos; @@ -49,6 +50,12 @@ public static SqlScalarExpression VisitBuiltinFunctionCall(MethodCallExpression if (methodCallExpression.Method.DeclaringType.GeUnderlyingSystemType() == typeof(CosmosLinqExtensions)) { + // CosmosLinq Extensions are either RegexMatch or Type check functions (IsString, IsBool, etc.) + if (methodCallExpression.Method.Name == nameof(CosmosLinqExtensions.RegexMatch)) + { + return StringBuiltinFunctions.Visit(methodCallExpression, context); + } + return TypeCheckFunctions.Visit(methodCallExpression, context); } } diff --git a/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/StringBuiltinFunctions.cs b/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/StringBuiltinFunctions.cs index b04bd58c3c..7d833a03bd 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/StringBuiltinFunctions.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/BuiltinFunctions/StringBuiltinFunctions.cs @@ -327,6 +327,43 @@ protected override SqlScalarExpression VisitExplicit(MethodCallExpression method } } + private class RegexMatchVisitor : SqlBuiltinFunctionVisitor + { + public RegexMatchVisitor() + : base(SqlFunctionCallScalarExpression.Names.RegexMatch, + isStatic: true, + new List() + { + new Type[]{ typeof(object), typeof(string)}, // search string, regex pattern + new Type[]{ typeof(object), typeof(string), typeof(string)} // search string, regex pattern, search modifier + }) + { + } + + protected override SqlScalarExpression VisitImplicit(MethodCallExpression methodCallExpression, TranslationContext context) + { + int argumentCount = methodCallExpression.Arguments.Count; + if (argumentCount == 0 || argumentCount > 3 || (methodCallExpression.Arguments[1].NodeType != ExpressionType.Constant)) + { + return null; + } + + List arguments = new List + { + // Argument 0 and the Method object is the same, since Regex is an extension method + ExpressionToSql.VisitNonSubqueryScalarExpression(methodCallExpression.Arguments[0], context), + ExpressionToSql.VisitNonSubqueryScalarExpression(methodCallExpression.Arguments[1], context) + }; + + if (argumentCount > 2 && (methodCallExpression.Arguments[2].NodeType == ExpressionType.Constant)) + { + arguments.Add(ExpressionToSql.VisitNonSubqueryScalarExpression(methodCallExpression.Arguments[2], context)); + } + + return SqlFunctionCallScalarExpression.CreateBuiltin(SqlFunctionCallScalarExpression.Names.RegexMatch, arguments.ToArray()); + } + } + private class StringVisitToString : SqlBuiltinFunctionVisitor { public StringVisitToString() @@ -432,6 +469,10 @@ static StringBuiltinFunctions() "TrimStart", new StringVisitTrimStart() }, + { + nameof(CosmosLinqExtensions.RegexMatch), + new RegexMatchVisitor() + }, { "Replace", new SqlBuiltinFunctionVisitor(SqlFunctionCallScalarExpression.Names.Replace, diff --git a/Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs b/Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs index 6663f52673..619c1c1ecf 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/CosmosLinqExtensions.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Cosmos.Linq using System.Linq; using System.Linq.Expressions; using System.Reflection; + using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Diagnostics; @@ -175,6 +176,49 @@ public static bool IsString(this object obj) throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); } + /// + /// Returns a Boolean value indicating if the specified expression matches the supplied regex pattern. + /// For more information, see https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/regexmatch. + /// This method is to be used in LINQ expressions only and will be evaluated on server. + /// There's no implementation provided in the client library. + /// + /// + /// A string expression with a regular expression defined to use when searching. + /// Returns true if the string matches the regex expressions; otherwise, false. + /// + /// + /// document.Name.RegexMatch()); + /// ]]> + /// + /// + public static bool RegexMatch(this object obj, string regularExpression) + { + throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); + } + + /// + /// Returns a Boolean value indicating if the specified expression matches the supplied regex pattern. + /// For more information, see https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/regexmatch. + /// This method is to be used in LINQ expressions only and will be evaluated on server. + /// There's no implementation provided in the client library. + /// + /// + /// A string expression with a regular expression defined to use when searching. + /// An optional string expression with the selected modifiers to use with the regular expression. + /// Returns true if the string matches the regex expressions; otherwise, false. + /// + /// + /// document.Name.RegexMatch(, )); + /// ]]> + /// + /// + public static bool RegexMatch(this object obj, string regularExpression, string searchModifier) + { + throw new NotImplementedException(ClientResources.TypeCheckExtensionFunctionsNotImplemented); + } + /// /// This method generate query definition from LINQ query. /// diff --git a/Microsoft.Azure.Cosmos/src/SqlObjects/SqlFunctionCallScalarExpression.cs b/Microsoft.Azure.Cosmos/src/SqlObjects/SqlFunctionCallScalarExpression.cs index bcb38257c6..651ad5726d 100644 --- a/Microsoft.Azure.Cosmos/src/SqlObjects/SqlFunctionCallScalarExpression.cs +++ b/Microsoft.Azure.Cosmos/src/SqlObjects/SqlFunctionCallScalarExpression.cs @@ -112,6 +112,7 @@ sealed class SqlFunctionCallScalarExpression : SqlScalarExpression { Names.Power, Identifiers.Power }, { Names.Radians, Identifiers.Radians }, { Names.Rand, Identifiers.Rand }, + { Names.RegexMatch, Identifiers.RegexMatch }, { Names.Replace, Identifiers.Replace }, { Names.Replicate, Identifiers.Replicate }, { Names.Reverse, Identifiers.Reverse }, @@ -332,6 +333,7 @@ public static class Names public const string Power = "POWER"; public const string Radians = "RADIANS"; public const string Rand = "RAND"; + public const string RegexMatch = "RegexMatch"; public const string Replace = "REPLACE"; public const string Replicate = "REPLICATE"; public const string Reverse = "REVERSE"; @@ -474,6 +476,7 @@ public static class Identifiers public static readonly SqlIdentifier Power = SqlIdentifier.Create(Names.Power); public static readonly SqlIdentifier Radians = SqlIdentifier.Create(Names.Radians); public static readonly SqlIdentifier Rand = SqlIdentifier.Create(Names.Rand); + public static readonly SqlIdentifier RegexMatch = SqlIdentifier.Create(Names.RegexMatch); public static readonly SqlIdentifier Replace = SqlIdentifier.Create(Names.Replace); public static readonly SqlIdentifier Replicate = SqlIdentifier.Create(Names.Replicate); public static readonly SqlIdentifier Reverse = SqlIdentifier.Create(Names.Reverse); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestRegexMatchFunction.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestRegexMatchFunction.xml new file mode 100644 index 0000000000..03f808f8b5 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestRegexMatchFunction.xml @@ -0,0 +1,170 @@ + + + + + doc.StringField.RegexMatch("abcd"))]]> + + + + + + + + + doc.StringField.RegexMatch("abcd", "i"))]]> + + + + + + + + + doc.StringField.RegexMatch(doc.StringField2))]]> + + + + + + + + + doc.StringField.RegexMatch(doc.IntField.ToString()))]]> + + + + + + + + + doc.StringField.RegexMatch(doc.StringField2.ToUpper()))]]> + + + + + + + + + doc.StringField.RegexMatch(doc.StringField2.ToLower()))]]> + + + + + + + + + doc.StringField.RegexMatch(Concat(doc.StringField, "str")))]]> + + + + + + + + + doc.IntField.ToString().RegexMatch(doc.StringField))]]> + + + + + + + + + doc.IntField.ToString().RegexMatch(doc.StringField, doc.StringField2.ToString()))]]> + + + + + + + + + (doc.StringField.RegexMatch("abc") AndAlso doc.StringField2.RegexMatch("def")))]]> + + + + + + + + + (doc.StringField.RegexMatch("abc") OrElse doc.StringField2.RegexMatch("def")))]]> + + + + + + + + + doc.StringField.RegexMatch("abc")).Where(doc => doc.StringField2.RegexMatch("abc"))]]> + + + + + + + + + doc.StringField.RegexMatch("abc")).Where(doc => Not(doc.StringField2.RegexMatch("abc")))]]> + + + + + + + + + doc.StringField.RegexMatch("abcd", "this should error out on the back end"))]]> + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompare.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompare.xml index 17538ff1d8..e737413eed 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompare.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestStringCompare.xml @@ -5,11 +5,9 @@ (Compare(doc.StringField, doc.StringField2) == 0))]]> - - - + @@ -18,11 +16,9 @@ FROM root]]> (Compare(doc.StringField, doc.StringField2) > 0))]]> - - root["StringField2"]) -FROM root]]> - + root["StringField2"]) +FROM root]]> @@ -31,11 +27,9 @@ FROM root]]> (Compare(doc.StringField, doc.StringField2) >= 0))]]> - - = root["StringField2"]) -FROM root]]> - + = root["StringField2"]) +FROM root]]> @@ -44,11 +38,9 @@ FROM root]]> (Compare(doc.StringField, doc.StringField2) < 0))]]> - - - + @@ -57,11 +49,9 @@ FROM root]]> (Compare(doc.StringField, doc.StringField2) <= 0))]]> - - - + @@ -70,11 +60,9 @@ FROM root]]> (Compare(doc.StringField, "str") == 0))]]> - - - + @@ -83,11 +71,9 @@ FROM root]]> (Compare(doc.StringField, "str") > 0))]]> - - "str") -FROM root]]> - + "str") +FROM root]]> @@ -96,11 +82,9 @@ FROM root]]> (Compare(doc.StringField, "str") >= 0))]]> - - = "str") -FROM root]]> - + = "str") +FROM root]]> @@ -109,11 +93,9 @@ FROM root]]> (Compare(doc.StringField, "str") < 0))]]> - - - + @@ -122,11 +104,9 @@ FROM root]]> (Compare(doc.StringField, "str") <= 0))]]> - - - + @@ -135,11 +115,9 @@ FROM root]]> (0 == Compare(doc.StringField, doc.StringField2)))]]> - - - + @@ -148,11 +126,9 @@ FROM root]]> (0 < Compare(doc.StringField, doc.StringField2)))]]> - - root["StringField2"]) -FROM root]]> - + root["StringField2"]) +FROM root]]> @@ -161,11 +137,9 @@ FROM root]]> (0 <= Compare(doc.StringField, doc.StringField2)))]]> - - = root["StringField2"]) -FROM root]]> - + = root["StringField2"]) +FROM root]]> @@ -174,11 +148,9 @@ FROM root]]> (0 > Compare(doc.StringField, doc.StringField2)))]]> - - - + @@ -187,11 +159,9 @@ FROM root]]> (0 >= Compare(doc.StringField, doc.StringField2)))]]> - - - + diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTranslationBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTranslationBaselineTests.cs index d6e4ee4767..f13a92da82 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTranslationBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTranslationBaselineTests.cs @@ -291,6 +291,38 @@ public void TestTypeCheckFunctions() this.ExecuteTestSuite(inputs); } + [TestMethod] + public void TestRegexMatchFunction() + { + // Similar to the type checking function, RegexMatch are not supported client side. + // Therefore this method is verified with baseline only. + List data = new List(); + IOrderedQueryable query = testContainer.GetItemLinqQueryable(allowSynchronousQueryExecution: true); + Func> getQuery = useQuery => useQuery ? query : data.AsQueryable(); + + List inputs = new List + { + new LinqTestInput("RegexMatch with 1 argument", b => getQuery(b).Where(doc => doc.StringField.RegexMatch("abcd"))), + new LinqTestInput("RegexMatch with 2 argument", b => getQuery(b).Where(doc => doc.StringField.RegexMatch("abcd", "i"))), + new LinqTestInput("RegexMatch with 1st argument member expression", b => getQuery(b).Where(doc => doc.StringField.RegexMatch(doc.StringField2))), + new LinqTestInput("RegexMatch with ToString", b => getQuery(b).Where(doc => doc.StringField.RegexMatch(doc.IntField.ToString()))), + new LinqTestInput("RegexMatch with StringUpper", b => getQuery(b).Where(doc => doc.StringField.RegexMatch(doc.StringField2.ToUpper()))), + new LinqTestInput("RegexMatch with StringLower", b => getQuery(b).Where(doc => doc.StringField.RegexMatch(doc.StringField2.ToLower()))), + new LinqTestInput("RegexMatch with StringConcat", b => getQuery(b).Where(doc => doc.StringField.RegexMatch(string.Concat(doc.StringField, "str")))), + + new LinqTestInput("RegexMatch with string composition", b => getQuery(b).Where(doc => doc.IntField.ToString().RegexMatch(doc.StringField))), + new LinqTestInput("RegexMatch with string composition 2", b => getQuery(b).Where(doc => doc.IntField.ToString().RegexMatch(doc.StringField, doc.StringField2.ToString()))), + + new LinqTestInput("RegexMatch with conditional", b => getQuery(b).Where(doc => doc.StringField.RegexMatch("abc") && doc.StringField2.RegexMatch("def"))), + new LinqTestInput("RegexMatch with conditional 2", b => getQuery(b).Where(doc => doc.StringField.RegexMatch("abc") || doc.StringField2.RegexMatch("def"))), + new LinqTestInput("RegexMatch with conditional 3", b => getQuery(b).Where(doc => doc.StringField.RegexMatch("abc")).Where(doc => doc.StringField2.RegexMatch("abc"))), + new LinqTestInput("RegexMatch with conditional 4", b => getQuery(b).Where(doc => doc.StringField.RegexMatch("abc")).Where(doc => !doc.StringField2.RegexMatch("abc"))), + + new LinqTestInput("RegexMatch with 2nd argument invalid string options", b => getQuery(b).Where(doc => doc.StringField.RegexMatch("abcd", "this should error out on the back end"))), + }; + this.ExecuteTestSuite(inputs); + } + [TestMethod] public void TestMemberInitializer() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj index 8011b07351..30c29ec5db 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj @@ -202,6 +202,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 759762f21f..2ba2523435 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -5367,6 +5367,20 @@ ], "MethodInfo": "Boolean IsString(System.Object);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Boolean RegexMatch(System.Object, System.String, System.String)[System.Runtime.CompilerServices.ExtensionAttribute()]": { + "Type": "Method", + "Attributes": [ + "ExtensionAttribute" + ], + "MethodInfo": "Boolean RegexMatch(System.Object, System.String, System.String);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean RegexMatch(System.Object, System.String)[System.Runtime.CompilerServices.ExtensionAttribute()]": { + "Type": "Method", + "Attributes": [ + "ExtensionAttribute" + ], + "MethodInfo": "Boolean RegexMatch(System.Object, System.String);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Microsoft.Azure.Cosmos.FeedIterator ToStreamIterator[T](System.Linq.IQueryable`1[T])[System.Runtime.CompilerServices.ExtensionAttribute()]": { "Type": "Method", "Attributes": [ From b03df6bb12c3214f5e4fed3c851009741662c903 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Kolli Date: Wed, 4 Oct 2023 07:29:36 -0700 Subject: [PATCH 201/240] Chaning Bounded to Strong (#4103) --- docs/LocalQuorum.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/LocalQuorum.md b/docs/LocalQuorum.md index 5ca45e9055..a971955006 100644 --- a/docs/LocalQuorum.md +++ b/docs/LocalQuorum.md @@ -37,23 +37,23 @@ upgradeConsistencyProperty.SetValue(clientOptions, true); CosmosClient cosmosClient = new CosmosClient(..., clientOptions); ``` -#### Per request upgrade consistency to Bounded -> ###### Please note that Bounded here is only used as HINT for SDK to do quorum reads +#### Per request upgrade consistency to Strong +> ###### Please note that Strong here is only used as HINT for SDK to do quorum reads > ###### It will not impact CosmosDB account or write consistency levels ```C# ItemRequestOptions requestOption = new ItemRequestOptions(); -requestOption.ConsistencyLevel = ConsistencyLevel.Bounded; +requestOption.ConsistencyLevel = ConsistencyLevel.Strong; T item = await container.ReadItemAsync(docId, new PartitionKey(docPartitionKey), requestOption); ``` ```C# QueryRequestOptions requestOption = new QueryRequestOptions(); -requestOption.ConsistencyLevel = ConsistencyLevel.Bounded; +requestOption.ConsistencyLevel = ConsistencyLevel.Strong; await container.GetItemQueryIterator(queryText, continuationToken, requestOption); ``` -> #### Please use Bounded only for per request options as pattern +> #### Please use Strong only for per request options as pattern > #### Single master account possibly Strong == Bounded (**TBD**) \ No newline at end of file From 72e96faca5376afa1a2c9992bfb99cbeda5d11f9 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Thu, 5 Oct 2023 01:35:46 +0530 Subject: [PATCH 202/240] Client Telemetry: Adds new public APIs (#4056) * Revert "[Internal] Client Telemetry: Refactors code for collectors (#4037)" This reverts commit e2311a9fdcca392ec7d49c13939aaff3404deb85. * Revert "Revert "[Internal] Client Telemetry: Refactors code for collectors (#4037)"" This reverts commit f04234b76174180b482eadfa0f6f412c80d380c3. * firdst draft * initialize object * null handle * update contracts * compilation charges * fix tests * public API changes * add docs * contract updated * fixed tests * by default switch of te;emetry in sdk * fix tests * fix assertion * incorporate review comments * fetaure flag fix in script * switch case * add test * fix tests * fix test * fixed run.sh * minor changes * code refactor * changed default values and fix tests --- .../Tools/Benchmark/BenchmarkConfig.cs | 16 ++- .../Tools/Benchmark/run.sh | 18 ++- .../Tools/CTL/CTLConfig.cs | 14 +- .../src/ConnectionPolicy.cs | 22 +-- .../src/CosmosClientOptions.cs | 42 ++---- .../src/CosmosClientTelemetryOptions.cs | 58 ++++++++ .../src/CosmosThresholdOptions.cs | 31 ++++ Microsoft.Azure.Cosmos/src/DocumentClient.cs | 14 +- .../src/Fluent/CosmosClientBuilder.cs | 67 +++------ .../src/RequestOptions/RequestOptions.cs | 2 +- .../src/Resource/ClientContextCore.cs | 2 +- .../OpenTelemetry/CosmosDbEventSource.cs | 2 +- .../DistributedTracingOptions.cs | 30 ---- .../Filters/DiagnosticsFilterHelper.cs | 34 ++--- .../OpenTelemetryCoreRecorder.cs | 6 +- .../OpenTelemetryRecorderFactory.cs | 4 +- .../src/Telemetry/TelemetryToServiceHelper.cs | 4 +- ...riterBaselineTests.BulkOperationsAsync.xml | 9 +- ...neTests.PointOperationsExceptionsAsync.xml | 9 +- .../ClientTelemetryConfigurationTest.cs | 15 +- .../ClientTelemetryTestsBase.cs | 10 +- .../DistributedTracingOTelTests.cs | 37 +++-- .../SynchronizationContextTests.cs | 5 +- .../EndToEndTraceWriterBaselineTests.cs | 65 ++++++--- .../Utils/TestCommon.cs | 14 +- .../Utils/TransportClientHelper.cs | 9 +- .../Mocks/MockDocumentClient.cs | 6 +- .../Contracts/DotNetPreviewSDKAPI.json | 133 ++++++++++++++++-- .../CosmosClientOptionsUnitTests.cs | 20 ++- .../CosmosClientTests.cs | 34 +---- .../DiagnosticHandlerHelperTests.cs | 16 +-- .../Telemetry/DiagnosticsFilterHelperTest.cs | 35 +++-- .../Utils/MockCosmosUtil.cs | 5 +- 33 files changed, 501 insertions(+), 287 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/src/CosmosClientTelemetryOptions.cs create mode 100644 Microsoft.Azure.Cosmos/src/CosmosThresholdOptions.cs delete mode 100644 Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/DistributedTracingOptions.cs diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs index e3ec5c23bb..0fde6a8926 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs @@ -103,8 +103,8 @@ public class BenchmarkConfig [Option(Required = false, HelpText = "Disable core SDK logging")] public bool DisableCoreSdkLogging { get; set; } - [Option(Required = false, HelpText = "Enable Distributed Tracing")] - public bool EnableDistributedTracing { get; set; } + [Option(Required = false, HelpText = "Disable Distributed Tracing feature from source")] + public bool DisableDistributedTracing { get; set; } = false; [Option(Required = false, HelpText = "Client Telemetry Schedule in Seconds")] public int TelemetryScheduleInSec { get; set; } @@ -138,8 +138,8 @@ public class BenchmarkConfig [Option(Required = false, HelpText = "Application Insights connection string")] public string AppInsightsConnectionString { get; set; } - [Option(Required = false, HelpText = "Enable Client Telemetry Feature in SDK. Make sure you enable it from the portal also.")] - public bool EnableClientTelemetry { get; set; } = true; + [Option(Required = false, HelpText = "Disable Client Telemetry Feature in SDK. Make sure you enable it from the portal also.")] + public bool DisableClientTelemetry { get; set; } = false; internal int GetTaskCount(int containerThroughput) { @@ -220,7 +220,11 @@ internal Microsoft.Azure.Cosmos.CosmosClient CreateCosmosClient(string accountKe MaxRetryAttemptsOnRateLimitedRequests = 0, MaxRequestsPerTcpConnection = this.MaxRequestsPerTcpConnection, MaxTcpConnectionsPerEndpoint = this.MaxTcpConnectionsPerEndpoint, - EnableClientTelemetry = this.EnableClientTelemetry + CosmosClientTelemetryOptions = new Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions() + { + DisableSendingMetricsToService = this.DisableClientTelemetry, + DisableDistributedTracing = this.DisableDistributedTracing + } }; if (!string.IsNullOrWhiteSpace(this.ConsistencyLevel)) @@ -228,8 +232,6 @@ internal Microsoft.Azure.Cosmos.CosmosClient CreateCosmosClient(string accountKe clientOptions.ConsistencyLevel = (Microsoft.Azure.Cosmos.ConsistencyLevel)Enum.Parse(typeof(Microsoft.Azure.Cosmos.ConsistencyLevel), this.ConsistencyLevel, ignoreCase: true); } - clientOptions.IsDistributedTracingEnabled = this.EnableDistributedTracing; - return new Microsoft.Azure.Cosmos.CosmosClient( this.EndPoint, accountKey, diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh index 71b647d72d..81cafc4a4a 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh @@ -24,6 +24,12 @@ then exit -1 fi +if [ -z "$TELEMETRY_ENDPOINT" ] +then + echo "Missing TELEMETRY_ENDPOINT" + exit -1 +fi + if [ -z "$INCLUDE_QUERY" ] then echo "Missing INCLUDE_QUERY" @@ -41,26 +47,26 @@ echo $COMMIT_TIME echo $BRANCH_NAME # Client telemetry disabled ReadStreamExistsV3 -dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --disableClientTelemetry --disableDistributedTracing --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --partitionkeypath /pk --container testcol +dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk sleep 10 #Wait # Client telemetry enabled ReadStreamExistsV3. This is needed to see the impact of client telemetry. -dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithTelemetry --telemetryScheduleInSec 60 --disableDistributedTracing --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --partitionkeypath /pk --container testcol +dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithTelemetry --enableTelemetry --telemetryScheduleInSec 60 --telemetryEndpoint $TELEMETRY_ENDPOINT --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk sleep 10 #Wait # Open telemetry enabled ReadStreamExistsV3. This is needed to see the impact of distributed tracing (without listener) -dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithDistributedTracingWOListener --disableClientTelemetry --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --partitionkeypath /pk --container testcol +dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithDistributedTracingWOListener --enableDistributedTracing --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk sleep 10 #Wait #Point read operations for WORKLOAD_NAME in ReadNotExistsV3 ReadTExistsV3 ReadStreamExistsWithDiagnosticsV3 do - dotnet run -c Release -- -n 2000000 -w $WORKLOAD_NAME --pl $PL --telemetryScheduleInSec 60 --tcp 10 -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --partitionkeypath /pk --container testcol + dotnet run -c Release -- -n 2000000 -w $WORKLOAD_NAME --pl $PL --enableTelemetry --telemetryScheduleInSec 60 --telemetryEndpoint $TELEMETRY_ENDPOINT --tcp 10 -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk sleep 10 #Wait done #Insert operation -dotnet run -c Release -- -n 2000000 -w InsertV3 --pl 30 --telemetryScheduleInSec 60 --tcp 1 -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --partitionkeypath /pk --container testcol +dotnet run -c Release -- -n 2000000 -w InsertV3 --pl 30 --enableTelemetry --telemetryScheduleInSec 60 --telemetryEndpoint $TELEMETRY_ENDPOINT --tcp 1 -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk sleep 45 #Wait if [ "$INCLUDE_QUERY" = true ] @@ -70,7 +76,7 @@ then # pl is 16 because 18 was casuing a small amount of thorrtles. for WORKLOAD_NAME in ReadFeedStreamV3 QueryTSinglePkV3 QueryTSinglePkOrderByWithPaginationV3 QueryTSinglePkOrderByFullDrainV3 QueryTCrossPkV3 QueryTCrossPkOrderByWithPaginationV3 QueryTCrossPkOrderByFullDrainV3 QueryStreamSinglePkV3 QueryStreamSinglePkOrderByWithPaginationV3 QueryStreamSinglePkOrderByFullDrainV3 QueryStreamCrossPkV3 QueryStreamCrossPkOrderByWithPaginationV3 QueryStreamCrossPkOrderByFullDrainV3 do - dotnet run -c Release -- -n 200000 -w $WORKLOAD_NAME --pl 16 --telemetryScheduleInSec 60 --tcp 10 -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --partitionkeypath /pk --container testcol + dotnet run -c Release -- -n 200000 -w $WORKLOAD_NAME --pl 16 --enableTelemetry --telemetryScheduleInSec 60 --telemetryEndpoint $TELEMETRY_ENDPOINT --tcp 10 -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk sleep 10 #Wait done fi \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/CTL/CTLConfig.cs b/Microsoft.Azure.Cosmos.Samples/Tools/CTL/CTLConfig.cs index 98bba7b700..8d58271a22 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/CTL/CTLConfig.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/CTL/CTLConfig.cs @@ -103,8 +103,8 @@ public string DiagnosticsThresholdDuration [Option("ctl_reservoir_sample_size", Required = false, HelpText = "The reservoir sample size.")] public int ReservoirSampleSize { get; set; } = 1028; - [Option("ctl_enable_client_telemetry", Required = false, HelpText = "Enable Client Telemetry Feature in SDK. Make sure you enable it from the portal also.")] - public bool EnableClientTelemetry { get; set; } = true; + [Option("ctl_disable_client_telemetry", Required = false, HelpText = "Disable Client Telemetry Feature in SDK. Make sure you enable it from the portal also.")] + public bool DisableClientTelemetry { get; set; } = false; internal TimeSpan RunningTimeDurationAsTimespan { get; private set; } = TimeSpan.FromHours(10); internal TimeSpan DiagnosticsThresholdDurationAsTimespan { get; private set; } = TimeSpan.FromSeconds(60); @@ -130,12 +130,19 @@ internal CosmosClient CreateCosmosClient() CosmosClientOptions clientOptions = new CosmosClientOptions() { ApplicationName = CTLConfig.UserAgentSuffix, - EnableClientTelemetry = this.EnableClientTelemetry + CosmosClientTelemetryOptions = new CosmosClientTelemetryOptions() + { + DisableSendingMetricsToService = this.DisableClientTelemetry, + } }; + Console.WriteLine("ApplicationName = " + CTLConfig.UserAgentSuffix); + Console.WriteLine("DisableSendingMetricsToService = " + this.DisableClientTelemetry); + if (this.UseGatewayMode) { clientOptions.ConnectionMode = ConnectionMode.Gateway; + Console.WriteLine("ConnectionMode = " + ConnectionMode.Gateway); } if (!string.IsNullOrWhiteSpace(this.ConsistencyLevel)) @@ -143,6 +150,7 @@ internal CosmosClient CreateCosmosClient() if (Enum.TryParse(this.ConsistencyLevel, out ConsistencyLevel consistencyLevel)) { clientOptions.ConsistencyLevel = consistencyLevel; + Console.WriteLine("ConsistencyLevel = " + consistencyLevel); } else { diff --git a/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs b/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs index 8451918e9b..bd1b23b16c 100644 --- a/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Cosmos using System.Net.Http; using System.Net.Security; using System.Security.Cryptography.X509Certificates; - using Microsoft.Azure.Cosmos.Telemetry; using Microsoft.Azure.Documents; using Microsoft.Azure.Documents.Client; @@ -48,8 +47,9 @@ public ConnectionPolicy() this.MaxConnectionLimit = defaultMaxConcurrentConnectionLimit; this.RetryOptions = new RetryOptions(); this.EnableReadRequestsFallback = null; - this.EnableClientTelemetry = false; // by default feature flag is off this.ServerCertificateCustomValidationCallback = null; + + this.CosmosClientTelemetryOptions = new CosmosClientTelemetryOptions(); } /// @@ -211,15 +211,6 @@ public bool EnableTcpConnectionEndpointRediscovery set; } - /// - /// Gets or sets the flag to enable client telemetry feature. - /// - internal bool EnableClientTelemetry - { - get; - set; - } - /// /// Gets the default connection policy used to connect to the Azure Cosmos DB service. /// @@ -489,6 +480,15 @@ internal int? MaxTcpPartitionCount set; } + /// + /// Gets or sets Client Telemetry Options like feature flags and corresponding options + /// + internal CosmosClientTelemetryOptions CosmosClientTelemetryOptions + { + get; + set; + } + /// /// GlobalEndpointManager will subscribe to this event if user updates the preferredLocations list in the Azure Cosmos DB service. /// diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs index 2c07f060f8..b3b21e4f3b 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Cosmos using System.Linq; using System.Net; using System.Net.Http; - using System.Net.Http.Headers; using System.Net.Security; using System.Security.Cryptography.X509Certificates; using Microsoft.Azure.Cosmos.Fluent; @@ -85,6 +84,7 @@ public CosmosClientOptions() this.ConnectionProtocol = CosmosClientOptions.DefaultProtocol; this.ApiType = CosmosClientOptions.DefaultApiType; this.CustomHandlers = new Collection(); + this.CosmosClientTelemetryOptions = new CosmosClientTelemetryOptions(); } /// @@ -730,9 +730,14 @@ internal Protocol ConnectionProtocol internal bool? EnableCpuMonitor { get; set; } /// - /// Flag to enable telemetry + /// Gets or sets Client Telemetry Options like feature flags and corresponding options /// - internal bool? EnableClientTelemetry { get; set; } +#if PREVIEW + public +#else + internal +#endif + CosmosClientTelemetryOptions CosmosClientTelemetryOptions { get; set; } internal void SetSerializerIfNotConfigured(CosmosSerializer serializer) { @@ -771,12 +776,13 @@ internal virtual ConnectionPolicy GetConnectionPolicy(int clientId) EnableTcpConnectionEndpointRediscovery = this.EnableTcpConnectionEndpointRediscovery, EnableAdvancedReplicaSelectionForTcp = this.EnableAdvancedReplicaSelectionForTcp, HttpClientFactory = this.httpClientFactory, - ServerCertificateCustomValidationCallback = this.ServerCertificateCustomValidationCallback + ServerCertificateCustomValidationCallback = this.ServerCertificateCustomValidationCallback, + CosmosClientTelemetryOptions = new CosmosClientTelemetryOptions() }; - if (this.EnableClientTelemetry.HasValue) + if (this.CosmosClientTelemetryOptions != null) { - connectionPolicy.EnableClientTelemetry = this.EnableClientTelemetry.Value; + connectionPolicy.CosmosClientTelemetryOptions = this.CosmosClientTelemetryOptions; } if (this.ApplicationRegion != null) @@ -1013,29 +1019,5 @@ public override bool CanConvert(Type objectType) return objectType == typeof(DateTime); } } - - /// - /// Distributed Tracing Options. - /// - /// Applicable only when Operation level distributed tracing is enabled through - internal DistributedTracingOptions DistributedTracingOptions { get; set; } - - /// - /// Gets or sets the flag to generate operation level for methods calls using the Source Name "Azure.Cosmos.Operation". - /// - /// - /// The default value is true (for preview package). - /// - /// This flag is there to disable it from source. Please Refer https://opentelemetry.io/docs/instrumentation/net/exporters/ to know more about open telemetry exporters -#if PREVIEW - public -#else - internal -#endif - bool IsDistributedTracingEnabled { get; set; } -#if PREVIEW - = true; -#endif - } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientTelemetryOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientTelemetryOptions.cs new file mode 100644 index 0000000000..8b2a2aa6a0 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/CosmosClientTelemetryOptions.cs @@ -0,0 +1,58 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos +{ + /// + /// Telemetry Options for Cosmos Client to enable/disable telemetry and distributed tracing along with corresponding threshold values. + /// +#if PREVIEW + public +#else + internal +#endif + class CosmosClientTelemetryOptions + { + /// + /// Disable sending telemetry to service, is not applicable to this as of now. + /// + /// This option will disable sending telemetry to service.even it is opt-in from portal. + /// true +#if PREVIEW + public +#else + internal +#endif + bool DisableSendingMetricsToService { get; set; } = true; + + /// + /// This method enable/disable generation of operation level if listener is subscribed to the Source Name "Azure.Cosmos.Operation". + /// + /// false + /// Please Refer https://opentelemetry.io/docs/instrumentation/net/exporters/ to know more about open telemetry exporters +#if PREVIEW + public +#else + internal +#endif + bool DisableDistributedTracing { get; set; } = +#if PREVIEW + false; +#else + true; +#endif + + /// + /// Threshold values for Distributed Tracing. + /// These values decides whether to generate operation level with request diagnostics or not. + /// +#if PREVIEW + public +#else + internal +#endif + CosmosThresholdOptions CosmosThresholdOptions { get; set; } = new CosmosThresholdOptions(); + + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/CosmosThresholdOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosThresholdOptions.cs new file mode 100644 index 0000000000..5a04286f68 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/CosmosThresholdOptions.cs @@ -0,0 +1,31 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos +{ + using System; + + /// + /// Threshold values for Distributed Tracing + /// +#if PREVIEW + public +#else + internal +#endif + class CosmosThresholdOptions + { + /// + /// Latency Threshold for non point operations i.e. Query + /// + /// 500 ms + public TimeSpan NonPointOperationLatencyThreshold { get; set; } = TimeSpan.FromSeconds(3); + + /// + /// Latency Threshold for point operations i.e operation other than Query + /// + /// 100 ms + public TimeSpan PointOperationLatencyThreshold { get; set; } = TimeSpan.FromSeconds(1); + } +} diff --git a/Microsoft.Azure.Cosmos/src/DocumentClient.cs b/Microsoft.Azure.Cosmos/src/DocumentClient.cs index 9dee309028..3c261490a7 100644 --- a/Microsoft.Azure.Cosmos/src/DocumentClient.cs +++ b/Microsoft.Azure.Cosmos/src/DocumentClient.cs @@ -171,7 +171,7 @@ internal partial class DocumentClient : IDisposable, IAuthorizationTokenProvider internal RemoteCertificateValidationCallback remoteCertificateValidationCallback; //Distributed Tracing Flag - internal bool isDistributedTracingEnabled; + internal CosmosClientTelemetryOptions cosmosClientTelemetryOptions; //SessionContainer. internal ISessionContainer sessionContainer; @@ -432,7 +432,7 @@ internal DocumentClient(Uri serviceEndpoint, /// Flag to allow Quorum Read with Eventual Consistency Account /// /// This delegate responsible for validating the third party certificate. - /// This is distributed tracing flag + /// This is distributed tracing flag /// /// The service endpoint can be obtained from the Azure Management Portal. /// If you are connecting using one of the Master Keys, these can be obtained along with the endpoint from the Azure Management Portal @@ -460,7 +460,7 @@ internal DocumentClient(Uri serviceEndpoint, bool isLocalQuorumConsistency = false, string cosmosClientId = null, RemoteCertificateValidationCallback remoteCertificateValidationCallback = null, - bool isDistributedTracingEnabled = false) + CosmosClientTelemetryOptions cosmosClientTelemetryOptions = null) { if (sendingRequestEventArgs != null) { @@ -494,7 +494,7 @@ internal DocumentClient(Uri serviceEndpoint, storeClientFactory: storeClientFactory, cosmosClientId: cosmosClientId, remoteCertificateValidationCallback: remoteCertificateValidationCallback, - isDistributedTracingEnabled: isDistributedTracingEnabled); + cosmosClientTelemetryOptions: cosmosClientTelemetryOptions); } /// @@ -678,7 +678,7 @@ internal virtual void Initialize(Uri serviceEndpoint, TokenCredential tokenCredential = null, string cosmosClientId = null, RemoteCertificateValidationCallback remoteCertificateValidationCallback = null, - bool isDistributedTracingEnabled = false) + CosmosClientTelemetryOptions cosmosClientTelemetryOptions = null) { if (serviceEndpoint == null) { @@ -687,7 +687,7 @@ internal virtual void Initialize(Uri serviceEndpoint, this.clientId = cosmosClientId; this.remoteCertificateValidationCallback = remoteCertificateValidationCallback; - this.isDistributedTracingEnabled = isDistributedTracingEnabled; + this.cosmosClientTelemetryOptions = cosmosClientTelemetryOptions ?? new CosmosClientTelemetryOptions(); this.queryPartitionProvider = new AsyncLazy(async () => { @@ -6623,7 +6623,7 @@ private void InitializeDirectConnectivity(IStoreClientFactory storeClientFactory { Documents.Telemetry.DistributedTracingOptions distributedTracingOptions = new () { - IsDistributedTracingEnabled = this.isDistributedTracingEnabled + IsDistributedTracingEnabled = !this.cosmosClientTelemetryOptions.DisableDistributedTracing }; StoreClientFactory newClientFactory = new StoreClientFactory( diff --git a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs index bf04d103bb..8ba2ffa266 100644 --- a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs +++ b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs @@ -435,36 +435,6 @@ public CosmosClientBuilder WithConsistencyLevel(Cosmos.ConsistencyLevel consiste } - /// - /// Sets whether Distributed Tracing for "Azure.Cosmos.Operation" source is enabled. - /// - /// Whether is enabled. - /// The current . -#if PREVIEW - public -#else - internal -#endif - CosmosClientBuilder WithDistributedTracing(bool isEnabled = true) - { - this.clientOptions.IsDistributedTracingEnabled = isEnabled; - return this; - } - - /// - /// Enables Distributed Tracing with a Configuration ref. - /// - /// . - /// The current .] - /// Refer https://opentelemetry.io/docs/instrumentation/net/exporters/ to know more about open telemetry exporters - internal CosmosClientBuilder WithDistributedTracingOptions(DistributedTracingOptions options) - { - this.clientOptions.IsDistributedTracingEnabled = true; - this.clientOptions.DistributedTracingOptions = options; - - return this; - } - /// /// Sets the connection mode to Gateway. This is used by the client when connecting to the Azure Cosmos DB service. /// @@ -679,27 +649,6 @@ internal CosmosClientBuilder WithCpuMonitorDisabled() return this; } - /// - /// Disable Telemetry if enabled using environment properties - /// - /// The object - internal CosmosClientBuilder WithTelemetryDisabled() - { - this.clientOptions.EnableClientTelemetry = false; - return this; - } - - /// - /// To enable Telemetry, set COSMOS.CLIENT_TELEMETRY_ENABLED environment property. - /// This function is used by Test only. - /// - /// The object - internal CosmosClientBuilder WithTelemetryEnabled() - { - this.clientOptions.EnableClientTelemetry = true; - return this; - } - /// /// Enabled partition level failover in the SDK /// @@ -731,5 +680,21 @@ internal CosmosClientBuilder WithRetryWithOptions( this.clientOptions.TotalWaitTimeForRetryWithMilliseconds = totalWaitTimeForRetryWithMilliseconds; return this; } + + /// + /// To enable Telemetry features with corresponding options + /// + /// + /// The object +#if PREVIEW + public +#else + internal +#endif + CosmosClientBuilder WithClientTelemetryOptions(CosmosClientTelemetryOptions options) + { + this.clientOptions.CosmosClientTelemetryOptions = options; + return this; + } } } diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs index dc02f9a248..56c152568a 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs @@ -66,7 +66,7 @@ public class RequestOptions /// /// Set Request Level Distributed Tracing Options. /// - internal DistributedTracingOptions DistributedTracingOptions { get; set; } + internal CosmosThresholdOptions CosmosThresholdOptions { get; set; } /// /// Gets or sets the boolean to use effective partition key routing in the cosmos db request. diff --git a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs index a128e178d0..5d5b66ee71 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/ClientContextCore.cs @@ -82,7 +82,7 @@ internal static CosmosClientContext Create( sessionContainer: clientOptions.SessionContainer, cosmosClientId: cosmosClient.Id, remoteCertificateValidationCallback: ClientContextCore.SslCustomValidationCallBack(clientOptions.ServerCertificateCustomValidationCallback), - isDistributedTracingEnabled: clientOptions.IsDistributedTracingEnabled); + cosmosClientTelemetryOptions: clientOptions.CosmosClientTelemetryOptions); return ClientContextCore.Create( cosmosClient, diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs index 8898cea96d..f7fe0c307f 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/CosmosDbEventSource.cs @@ -31,7 +31,7 @@ public static bool IsEnabled(EventLevel level) [NonEvent] public static void RecordDiagnosticsForRequests( - DistributedTracingOptions config, + CosmosThresholdOptions config, Documents.OperationType operationType, OpenTelemetryAttributes response) { diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/DistributedTracingOptions.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/DistributedTracingOptions.cs deleted file mode 100644 index 6c44f06bf2..0000000000 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/DistributedTracingOptions.cs +++ /dev/null @@ -1,30 +0,0 @@ -// ------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -// ------------------------------------------------------------ - -namespace Microsoft.Azure.Cosmos -{ - using System; - - /// - /// Options for configuring the distributed tracing and event tracing - /// - internal sealed class DistributedTracingOptions - { - /// - /// Default Latency threshold for other than query Operation - /// - internal static readonly TimeSpan DefaultCrudLatencyThreshold = TimeSpan.FromMilliseconds(100); - - /// - /// Default Latency threshold for QUERY operation - /// - internal static readonly TimeSpan DefaultQueryTimeoutThreshold = TimeSpan.FromMilliseconds(500); - - /// - /// SDK generates (Event Source Name is "Azure-Cosmos-Operation-Request-Diagnostics") with Request Diagnostics String, If Operation level distributed tracing is not disabled i.e. - /// - /// If it is not set then, by default, it will generate for query operation which are taking more than 500 ms and non-query operations taking more than 100 ms. - public TimeSpan? LatencyThresholdForDiagnosticEvent { get; set; } - } -} diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs index d48392bb3e..3c0646f101 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs @@ -10,29 +10,18 @@ namespace Microsoft.Azure.Cosmos.Telemetry.Diagnostics internal static class DiagnosticsFilterHelper { + private static readonly CosmosThresholdOptions defaultThresholdOptions = new CosmosThresholdOptions(); + /// /// Allow only when Latency is not more than 100 (non-query) /250 (query) ms /// /// true or false public static bool IsLatencyThresholdCrossed( - DistributedTracingOptions config, + CosmosThresholdOptions config, OperationType operationType, OpenTelemetryAttributes response) { - TimeSpan latencyThreshold; - - if (config?.LatencyThresholdForDiagnosticEvent != null) - { - latencyThreshold = config.LatencyThresholdForDiagnosticEvent.Value; - } - else - { - latencyThreshold = DiagnosticsFilterHelper.IsPointOperation(operationType) ? - DistributedTracingOptions.DefaultCrudLatencyThreshold : - DistributedTracingOptions.DefaultQueryTimeoutThreshold; - } - - return response.Diagnostics.GetClientElapsedTime() > latencyThreshold; + return response.Diagnostics.GetClientElapsedTime() > DiagnosticsFilterHelper.DefaultThreshold(operationType, config); } /// @@ -48,11 +37,24 @@ public static bool IsSuccessfulResponse(HttpStatusCode statusCode, int substatus || (statusCode == System.Net.HttpStatusCode.PreconditionFailed && substatusCode == 0); } + /// + /// Get default threshold value based on operation type + /// + /// + /// + internal static TimeSpan DefaultThreshold(OperationType operationType, CosmosThresholdOptions config) + { + config ??= DiagnosticsFilterHelper.defaultThresholdOptions; + return DiagnosticsFilterHelper.IsPointOperation(operationType) ? + config.PointOperationLatencyThreshold : + config.NonPointOperationLatencyThreshold; + } + /// /// Check if passed operation type is a point operation /// /// - public static bool IsPointOperation(OperationType operationType) + internal static bool IsPointOperation(OperationType operationType) { return operationType == OperationType.Create || operationType == OperationType.Delete || diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs index ced441d368..3679d7c7bd 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs @@ -18,7 +18,7 @@ internal struct OpenTelemetryCoreRecorder : IDisposable private const string CosmosDb = "cosmosdb"; private readonly DiagnosticScope scope = default; - private readonly DistributedTracingOptions config = null; + private readonly CosmosThresholdOptions config = null; private readonly Activity activity = null; private readonly Documents.OperationType operationType = Documents.OperationType.Invalid; @@ -51,7 +51,7 @@ private OpenTelemetryCoreRecorder( string containerName, string databaseName, Documents.OperationType operationType, - CosmosClientContext clientContext, DistributedTracingOptions config) + CosmosClientContext clientContext, CosmosThresholdOptions config) { this.scope = scope; this.config = config; @@ -96,7 +96,7 @@ public static OpenTelemetryCoreRecorder CreateOperationLevelParentActivity( string databaseName, Documents.OperationType operationType, CosmosClientContext clientContext, - DistributedTracingOptions config) + CosmosThresholdOptions config) { return new OpenTelemetryCoreRecorder( operationScope, diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs index ca0b864d2f..61d8889aaa 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs @@ -42,7 +42,7 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, CosmosClientContext clientContext) { OpenTelemetryCoreRecorder openTelemetryRecorder = default; - if (clientContext is { ClientOptions.IsDistributedTracingEnabled: true }) + if (clientContext is { ClientOptions.CosmosClientTelemetryOptions.DisableDistributedTracing: false }) { // If there is no source then it will return default otherwise a valid diagnostic scope DiagnosticScope scope = LazyOperationScopeFactory.Value.CreateScope(name: operationName, @@ -60,7 +60,7 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, databaseName: databaseName, operationType: operationType, clientContext: clientContext, - config: requestOptions?.DistributedTracingOptions ?? clientContext.ClientOptions?.DistributedTracingOptions); + config: requestOptions?.CosmosThresholdOptions ?? clientContext.ClientOptions?.CosmosClientTelemetryOptions.CosmosThresholdOptions); } #if !INTERNAL else if (Activity.Current is null) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/TelemetryToServiceHelper.cs b/Microsoft.Azure.Cosmos/src/Telemetry/TelemetryToServiceHelper.cs index f358076b25..2d0e79071f 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/TelemetryToServiceHelper.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/TelemetryToServiceHelper.cs @@ -68,7 +68,7 @@ public static TelemetryToServiceHelper CreateAndInitializeClientConfigAndTelemet #if INTERNAL return new TelemetryToServiceHelper(); #else - if (!connectionPolicy.EnableClientTelemetry) + if (connectionPolicy.CosmosClientTelemetryOptions.DisableSendingMetricsToService) { return new TelemetryToServiceHelper(); } @@ -217,7 +217,7 @@ private void InitializeClientTelemetry(AccountClientConfiguration clientConfig) catch (Exception ex) { DefaultTrace.TraceWarning($"Error While starting Telemetry Job : {0}. Hence disabling Client Telemetry", ex); - this.connectionPolicy.EnableClientTelemetry = false; + this.connectionPolicy.CosmosClientTelemetryOptions.DisableSendingMetricsToService = true; } } else diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml index fa758baa05..d24e0d6ac3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.BulkOperationsAsync.xml @@ -3969,9 +3969,14 @@ maxRetryWaitTimeOnThrottledRequests: TimeSpan.FromSeconds(1), maxRetryAttemptsOnThrottledRequests: 3) .WithBulkExecution(true) - .WithDistributedTracingOptions(new DistributedTracingOptions() + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() { - LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) + DisableDistributedTracing = false, + CosmosThresholdOptions = new CosmosThresholdOptions() + { + PointOperationLatencyThreshold = TimeSpan.Zero, + NonPointOperationLatencyThreshold = TimeSpan.Zero + } }) .WithTransportClientHandlerFactory(transportClient => new TransportClientWrapper( transportClient, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml index 23f61fcef1..62b8f5b2bb 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.PointOperationsExceptionsAsync.xml @@ -190,9 +190,14 @@ Guid exceptionActivityId = Guid.NewGuid(); using CosmosClient throttleClient = TestCommon.CreateCosmosClient(builder => builder - .WithDistributedTracingOptions(new DistributedTracingOptions() + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() { - LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) + DisableDistributedTracing = false, + CosmosThresholdOptions = new CosmosThresholdOptions() + { + PointOperationLatencyThreshold = TimeSpan.Zero, + NonPointOperationLatencyThreshold = TimeSpan.Zero + } }) .WithThrottlingRetryOptions( maxRetryWaitTimeOnThrottledRequests: TimeSpan.FromSeconds(1), diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryConfigurationTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryConfigurationTest.cs index 57b5357055..9447191a90 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryConfigurationTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryConfigurationTest.cs @@ -80,7 +80,10 @@ public async Task Validate_ClientTelemetryJob_Status_if_Disabled_At_Instance_Lev this.cosmosClientBuilder .WithHttpClientFactory(() => new HttpClient(httpHandler)) - .WithTelemetryDisabled(); + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() + { + DisableSendingMetricsToService = true + }); this.SetClient(this.cosmosClientBuilder.Build()); @@ -144,7 +147,10 @@ public async Task Validate_ClientTelemetryJob_Status_with_Client_Config_Api_Stat this.cosmosClientBuilder .WithHttpClientFactory(() => new HttpClient(httpHandler)) - .WithTelemetryEnabled(); + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() + { + DisableSendingMetricsToService = false + }); this.SetClient(this.cosmosClientBuilder.Build()); @@ -212,7 +218,10 @@ public async Task Validate_ClientTelemetryJob_When_Flag_Is_Switched(bool flagSta this.cosmosClientBuilder .WithHttpClientFactory(() => new HttpClient(httpHandler)) - .WithTelemetryEnabled(); + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() + { + DisableSendingMetricsToService = false + }); this.SetClient(this.cosmosClientBuilder.Build()); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs index 30c239a036..3bb8a53c0c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs @@ -140,7 +140,10 @@ public virtual void TestInitialize() }; this.cosmosClientBuilder = this.GetBuilder() - .WithTelemetryEnabled() + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() + { + DisableSendingMetricsToService = false + }) .WithApplicationPreferredRegions(ClientTelemetryTestsBase.preferredRegionList); } @@ -666,7 +669,10 @@ public virtual async Task CreateItemWithSubStatusCodeTest(ConnectionMode mode) // Replacing originally initialized cosmos Builder with this one with new handler this.cosmosClientBuilder = this.cosmosClientBuilder - .WithTelemetryEnabled() + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() + { + DisableSendingMetricsToService = false + }) .WithHttpClientFactory(() => new HttpClient(httpHandler)); Container container = await this.CreateClientAndContainer( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DistributedTracingOTelTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DistributedTracingOTelTests.cs index 8b5825831c..53b0eb6e24 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DistributedTracingOTelTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DistributedTracingOTelTests.cs @@ -19,7 +19,6 @@ namespace Microsoft.Azure.Cosmos using System.Diagnostics; using Microsoft.Azure.Cosmos.Tracing; using System.Net.Http; - using System.ComponentModel; [VisualStudio.TestTools.UnitTesting.TestClass] public sealed class DistributedTracingOTelTests : BaseCosmosClientHelper @@ -46,7 +45,10 @@ public async Task SourceEnabled_FlagOn_DirectMode_RecordsActivity_AssertLogTrace await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, customizeClientBuilder: (builder) => builder - .WithDistributedTracing(true) + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() + { + DisableDistributedTracing = false + }) .WithConnectionModeDirect()); Container containerResponse = await this.database.CreateContainerAsync( @@ -128,7 +130,10 @@ public async Task SourceEnabled_FlagOn_GatewayMode_RecordsActivity_AssertLogTrac await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, customizeClientBuilder: (builder) => builder - .WithDistributedTracing(true) + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() + { + DisableDistributedTracing = false + }) .WithHttpClientFactory(() => new HttpClient(httpClientHandlerHelper)) .WithConnectionModeGateway()); @@ -158,13 +163,13 @@ await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, } [DataTestMethod] - [DataRow(false, true, "random.source.name", DisplayName = "DirectMode, DistributedFlag On, Random/No Source:Asserts no activity creation")] - [DataRow(true, true, "random.source.name", DisplayName = "GatewayMode, DistributedFlag On, Random/No Source:Asserts no activity creation")] - [DataRow(false, false, "random.source.name", DisplayName = "DirectMode, DistributedFlag Off, Random/No Source:Asserts no activity creation")] - [DataRow(true, false, "random.source.name", DisplayName = "GatewayMode, DistributedFlag Off, Random/No Source:Asserts no activity creation")] - [DataRow(false, false, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", DisplayName = "DirectMode, DistributedFlag Off, OperationLevel Source:Asserts no activity creation")] - [DataRow(true, false, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", DisplayName = "GatewayMode, DistributedFlag Off, OperationLevel Source:Asserts no activity creation")] - public async Task NoSourceEnabled_ResultsInNoSourceParentActivityCreation_AssertLogTraceId(bool useGateway, bool enableDistributingTracing, string source) + [DataRow(false, false, "random.source.name", DisplayName = "DirectMode, DistributedFlag On, Random/No Source:Asserts no activity creation")] + [DataRow(true, false, "random.source.name", DisplayName = "GatewayMode, DistributedFlag On, Random/No Source:Asserts no activity creation")] + [DataRow(false, true, "random.source.name", DisplayName = "DirectMode, DistributedFlag Off, Random/No Source:Asserts no activity creation")] + [DataRow(true, true, "random.source.name", DisplayName = "GatewayMode, DistributedFlag Off, Random/No Source:Asserts no activity creation")] + [DataRow(false, true, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", DisplayName = "DirectMode, DistributedFlag Off, OperationLevel Source:Asserts no activity creation")] + [DataRow(true, true, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", DisplayName = "GatewayMode, DistributedFlag Off, OperationLevel Source:Asserts no activity creation")] + public async Task NoSourceEnabled_ResultsInNoSourceParentActivityCreation_AssertLogTraceId(bool useGateway, bool disableDistributingTracing, string source) { using TracerProvider provider = Sdk.CreateTracerProviderBuilder() .AddCustomOtelExporter() @@ -175,14 +180,20 @@ public async Task NoSourceEnabled_ResultsInNoSourceParentActivityCreation_Assert { await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, customizeClientBuilder: (builder) => builder - .WithDistributedTracing(enableDistributingTracing) + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() + { + DisableDistributedTracing = disableDistributingTracing + }) .WithConnectionModeGateway()); } else { await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, customizeClientBuilder: (builder) => builder - .WithDistributedTracing(enableDistributingTracing)); + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() + { + DisableDistributedTracing = disableDistributingTracing + })); } ContainerResponse containerResponse = await this.database.CreateContainerAsync( @@ -194,7 +205,7 @@ await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, string diagnosticsCreateContainer = containerResponse.Diagnostics.ToString(); JObject objDiagnosticsCreate = JObject.Parse(diagnosticsCreateContainer); - if (enableDistributingTracing) + if (!disableDistributingTracing) { //DistributedTraceId present in logs string distributedTraceId = (string)objDiagnosticsCreate["data"]["DistributedTraceId"]; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SynchronizationContextTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SynchronizationContextTests.cs index 1c5676a46a..a51a77f14f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SynchronizationContextTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SynchronizationContextTests.cs @@ -59,7 +59,10 @@ public void VerifySynchronizationContextDoesNotLock(bool withClientTelemetry) { using (CosmosClient client = TestCommon.CreateCosmosClient( customizeClientBuilder: (builder) => builder - .WithTelemetryEnabled() + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions () + { + DisableSendingMetricsToService = !withClientTelemetry + }) .WithHttpClientFactory(() => new HttpClient(httpHandler)))) { Cosmos.Database database = client.CreateDatabaseAsync(databaseId).GetAwaiter().GetResult(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs index 79e947d41b..6cd8905b07 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/EndToEndTraceWriterBaselineTests.cs @@ -47,28 +47,48 @@ public sealed class EndToEndTraceWriterBaselineTests : BaselineTests builder + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() + { + DisableDistributedTracing = false, + CosmosThresholdOptions = new CosmosThresholdOptions() + { + PointOperationLatencyThreshold = TimeSpan.Zero, + NonPointOperationLatencyThreshold = TimeSpan.Zero + } + })); + bulkClient = TestCommon.CreateCosmosClient(builder => builder .WithBulkExecution(true) - .WithDistributedTracingOptions(new DistributedTracingOptions() - { - LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) - })); - + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() + { + DisableDistributedTracing = false, + CosmosThresholdOptions = new CosmosThresholdOptions() + { + PointOperationLatencyThreshold = TimeSpan.Zero, + NonPointOperationLatencyThreshold = TimeSpan.Zero + } + })); + // Set a small retry count to reduce test time miscCosmosClient = TestCommon.CreateCosmosClient(builder => builder .AddCustomHandlers(requestHandler) - .WithDistributedTracingOptions(new DistributedTracingOptions() - { - LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) - })); + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() + { + DisableDistributedTracing = false, + CosmosThresholdOptions = new CosmosThresholdOptions() + { + PointOperationLatencyThreshold = TimeSpan.Zero, + NonPointOperationLatencyThreshold = TimeSpan.Zero + } + })); EndToEndTraceWriterBaselineTests.database = await client.CreateDatabaseAsync( "databaseName", @@ -682,7 +702,10 @@ public async Task ValidateInvalidCredentialsTraceAsync() // It is not baseline test hence disable distributed tracing for this test CosmosClientOptions clientOptions = new CosmosClientOptions() { - IsDistributedTracingEnabled = false + CosmosClientTelemetryOptions = new CosmosClientTelemetryOptions() + { + DisableDistributedTracing = true + } }; using (CosmosClient client = new CosmosClient( @@ -1015,9 +1038,14 @@ public async Task PointOperationsExceptionsAsync() Guid exceptionActivityId = Guid.NewGuid(); using CosmosClient throttleClient = TestCommon.CreateCosmosClient(builder => builder - .WithDistributedTracingOptions(new DistributedTracingOptions() + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() { - LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) + DisableDistributedTracing = false, + CosmosThresholdOptions = new CosmosThresholdOptions() + { + PointOperationLatencyThreshold = TimeSpan.Zero, + NonPointOperationLatencyThreshold = TimeSpan.Zero + } }) .WithThrottlingRetryOptions( maxRetryWaitTimeOnThrottledRequests: TimeSpan.FromSeconds(1), @@ -1303,9 +1331,14 @@ public async Task BulkOperationsAsync() maxRetryWaitTimeOnThrottledRequests: TimeSpan.FromSeconds(1), maxRetryAttemptsOnThrottledRequests: 3) .WithBulkExecution(true) - .WithDistributedTracingOptions(new DistributedTracingOptions() + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() { - LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) + DisableDistributedTracing = false, + CosmosThresholdOptions = new CosmosThresholdOptions() + { + PointOperationLatencyThreshold = TimeSpan.Zero, + NonPointOperationLatencyThreshold = TimeSpan.Zero + } }) .WithTransportClientHandlerFactory(transportClient => new TransportClientWrapper( transportClient, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs index 8cfa5be33b..48a5025289 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs @@ -130,8 +130,7 @@ internal static CosmosClient CreateCosmosClient( internal static CosmosClient CreateCosmosClient( bool useGateway, - Action customizeClientBuilder = null, - bool enableDistributingTracing = false) + Action customizeClientBuilder = null) { CosmosClientBuilder cosmosClientBuilder = GetDefaultConfiguration(); @@ -141,14 +140,6 @@ internal static CosmosClient CreateCosmosClient( { cosmosClientBuilder.WithConnectionModeGateway(); } - - if(enableDistributingTracing) - { - cosmosClientBuilder.WithDistributedTracingOptions(new DistributedTracingOptions() - { - LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) - }); - } return cosmosClientBuilder.Build(); } @@ -164,8 +155,7 @@ internal static DocumentClient CreateClient(bool useGateway, Protocol protocol = RetryOptions retryOptions = null, ApiType apiType = ApiType.None, EventHandler recievedResponseEventHandler = null, - bool useMultipleWriteLocations = false, - bool enableClientTelemetry = false) + bool useMultipleWriteLocations = false) { string authKey = ConfigurationManager.AppSettings["MasterKey"]; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TransportClientHelper.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TransportClientHelper.cs index f34135b695..ebeebad7ae 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TransportClientHelper.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TransportClientHelper.cs @@ -83,9 +83,14 @@ internal static Container GetContainerWithIntercepter( if (enableDistributingTracing) { - builder.WithDistributedTracingOptions(new DistributedTracingOptions() + builder.WithClientTelemetryOptions(new CosmosClientTelemetryOptions() { - LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(.0001) + DisableDistributedTracing = false, + CosmosThresholdOptions = new CosmosThresholdOptions() + { + PointOperationLatencyThreshold = TimeSpan.Zero, + NonPointOperationLatencyThreshold = TimeSpan.Zero + } }); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/MockDocumentClient.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/MockDocumentClient.cs index 3484abb3ae..7d268407de 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/MockDocumentClient.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/MockDocumentClient.cs @@ -54,9 +54,11 @@ public static CosmosClient CreateMockCosmosClient( { policy = new ConnectionPolicy { - EnableClientTelemetry = true // feature flag is always true + CosmosClientTelemetryOptions = new CosmosClientTelemetryOptions + { + DisableSendingMetricsToService = !isClientTelemetryEnabled.Value + } }; - } MockDocumentClient documentClient = new MockDocumentClient(policy); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index 8546a93b2f..8f25a74f08 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -355,24 +355,141 @@ "Microsoft.Azure.Cosmos.CosmosClientOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { - "Boolean get_IsDistributedTracingEnabled()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions CosmosClientTelemetryOptions": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions CosmosClientTelemetryOptions;CanRead:True;CanWrite:True;Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions get_CosmosClientTelemetryOptions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_CosmosClientTelemetryOptions(Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions get_CosmosClientTelemetryOptions()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ "CompilerGeneratedAttribute" ], - "MethodInfo": "Boolean get_IsDistributedTracingEnabled();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + "MethodInfo": "Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions get_CosmosClientTelemetryOptions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_CosmosClientTelemetryOptions(Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_CosmosClientTelemetryOptions(Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, + "Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "Boolean DisableDistributedTracing": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Boolean DisableDistributedTracing;CanRead:True;CanWrite:True;Boolean get_DisableDistributedTracing();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_DisableDistributedTracing(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, - "Boolean IsDistributedTracingEnabled": { + "Boolean DisableSendingMetricsToService": { "Type": "Property", "Attributes": [], - "MethodInfo": "Boolean IsDistributedTracingEnabled;CanRead:True;CanWrite:True;Boolean get_IsDistributedTracingEnabled();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_IsDistributedTracingEnabled(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + "MethodInfo": "Boolean DisableSendingMetricsToService;CanRead:True;CanWrite:True;Boolean get_DisableSendingMetricsToService();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_DisableSendingMetricsToService(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean get_DisableDistributedTracing()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Boolean get_DisableDistributedTracing();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean get_DisableSendingMetricsToService()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Boolean get_DisableSendingMetricsToService();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.CosmosThresholdOptions CosmosThresholdOptions": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.CosmosThresholdOptions CosmosThresholdOptions;CanRead:True;CanWrite:True;Microsoft.Azure.Cosmos.CosmosThresholdOptions get_CosmosThresholdOptions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_CosmosThresholdOptions(Microsoft.Azure.Cosmos.CosmosThresholdOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.CosmosThresholdOptions get_CosmosThresholdOptions()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Microsoft.Azure.Cosmos.CosmosThresholdOptions get_CosmosThresholdOptions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void .ctor()": { + "Type": "Constructor", + "Attributes": [], + "MethodInfo": "[Void .ctor(), Void .ctor()]" + }, + "Void set_CosmosThresholdOptions(Microsoft.Azure.Cosmos.CosmosThresholdOptions)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_CosmosThresholdOptions(Microsoft.Azure.Cosmos.CosmosThresholdOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_DisableDistributedTracing(Boolean)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_DisableDistributedTracing(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_DisableSendingMetricsToService(Boolean)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_DisableSendingMetricsToService(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, + "Microsoft.Azure.Cosmos.CosmosThresholdOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "System.TimeSpan get_NonPointOperationLatencyThreshold()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.TimeSpan get_NonPointOperationLatencyThreshold();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan get_PointOperationLatencyThreshold()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.TimeSpan get_PointOperationLatencyThreshold();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan NonPointOperationLatencyThreshold": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.TimeSpan NonPointOperationLatencyThreshold;CanRead:True;CanWrite:True;System.TimeSpan get_NonPointOperationLatencyThreshold();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_NonPointOperationLatencyThreshold(System.TimeSpan);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan PointOperationLatencyThreshold": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.TimeSpan PointOperationLatencyThreshold;CanRead:True;CanWrite:True;System.TimeSpan get_PointOperationLatencyThreshold();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_PointOperationLatencyThreshold(System.TimeSpan);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void .ctor()": { + "Type": "Constructor", + "Attributes": [], + "MethodInfo": "[Void .ctor(), Void .ctor()]" + }, + "Void set_NonPointOperationLatencyThreshold(System.TimeSpan)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_NonPointOperationLatencyThreshold(System.TimeSpan);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, - "Void set_IsDistributedTracingEnabled(Boolean)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Void set_PointOperationLatencyThreshold(System.TimeSpan)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ "CompilerGeneratedAttribute" ], - "MethodInfo": "Void set_IsDistributedTracingEnabled(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + "MethodInfo": "Void set_PointOperationLatencyThreshold(System.TimeSpan);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {} @@ -454,10 +571,10 @@ "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { - "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder WithDistributedTracing(Boolean)": { + "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder WithClientTelemetryOptions(Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions)": { "Type": "Method", "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder WithDistributedTracing(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + "MethodInfo": "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder WithClientTelemetryOptions(Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs index 37d89c389a..f3c45adf48 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs @@ -99,6 +99,12 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() Assert.AreNotEqual(Cosmos.ConsistencyLevel.Session, clientOptions.ConsistencyLevel); Assert.IsFalse(policy.EnablePartitionLevelFailover); Assert.IsFalse(clientOptions.EnableAdvancedReplicaSelectionForTcp.HasValue); +#if PREVIEW + Assert.IsFalse(clientOptions.CosmosClientTelemetryOptions.DisableDistributedTracing); +#else + Assert.IsTrue(clientOptions.CosmosClientTelemetryOptions.DisableDistributedTracing); +#endif + Assert.IsTrue(clientOptions.CosmosClientTelemetryOptions.DisableSendingMetricsToService); cosmosClientBuilder.WithApplicationRegion(region) .WithConnectionModeGateway(maxConnections, webProxy) @@ -164,9 +170,14 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() portReuseMode, enableTcpConnectionEndpointRediscovery) .WithApplicationPreferredRegions(preferredLocations) - .WithDistributedTracingOptions(new DistributedTracingOptions + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() { - LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(100) + DisableDistributedTracing = false, + CosmosThresholdOptions = new CosmosThresholdOptions() + { + PointOperationLatencyThreshold = TimeSpan.FromMilliseconds(100), + NonPointOperationLatencyThreshold = TimeSpan.FromMilliseconds(100) + } }); cosmosClient = cosmosClientBuilder.Build(new MockDocumentClient()); @@ -179,8 +190,9 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() Assert.AreEqual(portReuseMode, clientOptions.PortReuseMode); Assert.IsTrue(clientOptions.EnableTcpConnectionEndpointRediscovery); CollectionAssert.AreEqual(preferredLocations.ToArray(), clientOptions.ApplicationPreferredRegions.ToArray()); - Assert.AreEqual(TimeSpan.FromMilliseconds(100), clientOptions.DistributedTracingOptions.LatencyThresholdForDiagnosticEvent); - Assert.IsTrue(clientOptions.IsDistributedTracingEnabled); + Assert.AreEqual(TimeSpan.FromMilliseconds(100), clientOptions.CosmosClientTelemetryOptions.CosmosThresholdOptions.PointOperationLatencyThreshold); + Assert.AreEqual(TimeSpan.FromMilliseconds(100), clientOptions.CosmosClientTelemetryOptions.CosmosThresholdOptions.NonPointOperationLatencyThreshold); + Assert.IsFalse(clientOptions.CosmosClientTelemetryOptions.DisableDistributedTracing); //Verify GetConnectionPolicy returns the correct values policy = clientOptions.GetConnectionPolicy(clientId: 0); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientTests.cs index 8d08704eeb..6740001f53 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientTests.cs @@ -7,7 +7,6 @@ namespace Microsoft.Azure.Cosmos.Tests using System; using System.Collections.Generic; using System.Diagnostics; - using System.Collections.Specialized; using System.Globalization; using System.Linq; using System.Net; @@ -16,7 +15,6 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Threading; using System.Threading.Tasks; using System.Web; - using FluentAssertions; using global::Azure; using global::Azure.Core; using Microsoft.Azure.Cosmos.Core.Trace; @@ -248,11 +246,7 @@ public void ValidateMasterKeyAuthProvider() using (CosmosClient client = new CosmosClient( CosmosClientTests.AccountEndpoint, - masterKeyCredential, - new CosmosClientOptions() - { - EnableClientTelemetry = false, - })) + masterKeyCredential)) { Assert.AreEqual(typeof(AuthorizationTokenProviderMasterKey), client.AuthorizationTokenProvider.GetType()); } @@ -265,11 +259,7 @@ public void ValidateResourceTokenAuthProvider() using (CosmosClient client = new CosmosClient( CosmosClientTests.AccountEndpoint, - resourceToken, - new CosmosClientOptions() - { - EnableClientTelemetry = false, - })) + resourceToken)) { Assert.AreEqual(typeof(AuthorizationTokenProviderResourceToken), client.AuthorizationTokenProvider.GetType()); } @@ -283,11 +273,7 @@ public void ValidateMasterKeyAzureCredentialAuthProvider() AzureKeyCredential masterKeyCredential = new AzureKeyCredential(originalKey); using (CosmosClient client = new CosmosClient( CosmosClientTests.AccountEndpoint, - masterKeyCredential, - new CosmosClientOptions() - { - EnableClientTelemetry = false, - })) + masterKeyCredential)) { Assert.AreEqual(typeof(AzureKeyCredentialAuthorizationTokenProvider), client.AuthorizationTokenProvider.GetType()); @@ -304,11 +290,7 @@ public void ValidateResourceTokenAzureCredentialAuthProvider() AzureKeyCredential resourceTokenCredential = new AzureKeyCredential(resourceToken); using (CosmosClient client = new CosmosClient( CosmosClientTests.AccountEndpoint, - resourceTokenCredential, - new CosmosClientOptions() - { - EnableClientTelemetry = false, - })) + resourceTokenCredential)) { Assert.AreEqual(typeof(AzureKeyCredentialAuthorizationTokenProvider), client.AuthorizationTokenProvider.GetType()); @@ -377,8 +359,7 @@ public async Task ValidateAzureKeyCredentialGatewayModeUpdateAsync() masterKeyCredential, new CosmosClientOptions() { - HttpClientFactory = () => new HttpClient(new HttpHandlerHelper(mockHttpHandler.Object)), - EnableClientTelemetry = false, + HttpClientFactory = () => new HttpClient(new HttpHandlerHelper(mockHttpHandler.Object)) })) { Container container = client.GetContainer(Guid.NewGuid().ToString(), Guid.NewGuid().ToString()); @@ -440,10 +421,7 @@ void TraceHandler(string message) for (int z = 0; z < 100; ++z) { - using CosmosClient cosmos = new(ConnectionString, new CosmosClientOptions - { - EnableClientTelemetry = true - }); + using CosmosClient cosmos = new(ConnectionString); } string assertMsg = String.Empty; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Diagnostics/DiagnosticHandlerHelperTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Diagnostics/DiagnosticHandlerHelperTests.cs index c620b726e7..cd0a92ad1b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Diagnostics/DiagnosticHandlerHelperTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Diagnostics/DiagnosticHandlerHelperTests.cs @@ -58,8 +58,9 @@ public async Task RefreshTestAsync() { // Get default instance of DiagnosticsHandlerHelper with client telemetry disabled (default) DiagnosticsHandlerHelper diagnosticHandlerHelper1 = DiagnosticsHandlerHelper.GetInstance(); - await Task.Delay(10000); // warm up + await Task.Delay(10000); // warm up to make sure there is at least one entry in the history Assert.IsNotNull(diagnosticHandlerHelper1.GetDiagnosticsSystemHistory()); + Assert.IsNull(diagnosticHandlerHelper1.GetClientTelemetrySystemHistory()); Assert.IsTrue(diagnosticHandlerHelper1.GetDiagnosticsSystemHistory().Values.Count > 0); int countBeforeRefresh = diagnosticHandlerHelper1.GetDiagnosticsSystemHistory().Values.Count; @@ -69,22 +70,21 @@ public async Task RefreshTestAsync() Assert.IsNull(TelemetrySystemUsageRecorderField1.GetValue(null)); // Refresh instance of DiagnosticsHandlerHelper with client telemetry enabled - DiagnosticsHandlerHelper.Refresh(true); - await Task.Delay(5000); // warm up again to populate telemetry data + DiagnosticsHandlerHelper.Refresh(isClientTelemetryEnabled: true); DiagnosticsHandlerHelper diagnosticHandlerHelper2 = DiagnosticsHandlerHelper.GetInstance(); - int countAfterRefresh = diagnosticHandlerHelper1.GetDiagnosticsSystemHistory().Values.Count; - + Assert.IsNotNull(diagnosticHandlerHelper2.GetDiagnosticsSystemHistory()); + int countAfterRefresh = diagnosticHandlerHelper2.GetDiagnosticsSystemHistory().Values.Count; + Assert.IsTrue(countBeforeRefresh <= countAfterRefresh, "After Refresh count should be greater than or equal to before refresh count"); - Assert.AreNotEqual(diagnosticHandlerHelper1, diagnosticHandlerHelper2); - Assert.IsNotNull(diagnosticHandlerHelper2.GetDiagnosticsSystemHistory()); + await Task.Delay(5000); // warm up to make sure there is at least one entry in the history Assert.IsNotNull(diagnosticHandlerHelper2.GetClientTelemetrySystemHistory()); Assert.IsTrue(diagnosticHandlerHelper2.GetClientTelemetrySystemHistory().Values.Count > 0); // Refresh instance of DiagnosticsHandlerHelper with client telemetry disabled - DiagnosticsHandlerHelper.Refresh(false); + DiagnosticsHandlerHelper.Refresh(isClientTelemetryEnabled: false); DiagnosticsHandlerHelper diagnosticHandlerHelper3 = DiagnosticsHandlerHelper.GetInstance(); Assert.IsNotNull(diagnosticHandlerHelper3.GetDiagnosticsSystemHistory()); Assert.IsNull(diagnosticHandlerHelper3.GetClientTelemetrySystemHistory()); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs index 5e32b26da1..62517239e3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/DiagnosticsFilterHelperTest.cs @@ -14,7 +14,6 @@ namespace Microsoft.Azure.Cosmos.Tests.Telemetry using Documents; using VisualStudio.TestTools.UnitTesting; - [TestClass] public class DiagnosticsFilterHelperTest { @@ -33,9 +32,9 @@ public void CheckReturnFalseOnSuccessAndLowerLatencyThanConfiguredConfig() { Assert.IsTrue(this.rootTrace.Duration > TimeSpan.Zero); - DistributedTracingOptions distributedTracingOptions = new DistributedTracingOptions + CosmosThresholdOptions distributedTracingOptions = new CosmosThresholdOptions { - LatencyThresholdForDiagnosticEvent = this.rootTrace.Duration.Add(TimeSpan.FromSeconds(1)) + PointOperationLatencyThreshold = this.rootTrace.Duration.Add(TimeSpan.FromSeconds(1)) }; OpenTelemetryAttributes response = new OpenTelemetryAttributes @@ -48,7 +47,7 @@ public void CheckReturnFalseOnSuccessAndLowerLatencyThanConfiguredConfig() DiagnosticsFilterHelper .IsLatencyThresholdCrossed(distributedTracingOptions, OperationType.Read, response), $" Response time is {response.Diagnostics.GetClientElapsedTime().Milliseconds}ms " + - $"and Configured threshold value is {distributedTracingOptions.LatencyThresholdForDiagnosticEvent.Value.Milliseconds}ms " + + $"and Configured threshold value is {distributedTracingOptions.PointOperationLatencyThreshold.Milliseconds}ms " + $"and Is response Success : {response.StatusCode.IsSuccess()}" ); } @@ -56,13 +55,6 @@ public void CheckReturnFalseOnSuccessAndLowerLatencyThanConfiguredConfig() public void CheckReturnTrueOnFailedStatusCode() { Assert.IsTrue(this.rootTrace.Duration > TimeSpan.Zero); - - - DistributedTracingOptions distributedTracingOptions = new DistributedTracingOptions - { - LatencyThresholdForDiagnosticEvent = this.rootTrace.Duration.Add(TimeSpan.FromSeconds(1)) - }; - OpenTelemetryAttributes response = new OpenTelemetryAttributes { StatusCode = HttpStatusCode.BadRequest, @@ -73,9 +65,28 @@ public void CheckReturnTrueOnFailedStatusCode() !DiagnosticsFilterHelper .IsSuccessfulResponse(response.StatusCode, response.SubStatusCode), $" Response time is {response.Diagnostics.GetClientElapsedTime().Milliseconds}ms " + - $"and Configured threshold value is {distributedTracingOptions.LatencyThresholdForDiagnosticEvent.Value.Milliseconds}ms " + $"and Is response Success : {response.StatusCode.IsSuccess()}"); } + [TestMethod] + public void CheckedDefaultThresholdBasedOnOperationType() + { + Assert.IsTrue(this.rootTrace.Duration > TimeSpan.Zero); + + CosmosThresholdOptions config = new CosmosThresholdOptions(); + + Array values = Enum.GetValues(typeof(OperationType)); + + foreach(OperationType operationType in values) + { + TimeSpan defaultThreshold = DiagnosticsFilterHelper.DefaultThreshold(operationType, config); + + if(DiagnosticsFilterHelper.IsPointOperation(operationType)) + Assert.AreEqual(defaultThreshold, config.PointOperationLatencyThreshold); + else + Assert.AreEqual(defaultThreshold, config.NonPointOperationLatencyThreshold); + } + } + } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Utils/MockCosmosUtil.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Utils/MockCosmosUtil.cs index 92a6e60038..77ba6981cb 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Utils/MockCosmosUtil.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Utils/MockCosmosUtil.cs @@ -36,7 +36,10 @@ public static CosmosClient CreateMockCosmosClient( { ConnectionPolicy policy = new ConnectionPolicy { - EnableClientTelemetry = enableTelemetry + CosmosClientTelemetryOptions = new CosmosClientTelemetryOptions + { + DisableSendingMetricsToService = !enableTelemetry + } }; DocumentClient documentClient = accountConsistencyLevel.HasValue ? new MockDocumentClient(accountConsistencyLevel.Value, policy) : new MockDocumentClient(policy); From 7ed22ac55b569354ea94733ea5ab4601d20dd586 Mon Sep 17 00:00:00 2001 From: Kevin Pilch Date: Fri, 6 Oct 2023 16:36:44 -0700 Subject: [PATCH 203/240] [Internal] Build: Adds CodeQL support in nightly builds (#4113) * Update azure-pipelines-nightly.yml * Newlines in variables sections --- azure-pipelines-nightly.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/azure-pipelines-nightly.yml b/azure-pipelines-nightly.yml index 04a53968aa..f0f7f3faea 100644 --- a/azure-pipelines-nightly.yml +++ b/azure-pipelines-nightly.yml @@ -16,10 +16,13 @@ variables: VmImage: windows-latest # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops BuildConfiguration: Release Packaging.EnableSBOMSigning: true + Codeql.Enabled: true stages: - stage: displayName: Generate nightly GA + variables: + Codeql.BuildIdentifier: ga jobs: - template: templates/nuget-pack.yml parameters: @@ -32,6 +35,8 @@ stages: CleanupFolder: true - stage: displayName: Generate nightly preview + variables: + Codeql.BuildIdentifier: preview jobs: - template: templates/nuget-pack.yml parameters: @@ -41,4 +46,4 @@ stages: ReleasePackage: true OutputPath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/$(BuildConfiguration)/Microsoft.Azure.Cosmos' BlobVersion: 'nightly-preview' - CleanupFolder: true \ No newline at end of file + CleanupFolder: true From 75eec5c33abff8fb07886af917d661f0963b452f Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Mon, 9 Oct 2023 20:29:11 +0530 Subject: [PATCH 204/240] Benchmark: Fixes to show estimated cost of a container only when new container is getting created (#4109) * Showing Estimated Cost only when new container is getting created * read container to get container response * disable client telemetry by default * removed unused imports * resolve merge conflict * fixed name * fix container not found * removed the message * Update Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs Co-authored-by: Matias Quaranta * removed line space --------- Co-authored-by: Kiran Kumar Kolli Co-authored-by: Matias Quaranta --- .../Tools/Benchmark/BenchmarkConfig.cs | 12 ++++++------ .../Tools/Benchmark/Program.cs | 12 +----------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs index 0fde6a8926..2c523374bf 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs @@ -103,8 +103,8 @@ public class BenchmarkConfig [Option(Required = false, HelpText = "Disable core SDK logging")] public bool DisableCoreSdkLogging { get; set; } - [Option(Required = false, HelpText = "Disable Distributed Tracing feature from source")] - public bool DisableDistributedTracing { get; set; } = false; + [Option(Required = false, HelpText = "Enable Distributed Tracing")] + public bool EnableDistributedTracing { get; set; } = false; [Option(Required = false, HelpText = "Client Telemetry Schedule in Seconds")] public int TelemetryScheduleInSec { get; set; } @@ -138,8 +138,8 @@ public class BenchmarkConfig [Option(Required = false, HelpText = "Application Insights connection string")] public string AppInsightsConnectionString { get; set; } - [Option(Required = false, HelpText = "Disable Client Telemetry Feature in SDK. Make sure you enable it from the portal also.")] - public bool DisableClientTelemetry { get; set; } = false; + [Option(Required = false, HelpText = "Enable Client Telemetry Feature in SDK. Make sure you enable it from the portal also.")] + public bool EnableTelemetry { get; set; } = false; internal int GetTaskCount(int containerThroughput) { @@ -222,8 +222,8 @@ internal Microsoft.Azure.Cosmos.CosmosClient CreateCosmosClient(string accountKe MaxTcpConnectionsPerEndpoint = this.MaxTcpConnectionsPerEndpoint, CosmosClientTelemetryOptions = new Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions() { - DisableSendingMetricsToService = this.DisableClientTelemetry, - DisableDistributedTracing = this.DisableDistributedTracing + DisableSendingMetricsToService = !this.EnableTelemetry, + DisableDistributedTracing = !this.EnableDistributedTracing } }; diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs index 9bbb33b9fd..fde9d5cd2c 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs @@ -7,10 +7,8 @@ namespace CosmosBenchmark using System; using System.Collections.Generic; using System.Diagnostics; - using System.Diagnostics.Tracing; using System.IO; using System.Linq; - using System.Net; using System.Net.Http; using System.Reflection; using System.Threading; @@ -18,7 +16,6 @@ namespace CosmosBenchmark using Azure.Monitor.OpenTelemetry.Exporter; using CosmosBenchmark.Fx; using Microsoft.Azure.Cosmos; - using Microsoft.Extensions.Logging; using Newtonsoft.Json.Linq; using OpenTelemetry; using OpenTelemetry.Metrics; @@ -323,14 +320,7 @@ private static Type[] AvailableBenchmarks() private static async Task CreatePartitionedContainerAsync(BenchmarkConfig options, CosmosClient cosmosClient) { Microsoft.Azure.Cosmos.Database database = await cosmosClient.CreateDatabaseIfNotExistsAsync(options.Database); - - // Show user cost of running this test - double estimatedCostPerMonth = 0.06 * options.Throughput; - double estimatedCostPerHour = estimatedCostPerMonth / (24 * 30); - Utility.TeeTraceInformation($"The container will cost an estimated ${Math.Round(estimatedCostPerHour, 2)} per hour (${Math.Round(estimatedCostPerMonth, 2)} per month)"); - Utility.TeeTraceInformation("Press enter to continue ..."); - Console.ReadLine(); - + string partitionKeyPath = options.PartitionKeyPath; return await database.CreateContainerIfNotExistsAsync(options.Container, partitionKeyPath, options.Throughput); } From a5dec66060a63572ac09d2c4943dc9b218650a70 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 10 Oct 2023 00:08:05 +0530 Subject: [PATCH 205/240] Distributed Tracing: Fixes SDK responses compatibility with opentelemetry response (#4097) * adding tets * wip * wip2 * fix code * add tests * fix test * fix test * remove consoles * fix indent and remove unused imports * internal to private rollback * added docs * removed unused imports * added exception in message * fix exception catching --- .../OpenTelemetryCoreRecorder.cs | 2 +- .../OpenTelemetry/OpenTelemetryResponse.cs | 52 +++-- .../OpenTelemetry/OpenTelemetryResponse{T}.cs | 56 +++-- .../Telemetry/OpenTelemetryRecorderTests.cs | 201 ++++++++++++++++++ 4 files changed, 284 insertions(+), 27 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs index 3679d7c7bd..2928685d97 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryCoreRecorder.cs @@ -223,7 +223,7 @@ Documents.OperationType operationType this.scope.AddAttribute(OpenTelemetryAttributeKeys.RequestContentLength, this.response.RequestContentLength); this.scope.AddAttribute(OpenTelemetryAttributeKeys.ResponseContentLength, this.response.ResponseContentLength); this.scope.AddAttribute(OpenTelemetryAttributeKeys.StatusCode, (int)this.response.StatusCode); - this.scope.AddAttribute(OpenTelemetryAttributeKeys.SubStatusCode, (int)this.response.SubStatusCode); + this.scope.AddAttribute(OpenTelemetryAttributeKeys.SubStatusCode, this.response.SubStatusCode); this.scope.AddAttribute(OpenTelemetryAttributeKeys.RequestCharge, this.response.RequestCharge); this.scope.AddAttribute(OpenTelemetryAttributeKeys.ItemCount, this.response.ItemCount); this.scope.AddAttribute(OpenTelemetryAttributeKeys.ActivityId, this.response.ActivityId); diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs index c9aba10ee6..09d43c6965 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse.cs @@ -4,8 +4,10 @@ namespace Microsoft.Azure.Cosmos { + using System; using System.IO; using System.Net; + using Microsoft.Azure.Cosmos.Core.Trace; using Telemetry; internal sealed class OpenTelemetryResponse : OpenTelemetryAttributes @@ -13,28 +15,28 @@ internal sealed class OpenTelemetryResponse : OpenTelemetryAttributes internal OpenTelemetryResponse(TransactionalBatchResponse responseMessage) : this( statusCode: responseMessage.StatusCode, - requestCharge: responseMessage.Headers?.RequestCharge, + requestCharge: OpenTelemetryResponse.GetHeader(responseMessage)?.RequestCharge, responseContentLength: null, diagnostics: responseMessage.Diagnostics, - itemCount: responseMessage.Headers?.ItemCount, + itemCount: OpenTelemetryResponse.GetHeader(responseMessage)?.ItemCount, requestMessage: null, - subStatusCode: (int)responseMessage.Headers?.SubStatusCode, - activityId: responseMessage.Headers?.ActivityId, - correlationId: responseMessage.Headers?.CorrelatedActivityId) + subStatusCode: OpenTelemetryResponse.GetHeader(responseMessage)?.SubStatusCode, + activityId: OpenTelemetryResponse.GetHeader(responseMessage)?.ActivityId, + correlationId: OpenTelemetryResponse.GetHeader(responseMessage)?.CorrelatedActivityId) { } internal OpenTelemetryResponse(ResponseMessage responseMessage) : this( statusCode: responseMessage.StatusCode, - requestCharge: responseMessage.Headers?.RequestCharge, + requestCharge: OpenTelemetryResponse.GetHeader(responseMessage)?.RequestCharge, responseContentLength: OpenTelemetryResponse.GetPayloadSize(responseMessage), diagnostics: responseMessage.Diagnostics, - itemCount: responseMessage.Headers?.ItemCount, + itemCount: OpenTelemetryResponse.GetHeader(responseMessage)?.ItemCount, requestMessage: responseMessage.RequestMessage, - subStatusCode: (int)responseMessage.Headers?.SubStatusCode, - activityId: responseMessage.Headers?.ActivityId, - correlationId: responseMessage.Headers?.CorrelatedActivityId, + subStatusCode: OpenTelemetryResponse.GetHeader(responseMessage)?.SubStatusCode, + activityId: OpenTelemetryResponse.GetHeader(responseMessage)?.ActivityId, + correlationId: OpenTelemetryResponse.GetHeader(responseMessage)?.CorrelatedActivityId, operationType: responseMessage is QueryResponse ? Documents.OperationType.Query : Documents.OperationType.Invalid ) { @@ -47,7 +49,7 @@ private OpenTelemetryResponse( CosmosDiagnostics diagnostics, string itemCount, RequestMessage requestMessage, - int subStatusCode, + Documents.SubStatusCodes? subStatusCode, string activityId, string correlationId, Documents.OperationType operationType = Documents.OperationType.Invalid) @@ -58,7 +60,7 @@ private OpenTelemetryResponse( this.ResponseContentLength = responseContentLength; this.Diagnostics = diagnostics; this.ItemCount = itemCount; - this.SubStatusCode = subStatusCode; + this.SubStatusCode = (int)(subStatusCode ?? Documents.SubStatusCodes.Unknown); this.ActivityId = activityId; this.CorrelatedActivityId = correlationId; this.OperationType = operationType; @@ -74,5 +76,31 @@ private static string GetPayloadSize(ResponseMessage response) } return response?.Headers?.ContentLength; } + + private static Headers GetHeader(TransactionalBatchResponse responseMessage) + { + try + { + return responseMessage?.Headers; + } + catch (NotImplementedException ex) + { + DefaultTrace.TraceVerbose("Failed to get headers from TransactionalBatchResponse. Exception: {0}", ex); + return null; + } + } + + private static Headers GetHeader(ResponseMessage responseMessage) + { + try + { + return responseMessage?.Headers; + } + catch (NotImplementedException ex) + { + DefaultTrace.TraceVerbose("Failed to get headers from ResponseMessage. Exception: {0}", ex); + return null; + } + } } } diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs index 4c96306a30..976b68173a 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryResponse{T}.cs @@ -4,7 +4,9 @@ namespace Microsoft.Azure.Cosmos { + using System; using System.Net; + using Microsoft.Azure.Cosmos.Core.Trace; using Telemetry; internal sealed class OpenTelemetryResponse : OpenTelemetryAttributes @@ -12,14 +14,14 @@ internal sealed class OpenTelemetryResponse : OpenTelemetryAttributes internal OpenTelemetryResponse(FeedResponse responseMessage) : this( statusCode: responseMessage.StatusCode, - requestCharge: responseMessage.Headers?.RequestCharge, - responseContentLength: responseMessage?.Headers?.ContentLength, + requestCharge: OpenTelemetryResponse.GetHeader(responseMessage)?.RequestCharge, + responseContentLength: OpenTelemetryResponse.GetHeader(responseMessage)?.ContentLength, diagnostics: responseMessage.Diagnostics, - itemCount: responseMessage.Headers?.ItemCount, + itemCount: OpenTelemetryResponse.GetHeader(responseMessage)?.ItemCount, requestMessage: responseMessage.RequestMessage, - subStatusCode: (int)responseMessage.Headers?.SubStatusCode, - activityId: responseMessage.Headers?.ActivityId, - correlatedActivityId: responseMessage.Headers?.CorrelatedActivityId, + subStatusCode: OpenTelemetryResponse.GetHeader(responseMessage)?.SubStatusCode, + activityId: OpenTelemetryResponse.GetHeader(responseMessage)?.ActivityId, + correlatedActivityId: OpenTelemetryResponse.GetHeader(responseMessage)?.CorrelatedActivityId, operationType: responseMessage is QueryResponse ? Documents.OperationType.Query : Documents.OperationType.Invalid) { } @@ -27,14 +29,14 @@ internal OpenTelemetryResponse(FeedResponse responseMessage) internal OpenTelemetryResponse(Response responseMessage) : this( statusCode: responseMessage.StatusCode, - requestCharge: responseMessage.Headers?.RequestCharge, - responseContentLength: responseMessage?.Headers?.ContentLength, + requestCharge: OpenTelemetryResponse.GetHeader(responseMessage)?.RequestCharge, + responseContentLength: OpenTelemetryResponse.GetHeader(responseMessage)?.ContentLength, diagnostics: responseMessage.Diagnostics, - itemCount: responseMessage.Headers?.ItemCount, + itemCount: OpenTelemetryResponse.GetHeader(responseMessage)?.ItemCount, requestMessage: responseMessage.RequestMessage, - subStatusCode: (int)responseMessage.Headers?.SubStatusCode, - activityId: responseMessage.Headers?.ActivityId, - correlatedActivityId: responseMessage.Headers?.CorrelatedActivityId, + subStatusCode: OpenTelemetryResponse.GetHeader(responseMessage)?.SubStatusCode, + activityId: OpenTelemetryResponse.GetHeader(responseMessage)?.ActivityId, + correlatedActivityId: OpenTelemetryResponse.GetHeader(responseMessage)?.CorrelatedActivityId, operationType: responseMessage is QueryResponse ? Documents.OperationType.Query : Documents.OperationType.Invalid) { } @@ -46,7 +48,7 @@ private OpenTelemetryResponse( CosmosDiagnostics diagnostics, string itemCount, RequestMessage requestMessage, - int subStatusCode, + Documents.SubStatusCodes? subStatusCode, string activityId, string correlatedActivityId, Documents.OperationType operationType) @@ -57,10 +59,36 @@ private OpenTelemetryResponse( this.ResponseContentLength = responseContentLength; this.Diagnostics = diagnostics; this.ItemCount = itemCount; - this.SubStatusCode = subStatusCode; + this.SubStatusCode = (int)(subStatusCode ?? Documents.SubStatusCodes.Unknown); this.ActivityId = activityId; this.CorrelatedActivityId = correlatedActivityId; this.OperationType = operationType; } + + private static Headers GetHeader(FeedResponse responseMessage) + { + try + { + return responseMessage?.Headers; + } + catch (NotImplementedException ex) + { + DefaultTrace.TraceWarning("Failed to get headers from FeedResponse. Exception: {0}", ex); + return null; + } + } + + private static Headers GetHeader(Response responseMessage) + { + try + { + return responseMessage?.Headers; + } + catch (NotImplementedException ex) + { + DefaultTrace.TraceWarning("Failed to get headers from Response. Exception: {0}", ex); + return null; + } + } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/OpenTelemetryRecorderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/OpenTelemetryRecorderTests.cs index 2095999f6c..601045cba5 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/OpenTelemetryRecorderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/OpenTelemetryRecorderTests.cs @@ -6,12 +6,18 @@ namespace Microsoft.Azure.Cosmos.Tests.Telemetry { using System; using System.Collections.Generic; + using System.Collections.ObjectModel; using System.Linq; + using System.Net; using System.Reflection; + using System.Threading; + using System.Threading.Tasks; using Cosmos.Telemetry; using Microsoft.Azure.Cosmos.Diagnostics; + using Microsoft.Azure.Cosmos.Scripts; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.VisualStudio.TestTools.UnitTesting; + using Moq; [TestClass] public class OpenTelemetryRecorderTests @@ -43,6 +49,201 @@ public void CheckExceptionsCompatibility() } } + /// + /// This test verifies whether OpenTelemetryResponse can be initialized using a specific type of response available in the SDK. + /// If any new response is added to the SDK in the future, it must be configured in either of the following dictionaries. + /// + [TestMethod] + public async Task CheckResponseCompatibility() + { + // This list contains all the response types which are not compatible with Open Telemetry Response + IReadOnlyList excludedResponses = new List() + { + "MediaResponse", // Part of dead code + "DocumentFeedResponse`1",// Part of dead code + "CosmosQuotaResponse",// Part of dead code + "StoredProcedureResponse`1" // Not supported as of now + }; + + // This dictionary contains a Key-Value pair where the Key represents the Response Type compatible with Open Telemetry Response, and the corresponding Value is a mocked instance. + // Essentially, at some point in the code, we send an instance of the response to Open Telemetry to retrieve relevant information. + IDictionary responseInstances = new Dictionary() + { + { "PartitionKeyRangeBatchResponse", await OpenTelemetryRecorderTests.GetPartitionKeyRangeBatchResponse() }, + { "TransactionalBatchResponse", await OpenTelemetryRecorderTests.GetTransactionalBatchResponse() }, + { "QueryResponse", new Mock().Object }, + { "QueryResponse`1", OpenTelemetryRecorderTests.GetQueryResponseWithGenerics()}, + { "ReadFeedResponse`1", ReadFeedResponse.CreateResponse (new ResponseMessage(HttpStatusCode.OK),MockCosmosUtil.Serializer)}, + { "ClientEncryptionKeyResponse", new Mock().Object}, + { "ContainerResponse", new Mock().Object }, + { "ItemResponse`1", new Mock>().Object }, + { "DatabaseResponse", new Mock().Object }, + { "PermissionResponse", new Mock().Object }, + { "ThroughputResponse", new Mock().Object }, + { "UserResponse", new Mock().Object }, + { "ChangeFeedEstimatorFeedResponse", ChangefeedResponseFunc}, + { "ChangeFeedEstimatorEmptyFeedResponse", ChangeFeedEstimatorEmptyFeedResponseFunc }, + { "StoredProcedureExecuteResponse`1",new Mock>().Object }, + { "StoredProcedureResponse", new Mock().Object }, + { "TriggerResponse", new Mock().Object }, + { "UserDefinedFunctionResponse", new Mock().Object } + }; + + Assembly asm = OpenTelemetryRecorderTests.GetAssemblyLocally(DllName); + + // Get all types (including internal) defined in the assembly + IEnumerable actualClasses = asm + .GetTypes() + .Where(type => + (type.Name.EndsWith("Response") || type.Name.EndsWith("Response`1")) && // Ending with Response and Response + !type.Name.Contains("OpenTelemetryResponse") && // Excluding OpenTelemetryResponse because we are testing this class + !type.IsAbstract && // Excluding abstract classes + !type.IsInterface && // Excluding interfaces + !excludedResponses.Contains(type.Name)); // Excluding all the types defined in excludedResponses list + + foreach (Type className in actualClasses) + { + Assert.IsTrue(responseInstances.TryGetValue(className.Name, out object instance), $" New Response type found i.e.{className.Name}"); + + if (instance is TransactionalBatchResponse transactionInstance) + { + _ = new OpenTelemetryResponse(transactionInstance); + } + else if (instance is ResponseMessage responseMessageInstance) + { + _ = new OpenTelemetryResponse(responseMessageInstance); + } + else if (instance is FeedResponse feedResponseInstance) + { + _ = new OpenTelemetryResponse(feedResponseInstance); + } + else if (instance is Response responseInstance) + { + _ = new OpenTelemetryResponse(responseInstance); + } + else if (instance is Response encrypResponse) + { + _ = new OpenTelemetryResponse(encrypResponse); + } + else if (instance is Response containerPropertiesResponse) + { + _ = new OpenTelemetryResponse(containerPropertiesResponse); + } + else if (instance is Response databasePropertiesResponse) + { + _ = new OpenTelemetryResponse(databasePropertiesResponse); + } + else if (instance is Response permissionPropertiesResponse) + { + _ = new OpenTelemetryResponse(permissionPropertiesResponse); + } + else if (instance is Response throughputPropertiesResponse) + { + _ = new OpenTelemetryResponse(throughputPropertiesResponse); + } + else if (instance is Response userPropertiesResponse) + { + _ = new OpenTelemetryResponse(userPropertiesResponse); + } + else if (instance is Func> fucntion) + { + _ = new OpenTelemetryResponse(fucntion(className)); + } + else if (instance is Response storedProcedureResponse) + { + _ = new OpenTelemetryResponse(storedProcedureResponse); + } + else if (instance is Response triggerResponse) + { + _ = new OpenTelemetryResponse(triggerResponse); + } + else if (instance is Response userDefinedFunctionResponse) + { + _ = new OpenTelemetryResponse(userDefinedFunctionResponse); + } + else if (instance is Response> storedProcedureExecuteResponse) + { + _ = new OpenTelemetryResponse>(storedProcedureExecuteResponse); + } + else + { + Assert.Fail("Opentelemetry does not support this response type " + className.Name); + } + } + } + + private static readonly Func> ChangefeedResponseFunc = (Type type) => + { + ConstructorInfo constructorInfo = type + .GetConstructor(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance, null, new Type[] { typeof(ITrace), typeof(ReadOnlyCollection), typeof(double) }, null); + if (constructorInfo != null) + { + return (FeedResponse)constructorInfo.Invoke( + new object[] { + NoOpTrace.Singleton, new List().AsReadOnly(), 10 }); + } + + return null; + }; + + private static readonly Func> ChangeFeedEstimatorEmptyFeedResponseFunc = (Type type) => + { + ConstructorInfo constructorInfo = type + .GetConstructor(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance, null, new Type[] { typeof(ITrace) }, null); + if (constructorInfo != null) + { + return (FeedResponse)constructorInfo.Invoke( + new object[] { + NoOpTrace.Singleton}); + } + + return null; + }; + + private static QueryResponse GetQueryResponseWithGenerics() + { + return QueryResponse.CreateResponse( + QueryResponse.CreateFailure( + new CosmosQueryResponseMessageHeaders(null, null, Documents.ResourceType.Document, "col"), HttpStatusCode.OK, new RequestMessage(), null, NoOpTrace.Singleton), + MockCosmosUtil.Serializer); + } + + private static async Task GetTransactionalBatchResponse(ItemBatchOperation[] arrayOperations = null) + { + if(arrayOperations == null) + { + arrayOperations = new ItemBatchOperation[1]; + arrayOperations[0] = new ItemBatchOperation(Documents.OperationType.Read, 0, new PartitionKey("0")); + } + + SinglePartitionKeyServerBatchRequest batchRequest = await SinglePartitionKeyServerBatchRequest.CreateAsync( + partitionKey: null, + operations: new ArraySegment(arrayOperations), + serializerCore: MockCosmosUtil.Serializer, + trace: NoOpTrace.Singleton, + cancellationToken: default); + + return await TransactionalBatchResponse.FromResponseMessageAsync( + new ResponseMessage(HttpStatusCode.OK) { Content = new System.IO.MemoryStream() }, + batchRequest, + MockCosmosUtil.Serializer, + true, + NoOpTrace.Singleton, + CancellationToken.None); + } + + private static async Task GetPartitionKeyRangeBatchResponse() + { + ItemBatchOperation[] arrayOperations = new ItemBatchOperation[1]; + + arrayOperations[0] = new ItemBatchOperation(Documents.OperationType.Read, 0, new PartitionKey("0")); + PartitionKeyRangeBatchResponse partitionKeyRangeBatchResponse = new PartitionKeyRangeBatchResponse( + arrayOperations.Length, + await OpenTelemetryRecorderTests.GetTransactionalBatchResponse(arrayOperations), + MockCosmosUtil.Serializer); + + return partitionKeyRangeBatchResponse; + } [TestMethod] public void MarkFailedTest() From 88fd4cdb9bd9975ae663e559e967a217745d1d02 Mon Sep 17 00:00:00 2001 From: Maya-Painter <130110800+Maya-Painter@users.noreply.github.com> Date: Mon, 9 Oct 2023 15:48:52 -0700 Subject: [PATCH 206/240] Revert "Query: Adds new system strings in JsonBinaryEncoding, replacing 1-byte user strings (#3400)" (#4108) This reverts commit 9140890d788cd43d5668d12072be6b965995a28a. --- .../JsonBinaryEncoding.FirstValueOffsets.cs | 4 +- .../src/Json/JsonBinaryEncoding.NodeTypes.cs | 4 +- .../Json/JsonBinaryEncoding.StringLengths.cs | 24 +- .../src/Json/JsonBinaryEncoding.Strings.cs | 29 ++- .../Json/JsonBinaryEncoding.SystemStrings.cs | 214 +----------------- .../Json/JsonBinaryEncoding.SystemStrings.tt | 32 --- .../src/Json/JsonBinaryEncoding.TypeMarker.cs | 33 ++- .../Json/JsonBinaryEncoding.ValueLengths.cs | 4 +- .../src/Json/JsonReader.JsonBinaryReader.cs | 4 +- .../src/Json/JsonWriter.JsonBinaryWriter.cs | 12 +- .../Json/JsonReaderTests.cs | 20 +- .../Json/JsonWriterTests.cs | 20 +- 12 files changed, 98 insertions(+), 302 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.FirstValueOffsets.cs b/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.FirstValueOffsets.cs index 609ede82ef..36070e533c 100644 --- a/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.FirstValueOffsets.cs +++ b/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.FirstValueOffsets.cs @@ -21,11 +21,13 @@ private static class FirstValueOffsets 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - // Encoded 1-byte system string (64 values) + // Encoded 1-byte system string (32 values) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + // Encoded 1-byte user string (32 values) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, diff --git a/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.NodeTypes.cs b/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.NodeTypes.cs index e0aa15c2c5..80885d9296 100644 --- a/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.NodeTypes.cs +++ b/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.NodeTypes.cs @@ -36,11 +36,13 @@ public static class NodeTypes Number, Number, Number, Number, Number, Number, Number, Number, Number, Number, Number, Number, Number, Number, Number, Number, - // Encoded 1-byte system string (64 values) + // Encoded 1-byte system string (32 values) String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, + + // Encoded 1-byte user string (32 values) String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, diff --git a/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.StringLengths.cs b/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.StringLengths.cs index 09e85f3815..ac68cfe027 100644 --- a/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.StringLengths.cs +++ b/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.StringLengths.cs @@ -37,7 +37,7 @@ private static class StringLengths NotStr, NotStr, NotStr, NotStr, NotStr, NotStr, NotStr, NotStr, NotStr, NotStr, NotStr, NotStr, NotStr, NotStr, NotStr, NotStr, - // Encoded 1-byte system string (64 values) + // Encoded 1-byte system string (32 values) SystemStrings.Strings[0].Utf8String.Length, SystemStrings.Strings[1].Utf8String.Length, SystemStrings.Strings[2].Utf8String.Length, SystemStrings.Strings[3].Utf8String.Length, SystemStrings.Strings[4].Utf8String.Length, SystemStrings.Strings[5].Utf8String.Length, @@ -54,22 +54,12 @@ private static class StringLengths SystemStrings.Strings[26].Utf8String.Length, SystemStrings.Strings[27].Utf8String.Length, SystemStrings.Strings[28].Utf8String.Length, SystemStrings.Strings[29].Utf8String.Length, SystemStrings.Strings[30].Utf8String.Length, SystemStrings.Strings[31].Utf8String.Length, - SystemStrings.Strings[32].Utf8String.Length, SystemStrings.Strings[33].Utf8String.Length, - SystemStrings.Strings[34].Utf8String.Length, SystemStrings.Strings[35].Utf8String.Length, - SystemStrings.Strings[36].Utf8String.Length, SystemStrings.Strings[37].Utf8String.Length, - SystemStrings.Strings[38].Utf8String.Length, SystemStrings.Strings[39].Utf8String.Length, - SystemStrings.Strings[40].Utf8String.Length, SystemStrings.Strings[41].Utf8String.Length, - SystemStrings.Strings[42].Utf8String.Length, SystemStrings.Strings[43].Utf8String.Length, - SystemStrings.Strings[44].Utf8String.Length, SystemStrings.Strings[45].Utf8String.Length, - SystemStrings.Strings[46].Utf8String.Length, SystemStrings.Strings[47].Utf8String.Length, - SystemStrings.Strings[48].Utf8String.Length, SystemStrings.Strings[49].Utf8String.Length, - SystemStrings.Strings[50].Utf8String.Length, SystemStrings.Strings[51].Utf8String.Length, - SystemStrings.Strings[52].Utf8String.Length, SystemStrings.Strings[53].Utf8String.Length, - SystemStrings.Strings[54].Utf8String.Length, SystemStrings.Strings[55].Utf8String.Length, - SystemStrings.Strings[56].Utf8String.Length, SystemStrings.Strings[57].Utf8String.Length, - SystemStrings.Strings[58].Utf8String.Length, SystemStrings.Strings[59].Utf8String.Length, - SystemStrings.Strings[60].Utf8String.Length, SystemStrings.Strings[61].Utf8String.Length, - SystemStrings.Strings[62].Utf8String.Length, SystemStrings.Strings[63].Utf8String.Length, + + // Encoded 1-byte user string (32 values) + UsrStr1, UsrStr1, UsrStr1, UsrStr1, UsrStr1, UsrStr1, UsrStr1, UsrStr1, + UsrStr1, UsrStr1, UsrStr1, UsrStr1, UsrStr1, UsrStr1, UsrStr1, UsrStr1, + UsrStr1, UsrStr1, UsrStr1, UsrStr1, UsrStr1, UsrStr1, UsrStr1, UsrStr1, + UsrStr1, UsrStr1, UsrStr1, UsrStr1, UsrStr1, UsrStr1, UsrStr1, UsrStr1, // Encoded 2-byte user string (8 values) UsrStr2, UsrStr2, UsrStr2, UsrStr2, UsrStr2, UsrStr2, UsrStr2, UsrStr2, diff --git a/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.Strings.cs b/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.Strings.cs index 5c3bf992a1..d3c866fbf0 100644 --- a/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.Strings.cs +++ b/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.Strings.cs @@ -38,11 +38,13 @@ internal static partial class JsonBinaryEncoding false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, - // Encoded 0-byte system string (64 values) + // Encoded 0-byte system string (32 values) true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, + + // Encoded true-byte user string (32 values) true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, @@ -384,14 +386,29 @@ private static bool TryGetUserStringId(ReadOnlySpan stringToken, out int u return false; } - // JsonBinaryEncoding.TypeMarker.IsTwoByteEncodedUserString(typeMarker) must be true - if (stringToken.Length < 2) + if (JsonBinaryEncoding.TypeMarker.IsOneByteEncodedUserString(typeMarker)) { - userStringId = default; - return false; + if (stringToken.Length < 1) + { + userStringId = default; + return false; + } + + userStringId = typeMarker - JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin; } + else //// JsonBinaryEncoding.TypeMarker.IsTwoByteEncodedUserString(typeMarker) + { + if (stringToken.Length < 2) + { + userStringId = default; + return false; + } - userStringId = stringToken[1] + ((stringToken[0] - JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin) * 0xFF); + const byte OneByteCount = JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMax - JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin; + userStringId = OneByteCount + + stringToken[1] + + ((stringToken[0] - JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin) * 0xFF); + } return true; } diff --git a/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.SystemStrings.cs b/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.SystemStrings.cs index 87f2a24062..e9edee7854 100644 --- a/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.SystemStrings.cs +++ b/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.SystemStrings.cs @@ -2,7 +2,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // ------------------------------------------------------------ -// This is auto-generated code. Modify: JsonBinaryEncoding.SystemStrings.tt: 86 +// This is auto-generated code. Modify: JsonBinaryEncoding.SystemStrings.tt: 54 namespace Microsoft.Azure.Cosmos.Json { @@ -51,38 +51,6 @@ public static class SystemStrings UtfAllString.Create("Feature"), UtfAllString.Create("FeatureCollection"), UtfAllString.Create("_id"), - UtfAllString.Create("$id"), - UtfAllString.Create("$pk"), - UtfAllString.Create("_isEdge"), - UtfAllString.Create("_partitionKey"), - UtfAllString.Create("_type"), - UtfAllString.Create("_value"), - UtfAllString.Create("data"), - UtfAllString.Create("Data"), - UtfAllString.Create("entity"), - UtfAllString.Create("isDeleted"), - UtfAllString.Create("IsDeleted"), - UtfAllString.Create("key"), - UtfAllString.Create("Key"), - UtfAllString.Create("Location"), - UtfAllString.Create("partition"), - UtfAllString.Create("partition_id"), - UtfAllString.Create("partitionKey"), - UtfAllString.Create("PartitionKey"), - UtfAllString.Create("pk"), - UtfAllString.Create("state"), - UtfAllString.Create("State"), - UtfAllString.Create("status"), - UtfAllString.Create("Status"), - UtfAllString.Create("subscriptionId"), - UtfAllString.Create("SubscriptionId"), - UtfAllString.Create("tenantId"), - UtfAllString.Create("TenantId"), - UtfAllString.Create("timestamp"), - UtfAllString.Create("Timestamp"), - UtfAllString.Create("ttl"), - UtfAllString.Create("userId"), - UtfAllString.Create("UserId"), }.ToImmutableArray(); public static int? GetSystemStringId(Utf8Span buffer) @@ -93,15 +61,11 @@ public static class SystemStrings 3 => GetSystemStringIdLength3(buffer.Span), 4 => GetSystemStringIdLength4(buffer.Span), 5 => GetSystemStringIdLength5(buffer.Span), - 6 => GetSystemStringIdLength6(buffer.Span), 7 => GetSystemStringIdLength7(buffer.Span), 8 => GetSystemStringIdLength8(buffer.Span), - 9 => GetSystemStringIdLength9(buffer.Span), 10 => GetSystemStringIdLength10(buffer.Span), 11 => GetSystemStringIdLength11(buffer.Span), 12 => GetSystemStringIdLength12(buffer.Span), - 13 => GetSystemStringIdLength13(buffer.Span), - 14 => GetSystemStringIdLength14(buffer.Span), 15 => GetSystemStringIdLength15(buffer.Span), 17 => GetSystemStringIdLength17(buffer.Span), 18 => GetSystemStringIdLength18(buffer.Span), @@ -131,11 +95,6 @@ public static class SystemStrings return 12; } - if (buffer.SequenceEqual(Strings[50].Utf8String.Span.Span)) - { - return 50; - } - return null; } private static int? GetSystemStringIdLength3(ReadOnlySpan buffer) @@ -155,31 +114,6 @@ public static class SystemStrings return 31; } - if (buffer.SequenceEqual(Strings[32].Utf8String.Span.Span)) - { - return 32; - } - - if (buffer.SequenceEqual(Strings[33].Utf8String.Span.Span)) - { - return 33; - } - - if (buffer.SequenceEqual(Strings[43].Utf8String.Span.Span)) - { - return 43; - } - - if (buffer.SequenceEqual(Strings[44].Utf8String.Span.Span)) - { - return 44; - } - - if (buffer.SequenceEqual(Strings[61].Utf8String.Span.Span)) - { - return 61; - } - return null; } private static int? GetSystemStringIdLength4(ReadOnlySpan buffer) @@ -214,16 +148,6 @@ public static class SystemStrings return 27; } - if (buffer.SequenceEqual(Strings[38].Utf8String.Span.Span)) - { - return 38; - } - - if (buffer.SequenceEqual(Strings[39].Utf8String.Span.Span)) - { - return 39; - } - return null; } private static int? GetSystemStringIdLength5(ReadOnlySpan buffer) @@ -258,55 +182,6 @@ public static class SystemStrings return 28; } - if (buffer.SequenceEqual(Strings[36].Utf8String.Span.Span)) - { - return 36; - } - - if (buffer.SequenceEqual(Strings[51].Utf8String.Span.Span)) - { - return 51; - } - - if (buffer.SequenceEqual(Strings[52].Utf8String.Span.Span)) - { - return 52; - } - - return null; - } - private static int? GetSystemStringIdLength6(ReadOnlySpan buffer) - { - if (buffer.SequenceEqual(Strings[37].Utf8String.Span.Span)) - { - return 37; - } - - if (buffer.SequenceEqual(Strings[40].Utf8String.Span.Span)) - { - return 40; - } - - if (buffer.SequenceEqual(Strings[53].Utf8String.Span.Span)) - { - return 53; - } - - if (buffer.SequenceEqual(Strings[54].Utf8String.Span.Span)) - { - return 54; - } - - if (buffer.SequenceEqual(Strings[62].Utf8String.Span.Span)) - { - return 62; - } - - if (buffer.SequenceEqual(Strings[63].Utf8String.Span.Span)) - { - return 63; - } - return null; } private static int? GetSystemStringIdLength7(ReadOnlySpan buffer) @@ -321,11 +196,6 @@ public static class SystemStrings return 29; } - if (buffer.SequenceEqual(Strings[34].Utf8String.Span.Span)) - { - return 34; - } - return null; } private static int? GetSystemStringIdLength8(ReadOnlySpan buffer) @@ -335,50 +205,6 @@ public static class SystemStrings return 10; } - if (buffer.SequenceEqual(Strings[45].Utf8String.Span.Span)) - { - return 45; - } - - if (buffer.SequenceEqual(Strings[57].Utf8String.Span.Span)) - { - return 57; - } - - if (buffer.SequenceEqual(Strings[58].Utf8String.Span.Span)) - { - return 58; - } - - return null; - } - private static int? GetSystemStringIdLength9(ReadOnlySpan buffer) - { - if (buffer.SequenceEqual(Strings[41].Utf8String.Span.Span)) - { - return 41; - } - - if (buffer.SequenceEqual(Strings[42].Utf8String.Span.Span)) - { - return 42; - } - - if (buffer.SequenceEqual(Strings[46].Utf8String.Span.Span)) - { - return 46; - } - - if (buffer.SequenceEqual(Strings[59].Utf8String.Span.Span)) - { - return 59; - } - - if (buffer.SequenceEqual(Strings[60].Utf8String.Span.Span)) - { - return 60; - } - return null; } private static int? GetSystemStringIdLength10(ReadOnlySpan buffer) @@ -426,44 +252,6 @@ public static class SystemStrings return 20; } - if (buffer.SequenceEqual(Strings[47].Utf8String.Span.Span)) - { - return 47; - } - - if (buffer.SequenceEqual(Strings[48].Utf8String.Span.Span)) - { - return 48; - } - - if (buffer.SequenceEqual(Strings[49].Utf8String.Span.Span)) - { - return 49; - } - - return null; - } - private static int? GetSystemStringIdLength13(ReadOnlySpan buffer) - { - if (buffer.SequenceEqual(Strings[35].Utf8String.Span.Span)) - { - return 35; - } - - return null; - } - private static int? GetSystemStringIdLength14(ReadOnlySpan buffer) - { - if (buffer.SequenceEqual(Strings[55].Utf8String.Span.Span)) - { - return 55; - } - - if (buffer.SequenceEqual(Strings[56].Utf8String.Span.Span)) - { - return 56; - } - return null; } private static int? GetSystemStringIdLength15(ReadOnlySpan buffer) diff --git a/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.SystemStrings.tt b/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.SystemStrings.tt index c369e3e489..fd06958ed0 100644 --- a/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.SystemStrings.tt +++ b/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.SystemStrings.tt @@ -43,38 +43,6 @@ string[] systemStrings = new string[] "Feature", "FeatureCollection", "_id", - "$id", - "$pk", - "_isEdge", - "_partitionKey", - "_type", - "_value", - "data", - "Data", - "entity", - "isDeleted", - "IsDeleted", - "key", - "Key", - "Location", - "partition", - "partition_id", - "partitionKey", - "PartitionKey", - "pk", - "state", - "State", - "status", - "Status", - "subscriptionId", - "SubscriptionId", - "tenantId", - "TenantId", - "timestamp", - "Timestamp", - "ttl", - "userId", - "UserId", }; int[] distinctStringLengths = systemStrings.Select(x => x.Length).Distinct().OrderBy(x => x).ToArray(); diff --git a/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.TypeMarker.cs b/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.TypeMarker.cs index 5c17074451..8fab1e22fb 100644 --- a/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.TypeMarker.cs +++ b/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.TypeMarker.cs @@ -27,7 +27,7 @@ public readonly struct TypeMarker public const byte LiteralIntMax = LiteralIntMin + 32; #endregion - #region [0x20, 0x60): Encoded 1-byte system string (64 values) + #region [0x20, 0x40): Encoded 1-byte system string (32 values) /// /// The first type marker for a system string whose value can be encoded in a 1 byte type marker. /// @@ -36,14 +36,26 @@ public readonly struct TypeMarker /// /// The last type marker for a system string whose value can be encoded in a 1 byte type marker. /// - public const byte SystemString1ByteLengthMax = SystemString1ByteLengthMin + 64; + public const byte SystemString1ByteLengthMax = SystemString1ByteLengthMin + 32; + #endregion + + #region [0x40, 0x60): Encoded 1-byte user string (32 values) + /// + /// The first type marker for a user string whose value can be encoded in a 1 byte type marker. + /// + public const byte UserString1ByteLengthMin = SystemString1ByteLengthMax; + + /// + /// The last type marker for a user string whose value can be encoded in a 1 byte type marker. + /// + public const byte UserString1ByteLengthMax = UserString1ByteLengthMin + 32; #endregion #region [0x60, 0x68): 2-byte user string (8 values) /// /// The first type marker for a system string whose value can be encoded in a 2 byte type marker. /// - public const byte UserString2ByteLengthMin = SystemString1ByteLengthMax; + public const byte UserString2ByteLengthMin = UserString1ByteLengthMax; /// /// The last type marker for a system string whose value can be encoded in a 2 byte type marker. @@ -455,6 +467,17 @@ public static bool IsSystemString(byte typeMarker) return InRange(typeMarker, SystemString1ByteLengthMin, SystemString1ByteLengthMax); } + /// + /// Gets whether a typeMarker is for a one byte encoded user string. + /// + /// The input type marker. + /// Whether the typeMarker is for a one byte encoded user string. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsOneByteEncodedUserString(byte typeMarker) + { + return InRange(typeMarker, UserString1ByteLengthMin, UserString1ByteLengthMax); + } + /// /// Gets whether a typeMarker is for a two byte encoded user string. /// @@ -474,7 +497,7 @@ public static bool IsTwoByteEncodedUserString(byte typeMarker) [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsUserString(byte typeMarker) { - return IsTwoByteEncodedUserString(typeMarker); + return IsOneByteEncodedUserString(typeMarker) || IsTwoByteEncodedUserString(typeMarker); } /// @@ -485,7 +508,7 @@ public static bool IsUserString(byte typeMarker) [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsOneByteEncodedString(byte typeMarker) { - return InRange(typeMarker, SystemString1ByteLengthMin, SystemString1ByteLengthMax); + return InRange(typeMarker, SystemString1ByteLengthMin, UserString1ByteLengthMax); } /// diff --git a/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.ValueLengths.cs b/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.ValueLengths.cs index c8b8daac7d..29427c9dbd 100644 --- a/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.ValueLengths.cs +++ b/Microsoft.Azure.Cosmos/src/Json/JsonBinaryEncoding.ValueLengths.cs @@ -43,11 +43,13 @@ private static class ValueLengths 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - // Encoded 1-byte system string (64 values) + // Encoded 1-byte system string (32 values) 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + // Encoded 1-byte user string (32 values) 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, diff --git a/Microsoft.Azure.Cosmos/src/Json/JsonReader.JsonBinaryReader.cs b/Microsoft.Azure.Cosmos/src/Json/JsonReader.JsonBinaryReader.cs index 1c64b1999a..02b11a9cc1 100644 --- a/Microsoft.Azure.Cosmos/src/Json/JsonReader.JsonBinaryReader.cs +++ b/Microsoft.Azure.Cosmos/src/Json/JsonReader.JsonBinaryReader.cs @@ -26,11 +26,13 @@ abstract partial class JsonReader : IJsonReader JsonTokenType.Number, JsonTokenType.Number, JsonTokenType.Number, JsonTokenType.Number, JsonTokenType.Number, JsonTokenType.Number, JsonTokenType.Number, JsonTokenType.Number, JsonTokenType.Number, JsonTokenType.Number, JsonTokenType.Number, JsonTokenType.Number, JsonTokenType.Number, JsonTokenType.Number, JsonTokenType.Number, JsonTokenType.Number, - // Encoded 1-byte system string (64 values) + // Encoded 1-byte system string (32 values) JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, + + // Encoded 1-byte user string (32 values) JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, JsonTokenType.String, diff --git a/Microsoft.Azure.Cosmos/src/Json/JsonWriter.JsonBinaryWriter.cs b/Microsoft.Azure.Cosmos/src/Json/JsonWriter.JsonBinaryWriter.cs index 0df6582cf6..6b20d99f59 100644 --- a/Microsoft.Azure.Cosmos/src/Json/JsonWriter.JsonBinaryWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Json/JsonWriter.JsonBinaryWriter.cs @@ -81,16 +81,18 @@ private enum RawValueType : byte RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, - // Encoded 1-byte system string (64 values) - RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, - RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, - RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, - RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, + // Encoded 1-byte system string (32 values) RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, RawValueType.Token, + // Encoded 1-byte user string (32 values) + RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, + RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, + RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, + RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, + // Encoded 2-byte user string (8 values) RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, RawValueType.StrUsr, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Json/JsonReaderTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Json/JsonReaderTests.cs index 52571f33e9..2f31613d08 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Json/JsonReaderTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Json/JsonReaderTests.cs @@ -2281,9 +2281,9 @@ public void SimpleObjectTest() List elements = new List { - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 0 }, + new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin }, new byte[] { JsonBinaryEncoding.TypeMarker.LiteralIntMin + 10 }, - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 1 }, + new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin + 1) }, new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.EncodedStringLengthMin + "example glossary".Length), 101, 120, 97, 109, 112, 108, 101, 32, 103, 108, 111, 115, 115, 97, 114, 121 } }; byte[] elementsBytes = elements.SelectMany(x => x).ToArray(); @@ -2405,25 +2405,25 @@ public void AllPrimitivesObjectTest() new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.SystemString1ByteLengthMin + 12) }, new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.EncodedStringLengthMin + "7029d079-4016-4436-b7da-36c0bae54ff6".Length), 55, 48, 50, 57, 100, 48, 55, 57, 45, 52, 48, 49, 54, 45, 52, 52, 51, 54, 45, 98, 55, 100, 97, 45, 51, 54, 99, 48, 98, 97, 101, 53, 52, 102, 102, 54 }, - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 0 }, + new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin }, new byte[] { JsonBinaryEncoding.TypeMarker.NumberDouble, 0x98, 0x8B, 0x30, 0xE3, 0xCB, 0x45, 0xC8, 0x3F }, - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 1 }, + new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin + 1) }, new byte[] { JsonBinaryEncoding.TypeMarker.NumberInt32, 0x19, 0xDF, 0xB6, 0xB0 }, - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 2 }, + new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin + 2) }, new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.EncodedStringLengthMin + "XCPCFXPHHF".Length), 88, 67, 80, 67, 70, 88, 80, 72, 72, 70 }, - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 3 }, + new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin + 3) }, new byte[] { JsonBinaryEncoding.TypeMarker.True }, - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 4 }, + new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin + 4) }, new byte[] { JsonBinaryEncoding.TypeMarker.Null }, - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 5 }, + new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin + 5) }, new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.EncodedStringLengthMin + "2526-07-11T18:18:16.4520716".Length), 50, 53, 50, 54, 45, 48, 55, 45, 49, 49, 84, 49, 56, 58, 49, 56, 58, 49, 54, 46, 52, 53, 50, 48, 55, 49, 54 }, - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 6 } + new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin + 6) } }; List innerObjectElements = new List @@ -2447,7 +2447,7 @@ public void AllPrimitivesObjectTest() elements.Add(new byte[] { JsonBinaryEncoding.TypeMarker.Object1ByteLength, (byte)innerObjectElementsBytes.Length }); elements.Add(innerObjectElementsBytes); - elements.Add(new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 7 }); + elements.Add(new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin + 7) }); elements.Add(new byte[] { JsonBinaryEncoding.TypeMarker.String1ByteLength, (byte)"tiger diamond newbrunswick snowleopard chocolate dog snowleopard turtle cat sapphire peach sapphire vancouver white chocolate horse diamond lion superlongcolourname ruby".Length, 116, 105, 103, 101, 114, 32, 100, 105, 97, 109, 111, 110, 100, 32, 110, 101, 119, 98, 114, 117, 110, 115, 119, 105, 99, 107, 32, 115, 110, 111, 119, 108, 101, 111, 112, 97, 114, 100, 32, 99, 104, 111, 99, 111, 108, 97, 116, 101, 32, 100, 111, 103, 32, 115, 110, 111, 119, 108, 101, 111, 112, 97, 114, 100, 32, 116, 117, 114, 116, 108, 101, 32, 99, 97, 116, 32, 115, 97, 112, 112, 104, 105, 114, 101, 32, 112, 101, 97, 99, 104, 32, 115, 97, 112, 112, 104, 105, 114, 101, 32, 118, 97, 110, 99, 111, 117, 118, 101, 114, 32, 119, 104, 105, 116, 101, 32, 99, 104, 111, 99, 111, 108, 97, 116, 101, 32, 104, 111, 114, 115, 101, 32, 100, 105, 97, 109, 111, 110, 100, 32, 108, 105, 111, 110, 32, 115, 117, 112, 101, 114, 108, 111, 110, 103, 99, 111, 108, 111, 117, 114, 110, 97, 109, 101, 32, 114, 117, 98, 121 }); byte[] elementsBytes = elements.SelectMany(x => x).ToArray(); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Json/JsonWriterTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Json/JsonWriterTests.cs index b44cb49b1f..0997b4dfd2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Json/JsonWriterTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Json/JsonWriterTests.cs @@ -2353,9 +2353,9 @@ public void SimpleObjectTest() List elements = new List { - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 0 }, + new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin }, new byte[] { JsonBinaryEncoding.TypeMarker.LiteralIntMin + 10 }, - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 1 }, + new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin + 1) }, new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.EncodedStringLengthMin + "example glossary".Length), 101, 120, 97, 109, 112, 108, 101, 32, 103, 108, 111, 115, 115, 97, 114, 121 } }; byte[] elementsBytes = elements.SelectMany(x => x).ToArray(); @@ -2484,25 +2484,25 @@ public void AllPrimitivesObjectTest() new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.SystemString1ByteLengthMin + 12) }, new byte[] { JsonBinaryEncoding.TypeMarker.LowercaseGuidString, 0x07, 0x92, 0x0D, 0x97, 0x04, 0x61, 0x44, 0x63, 0x7B, 0xAD, 0x63, 0x0C, 0xAB, 0x5E, 0xF4, 0x6F }, - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 0 }, + new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin }, new byte[] { JsonBinaryEncoding.TypeMarker.NumberDouble, 0x98, 0x8B, 0x30, 0xE3, 0xCB, 0x45, 0xC8, 0x3F }, - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 1 }, + new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin + 1) }, new byte[] { JsonBinaryEncoding.TypeMarker.NumberInt32, 0x19, 0xDF, 0xB6, 0xB0 }, - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 2 }, + new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin + 2) }, new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.EncodedStringLengthMin + "XCPCFXPHHF".Length), 88, 67, 80, 67, 70, 88, 80, 72, 72, 70 }, - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 3 }, + new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin + 3) }, new byte[] { JsonBinaryEncoding.TypeMarker.True }, - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 4 }, + new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin + 4) }, new byte[] { JsonBinaryEncoding.TypeMarker.Null }, - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 5 }, + new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin + 5) }, new byte[] { JsonBinaryEncoding.TypeMarker.CompressedDateTimeString, 0x1B, 0x63, 0x73, 0x1C, 0xC8, 0x22, 0x2E, 0xB9, 0x92, 0x2B, 0xD7, 0x65, 0x13, 0x28, 0x07 }, - new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 6 } + new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin + 6) } }; List innerObjectElements = new List @@ -2526,7 +2526,7 @@ public void AllPrimitivesObjectTest() elements.Add(new byte[] { JsonBinaryEncoding.TypeMarker.Object1ByteLength, (byte)innerObjectElementsBytes.Length }); elements.Add(innerObjectElementsBytes); - elements.Add(new byte[] { (byte)JsonBinaryEncoding.TypeMarker.UserString2ByteLengthMin, 7 }); + elements.Add(new byte[] { (byte)(JsonBinaryEncoding.TypeMarker.UserString1ByteLengthMin + 7) }); elements.Add(new byte[] { JsonBinaryEncoding.TypeMarker.Packed7BitStringLength1, (byte)"tiger diamond newbrunswick snowleopard chocolate dog snowleopard turtle cat sapphire peach sapphire vancouver white chocolate horse diamond lion superlongcolourname ruby".Length, 0xF4, 0xF4, 0xB9, 0x2C, 0x07, 0x91, 0xD3, 0xE1, 0xF6, 0xDB, 0x4D, 0x06, 0xB9, 0xCB, 0x77, 0xB1, 0xBC, 0xEE, 0x9E, 0xDF, 0xD3, 0xE3, 0x35, 0x68, 0xEE, 0x7E, 0xDF, 0xD9, 0xE5, 0x37, 0x3C, 0x2C, 0x27, 0x83, 0xC6, 0xE8, 0xF7, 0xF8, 0xCD, 0x0E, 0xD3, 0xCB, 0x20, 0xF2, 0xFB, 0x0C, 0x9A, 0xBB, 0xDF, 0x77, 0x76, 0xF9, 0x0D, 0x0F, 0xCB, 0xC9, 0x20, 0x7A, 0x5D, 0x4E, 0x67, 0x97, 0x41, 0xE3, 0x30, 0x1D, 0x34, 0x0F, 0xC3, 0xE1, 0xE8, 0xB4, 0xBC, 0x0C, 0x82, 0x97, 0xC3, 0x63, 0x34, 0x68, 0x1E, 0x86, 0xC3, 0xD1, 0x69, 0x79, 0x19, 0x64, 0x0F, 0xBB, 0xC7, 0xEF, 0xBA, 0xBD, 0x2C, 0x07, 0xDD, 0xD1, 0x69, 0x7A, 0x19, 0x34, 0x46, 0xBF, 0xC7, 0x6F, 0x76, 0x98, 0x5E, 0x06, 0xA1, 0xDF, 0xF2, 0x79, 0x19, 0x44, 0x4E, 0x87, 0xDB, 0x6F, 0x37, 0x19, 0xC4, 0x4E, 0xBF, 0xDD, 0xA0, 0x79, 0x1D, 0x5E, 0x96, 0xB3, 0xDF, 0xEE, 0xF3, 0xF8, 0xCD, 0x7E, 0xD7, 0xE5, 0xEE, 0x70, 0xBB, 0x0C, 0x92, 0xD7, 0xC5, 0x79 }); byte[] elementsBytes = elements.SelectMany(x => x).ToArray(); From e2fb347a4a72801fc6c0fcbcd0fc6fa06f48c3db Mon Sep 17 00:00:00 2001 From: iain Date: Tue, 10 Oct 2023 16:59:39 +0100 Subject: [PATCH 207/240] CosmosClientOptions: Adds support for multiple formats of Azure region names (#4016) * Allow ComosClientOptions to take ApplicationRegion and ApplicationPreferredRegions in multiple region name formats. This is a proposed fix for - https://github.com/Azure/azure-cosmos-dotnet-v3/issues/2330 * Address PR comment to avoid duplicating list of names. * Remove the map table cache The map table is only used on initialization, so there's no need to keep a cache of it for the lifetime of the application * Only convert the region names when the client is initializing The cache is created before converting all the names, so it only needs created once, but doesn't remain for the entire lifetime of the application * Update tests * Make RegionNameMapper an instantiable class Instead of having a prepare/clear cache system on a static class, make RegionNameMapper a class that gets instantiated for use and let the ctor handle it. * Remove debugging * Update tests to actually test things --------- Co-authored-by: Pradeep Chellappan Co-authored-by: Pradeep Chellappan <94089783+pradeep-chellappan@users.noreply.github.com> Co-authored-by: Matias Quaranta Co-authored-by: Kiran Kumar Kolli --- .../src/CosmosClientOptions.cs | 19 +- .../src/RegionNameMapper.cs | 53 ++++++ .../CosmosClientOptionsUnitTests.cs | 167 +++++++++++++++++- 3 files changed, 230 insertions(+), 9 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/src/RegionNameMapper.cs diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs index b3b21e4f3b..aac863f0e7 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs @@ -785,14 +785,17 @@ internal virtual ConnectionPolicy GetConnectionPolicy(int clientId) connectionPolicy.CosmosClientTelemetryOptions = this.CosmosClientTelemetryOptions; } - if (this.ApplicationRegion != null) - { - connectionPolicy.SetCurrentLocation(this.ApplicationRegion); - } - - if (this.ApplicationPreferredRegions != null) - { - connectionPolicy.SetPreferredLocations(this.ApplicationPreferredRegions); + RegionNameMapper mapper = new RegionNameMapper(); + if (!string.IsNullOrEmpty(this.ApplicationRegion)) + { + connectionPolicy.SetCurrentLocation(mapper.GetCosmosDBRegionName(this.ApplicationRegion)); + } + + if (this.ApplicationPreferredRegions != null) + { + List mappedRegions = this.ApplicationPreferredRegions.Select(s => mapper.GetCosmosDBRegionName(s)).ToList(); + + connectionPolicy.SetPreferredLocations(mappedRegions); } if (this.MaxRetryAttemptsOnRateLimitedRequests != null) diff --git a/Microsoft.Azure.Cosmos/src/RegionNameMapper.cs b/Microsoft.Azure.Cosmos/src/RegionNameMapper.cs new file mode 100644 index 0000000000..dbcf0d7c08 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/RegionNameMapper.cs @@ -0,0 +1,53 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos +{ + using System; + using System.Collections.Generic; + using System.Reflection; + + /// + /// Maps a normalized region name to the format that CosmosDB is expecting (for e.g. from 'westus2' to 'West US 2') + /// + internal sealed class RegionNameMapper + { + private readonly Dictionary normalizedToCosmosDBRegionNameMapping; + + public RegionNameMapper() + { + FieldInfo[] fields = typeof(Regions).GetFields(BindingFlags.Public | BindingFlags.Static); + + this.normalizedToCosmosDBRegionNameMapping = new Dictionary(StringComparer.OrdinalIgnoreCase); + + foreach (FieldInfo field in fields) + { + this.normalizedToCosmosDBRegionNameMapping[field.Name] = field.GetValue(null).ToString(); + } + } + + /// + /// Given a normalized region name, this function retrieves the region name in the format that CosmosDB expects. + /// If the region is not known, the same value as input is returned. + /// + /// An Azure region name in a normalized format. The input is not case sensitive. + /// A string that contains the region name in the format that CosmosDB expects. + public string GetCosmosDBRegionName(string normalizedRegionName) + { + if (string.IsNullOrEmpty(normalizedRegionName)) + { + return string.Empty; + } + + normalizedRegionName = normalizedRegionName.Replace(" ", string.Empty); + if (this.normalizedToCosmosDBRegionNameMapping.TryGetValue(normalizedRegionName, + out string cosmosDBRegionName)) + { + return cosmosDBRegionName; + } + + return normalizedRegionName; + } + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs index f3c45adf48..04d51ea06c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs @@ -6,7 +6,8 @@ namespace Microsoft.Azure.Cosmos.Tests { using System; using System.Collections; - using System.Collections.Generic; + using System.Collections.Generic; + using System.Collections.ObjectModel; using System.Linq; using System.Net; using System.Net.Http; @@ -556,6 +557,170 @@ public void WithQuorumReadWithEventualConsistencyAccount() Assert.IsTrue(cosmosClientOptions.EnableUpgradeConsistencyToLocalQuorum); } + [TestMethod] + public void VerifyRegionNameFormatConversionForApplicationRegion() + { + CosmosClientOptions cosmosClientOptions = new CosmosClientOptions(); + cosmosClientOptions.ApplicationRegion = "westus2"; + + ConnectionPolicy policy = cosmosClientOptions.GetConnectionPolicy(0); + + // Need to see Regions.WestUS2 in the list, but not "westus2" + bool seenWestUS2 = false; + bool seenNormalized = false; + + foreach (string region in policy.PreferredLocations) + { + if (region == "westus2") + { + seenNormalized = true; + } + + if (region == Regions.WestUS2) + { + seenWestUS2 = true; + } + } + Assert.IsTrue(seenWestUS2); + Assert.IsFalse(seenNormalized); + } + + [TestMethod] + public void VerifyRegionNameFormatConversionBypassForApplicationRegion() + { + CosmosClientOptions cosmosClientOptions = new CosmosClientOptions(); + + // No conversion for expected format. + cosmosClientOptions.ApplicationRegion = Regions.NorthCentralUS; + + ConnectionPolicy policy = cosmosClientOptions.GetConnectionPolicy(0); + + Assert.AreEqual(Regions.NorthCentralUS, policy.PreferredLocations[0]); + + // Ignore unknown values. + cosmosClientOptions.ApplicationRegion = null; + + policy = cosmosClientOptions.GetConnectionPolicy(0); + + Assert.AreEqual(0, policy.PreferredLocations.Count); + + cosmosClientOptions.ApplicationRegion = string.Empty; + policy = cosmosClientOptions.GetConnectionPolicy(0); + + Assert.AreEqual(0, policy.PreferredLocations.Count); + + cosmosClientOptions.ApplicationRegion = "Invalid region"; + Assert.ThrowsException(() => cosmosClientOptions.GetConnectionPolicy(0)); + } + + [TestMethod] + public void VerifyRegionNameFormatConversionForApplicationPreferredRegions() + { + CosmosClientOptions cosmosClientOptions = new CosmosClientOptions(); + cosmosClientOptions.ApplicationPreferredRegions = new List {"westus2", "usdodcentral", Regions.ChinaNorth3}; + + ConnectionPolicy policy = cosmosClientOptions.GetConnectionPolicy(0); + + bool seenUSDodCentral = false; + bool seenWestUS2 = false; + bool seenChinaNorth3 = false; + bool seenNormalizedUSDodCentral = false; + bool seenNormalizedWestUS2 = false; + + foreach (string region in policy.PreferredLocations) + { + if (region == Regions.USDoDCentral) + { + seenUSDodCentral = true; + } + + if (region == Regions.WestUS2) + { + seenWestUS2 = true; + } + + if (region == Regions.ChinaNorth3) + { + seenChinaNorth3 = true; + } + + if (region == "westus2") + { + seenNormalizedWestUS2 = true; + } + + if (region == "usdodcentral") + { + seenNormalizedUSDodCentral = true; + } + } + + Assert.IsTrue(seenChinaNorth3); + Assert.IsTrue(seenWestUS2); + Assert.IsTrue(seenUSDodCentral); + Assert.IsFalse(seenNormalizedUSDodCentral); + Assert.IsFalse(seenNormalizedWestUS2); + } + + [TestMethod] + public void VerifyRegionNameFormatConversionBypassForInvalidApplicationPreferredRegions() + { + CosmosClientOptions cosmosClientOptions = new CosmosClientOptions(); + + // List contains valid and invalid values + cosmosClientOptions.ApplicationPreferredRegions = new List + { + null, + string.Empty, + Regions.JioIndiaCentral, + "westus2", + "Invalid region" + }; + + ConnectionPolicy policy = cosmosClientOptions.GetConnectionPolicy(0); + + bool seenJioIndiaCentral = false; + bool seenWestUS2 = false; + bool seenNormalized = false; + + foreach (string region in policy.PreferredLocations) + { + if (region == Regions.JioIndiaCentral) + { + seenJioIndiaCentral = true; + } + + if (region == Regions.WestUS2) + { + seenWestUS2 = true; + } + + if (region == "westus2") + { + seenNormalized = true; + } + } + + Assert.IsTrue(seenJioIndiaCentral); + Assert.IsTrue(seenWestUS2); + Assert.IsFalse(seenNormalized); + } + + [TestMethod] + public void RegionNameMappingTest() + { + RegionNameMapper mapper = new RegionNameMapper(); + + // Test normalized name + Assert.AreEqual(Regions.WestUS2, mapper.GetCosmosDBRegionName("westus2")); + + // Test with spaces + Assert.AreEqual(Regions.WestUS2, mapper.GetCosmosDBRegionName("west us 2")); + + // Test for case insenstive + Assert.AreEqual(Regions.WestUS2, mapper.GetCosmosDBRegionName("wEsTuS2")); + } + [TestMethod] public void InvalidApplicationNameCatchTest() { From 4e2beda5efddcc52c0b433bcc2cce788d9b5ca27 Mon Sep 17 00:00:00 2001 From: Arooshi Avasthy <113193425+aavasthy@users.noreply.github.com> Date: Tue, 10 Oct 2023 15:19:07 -0700 Subject: [PATCH 208/240] Distributed Tracing: Fixes traceid null exception issue (#4111) * Fix traceid null exception issue * Fixing merge conflicts * Fixing merge conflicts * Update script * Code cleanup * Updated change description * updated comment description * updated comment description --------- Co-authored-by: Matias Quaranta --- .../OpenTelemetryRecorderFactory.cs | 24 +++++- .../DistributedTracingOTelTests.cs | 73 +++++++++++++++---- .../Tracing/AssertActivity.cs | 4 +- .../Tracing/CustomListener.cs | 29 ++++++-- .../Tracing/CustomOtelExporter.cs | 3 +- 5 files changed, 106 insertions(+), 27 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs index 61d8889aaa..b8babd37da 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs @@ -48,7 +48,9 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, DiagnosticScope scope = LazyOperationScopeFactory.Value.CreateScope(name: operationName, kind: clientContext.ClientOptions.ConnectionMode == ConnectionMode.Gateway ? DiagnosticScope.ActivityKind.Internal : DiagnosticScope.ActivityKind.Client); - // Record values only when we have a valid Diagnostic Scope + // Need a parent activity id associated with the operation which is logged in diagnostics and used for tracing purpose. + // If there are listeners at operation level then scope is enabled and it tries to create activity. + // However, if available listeners are not subscribed to operation level event then it will lead to scope being enabled but no activity is created. if (scope.IsEnabled) { scope.SetDisplayName($"{operationName} {containerName}"); @@ -63,14 +65,28 @@ public static OpenTelemetryCoreRecorder CreateRecorder(string operationName, config: requestOptions?.CosmosThresholdOptions ?? clientContext.ClientOptions?.CosmosClientTelemetryOptions.CosmosThresholdOptions); } #if !INTERNAL - else if (Activity.Current is null) + // Need a parent activity which groups all network activities under it and is logged in diagnostics and used for tracing purpose. + // If there are listeners at network level then scope is enabled and it tries to create activity. + // However, if available listeners are not subscribed to network event then it will lead to scope being enabled but no activity is created. + else { DiagnosticScope requestScope = LazyNetworkScopeFactory.Value.CreateScope(name: operationName); + openTelemetryRecorder = requestScope.IsEnabled ? OpenTelemetryCoreRecorder.CreateNetworkLevelParentActivity(networkScope: requestScope) : openTelemetryRecorder; + } - openTelemetryRecorder = requestScope.IsEnabled ? OpenTelemetryCoreRecorder.CreateNetworkLevelParentActivity(networkScope: requestScope) : OpenTelemetryCoreRecorder.CreateParentActivity(operationName); + // If there are no listeners at operation level and network level and no parent activity created. + // Then create a dummy activity as there should be a parent level activity always to send a traceid to the backend services through context propagation. + // The parent activity id is logged in diagnostics and used for tracing purpose. + if (Activity.Current is null) + { + openTelemetryRecorder = OpenTelemetryCoreRecorder.CreateParentActivity(operationName); } #endif - trace.AddDatum("DistributedTraceId", Activity.Current?.TraceId); + // Safety check as diagnostic logs should not break the code. + if (Activity.Current?.TraceId != null) + { + trace.AddDatum("DistributedTraceId", Activity.Current.TraceId); + } } return openTelemetryRecorder; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DistributedTracingOTelTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DistributedTracingOTelTests.cs index 53b0eb6e24..43d9be341d 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DistributedTracingOTelTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/DistributedTracingOTelTests.cs @@ -19,6 +19,7 @@ namespace Microsoft.Azure.Cosmos using System.Diagnostics; using Microsoft.Azure.Cosmos.Tracing; using System.Net.Http; + using Microsoft.Azure.Cosmos.Tests; [VisualStudio.TestTools.UnitTesting.TestClass] public sealed class DistributedTracingOTelTests : BaseCosmosClientHelper @@ -33,7 +34,8 @@ public void TestInitialize() [DataTestMethod] [DataRow($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Request", DisplayName = "DirectMode and DistributedFlag On: Asserts activity creation at operation and network level with Diagnostic TraceId being added to logs")] [DataRow($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", null, DisplayName = "DirectMode and DistributedFlag On: Asserts activity creation at operation level with Diagnostic TraceId being added to logs")] - public async Task SourceEnabled_FlagOn_DirectMode_RecordsActivity_AssertLogTraceId_AssertTraceparent(string operationLevelSource, string networkLevelSource) + [DataRow(null, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Request", DisplayName = "DirectMode and DistributedFlag On: Asserts activity creation at network level with Diagnostic TraceId being added to logs")] + public async Task SourceEnabled_FlagOn_DirectMode_RecordsOperationNetworkActivity_AssertLogTraceId_AssertTraceparent(string operationLevelSource, string networkLevelSource) { string[] sources = new string[] { operationLevelSource, networkLevelSource }; sources = sources.Where(x => x != null).ToArray(); @@ -43,12 +45,12 @@ public async Task SourceEnabled_FlagOn_DirectMode_RecordsActivity_AssertLogTrace .AddSource(sources) .Build(); - await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, + await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, customizeClientBuilder: (builder) => builder .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() - { + { DisableDistributedTracing = false - }) + }) .WithConnectionModeDirect()); Container containerResponse = await this.database.CreateContainerAsync( @@ -106,7 +108,8 @@ await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, [DataTestMethod] [DataRow($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Request", DisplayName = "GatewayMode and DistributedFlag On: Asserts activity creation at operation and network level with Diagnostic TraceId being added to logs")] [DataRow($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", null, DisplayName = "GatewayMode and DistributedFlag On: Asserts activity creation at operation level with Diagnostic TraceId being added to logs")] - public async Task SourceEnabled_FlagOn_GatewayMode_RecordsActivity_AssertLogTraceId_AssertTraceparent(string operationLevelSource, string networkLevelSource) + [DataRow(null, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Request", DisplayName = "GatewayMode and DistributedFlag On: Asserts activity creation at network level with Diagnostic TraceId being added to logs")] + public async Task SourceEnabled_FlagOn_GatewayMode_RecordsOperationNetworkActivity_AssertLogTraceId_AssertTraceparent(string operationLevelSource, string networkLevelSource) { string[] sources = new string[] { operationLevelSource, networkLevelSource }; sources = sources.Where(x => x != null).ToArray(); @@ -128,12 +131,12 @@ public async Task SourceEnabled_FlagOn_GatewayMode_RecordsActivity_AssertLogTrac .AddSource(sources) .Build(); - await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, + await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, customizeClientBuilder: (builder) => builder .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() - { + { DisableDistributedTracing = false - }) + }) .WithHttpClientFactory(() => new HttpClient(httpClientHandlerHelper)) .WithConnectionModeGateway()); @@ -142,7 +145,6 @@ await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, partitionKeyPath: "/id", throughput: 20000); - List b = CustomOtelExporter.CollectedActivities.ToList(); //Assert traceId in Diagnostics logs string diagnosticsCreateContainer = containerResponse.Diagnostics.ToString(); JObject objDiagnosticsCreate = JObject.Parse(diagnosticsCreateContainer); @@ -169,7 +171,7 @@ await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, [DataRow(true, true, "random.source.name", DisplayName = "GatewayMode, DistributedFlag Off, Random/No Source:Asserts no activity creation")] [DataRow(false, true, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", DisplayName = "DirectMode, DistributedFlag Off, OperationLevel Source:Asserts no activity creation")] [DataRow(true, true, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", DisplayName = "GatewayMode, DistributedFlag Off, OperationLevel Source:Asserts no activity creation")] - public async Task NoSourceEnabled_ResultsInNoSourceParentActivityCreation_AssertLogTraceId(bool useGateway, bool disableDistributingTracing, string source) + public async Task NoSourceNoFlagEnabled_ResultsInNoOperationNetworkActivityCreation_AssertLogTraceId(bool useGateway, bool disableDistributingTracing, string source) { using TracerProvider provider = Sdk.CreateTracerProviderBuilder() .AddCustomOtelExporter() @@ -178,20 +180,20 @@ public async Task NoSourceEnabled_ResultsInNoSourceParentActivityCreation_Assert if (useGateway) { - await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, + await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, customizeClientBuilder: (builder) => builder .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() - { + { DisableDistributedTracing = disableDistributingTracing }) .WithConnectionModeGateway()); } else { - await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, + await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, customizeClientBuilder: (builder) => builder .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() - { + { DisableDistributedTracing = disableDistributingTracing })); } @@ -221,6 +223,49 @@ await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, Assert.AreEqual(0, CustomOtelExporter.CollectedActivities.Count()); } + + [DataTestMethod] + [DataRow(false)] + [DataRow(true)] + public async Task SuppressListenerEvents_ResultsInNoScopeActivityCreation_AssertTraceIdNotNull(bool useGateway) + { + // Initialize CustomListener with suppression + CustomListener customListener = new CustomListener($"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.*", "Azure-Cosmos-Operation-Request-Diagnostics", true); + + if (useGateway) + { + await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, + customizeClientBuilder: (builder) => builder + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() + { + DisableDistributedTracing = false + }) + .WithConnectionModeGateway()); + } + else + { + await base.TestInit(validateSinglePartitionKeyRangeCacheCall: false, + customizeClientBuilder: (builder) => builder + .WithClientTelemetryOptions(new CosmosClientTelemetryOptions() + { + DisableDistributedTracing = false + })); + } + + ContainerResponse containerResponse = await this.database.CreateContainerAsync( + id: Guid.NewGuid().ToString(), + partitionKeyPath: "/id", + throughput: 20000); + + // Assert traceId in Diagnostics logs + string diagnosticsCreateContainer = containerResponse.Diagnostics.ToString(); + JObject objDiagnosticsCreate = JObject.Parse(diagnosticsCreateContainer); + Assert.IsNotNull(objDiagnosticsCreate["data"]["DistributedTraceId"], "Distributed Trace Id has value in diagnostics i.e. " + (string)objDiagnosticsCreate["data"]["DistributedTraceId"]); + + // Cleanup + customListener.Dispose(); + } + [TestCleanup] public async Task CleanUp() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs index 9b9be4479a..2bcd002b79 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/AssertActivity.cs @@ -83,7 +83,9 @@ public static void AreEqualAcrossListeners() { Assert.AreEqual( JsonConvert.SerializeObject(CustomListener.CollectedOperationActivities.OrderBy(x => x.Id)), - JsonConvert.SerializeObject(CustomOtelExporter.CollectedActivities.OrderBy(x => x.Id))); + JsonConvert.SerializeObject(CustomOtelExporter.CollectedActivities + .Where(activity => activity.Source.Name == $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation") + .OrderBy(x => x.Id))); } private static void AssertDatabaseAndContainerName(string name, KeyValuePair tag) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs index cae05fa94d..6d612c29c7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomListener.cs @@ -26,7 +26,8 @@ internal class CustomListener : { private readonly Func sourceNameFilter; private readonly string eventName; - + private readonly bool suppressAllEvents; + private ConcurrentBag subscriptions = new(); private ConcurrentBag Scopes { get; } = new(); @@ -36,21 +37,22 @@ internal class CustomListener : private static List EventSources { set; get; } = new(); - public CustomListener(string name, string eventName) - : this(n => Regex.Match(n, name).Success, eventName) + public CustomListener(string name, string eventName, bool suppressAllEvents = false) + : this(n => Regex.Match(n, name).Success, eventName, suppressAllEvents) { } - public CustomListener(Func filter, string eventName) + public CustomListener(Func filter, string eventName, bool suppressAllEvents = false) { this.sourceNameFilter = filter; this.eventName = eventName; + this.suppressAllEvents = suppressAllEvents; foreach (EventSource eventSource in EventSources) { this.OnEventSourceCreated(eventSource); } - + DiagnosticListener.AllListeners.Subscribe(this); } @@ -149,7 +151,15 @@ public void OnNext(DiagnosticListener value) { lock (this.Scopes) { - this.subscriptions?.Add(value.Subscribe(this)); + IDisposable subscriber = value.Subscribe(this, isEnabled: (name) => + { + if (this.suppressAllEvents) + { + return false; + } + return true; + }); + this.subscriptions?.Add(subscriber); } } } @@ -159,7 +169,12 @@ public void OnNext(DiagnosticListener value) /// protected override void OnEventSourceCreated(EventSource eventSource) { - if(this.eventName == null) + if (this.eventName == null) + { + EventSources.Add(eventSource); + } + + if (this.eventName == null) { EventSources.Add(eventSource); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs index eb46d83e48..a115a64084 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Tracing/CustomOtelExporter.cs @@ -35,7 +35,8 @@ public override ExportResult Export(in Batch batch) foreach (Activity activity in batch) { - if (string.Equals(activity.Source.Name, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", StringComparison.OrdinalIgnoreCase)) + if (string.Equals(activity.Source.Name, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Operation", StringComparison.OrdinalIgnoreCase) + || string.Equals(activity.Source.Name, $"{OpenTelemetryAttributeKeys.DiagnosticNamespace}.Request", StringComparison.OrdinalIgnoreCase)) { AssertActivity.IsValidOperationActivity(activity); From 7db0aa08a7480da450e8839fd817298250586232 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Thu, 12 Oct 2023 21:15:42 +0530 Subject: [PATCH 209/240] Telemetry Options: Adds telemetry options in GA package (#4117) * GA telemetry options and updated contract * enabe requuest level option * added request option in public contract --- .../src/CosmosClientOptions.cs | 7 +- .../src/CosmosClientTelemetryOptions.cs | 28 +-- .../src/CosmosThresholdOptions.cs | 7 +- .../src/Fluent/CosmosClientBuilder.cs | 7 +- .../src/RequestOptions/RequestOptions.cs | 5 +- .../Contracts/DotNetPreviewSDKAPI.json | 153 ----------------- .../Contracts/DotNetSDKAPI.json | 160 ++++++++++++++++++ 7 files changed, 170 insertions(+), 197 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs index aac863f0e7..60ae9298b0 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs @@ -732,12 +732,7 @@ internal Protocol ConnectionProtocol /// /// Gets or sets Client Telemetry Options like feature flags and corresponding options /// -#if PREVIEW - public -#else - internal -#endif - CosmosClientTelemetryOptions CosmosClientTelemetryOptions { get; set; } + public CosmosClientTelemetryOptions CosmosClientTelemetryOptions { get; set; } internal void SetSerializerIfNotConfigured(CosmosSerializer serializer) { diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientTelemetryOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientTelemetryOptions.cs index 8b2a2aa6a0..ec16c0f3b8 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClientTelemetryOptions.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClientTelemetryOptions.cs @@ -7,36 +7,21 @@ namespace Microsoft.Azure.Cosmos /// /// Telemetry Options for Cosmos Client to enable/disable telemetry and distributed tracing along with corresponding threshold values. /// -#if PREVIEW - public -#else - internal -#endif - class CosmosClientTelemetryOptions + public class CosmosClientTelemetryOptions { /// /// Disable sending telemetry to service, is not applicable to this as of now. /// /// This option will disable sending telemetry to service.even it is opt-in from portal. /// true -#if PREVIEW - public -#else - internal -#endif - bool DisableSendingMetricsToService { get; set; } = true; + public bool DisableSendingMetricsToService { get; set; } = true; /// /// This method enable/disable generation of operation level if listener is subscribed to the Source Name "Azure.Cosmos.Operation". /// /// false /// Please Refer https://opentelemetry.io/docs/instrumentation/net/exporters/ to know more about open telemetry exporters -#if PREVIEW - public -#else - internal -#endif - bool DisableDistributedTracing { get; set; } = + public bool DisableDistributedTracing { get; set; } = #if PREVIEW false; #else @@ -47,12 +32,7 @@ class CosmosClientTelemetryOptions /// Threshold values for Distributed Tracing. /// These values decides whether to generate operation level with request diagnostics or not. /// -#if PREVIEW - public -#else - internal -#endif - CosmosThresholdOptions CosmosThresholdOptions { get; set; } = new CosmosThresholdOptions(); + public CosmosThresholdOptions CosmosThresholdOptions { get; set; } = new CosmosThresholdOptions(); } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/CosmosThresholdOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosThresholdOptions.cs index 5a04286f68..57b7cbf57a 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosThresholdOptions.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosThresholdOptions.cs @@ -9,12 +9,7 @@ namespace Microsoft.Azure.Cosmos /// /// Threshold values for Distributed Tracing /// -#if PREVIEW - public -#else - internal -#endif - class CosmosThresholdOptions + public class CosmosThresholdOptions { /// /// Latency Threshold for non point operations i.e. Query diff --git a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs index 8ba2ffa266..59325ecb83 100644 --- a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs +++ b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs @@ -686,12 +686,7 @@ internal CosmosClientBuilder WithRetryWithOptions( /// /// /// The object -#if PREVIEW - public -#else - internal -#endif - CosmosClientBuilder WithClientTelemetryOptions(CosmosClientTelemetryOptions options) + public CosmosClientBuilder WithClientTelemetryOptions(CosmosClientTelemetryOptions options) { this.clientOptions.CosmosClientTelemetryOptions = options; return this; diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs index 56c152568a..e8d4c602ff 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs @@ -64,9 +64,10 @@ public class RequestOptions PriorityLevel? PriorityLevel { get; set; } /// - /// Set Request Level Distributed Tracing Options. + /// Threshold values for Distributed Tracing. + /// These values decides whether to generate operation level with request diagnostics or not. /// - internal CosmosThresholdOptions CosmosThresholdOptions { get; set; } + public CosmosThresholdOptions CosmosThresholdOptions { get; set; } /// /// Gets or sets the boolean to use effective partition key routing in the cosmos db request. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index 8f25a74f08..dde2d208bc 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -352,148 +352,6 @@ }, "NestedTypes": {} }, - "Microsoft.Azure.Cosmos.CosmosClientOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { - "Subclasses": {}, - "Members": { - "Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions CosmosClientTelemetryOptions": { - "Type": "Property", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions CosmosClientTelemetryOptions;CanRead:True;CanWrite:True;Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions get_CosmosClientTelemetryOptions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_CosmosClientTelemetryOptions(Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions get_CosmosClientTelemetryOptions()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions get_CosmosClientTelemetryOptions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Void set_CosmosClientTelemetryOptions(Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "Void set_CosmosClientTelemetryOptions(Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - } - }, - "NestedTypes": {} - }, - "Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { - "Subclasses": {}, - "Members": { - "Boolean DisableDistributedTracing": { - "Type": "Property", - "Attributes": [], - "MethodInfo": "Boolean DisableDistributedTracing;CanRead:True;CanWrite:True;Boolean get_DisableDistributedTracing();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_DisableDistributedTracing(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Boolean DisableSendingMetricsToService": { - "Type": "Property", - "Attributes": [], - "MethodInfo": "Boolean DisableSendingMetricsToService;CanRead:True;CanWrite:True;Boolean get_DisableSendingMetricsToService();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_DisableSendingMetricsToService(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Boolean get_DisableDistributedTracing()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "Boolean get_DisableDistributedTracing();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Boolean get_DisableSendingMetricsToService()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "Boolean get_DisableSendingMetricsToService();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.CosmosThresholdOptions CosmosThresholdOptions": { - "Type": "Property", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.CosmosThresholdOptions CosmosThresholdOptions;CanRead:True;CanWrite:True;Microsoft.Azure.Cosmos.CosmosThresholdOptions get_CosmosThresholdOptions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_CosmosThresholdOptions(Microsoft.Azure.Cosmos.CosmosThresholdOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.CosmosThresholdOptions get_CosmosThresholdOptions()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "Microsoft.Azure.Cosmos.CosmosThresholdOptions get_CosmosThresholdOptions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Void .ctor()": { - "Type": "Constructor", - "Attributes": [], - "MethodInfo": "[Void .ctor(), Void .ctor()]" - }, - "Void set_CosmosThresholdOptions(Microsoft.Azure.Cosmos.CosmosThresholdOptions)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "Void set_CosmosThresholdOptions(Microsoft.Azure.Cosmos.CosmosThresholdOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Void set_DisableDistributedTracing(Boolean)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "Void set_DisableDistributedTracing(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Void set_DisableSendingMetricsToService(Boolean)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "Void set_DisableSendingMetricsToService(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - } - }, - "NestedTypes": {} - }, - "Microsoft.Azure.Cosmos.CosmosThresholdOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { - "Subclasses": {}, - "Members": { - "System.TimeSpan get_NonPointOperationLatencyThreshold()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "System.TimeSpan get_NonPointOperationLatencyThreshold();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "System.TimeSpan get_PointOperationLatencyThreshold()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "System.TimeSpan get_PointOperationLatencyThreshold();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "System.TimeSpan NonPointOperationLatencyThreshold": { - "Type": "Property", - "Attributes": [], - "MethodInfo": "System.TimeSpan NonPointOperationLatencyThreshold;CanRead:True;CanWrite:True;System.TimeSpan get_NonPointOperationLatencyThreshold();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_NonPointOperationLatencyThreshold(System.TimeSpan);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "System.TimeSpan PointOperationLatencyThreshold": { - "Type": "Property", - "Attributes": [], - "MethodInfo": "System.TimeSpan PointOperationLatencyThreshold;CanRead:True;CanWrite:True;System.TimeSpan get_PointOperationLatencyThreshold();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_PointOperationLatencyThreshold(System.TimeSpan);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Void .ctor()": { - "Type": "Constructor", - "Attributes": [], - "MethodInfo": "[Void .ctor(), Void .ctor()]" - }, - "Void set_NonPointOperationLatencyThreshold(System.TimeSpan)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "Void set_NonPointOperationLatencyThreshold(System.TimeSpan);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Void set_PointOperationLatencyThreshold(System.TimeSpan)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { - "Type": "Method", - "Attributes": [ - "CompilerGeneratedAttribute" - ], - "MethodInfo": "Void set_PointOperationLatencyThreshold(System.TimeSpan);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - } - }, - "NestedTypes": {} - }, "Microsoft.Azure.Cosmos.DedicatedGatewayRequestOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { @@ -568,17 +426,6 @@ }, "NestedTypes": {} }, - "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { - "Subclasses": {}, - "Members": { - "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder WithClientTelemetryOptions(Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions)": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder WithClientTelemetryOptions(Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - } - }, - "NestedTypes": {} - }, "Microsoft.Azure.Cosmos.Linq.CosmosLinqExtensions;System.Object;IsAbstract:True;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 2ba2523435..fd2aa8b93e 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -2736,6 +2736,18 @@ "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.ConnectionMode get_ConnectionMode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions CosmosClientTelemetryOptions": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions CosmosClientTelemetryOptions;CanRead:True;CanWrite:True;Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions get_CosmosClientTelemetryOptions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_CosmosClientTelemetryOptions(Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions get_CosmosClientTelemetryOptions()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions get_CosmosClientTelemetryOptions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Microsoft.Azure.Cosmos.CosmosSerializationOptions get_SerializerOptions()": { "Type": "Method", "Attributes": [], @@ -3007,6 +3019,13 @@ ], "MethodInfo": "Void set_ConsistencyLevel(System.Nullable`1[Microsoft.Azure.Cosmos.ConsistencyLevel]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Void set_CosmosClientTelemetryOptions(Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_CosmosClientTelemetryOptions(Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Void set_EnableContentResponseOnWrite(System.Nullable`1[System.Boolean])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ @@ -3116,6 +3135,74 @@ }, "NestedTypes": {} }, + "Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "Boolean DisableDistributedTracing": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Boolean DisableDistributedTracing;CanRead:True;CanWrite:True;Boolean get_DisableDistributedTracing();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_DisableDistributedTracing(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean DisableSendingMetricsToService": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Boolean DisableSendingMetricsToService;CanRead:True;CanWrite:True;Boolean get_DisableSendingMetricsToService();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_DisableSendingMetricsToService(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean get_DisableDistributedTracing()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Boolean get_DisableDistributedTracing();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Boolean get_DisableSendingMetricsToService()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Boolean get_DisableSendingMetricsToService();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.CosmosThresholdOptions CosmosThresholdOptions": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.CosmosThresholdOptions CosmosThresholdOptions;CanRead:True;CanWrite:True;Microsoft.Azure.Cosmos.CosmosThresholdOptions get_CosmosThresholdOptions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_CosmosThresholdOptions(Microsoft.Azure.Cosmos.CosmosThresholdOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.CosmosThresholdOptions get_CosmosThresholdOptions()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Microsoft.Azure.Cosmos.CosmosThresholdOptions get_CosmosThresholdOptions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void .ctor()": { + "Type": "Constructor", + "Attributes": [], + "MethodInfo": "[Void .ctor(), Void .ctor()]" + }, + "Void set_CosmosThresholdOptions(Microsoft.Azure.Cosmos.CosmosThresholdOptions)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_CosmosThresholdOptions(Microsoft.Azure.Cosmos.CosmosThresholdOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_DisableDistributedTracing(Boolean)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_DisableDistributedTracing(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_DisableSendingMetricsToService(Boolean)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_DisableSendingMetricsToService(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.CosmosDiagnostics;System.Object;IsAbstract:True;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { @@ -3535,6 +3622,55 @@ }, "NestedTypes": {} }, + "Microsoft.Azure.Cosmos.CosmosThresholdOptions;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "System.TimeSpan get_NonPointOperationLatencyThreshold()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.TimeSpan get_NonPointOperationLatencyThreshold();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan get_PointOperationLatencyThreshold()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.TimeSpan get_PointOperationLatencyThreshold();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan NonPointOperationLatencyThreshold": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.TimeSpan NonPointOperationLatencyThreshold;CanRead:True;CanWrite:True;System.TimeSpan get_NonPointOperationLatencyThreshold();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_NonPointOperationLatencyThreshold(System.TimeSpan);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan PointOperationLatencyThreshold": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.TimeSpan PointOperationLatencyThreshold;CanRead:True;CanWrite:True;System.TimeSpan get_PointOperationLatencyThreshold();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_PointOperationLatencyThreshold(System.TimeSpan);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void .ctor()": { + "Type": "Constructor", + "Attributes": [], + "MethodInfo": "[Void .ctor(), Void .ctor()]" + }, + "Void set_NonPointOperationLatencyThreshold(System.TimeSpan)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_NonPointOperationLatencyThreshold(System.TimeSpan);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_PointOperationLatencyThreshold(System.TimeSpan)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_PointOperationLatencyThreshold(System.TimeSpan);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.Database;System.Object;IsAbstract:True;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { @@ -4418,6 +4554,11 @@ "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder WithBulkExecution(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder WithClientTelemetryOptions(Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder WithClientTelemetryOptions(Microsoft.Azure.Cosmos.CosmosClientTelemetryOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder WithConnectionModeDirect()": { "Type": "Method", "Attributes": [], @@ -7804,6 +7945,18 @@ } }, "Members": { + "Microsoft.Azure.Cosmos.CosmosThresholdOptions CosmosThresholdOptions": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.CosmosThresholdOptions CosmosThresholdOptions;CanRead:True;CanWrite:True;Microsoft.Azure.Cosmos.CosmosThresholdOptions get_CosmosThresholdOptions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_CosmosThresholdOptions(Microsoft.Azure.Cosmos.CosmosThresholdOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.CosmosThresholdOptions get_CosmosThresholdOptions()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Microsoft.Azure.Cosmos.CosmosThresholdOptions get_CosmosThresholdOptions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Microsoft.Azure.Cosmos.RequestOptions ShallowCopy()": { "Type": "Method", "Attributes": [], @@ -7869,6 +8022,13 @@ ], "MethodInfo": "Void set_AddRequestHeaders(System.Action`1[Microsoft.Azure.Cosmos.Headers]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Void set_CosmosThresholdOptions(Microsoft.Azure.Cosmos.CosmosThresholdOptions)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_CosmosThresholdOptions(Microsoft.Azure.Cosmos.CosmosThresholdOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Void set_IfMatchEtag(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ From 20547bce55d935518803d81f2ad5d235d543fb5d Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:43:07 -0700 Subject: [PATCH 210/240] [Internal] Direct Package: Adds version bump (#4120) * direct version bump * Code changes to fix emulator tests to comply with direct release 3.31.5. --------- Co-authored-by: Debdatta Kunda --- Directory.Build.props | 2 +- .../ClientCreateAndInitializeTest.cs | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 404becc428..0afd5f98c2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,7 +3,7 @@ 3.35.4 3.35.4 preview - 3.31.4 + 3.31.5 2.0.3 2.0.3 preview diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs index e07fe85a7e..8bbb7f5d54 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs @@ -276,10 +276,9 @@ public async Task CreateAndInitializeAsync_WithValidDatabaseAndContainer_ShouldO .GetValue(loadBalancingPartition); Assert.IsNotNull(openChannels); - 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(1, openChannels.Count, "Here the expected value 1 explains how many TCP connections were opened by 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 each of these replica," + + "hence 12 * 4 = 48 times we call the OpenChannelAsync(). However, the number of TCP connections established would be just one per each unique endpoint."); Assert.AreEqual(openChannels.Count * maxRequestsPerConnection, channelCapacity); Documents.Rntbd.LbChannelState channelState = openChannels.First(); From 8f65cd244293cb19c3af56bb6de91737a9535c1b Mon Sep 17 00:00:00 2001 From: Maya Painter <130110800+Maya-Painter@users.noreply.github.com> Date: Tue, 17 Oct 2023 07:39:29 -0700 Subject: [PATCH 211/240] Query : Adds Missing QueryMetrics Documentation (#4127) * Update ServerSidePartitionedMetrics.cs * Update ServerSidePartitionedMetrics.cs --- .../src/Query/Core/Metrics/ServerSidePartitionedMetrics.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSidePartitionedMetrics.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSidePartitionedMetrics.cs index 3fd1f47094..be5a624a42 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSidePartitionedMetrics.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSidePartitionedMetrics.cs @@ -22,6 +22,9 @@ public abstract class ServerSidePartitionedMetrics /// /// Gets the partition key range id for the partition. /// + /// + /// Only has a value in direct mode. When using gateway mode, this is null. + /// public abstract int? PartitionKeyRangeId { get; } } } From 51a8c6c2fe9c6af397b0c0e19f808c22e85f0575 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Wed, 18 Oct 2023 14:48:33 +0530 Subject: [PATCH 212/240] TriggerOperation: Adds Upsert Operation Support (#4119) * Added Upsert Trigger Operation Support * updated contract * fix test --- .../src/Resource/Settings/TriggerOperation.cs | 7 ++- .../TriggersTests.cs | 60 +++++++++++++------ .../Contracts/DotNetSDKAPI.json | 5 ++ .../SettingsContractTests.cs | 13 +++- 4 files changed, 66 insertions(+), 19 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/TriggerOperation.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/TriggerOperation.cs index 1f1aa61ab2..d877671f5a 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Settings/TriggerOperation.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/TriggerOperation.cs @@ -32,6 +32,11 @@ public enum TriggerOperation : short /// /// Specifies replace operations only. /// - Replace = 0x4 + Replace = 0x4, + + /// + /// Specifies upsert operations only. + /// + Upsert = 0x5 } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/TriggersTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/TriggersTests.cs index 82d76427d5..b21feb3e68 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/TriggersTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/TriggersTests.cs @@ -106,7 +106,9 @@ public async Task CRUDTest() } [TestMethod] - public async Task ValidatePreTriggerTest() + [DataRow(TriggerOperation.Create)] + [DataRow(TriggerOperation.Upsert)] + public async Task ValidatePreTriggerTest(TriggerOperation triggerOperation) { string triggerId = "SetJobNumber"; @@ -124,7 +126,7 @@ public async Task ValidatePreTriggerTest() { Id = triggerId, TriggerType = TriggerType.Pre, - TriggerOperation = TriggerOperation.Create, + TriggerOperation = triggerOperation, Body = @"function setJobNumber() { var context = getContext(); var request = context.getRequest(); @@ -150,15 +152,27 @@ public async Task ValidatePreTriggerTest() Job value = new Job() { Id = Guid.NewGuid(), InvestigationKey = "investigation~1" }; - // this should create the document successfully with jobnumber of 1 - Job createdItem = await this.container.CreateItemAsync(item: value, partitionKey: null, requestOptions: new ItemRequestOptions + Job item = null; + if (triggerOperation == TriggerOperation.Create) { - PreTriggers = new List { triggerId } - }); - - Assert.AreEqual(value.Id, createdItem.Id); - Assert.AreEqual(value.InvestigationKey, createdItem.InvestigationKey); - Assert.AreEqual(1, createdItem.JobNumber); + // this should create the document successfully with jobnumber of 1 + item = await this.container.CreateItemAsync(item: value, partitionKey: null, requestOptions: new ItemRequestOptions + { + PreTriggers = new List { triggerId } + }); + } + else if(triggerOperation == TriggerOperation.Upsert) + { + // this should create the document successfully with jobnumber of 1 + item = await this.container.UpsertItemAsync(item: value, partitionKey: null, requestOptions: new ItemRequestOptions + { + PreTriggers = new List { triggerId } + }); + } + + Assert.AreEqual(value.Id, item.Id); + Assert.AreEqual(value.InvestigationKey, item.InvestigationKey); + Assert.AreEqual(1, item.JobNumber); List result = this.container.GetItemLinqQueryable(allowSynchronousQueryExecution: true).Where(x => x.InvestigationKey == "investigation~1").ToList(); Assert.IsNotNull(result); @@ -171,15 +185,27 @@ public async Task ValidatePreTriggerTest() value.Id = Guid.NewGuid(); - // this should create the document successfully with jobnumber of 2 - Job createdItem2 = await this.container.CreateItemAsync(item: value, partitionKey: null, requestOptions: new ItemRequestOptions + Job item2 = null; + if (triggerOperation == TriggerOperation.Create) { - PreTriggers = new List { "SetJobNumber" } - }); + // this should create the document successfully with jobnumber of 2 + item2 = await this.container.CreateItemAsync(item: value, partitionKey: null, requestOptions: new ItemRequestOptions + { + PreTriggers = new List { "SetJobNumber" } + }); + } + else if (triggerOperation == TriggerOperation.Upsert) + { + // this should create the document successfully with jobnumber of 1 + item2 = await this.container.UpsertItemAsync(item: value, partitionKey: null, requestOptions: new ItemRequestOptions + { + PreTriggers = new List { "SetJobNumber" } + }); + } - Assert.AreEqual(value.Id, createdItem2.Id); - Assert.AreEqual(value.InvestigationKey, createdItem2.InvestigationKey); - Assert.AreEqual(2, createdItem2.JobNumber); + Assert.AreEqual(value.Id, item2.Id); + Assert.AreEqual(value.InvestigationKey, item2.InvestigationKey); + Assert.AreEqual(2, item2.JobNumber); result = this.container.GetItemLinqQueryable(allowSynchronousQueryExecution: true).Where(x => x.InvestigationKey == "investigation~1").ToList(); Assert.IsNotNull(result); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index fd2aa8b93e..8c8d7d6ae1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -8799,6 +8799,11 @@ "Type": "Field", "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.Scripts.TriggerOperation Update;IsInitOnly:False;IsStatic:True;" + }, + "Microsoft.Azure.Cosmos.Scripts.TriggerOperation Upsert": { + "Type": "Field", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.Scripts.TriggerOperation Upsert;IsInitOnly:False;IsStatic:True;" } }, "NestedTypes": {} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/SettingsContractTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/SettingsContractTests.cs index 2e8df92318..4cf045cd7b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/SettingsContractTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/SettingsContractTests.cs @@ -69,7 +69,7 @@ public void OperationKindMatchesDirect() [TestMethod] public void TriggerOperationMatchesDirect() { - this.AssertEnums(); + this.AssertEnumsContains(); } [TestMethod] @@ -1147,5 +1147,16 @@ private void AssertEnums() where TFirstEnum : struct, I Assert.AreEqual(Convert.ToInt32(documentssVersion), Convert.ToInt32(cosmosVersion)); } } + + private void AssertEnumsContains() where TFirstEnum : struct, IConvertible where TSecondEnum : struct, IConvertible + { + string[] allCosmosEntries = Enum.GetNames(typeof(TFirstEnum)); + string[] allDocumentsEntries = Enum.GetNames(typeof(TSecondEnum)); + + foreach(string entry in allDocumentsEntries) + { + Assert.IsTrue(allCosmosEntries.Contains(entry)); + } + } } } From 5777a3af0d9161f929849adbc03a73770c8dd081 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Wed, 18 Oct 2023 21:21:56 +0530 Subject: [PATCH 213/240] SDK 3.36.0 : Adds version bump and changelog (#4118) * first draft * updated changelog * remove already released PRs * updated pr links * changelog and contract changes * updated changelog * updated changelog * updated changelog * remove 4071 from changelog as it should be internal PR * removed an query internal log * updated contracts --- Directory.Build.props | 4 +- .../contracts/API_3.36.0-preview.txt | 1610 +++++++++++++++++ .../contracts/API_3.36.0.txt | 1551 ++++++++++++++++ changelog.md | 26 +- 4 files changed, 3188 insertions(+), 3 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.36.0-preview.txt create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.36.0.txt diff --git a/Directory.Build.props b/Directory.Build.props index 0afd5f98c2..514e8e7abb 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 3.35.4 - 3.35.4 + 3.36.0 + 3.36.0 preview 3.31.5 2.0.3 diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.36.0-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.36.0-preview.txt new file mode 100644 index 0000000000..e94727e915 --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.36.0-preview.txt @@ -0,0 +1,1610 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public sealed class ComputedProperty + { + public ComputedProperty(); + public string Name { get; set; } + public string Query { get; set; } + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public Collection ComputedProperties { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public CosmosClientTelemetryOptions CosmosClientTelemetryOptions { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public class CosmosClientTelemetryOptions + { + public CosmosClientTelemetryOptions(); + public CosmosThresholdOptions CosmosThresholdOptions { get; set; } + public bool DisableDistributedTracing { get; set; } + public bool DisableSendingMetricsToService { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual ServerSideCumulativeMetrics GetQueryMetrics(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public class CosmosThresholdOptions + { + public CosmosThresholdOptions(); + public TimeSpan NonPointOperationLatencyThreshold { get; set; } + public TimeSpan PointOperationLatencyThreshold { get; set; } + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable BypassIntegratedCache { get; set; } + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public enum PriorityLevel + { + High = 1, + Low = 2, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public bool EnableOptimisticDirectExecution { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public CosmosThresholdOptions CosmosThresholdOptions { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public Nullable PriorityLevel { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public abstract class ServerSideCumulativeMetrics + { + protected ServerSideCumulativeMetrics(); + public abstract ServerSideMetrics CumulativeMetrics { get; } + public abstract IReadOnlyList PartitionedMetrics { get; } + } + public abstract class ServerSideMetrics + { + protected ServerSideMetrics(); + public abstract TimeSpan DocumentLoadTime { get; } + public abstract TimeSpan DocumentWriteTime { get; } + public abstract double IndexHitRatio { get; } + public abstract TimeSpan IndexLookupTime { get; } + public abstract long OutputDocumentCount { get; } + public abstract long OutputDocumentSize { get; } + public abstract TimeSpan QueryPreparationTime { get; } + public abstract long RetrievedDocumentCount { get; } + public abstract long RetrievedDocumentSize { get; } + public abstract TimeSpan RuntimeExecutionTime { get; } + public abstract TimeSpan TotalTime { get; } + public abstract TimeSpan VMExecutionTime { get; } + } + public abstract class ServerSidePartitionedMetrics + { + protected ServerSidePartitionedMetrics(); + public abstract string FeedRange { get; } + public abstract Nullable PartitionKeyRangeId { get; } + public abstract ServerSideMetrics ServerSideMetrics { get; } + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ComputedPropertiesDefinition + { + public T Attach(); + public ComputedPropertiesDefinition WithComputedProperty(string name, string query); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public ComputedPropertiesDefinition WithComputedProperties(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithClientTelemetryOptions(CosmosClientTelemetryOptions options); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool RegexMatch(this object obj, string regularExpression); + public static bool RegexMatch(this object obj, string regularExpression, string searchModifier); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + Upsert = (short)5, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.36.0.txt b/Microsoft.Azure.Cosmos/contracts/API_3.36.0.txt new file mode 100644 index 0000000000..e4f36a2457 --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.36.0.txt @@ -0,0 +1,1551 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public CosmosClientTelemetryOptions CosmosClientTelemetryOptions { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public class CosmosClientTelemetryOptions + { + public CosmosClientTelemetryOptions(); + public CosmosThresholdOptions CosmosThresholdOptions { get; set; } + public bool DisableDistributedTracing { get; set; } + public bool DisableSendingMetricsToService { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual ServerSideCumulativeMetrics GetQueryMetrics(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public class CosmosThresholdOptions + { + public CosmosThresholdOptions(); + public TimeSpan NonPointOperationLatencyThreshold { get; set; } + public TimeSpan PointOperationLatencyThreshold { get; set; } + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public CosmosThresholdOptions CosmosThresholdOptions { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public abstract class ServerSideCumulativeMetrics + { + protected ServerSideCumulativeMetrics(); + public abstract ServerSideMetrics CumulativeMetrics { get; } + public abstract IReadOnlyList PartitionedMetrics { get; } + } + public abstract class ServerSideMetrics + { + protected ServerSideMetrics(); + public abstract TimeSpan DocumentLoadTime { get; } + public abstract TimeSpan DocumentWriteTime { get; } + public abstract double IndexHitRatio { get; } + public abstract TimeSpan IndexLookupTime { get; } + public abstract long OutputDocumentCount { get; } + public abstract long OutputDocumentSize { get; } + public abstract TimeSpan QueryPreparationTime { get; } + public abstract long RetrievedDocumentCount { get; } + public abstract long RetrievedDocumentSize { get; } + public abstract TimeSpan RuntimeExecutionTime { get; } + public abstract TimeSpan TotalTime { get; } + public abstract TimeSpan VMExecutionTime { get; } + } + public abstract class ServerSidePartitionedMetrics + { + protected ServerSidePartitionedMetrics(); + public abstract string FeedRange { get; } + public abstract Nullable PartitionKeyRangeId { get; } + public abstract ServerSideMetrics ServerSideMetrics { get; } + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithClientTelemetryOptions(CosmosClientTelemetryOptions options); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool RegexMatch(this object obj, string regularExpression); + public static bool RegexMatch(this object obj, string regularExpression, string searchModifier); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + Upsert = (short)5, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/changelog.md b/changelog.md index d6ca1007c1..8b08e37210 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,30 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [3.36.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.36.0) - 2023-10-17 + +#### Fixed +- [4039](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4039) GatewayAddressCache: Fixes Unobserved Exception During Background Address Refresh (#4039) +- [4098](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4098) Distributed Tracing: Fixes dependency failure on appinsights (#4098) +- [4097](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4097) Distributed Tracing: Fixes SDK responses compatibility with opentelemetry response (#4097) +- [4111](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4111) Distributed Tracing: Fixes traceid null exception issue (#4111) + +#### Added +- [4009](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4009) Query: Adds ODE continuation token support for non-ODE pipelines (#4009) +- [4078](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4078) Query: Adds LINQ RegexMatch Extension method (#4078) +- [4001](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4001) Query: Adds public backend metrics property to Diagnostics (#4001) +- [4016](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4016) CosmosClientOptions: Adds support for multiple formats of Azure region names (#4016) +- [4056](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4056) Client Telemetry: Adds new public APIs (#4056) +> Note: Refer this [3983](https://github.com/Azure/azure-cosmos-dotnet-v3/issues/3983) for API signature and default values. +- [4119](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4119) TriggerOperation: Adds Upsert Operation Support(#4119) + +### [3.356.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.36.0-preview) - 2023-10-17 + +#### Added + - [4056](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4056) Client Telemetry: Adds new public APIs (#4056). WARNING: This is breaking change for preview SDK + > Note: `isDistributedTracingEnabled` is removed from `CosmosClientOptions` and `withDistributedTracing()` is removed from `CosmosClientBuilder`. + > Refer this [3983](https://github.com/Azure/azure-cosmos-dotnet-v3/issues/3983) for new API signature and default values + ### [3.35.4-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.4-preview) - 2023-09-15 ### [3.35.4](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.4) - 2023-09-15 @@ -22,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### [3.35.3-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.3-preview) - 2023-08-10 ### [3.35.3](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.3) - 2023-08-10 + #### Fixed - [4030](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4030) Upgrade Resiliency: Fixes Race Condition by Calling Dispose Too Early @@ -215,7 +240,6 @@ If you have a scenario where tokens generated from the newer SDKs are used by an - [#3433](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3433) CosmosOperationCanceledException: Adds serializable functionality - [#3419](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3419) Documentation: Removes mention of obsolete disableAutomaticIdGeneration - [#3404](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3404) Patch: Adds public to `PatchOperation` class for testing -- [#3400](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3400) Query: Adds new system strings in JsonBinaryEncoding, replacing 1-byte user strings - [#3380](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3380) Query: Adds aggressive prefetching for `GROUP BY` and `COUNT(DISTINCT)` ### [3.30.1](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.30.1) - 2022-09-01 From f3a9cae960278377bacc936a047ea7ca6c009614 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Wed, 18 Oct 2023 23:33:21 +0530 Subject: [PATCH 214/240] Release 3.36.0: Fixes pipeline by removing ReleasePackage variable (#4130) * remove release variable * revert build config variable change also --- azure-pipelines-official.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/azure-pipelines-official.yml b/azure-pipelines-official.yml index 81cd3d3d91..db77d4b0fd 100644 --- a/azure-pipelines-official.yml +++ b/azure-pipelines-official.yml @@ -7,7 +7,6 @@ variables: VmImage: windows-latest # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops BuildConfiguration: Release Packaging.EnableSBOMSigning: true - ReleasePackage: true OS: 'Windows' stages: @@ -61,8 +60,8 @@ stages: jobs: - template: templates/nuget-pack.yml parameters: - BuildConfiguration: $(BuildConfiguration) + BuildConfiguration: Release VmImage: $(VmImage) - ReleasePackage: $(ReleasePackage) + ReleasePackage: true OutputPath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/$(BuildConfiguration)/Microsoft.Azure.Cosmos' BlobVersion: $(BlobVersion) \ No newline at end of file From 28204bb5a261af1bb6711a3cba3961079c558351 Mon Sep 17 00:00:00 2001 From: Philip Thomas <86612891+philipthomas-MSFT@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:16:43 -0400 Subject: [PATCH 215/240] Item Operations: Fixes JsonSerialization exception when MissingMemberHandling = Error on Json default settings when NotFound on Item operations. (#4125) * issue 4115 initial checkin. need insight from issuer on reproducing this issue * test refactoring and adding more coverage for other NotFound scenarios * commit on some actionables * setting JsonConvert.DefaultSettings to null so that other tests will not fail * as requested, removed catches from test methods --- .../CosmosExceptionFactory.cs | 9 +- .../CosmosItemTests.cs | 354 +++++++++++++++++- 2 files changed, 350 insertions(+), 13 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosExceptionFactory.cs b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosExceptionFactory.cs index 0648aecbc3..741f8906fa 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosExceptionFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/CosmosExceptions/CosmosExceptionFactory.cs @@ -159,6 +159,7 @@ internal static (Error, string) GetErrorFromStream( using (StreamReader streamReader = new StreamReader(content)) { string errorContent = streamReader.ReadToEnd(); + try { JObject errorObj = JObject.Parse(errorContent); @@ -179,7 +180,7 @@ internal static (Error, string) GetErrorFromStream( return (error, message.ToString()); } } - catch (Newtonsoft.Json.JsonReaderException) + catch (Exception exception) when (CosmosExceptionFactory.ExceptionsToIgnore(exception)) { } @@ -193,6 +194,12 @@ internal static (Error, string) GetErrorFromStream( } } + private static bool ExceptionsToIgnore(Exception exception) + { + return exception is Newtonsoft.Json.JsonReaderException || + exception is Newtonsoft.Json.JsonSerializationException; + } + internal static CosmosException CreateRequestTimeoutException( string message, Headers headers, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs index 607b552b83..860c780e41 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs @@ -781,7 +781,7 @@ public async Task PartitionKeyDeleteTestForSubpartitionedContainer() try { database = await client.CreateDatabaseIfNotExistsAsync("mydb"); - + ContainerProperties containerProperties = new ContainerProperties("subpartitionedcontainer", new List { "/Country", "/City" }); Container container = await database.CreateContainerAsync(containerProperties); ContainerInternal containerInternal = (ContainerInternal)container; @@ -812,7 +812,7 @@ public async Task PartitionKeyDeleteTestForSubpartitionedContainer() doc1.SetValue("Country", "USA"); doc1.SetValue("City", "Stonybrook"); documents[4] = await container.CreateItemAsync(doc1); - + Cosmos.PartitionKey partitionKey1 = new PartitionKeyBuilder().Add("USA").Add("Stonybrook").Build(); using (ResponseMessage pKDeleteResponse = await containerInternal.DeleteAllItemsByPartitionKeyStreamAsync(partitionKey1)) @@ -844,7 +844,7 @@ public async Task PartitionKeyDeleteTestForSubpartitionedContainer() finally { HttpConstants.Versions.CurrentVersion = currentVersion; - if(database != null) await database.DeleteAsync(); + if (database != null) await database.DeleteAsync(); } } @@ -973,7 +973,7 @@ public async Task ItemCustomSerializerTest() // Each parameter in query spec should be a call to the custom serializer int parameterCount = queryDefinition.ToSqlQuerySpec().Parameters.Count; - Assert.AreEqual((parameterCount*pageCount)+parameterCount, toStreamCount, $"missing to stream call. Expected: {(parameterCount * pageCount) + parameterCount}, Actual: {toStreamCount} for query:{queryDefinition.ToSqlQuerySpec().QueryText}"); + Assert.AreEqual((parameterCount * pageCount) + parameterCount, toStreamCount, $"missing to stream call. Expected: {(parameterCount * pageCount) + parameterCount}, Actual: {toStreamCount} for query:{queryDefinition.ToSqlQuerySpec().QueryText}"); Assert.AreEqual(pageCount, fromStreamCount); } } @@ -1195,7 +1195,7 @@ public async Task QueryStreamValueTest() { Assert.AreEqual(3, pageCount); } - + IReadOnlyList<(string Name, object Value)> parameters1 = queryDefinition.GetQueryParameters(); @@ -1362,7 +1362,7 @@ public async Task ItemMultiplePartitionQuery() { FeedResponse iter = await feedIterator.ReadNextAsync(); Assert.IsTrue(iter.Count() <= 1); - if(iter.Count() == 1) + if (iter.Count() == 1) { found = true; ToDoActivity response = iter.First(); @@ -1493,8 +1493,8 @@ public async Task ItemMultiplePartitionOrderByQueryStream() }; IList deleteList = await ToDoActivity.CreateRandomItems( - this.Container, - 300, + this.Container, + 300, randomPartitionKey: true, randomTaskNumber: true); @@ -1753,8 +1753,8 @@ public async Task ItemEpkQuerySingleKeyRangeValidation() public async Task ItemQueryStreamSerializationSetting() { IList deleteList = await ToDoActivity.CreateRandomItems( - container: this.Container, - pkCount: 101, + container: this.Container, + pkCount: 101, randomTaskNumber: true); QueryDefinition sql = new QueryDefinition("SELECT * FROM toDoActivity t ORDER BY t.taskNum"); @@ -2135,9 +2135,9 @@ public async Task ItemPatchSuccessTest() Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); Assert.IsNotNull(response.Resource); Assert.AreEqual(null, response.Resource.children[0].id); - + patchOperations.Clear(); - patchOperations.Add(PatchOperation.Add("/children/1/description","Child#1")); + patchOperations.Add(PatchOperation.Add("/children/1/description", "Child#1")); patchOperations.Add(PatchOperation.Move("/children/0/description", "/description")); patchOperations.Add(PatchOperation.Move("/children/1/description", "/children/0/description")); // with content response @@ -3151,6 +3151,336 @@ public async Task HaLayerDoesNotThrowNullOnGoneExceptionTest() } } + /// + /// + /// + /// + [TestMethod] + [Owner("philipthomas")] + [Description("ReadItemStreamAsync is yielding a Newtonsoft.Json.JsonSerializationException whenever " + + "the item is not found and the MissingMemberHandling is set to MissingMemberHandling.Error. " + + "ReadItemStreamAsync should yield a CosmosException with a NotFound StatusCode.")] + public async Task GivenReadItemStreamAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync() + { + await CosmosItemTests.GivenItemStreamAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync( + itemStreamAsync: async (container, itemIdThatWillNotExist, partitionKeyValue, cancellationToken) => await container.ReadItemStreamAsync( + id: itemIdThatWillNotExist, + partitionKey: new Cosmos.PartitionKey(partitionKeyValue), + cancellationToken: cancellationToken)); + } + + /// + /// + /// + /// + [TestMethod] + [Owner("philipthomas")] + [Description("ReadItemAsync is yielding a Newtonsoft.Json.JsonSerializationException whenever " + + "the item is not found and MissingMemberHandling is set to MissingMemberHandling.Error. " + + "ReadItemAsync should yield a CosmosException with a NotFound StatusCode.")] + public async Task GivenReadItemAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync() + { + await CosmosItemTests.GivenItemAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync( + itemAsync: async (container, itemIdThatWillNotExist, partitionKeyValue, toDoActivity, cancellationToken) => await container.ReadItemAsync( + id: itemIdThatWillNotExist, + partitionKey: new Cosmos.PartitionKey(partitionKeyValue), + cancellationToken: cancellationToken)); + } + + /// + /// + /// + /// + [TestMethod] + [Owner("philipthomas")] + [Description("DeleteItemStreamAsync is yielding a Newtonsoft.Json.JsonSerializationException whenever " + + "the item is not found and the MissingMemberHandling is set to MissingMemberHandling.Error. " + + "DeleteItemStreamAsync should yield a CosmosException with a NotFound StatusCode.")] + public async Task GivenDeleteItemStreamAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync() + { + await CosmosItemTests.GivenItemStreamAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync( + itemStreamAsync: async (container, itemIdThatWillNotExist, partitionKeyValue, cancellationToken) => await container.DeleteItemStreamAsync( + id: itemIdThatWillNotExist, + partitionKey: new Cosmos.PartitionKey(partitionKeyValue), + cancellationToken: cancellationToken)); + } + + /// + /// + /// + /// + [TestMethod] + [Owner("philipthomas")] + [Description("DeleteItemAsync is yielding a Newtonsoft.Json.JsonSerializationException whenever " + + "the item is not found and MissingMemberHandling is set to MissingMemberHandling.Error. " + + "DeleteItemAsync should yield a CosmosException with a NotFound StatusCode.")] + public async Task GivenDeleteItemAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync() + { + await CosmosItemTests.GivenItemAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync( + itemAsync: async (container, itemIdThatWillNotExist, partitionKeyValue, toDoActivity, cancellationToken) => await container.DeleteItemAsync( + id: itemIdThatWillNotExist, + partitionKey: new Cosmos.PartitionKey(partitionKeyValue), + cancellationToken: cancellationToken)); + } + + /// + /// + /// + /// + [TestMethod] + [Owner("philipthomas")] + [Description("DeleteItemStreamAsync is yielding a Newtonsoft.Json.JsonSerializationException whenever " + + "the item is not found and the MissingMemberHandling is set to MissingMemberHandling.Error. " + + "DeleteItemStreamAsync should yield a CosmosException with a NotFound StatusCode.")] + public async Task GivenReplaceItemStreamAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync() + { + await CosmosItemTests.GivenItemStreamAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync( + itemStreamAsync: async (container, itemIdThatWillNotExist, partitionKeyValue, cancellationToken) => await container.ReplaceItemStreamAsync( + streamPayload: new MemoryStream(), + id: itemIdThatWillNotExist, + partitionKey: new Cosmos.PartitionKey(partitionKeyValue), + cancellationToken: cancellationToken)); + } + + /// + /// + /// + /// + [TestMethod] + [Owner("philipthomas")] + [Description("ReplaceItemAsync is yielding a Newtonsoft.Json.JsonSerializationException whenever " + + "the item is not found and MissingMemberHandling is set to MissingMemberHandling.Error. " + + "ReplaceItemAsync should yield a CosmosException with a NotFound StatusCode.")] + public async Task GivenReplaceItemAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync() + { + await CosmosItemTests.GivenItemAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync( + itemAsync: async (container, itemIdThatWillNotExist, partitionKeyValue, toDoActivity, cancellationToken) => await container.ReplaceItemAsync( + item: toDoActivity, + id: itemIdThatWillNotExist, + partitionKey: new Cosmos.PartitionKey(partitionKeyValue), + cancellationToken: cancellationToken)); + } + + /// + /// + /// + /// + [TestMethod] + [Owner("philipthomas")] + [Description("PatchItemStreamAsync is yielding a Newtonsoft.Json.JsonSerializationException whenever " + + "the item is not found and the MissingMemberHandling is set to MissingMemberHandling.Error. " + + "PatchItemStreamAsync should yield a CosmosException with a NotFound StatusCode.")] + public async Task GivenPatchItemStreamAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync() + { + List patchOperations = new() + { + PatchOperation.Add("/children/1/pk", "patched"), + PatchOperation.Remove("/description"), + PatchOperation.Replace("/taskNum", 1) + }; + + await CosmosItemTests.GivenItemStreamAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync( + itemStreamAsync: async (container, itemIdThatWillNotExist, partitionKeyValue, cancellationToken) => await container.PatchItemStreamAsync( + patchOperations: patchOperations, + id: itemIdThatWillNotExist, + partitionKey: new Cosmos.PartitionKey(partitionKeyValue), + cancellationToken: cancellationToken)); + } + + /// + /// + /// + /// + [TestMethod] + [Owner("philipthomas")] + [Description("PatchItemAsync is yielding a Newtonsoft.Json.JsonSerializationException whenever " + + "the item is not found and MissingMemberHandling is set to MissingMemberHandling.Error. " + + "PatchItemAsync should yield a CosmosException with a NotFound StatusCode.")] + public async Task GivenPatchItemAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync() + { + List patchOperations = new() + { + PatchOperation.Add("/children/1/pk", "patched"), + PatchOperation.Remove("/description"), + PatchOperation.Replace("/taskNum", 1) + }; + + await CosmosItemTests.GivenItemAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync( + itemAsync: async (container, itemIdThatWillNotExist, partitionKeyValue, toDoActivity, cancellationToken) => await container.PatchItemAsync( + patchOperations: patchOperations, + id: itemIdThatWillNotExist, + partitionKey: new Cosmos.PartitionKey(partitionKeyValue), + cancellationToken: cancellationToken)); + } + + private static async Task GivenItemStreamAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync( + Func> itemStreamAsync) + { + // AAA + // Arrange + CancellationTokenSource cancellationTokenSource = new(); + CancellationToken cancellationToken = cancellationTokenSource.Token; + + // Food for thought, actionable items. + // + // 1. Is there anything else that we should be concerned with that would give us the same behavior? + // 2. Are there other operations other than those that can yield an NotFound exception that we should be + // concerned with? + // 3. Can we also reset the DefaultSettings before we make the call, and reset it back once it is done? + + JsonConvert.DefaultSettings = () => new JsonSerializerSettings + { + MissingMemberHandling = MissingMemberHandling.Error + }; + + CosmosClient cosmosClient = TestCommon.CreateCosmosClient(); + + string databaseId = Guid.NewGuid().ToString(); + Cosmos.Database database = await cosmosClient.CreateDatabaseIfNotExistsAsync( + id: databaseId, + cancellationToken: cancellationToken); + + try + { + string containerId = Guid.NewGuid().ToString(); + Container container = await database.CreateContainerIfNotExistsAsync( + containerProperties: new ContainerProperties + { + Id = containerId, + PartitionKeyPath = "/pk", + }, + cancellationToken: cancellationToken); + + + // Act + string itemIdThatWillNotExist = Guid.NewGuid().ToString(); + string partitionKeyValue = Guid.NewGuid().ToString(); + + ResponseMessage response = await itemStreamAsync(container, itemIdThatWillNotExist, partitionKeyValue, cancellationToken); + + // Assert + Debug.Assert( + condition: response != null, + message: $"{response}"); + + Assert.AreEqual( + expected: HttpStatusCode.NotFound, + actual: response.StatusCode); + + string content = JsonConvert.SerializeObject(response.Content); + + Assert.AreEqual( + expected: "null", + actual: content); + + string errorMessage = JsonConvert.SerializeObject(response.ErrorMessage); + + Assert.IsNotNull(value: errorMessage); + + Debug.Assert( + condition: response.CosmosException != null, + message: $"{response.CosmosException}"); + + Assert.AreEqual( + expected: HttpStatusCode.NotFound, + actual: response.StatusCode); + + Debug.WriteLine(message: $"{nameof(response.CosmosException)}: {response.CosmosException}"); + + Assert.AreEqual( + actual: response.CosmosException.StatusCode, + expected: HttpStatusCode.NotFound); + } + finally + { + if (database != null) + { + // Remove the test database. Cleanup. + _ = await database.DeleteAsync(cancellationToken: cancellationToken); + + Debug.WriteLine($"The {nameof(database)} with id '{databaseId}' was removed."); + } + + // Setting this back because it blows up other serialization tests. + + JsonConvert.DefaultSettings = () => default; + } + } + + private static async Task GivenItemAsyncWhenMissingMemberHandlingIsErrorThenExpectsCosmosExceptionTestAsync( + Func>> itemAsync) + { + // AAA + // Arrange + CancellationTokenSource cancellationTokenSource = new(); + CancellationToken cancellationToken = cancellationTokenSource.Token; + + // Food for thought, actionable items. + // + // 1. Is there anything else that we should be concerned with that would give us the same behavior? + // 2. Are there other operations other than those that can yield an NotFound exception that we should be + // concerned with? + // 3. Can we also reset the DefaultSettings before we make the call, and reset it back once it is done? + + JsonConvert.DefaultSettings = () => new JsonSerializerSettings + { + MissingMemberHandling = MissingMemberHandling.Error + }; + + CosmosClient cosmosClient = TestCommon.CreateCosmosClient(); + + string databaseId = Guid.NewGuid().ToString(); + Cosmos.Database database = await cosmosClient.CreateDatabaseIfNotExistsAsync( + id: databaseId, + cancellationToken: cancellationToken); + + try + { + string containerId = Guid.NewGuid().ToString(); + Container container = await database.CreateContainerIfNotExistsAsync( + containerProperties: new ContainerProperties + { + Id = containerId, + PartitionKeyPath = "/pk", + }, + cancellationToken: cancellationToken); + + + // Act + // If any thing other than a CosmosException is thrown, the call to ReadItemAsync below will fail. + string itemIdThatWillNotExist = Guid.NewGuid().ToString(); + string partitionKeyValue = Guid.NewGuid().ToString(); + + CosmosException cosmosException = await Assert.ThrowsExceptionAsync(action: + async () => await itemAsync(container, itemIdThatWillNotExist, partitionKeyValue, new ToDoActivity { id = Guid.NewGuid().ToString(), pk = "Georgia" }, cancellationToken)) ; + + // Assert + Debug.Assert( + condition: cosmosException != null, + message: $"{cosmosException}"); + + Debug.WriteLine(message: $"{nameof(cosmosException)}: {cosmosException}"); + + Assert.AreEqual( + actual: cosmosException.StatusCode, + expected: HttpStatusCode.NotFound); + } + finally + { + if (database != null) + { + // Remove the test database. Cleanup. + _ = await database.DeleteAsync(cancellationToken: cancellationToken); + + Debug.WriteLine($"The {nameof(database)} with id '{databaseId}' was removed."); + } + + // Setting this back because it blows up other serialization tests. + + JsonConvert.DefaultSettings = () => default; + } + } + private async Task AutoGenerateIdPatternTest(Cosmos.PartitionKey pk, T itemWithoutId) { string autoId = Guid.NewGuid().ToString(); From 1afcacd3169a7a9bcc4a196837b71509c63df1d2 Mon Sep 17 00:00:00 2001 From: Maya Painter <130110800+Maya-Painter@users.noreply.github.com> Date: Wed, 18 Oct 2023 14:56:37 -0700 Subject: [PATCH 216/240] [Internal] Query : Adds test coverage for custom serializers (#4114) * initial cleanup * test updates - working * cleanup * more cleanup * more * whoops * Add results to basline * adding payload to xml * some generics * cleanup * Add datamember serializer * reorder functions and test fix * tostring() update and add case * fix payload * fix datamembertest * cleanup * cleanup * PR comment --------- Co-authored-by: Matias Quaranta --- .../src/Linq/ExpressionToSQL.cs | 15 +- .../Resource/Container/ContainerCore.Items.cs | 5 - .../Serializer/CosmosLinqSerializerOptions.cs | 4 - ...seline.TestMemberInitializerDataMember.xml | 236 ++++++++++ ...erBaseline.TestMemberInitializerDotNet.xml | 236 ++++++++++ ...e.TestMemberInitializerMultiSerializer.xml | 236 ++++++++++ ...seline.TestMemberInitializerNewtonsoft.xml | 236 ++++++++++ .../CustomSerializationTests.cs | 32 +- .../Linq/LinqTestsCommon.cs | 140 ++++-- ...TranslationWithCustomSerializerBaseline.cs | 407 ++++++++++++++++++ ...icrosoft.Azure.Cosmos.EmulatorTests.csproj | 20 +- 11 files changed, 1486 insertions(+), 81 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerDataMember.xml create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerDotNet.xml create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerMultiSerializer.xml create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerNewtonsoft.xml create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationWithCustomSerializerBaseline.cs diff --git a/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs b/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs index 2ada0738da..fef136d8d2 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs @@ -15,12 +15,10 @@ namespace Microsoft.Azure.Cosmos.Linq using System.Reflection; using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.CosmosElements.Numbers; - using Microsoft.Azure.Cosmos.Serializer; using Microsoft.Azure.Cosmos.Spatial; using Microsoft.Azure.Cosmos.SqlObjects; using Microsoft.Azure.Documents; using Newtonsoft.Json; - using Newtonsoft.Json.Linq; using static Microsoft.Azure.Cosmos.Linq.FromParameterBindings; // ReSharper disable UnusedParameter.Local @@ -77,10 +75,9 @@ public static class LinqMethods public const string Where = "Where"; } - private static string SqlRoot = "root"; - private static string DefaultParameterName = "v"; - private static bool usePropertyRef = false; - private static SqlIdentifier RootIdentifier = SqlIdentifier.Create(SqlRoot); + private static readonly string SqlRoot = "root"; + private static readonly string DefaultParameterName = "v"; + private static readonly bool usePropertyRef = false; /// /// Toplevel entry point. @@ -455,12 +452,12 @@ private static SqlScalarExpression VisitBinary(BinaryExpression inputExpression, { if (TryMatchStringCompareTo(methodCallExpression, constantExpression, inputExpression.NodeType)) { - return ExpressionToSql.VisitStringCompareTo(methodCallExpression, constantExpression, inputExpression.NodeType, reverseNodeType, context); + return ExpressionToSql.VisitStringCompareTo(methodCallExpression, inputExpression.NodeType, reverseNodeType, context); } if (TryMatchStringCompare(methodCallExpression, constantExpression, inputExpression.NodeType)) { - return ExpressionToSql.VisitStringCompare(methodCallExpression, constantExpression, inputExpression.NodeType, reverseNodeType, context); + return ExpressionToSql.VisitStringCompare(methodCallExpression, inputExpression.NodeType, reverseNodeType, context); } } @@ -613,7 +610,6 @@ private static bool TryMatchStringCompareTo(MethodCallExpression left, ConstantE private static SqlScalarExpression VisitStringCompareTo( MethodCallExpression left, - ConstantExpression right, ExpressionType compareOperator, bool reverseNodeType, TranslationContext context) @@ -690,7 +686,6 @@ private static bool TryMatchStringCompare(MethodCallExpression left, ConstantExp private static SqlScalarExpression VisitStringCompare( MethodCallExpression left, - ConstantExpression right, ExpressionType compareOperator, bool reverseNodeType, TranslationContext context) diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs index a694b78019..fd9ad03b53 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs @@ -16,8 +16,6 @@ namespace Microsoft.Azure.Cosmos using Microsoft.Azure.Cosmos.ChangeFeed; using Microsoft.Azure.Cosmos.ChangeFeed.FeedProcessing; using Microsoft.Azure.Cosmos.ChangeFeed.Pagination; - using Microsoft.Azure.Cosmos.ChangeFeed.Utils; - using Microsoft.Azure.Cosmos.Common; using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.Json; using Microsoft.Azure.Cosmos.Linq; @@ -29,11 +27,8 @@ namespace Microsoft.Azure.Cosmos using Microsoft.Azure.Cosmos.Query.Core.QueryPlan; using Microsoft.Azure.Cosmos.ReadFeed; using Microsoft.Azure.Cosmos.ReadFeed.Pagination; - using Microsoft.Azure.Cosmos.Routing; - using Microsoft.Azure.Cosmos.Serializer; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; - using Microsoft.Azure.Documents.Routing; /// /// Used to perform operations on items. There are two different types of operations. diff --git a/Microsoft.Azure.Cosmos/src/Serializer/CosmosLinqSerializerOptions.cs b/Microsoft.Azure.Cosmos/src/Serializer/CosmosLinqSerializerOptions.cs index b7523b2c6a..3b215a9cc8 100644 --- a/Microsoft.Azure.Cosmos/src/Serializer/CosmosLinqSerializerOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Serializer/CosmosLinqSerializerOptions.cs @@ -4,10 +4,6 @@ namespace Microsoft.Azure.Cosmos { - using System; - using System.Collections.Generic; - using System.Text; - /// /// This class provides a way to configure Linq Serialization Properties /// diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerDataMember.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerDataMember.xml new file mode 100644 index 0000000000..6734a125fa --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerDataMember.xml @@ -0,0 +1,236 @@ + + + + + (doc.NumericField == 1))]]> + + + + + + + + + + + (doc == new DataObjectDataMember() {NumericField = 1, StringField = "1"}))]]> + + + + + + + + + + + new DataObjectDataMember() {NumericField = 1, StringField = "1"})]]> + + + + + + + + + + + IIF((doc.NumericField > 1), new DataObjectDataMember() {NumericField = 1, StringField = "1"}, new DataObjectDataMember() {NumericField = 1, StringField = "1"}))]]> + + + 1) ? {"NumericFieldDataMember": 1, "StringFieldDataMember": "1", "id": null, "Pk": null} : {"NumericFieldDataMember": 1, "StringFieldDataMember": "1", "id": null, "Pk": null}) +FROM root]]> + + + + + + + + (doc == new DataObjectDataMember() {NumericField = doc.NumericField, StringField = doc.StringField})).Select(b => "A")]]> + + + + + + + + + + + (doc.NumericField == 1))]]> + + + + + + + + + + + (doc == new DataObjectDataMember() {NumericField = 1, StringField = "1"}))]]> + + + + + + + + + + + new DataObjectDataMember() {NumericField = 1, StringField = "1"})]]> + + + + + + + + + + + IIF((doc.NumericField > 1), new DataObjectDataMember() {NumericField = 1, StringField = "1"}, new DataObjectDataMember() {NumericField = 1, StringField = "1"}))]]> + + + 1) ? {"NumericFieldDataMember": 1, "StringFieldDataMember": "1", "id": null, "Pk": null} : {"NumericFieldDataMember": 1, "StringFieldDataMember": "1", "id": null, "Pk": null}) +FROM root]]> + + + + + + + + (doc == new DataObjectDataMember() {NumericField = doc.NumericField, StringField = doc.StringField})).Select(b => "A")]]> + + + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerDotNet.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerDotNet.xml new file mode 100644 index 0000000000..b381e2b651 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerDotNet.xml @@ -0,0 +1,236 @@ + + + + + (doc.NumericField == 1))]]> + + + + + + + + + + + (doc == new DataObjectDotNet() {NumericField = 1, StringField = "1"}))]]> + + + + + + + + + + + new DataObjectDotNet() {NumericField = 1, StringField = "1"})]]> + + + + + + + + + + + IIF((doc.NumericField > 1), new DataObjectDotNet() {NumericField = 1, StringField = "1"}, new DataObjectDotNet() {NumericField = 1, StringField = "1"}))]]> + + + 1) ? {"NumericField": 1, "StringField": "1", "id": null, "Pk": null} : {"NumericField": 1, "StringField": "1", "id": null, "Pk": null}) +FROM root]]> + + + + + + + + (doc == new DataObjectDotNet() {NumericField = doc.NumericField, StringField = doc.StringField})).Select(b => "A")]]> + + + + + + + + + + + (doc.NumericField == 1))]]> + + + + + + + + + + + (doc == new DataObjectDotNet() {NumericField = 1, StringField = "1"}))]]> + + + + + + + + + + + new DataObjectDotNet() {NumericField = 1, StringField = "1"})]]> + + + + + + + + + + + IIF((doc.NumericField > 1), new DataObjectDotNet() {NumericField = 1, StringField = "1"}, new DataObjectDotNet() {NumericField = 1, StringField = "1"}))]]> + + + 1) ? {"NumericField": 1, "StringField": "1", "id": null, "Pk": null} : {"NumericField": 1, "StringField": "1", "id": null, "Pk": null}) +FROM root]]> + + + + + + + + (doc == new DataObjectDotNet() {NumericField = doc.NumericField, StringField = doc.StringField})).Select(b => "A")]]> + + + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerMultiSerializer.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerMultiSerializer.xml new file mode 100644 index 0000000000..704eb39807 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerMultiSerializer.xml @@ -0,0 +1,236 @@ + + + + + (doc.NumericField == 1))]]> + + + + + + + + + + + (doc == new DataObjectMultiSerializer() {NumericField = 1, StringField = "1"}))]]> + + + + + + + + + + + new DataObjectMultiSerializer() {NumericField = 1, StringField = "1"})]]> + + + + + + + + + + + IIF((doc.NumericField > 1), new DataObjectMultiSerializer() {NumericField = 1, StringField = "1"}, new DataObjectMultiSerializer() {NumericField = 1, StringField = "1"}))]]> + + + 1) ? {"NumberValueNewtonsoft": 1, "StringValueNewtonsoft": "1", "id": null, "Pk": null} : {"NumberValueNewtonsoft": 1, "StringValueNewtonsoft": "1", "id": null, "Pk": null}) +FROM root]]> + + + + + + + + (doc == new DataObjectMultiSerializer() {NumericField = doc.NumericField, StringField = doc.StringField})).Select(b => "A")]]> + + + + + + + + + + + (doc.NumericField == 1))]]> + + + + + + + + + + + (doc == new DataObjectMultiSerializer() {NumericField = 1, StringField = "1"}))]]> + + + + + + + + + + + new DataObjectMultiSerializer() {NumericField = 1, StringField = "1"})]]> + + + + + + + + + + + IIF((doc.NumericField > 1), new DataObjectMultiSerializer() {NumericField = 1, StringField = "1"}, new DataObjectMultiSerializer() {NumericField = 1, StringField = "1"}))]]> + + + 1) ? {"NumberValueNewtonsoft": 1, "StringValueNewtonsoft": "1", "id": null, "Pk": null} : {"NumberValueNewtonsoft": 1, "StringValueNewtonsoft": "1", "id": null, "Pk": null}) +FROM root]]> + + + + + + + + (doc == new DataObjectMultiSerializer() {NumericField = doc.NumericField, StringField = doc.StringField})).Select(b => "A")]]> + + + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerNewtonsoft.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerNewtonsoft.xml new file mode 100644 index 0000000000..b5b16752cc --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerNewtonsoft.xml @@ -0,0 +1,236 @@ + + + + + (doc.NumericField == 1))]]> + + + + + + + + + + + (doc == new DataObjectNewtonsoft() {NumericField = 1, StringField = "1"}))]]> + + + + + + + + + + + new DataObjectNewtonsoft() {NumericField = 1, StringField = "1"})]]> + + + + + + + + + + + IIF((doc.NumericField > 1), new DataObjectNewtonsoft() {NumericField = 1, StringField = "1"}, new DataObjectNewtonsoft() {NumericField = 1, StringField = "1"}))]]> + + + 1) ? {"NumberValueNewtonsoft": 1, "StringValueNewtonsoft": "1", "id": null, "Pk": null} : {"NumberValueNewtonsoft": 1, "StringValueNewtonsoft": "1", "id": null, "Pk": null}) +FROM root]]> + + + + + + + + (doc == new DataObjectNewtonsoft() {NumericField = doc.NumericField, StringField = doc.StringField})).Select(b => "A")]]> + + + + + + + + + + + (doc.NumericField == 1))]]> + + + + + + + + + + + (doc == new DataObjectNewtonsoft() {NumericField = 1, StringField = "1"}))]]> + + + + + + + + + + + new DataObjectNewtonsoft() {NumericField = 1, StringField = "1"})]]> + + + + + + + + + + + IIF((doc.NumericField > 1), new DataObjectNewtonsoft() {NumericField = 1, StringField = "1"}, new DataObjectNewtonsoft() {NumericField = 1, StringField = "1"}))]]> + + + 1) ? {"NumberValueNewtonsoft": 1, "StringValueNewtonsoft": "1", "id": null, "Pk": null} : {"NumberValueNewtonsoft": 1, "StringValueNewtonsoft": "1", "id": null, "Pk": null}) +FROM root]]> + + + + + + + + (doc == new DataObjectNewtonsoft() {NumericField = doc.NumericField, StringField = doc.StringField})).Select(b => "A")]]> + + + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CustomSerializationTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CustomSerializationTests.cs index 5e6e2fe7bb..3334c201d1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CustomSerializationTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CustomSerializationTests.cs @@ -14,7 +14,6 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Runtime.Serialization; using System.Text; using System.Threading.Tasks; - using Microsoft.Azure.Cosmos.Linq; using Microsoft.Azure.Cosmos.Utils; using Microsoft.Azure.Documents; using Microsoft.Azure.Documents.Client; @@ -35,7 +34,7 @@ public abstract class CustomSerializationTests private Uri databaseUri; private Uri collectionUri; private Uri partitionedCollectionUri; - private PartitionKeyDefinition defaultPartitionKeyDefinition = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection(new[] { "/pk" }), Kind = PartitionKind.Hash }; + private readonly PartitionKeyDefinition defaultPartitionKeyDefinition = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection(new[] { "/pk" }), Kind = PartitionKind.Hash }; internal abstract DocumentClient CreateDocumentClient( Uri hostUri, @@ -77,7 +76,7 @@ public void TestSetup() { if (ex.StatusCode == System.Net.HttpStatusCode.ServiceUnavailable) { - // Emulator con sometimes fail under load, so we retry + // Emulator can sometimes fail under load, so we retry Task.Delay(1000); this.documentClient.CreateDocumentCollectionAsync(this.databaseUri, newCollection, new RequestOptions { OfferThroughput = 400 }).Wait(); } @@ -100,7 +99,7 @@ public void TestSetup() { if (ex.StatusCode == System.Net.HttpStatusCode.ServiceUnavailable) { - // Emulator con sometimes fail under load, so we retry + // Emulator can sometimes fail under load, so we retry Task.Delay(1000); this.documentClient.CreateDocumentCollectionAsync(this.databaseUri, partitionedCollection, new RequestOptions { OfferThroughput = 10000 }).Wait(); } @@ -136,13 +135,12 @@ public void TestDateParseHandlingOnReadDocument() // Verify round-trip create and read document RequestOptions applyRequestOptions = this.ApplyRequestOptions(new RequestOptions(), serializerSettings); - this.AssertPropertyOnReadDocument(client, this.collectionUri, createdDocument, applyRequestOptions, originalDocument, jsonProperty); - this.AssertPropertyOnReadDocument(client, this.partitionedCollectionUri, partitionedDocument, applyRequestOptions, originalDocument, jsonProperty); + this.AssertPropertyOnReadDocument(client, createdDocument, applyRequestOptions, originalDocument, jsonProperty); + this.AssertPropertyOnReadDocument(client, partitionedDocument, applyRequestOptions, originalDocument, jsonProperty); } private void AssertPropertyOnReadDocument( DocumentClient client, - Uri targetCollectionUri, Document createdDocument, RequestOptions requestOptions, Document originalDocument, @@ -311,26 +309,6 @@ public async Task TestJsonSerializerSettings(bool useGateway) } this.AssertEqual(testDocument, allDocuments.First()); - - //Will add LINQ test once it is available with new V3 OM - // // LINQ Lambda - // var query1 = client.CreateDocumentQuery(partitionedCollectionUri, options) - // .Where(_ => _.Id.CompareTo(String.Empty) > 0) - // .Select(_ => _.Id); - // string query1Str = query1.ToString(); - // var result = query1.ToList(); - // Assert.AreEqual(1, result.Count); - // Assert.AreEqual(testDocument.Id, result[0]); - - // // LINQ Query - // var query2 = - // from f in client.CreateDocumentQuery(partitionedCollectionUri, options) - // where f.Id.CompareTo(String.Empty) > 0 - // select f.Id; - // string query2Str = query2.ToString(); - // var result2 = query2.ToList(); - // Assert.AreEqual(1, result2.Count); - // Assert.AreEqual(testDocument.Id, result2[0]); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTestsCommon.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTestsCommon.cs index 87b33110e2..c8513e41b8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTestsCommon.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTestsCommon.cs @@ -156,12 +156,11 @@ public static Boolean IsAnonymousType(Type type) } /// - /// Validate the results of CosmosDB query and the results of LinQ query on the original data - /// Using Assert, will fail the unit test if the two results list are not SequenceEqual + /// Gets the results of CosmosDB query and the results of LINQ query on the original data /// /// /// - public static void ValidateResults(IQueryable queryResults, IQueryable dataResults) + public static (List queryResults, List dataResults) GetResults(IQueryable queryResults, IQueryable dataResults) { // execution validation IEnumerator queryEnumerator = queryResults.GetEnumerator(); @@ -171,7 +170,19 @@ public static void ValidateResults(IQueryable queryResults, IQueryable dataResul queryResultsList.Add(queryEnumerator.Current); } - List dataResultsList = dataResults.Cast().ToList(); + List dataResultsList = dataResults?.Cast()?.ToList(); + + return (queryResultsList, dataResultsList); + } + + /// + /// Validates the results of CosmosDB query and the results of LINQ query on the original data + /// Using Assert, will fail the unit test if the two results list are not SequenceEqual + /// + /// + /// + private static void ValidateResults(List queryResultsList, List dataResultsList) + { bool resultMatched = true; string actualStr = null; string expectedStr = null; @@ -229,9 +240,8 @@ public static void ValidateResults(IQueryable queryResults, IQueryable dataResul string assertMsg = string.Empty; if (!resultMatched) { - if (actualStr == null) actualStr = JsonConvert.SerializeObject(queryResultsList); - - if (expectedStr == null) expectedStr = JsonConvert.SerializeObject(dataResultsList); + actualStr ??= JsonConvert.SerializeObject(queryResultsList); + expectedStr ??= JsonConvert.SerializeObject(dataResultsList); resultMatched |= actualStr.Equals(expectedStr); if (!resultMatched) @@ -271,7 +281,7 @@ public static DateTime RandomDateTime(Random random, DateTime midDateTime) } /// - /// Generate test data for most LinQ tests + /// Generate test data for most LINQ tests /// /// the object type /// the lamda to create an instance of test data @@ -315,6 +325,44 @@ public static Func> GenerateTestCosmosData(Func + /// Generate a non-random payload for serializer LINQ tests. + /// + /// the object type + /// the lamda to create an instance of test data + /// number of test data to be created + /// the target container + /// if theCosmosLinqSerializerOption of camelCaseSerialization should be applied + /// a lambda that takes a boolean which indicate where the query should run against CosmosDB or against original data, and return a query results as IQueryable. Also the serialized payload. + public static Func> GenerateSerializationTestCosmosData(Func func, int count, Container container, bool camelCaseSerialization = false) + { + List data = new List(); + for (int i = 0; i < count; i++) + { + data.Add(func(i, camelCaseSerialization)); + } + + foreach (T obj in data) + { + ItemResponse response = container.CreateItemAsync(obj, new Cosmos.PartitionKey("Test")).Result; + } + + FeedOptions feedOptions = new FeedOptions() { EnableScanInQuery = true, EnableCrossPartitionQuery = true }; + QueryRequestOptions requestOptions = new QueryRequestOptions() + { +#if PREVIEW + EnableOptimisticDirectExecution = false +#endif + }; + + CosmosLinqSerializerOptions linqSerializerOptions = new CosmosLinqSerializerOptions { PropertyNamingPolicy = camelCaseSerialization ? CosmosPropertyNamingPolicy.CamelCase : CosmosPropertyNamingPolicy.Default }; + IOrderedQueryable query = container.GetItemLinqQueryable(allowSynchronousQueryExecution: true, requestOptions: requestOptions, linqSerializerOptions: linqSerializerOptions); + + IQueryable getQuery(bool useQuery) => useQuery ? query : data.AsQueryable(); + + return getQuery; + } + public static Func> GenerateFamilyCosmosData( Cosmos.Database cosmosDatabase, out Container container) { @@ -434,7 +482,7 @@ Family createDataObj(Random random) for (int j = 0; j < random.Next(MaxThings) + 1; ++j) { obj.Children[i].Things.Add( - j == 0 ? "A" : $"{j}-{random.Next().ToString()}", + j == 0 ? "A" : $"{j}-{random.Next()}", LinqTestsCommon.RandomString(random, random.Next(MaxThingStringLength))); } } @@ -462,9 +510,7 @@ Family createDataObj(Random random) return getQuery; } - public static Func> GenerateSimpleCosmosData( - Cosmos.Database cosmosDatabase - ) + public static Func> GenerateSimpleCosmosData(Cosmos.Database cosmosDatabase) { const int DocumentCount = 10; PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection(new[] { "/Pk" }), Kind = PartitionKind.Hash }; @@ -480,7 +526,7 @@ Cosmos.Database cosmosDatabase { Id = Guid.NewGuid().ToString(), Number = random.Next(-10000, 10000), - Flag = index % 2 == 0 ? true : false, + Flag = index % 2 == 0, Multiples = new int[] { index, index * 2, index * 3, index * 4 }, Pk = "Test" }; @@ -508,28 +554,35 @@ Cosmos.Database cosmosDatabase return getQuery; } - public static LinqTestOutput ExecuteTest(LinqTestInput input) + public static LinqTestOutput ExecuteTest(LinqTestInput input, bool serializeResultsInBaseline = false) { string querySqlStr = string.Empty; try { Func compiledQuery = input.Expression.Compile(); - IQueryable queryResults = compiledQuery(true); - querySqlStr = JObject.Parse(queryResults.ToString()).GetValue("query", StringComparison.Ordinal).ToString(); + IQueryable query = compiledQuery(true); + querySqlStr = JObject.Parse(query.ToString()).GetValue("query", StringComparison.Ordinal).ToString(); - // we skip unordered query because the LinQ results vs actual query results are non-deterministic + IQueryable dataQuery = input.skipVerification ? null : compiledQuery(false); + + (List queryResults, List dataResults) = GetResults(query, dataQuery); + + // we skip unordered query because the LINQ results vs actual query results are non-deterministic if (!input.skipVerification) { - IQueryable dataResults = compiledQuery(false); LinqTestsCommon.ValidateResults(queryResults, dataResults); } - return new LinqTestOutput(querySqlStr); + string serializedResults = serializeResultsInBaseline ? + JsonConvert.SerializeObject(queryResults.Select(item => item is LinqTestObject ? item.ToString() : item), new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented}) : + null; + + return new LinqTestOutput(querySqlStr, serializedResults, errorMsg: null, input.inputData); } catch (Exception e) { - return new LinqTestOutput(querySqlStr, LinqTestsCommon.BuildExceptionMessageForTest(e)); + return new LinqTestOutput(querySqlStr, serializedResults: null, errorMsg: LinqTestsCommon.BuildExceptionMessageForTest(e), inputData: input.inputData); } } @@ -570,13 +623,15 @@ public class LinqTestObject { private string json; + protected virtual string SerializeForTestBaseline() + { + return JsonConvert.SerializeObject(this); + } + public override string ToString() { // simple cached serialization - if (this.json == null) - { - this.json = JsonConvert.SerializeObject(this); - } + this.json ??= this.SerializeForTestBaseline(); return this.json; } @@ -608,18 +663,25 @@ public class LinqTestInput : BaselineTestInput internal int randomSeed = -1; internal Expression> Expression { get; } internal string expressionStr; + internal string inputData; // We skip the verification between Cosmos DB and actual query restuls in the following cases // - unordered query since the results are not deterministics for LinQ results and actual query results // - scenarios not supported in LINQ, e.g. sequence doesn't contain element. internal bool skipVerification; - internal LinqTestInput(string description, Expression> expr, bool skipVerification = false, string expressionStr = null) + internal LinqTestInput( + string description, + Expression> expr, + bool skipVerification = false, + string expressionStr = null, + string inputData = null) : base(description) { this.Expression = expr ?? throw new ArgumentNullException($"{nameof(expr)} must not be null."); this.skipVerification = skipVerification; this.expressionStr = expressionStr; + this.inputData = inputData; } public static string FilterInputExpression(string input) @@ -656,11 +718,7 @@ public override void SerializeAsXml(XmlWriter xmlWriter) throw new ArgumentNullException($"{nameof(xmlWriter)} cannot be null."); } - if (this.expressionStr == null) - { - this.expressionStr = LinqTestInput.FilterInputExpression(this.Expression.Body.ToString()); - } - + this.expressionStr ??= LinqTestInput.FilterInputExpression(this.Expression.Body.ToString()); xmlWriter.WriteStartElement("Description"); xmlWriter.WriteCData(this.Description); @@ -678,7 +736,9 @@ public class LinqTestOutput : BaselineTestOutput internal static Regex newLine = new Regex("(\r\n|\r|\n)"); internal string SqlQuery { get; } - internal string ErrorMessage { get; private set; } + internal string ErrorMessage { get; } + internal string Results { get; } + internal string InputData { get; } private static readonly Dictionary newlineKeywords = new Dictionary() { { "SELECT", "\nSELECT" }, @@ -704,10 +764,12 @@ public static string FormatErrorMessage(string msg) return msg; } - internal LinqTestOutput(string sqlQuery, string errorMsg = null) + internal LinqTestOutput(string sqlQuery, string serializedResults, string errorMsg, string inputData) { this.SqlQuery = FormatSql(sqlQuery); + this.Results = serializedResults; this.ErrorMessage = errorMsg; + this.InputData = inputData; } public static String FormatSql(string sqlQuery) @@ -740,7 +802,7 @@ public static String FormatSql(string sqlQuery) } else if (tokens[i].StartsWith(endCue, StringComparison.OrdinalIgnoreCase)) { - indentSb.Length = indentSb.Length - oneTab.Length; + indentSb.Length -= oneTab.Length; } sb.Append(indentSb).Append(tokens[i]).Append("\n"); @@ -754,6 +816,18 @@ public override void SerializeAsXml(XmlWriter xmlWriter) xmlWriter.WriteStartElement(nameof(this.SqlQuery)); xmlWriter.WriteCData(this.SqlQuery); xmlWriter.WriteEndElement(); + if (this.InputData != null) + { + xmlWriter.WriteStartElement("InputData"); + xmlWriter.WriteCData(this.InputData); + xmlWriter.WriteEndElement(); + } + if (this.Results != null) + { + xmlWriter.WriteStartElement("Results"); + xmlWriter.WriteCData(this.Results); + xmlWriter.WriteEndElement(); + } if (this.ErrorMessage != null) { xmlWriter.WriteStartElement("ErrorMessage"); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationWithCustomSerializerBaseline.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationWithCustomSerializerBaseline.cs new file mode 100644 index 0000000000..3266809926 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationWithCustomSerializerBaseline.cs @@ -0,0 +1,407 @@ +//----------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +//----------------------------------------------------------------------- +namespace Microsoft.Azure.Cosmos.Services.Management.Tests.LinqProviderTests +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Linq.Dynamic; + using System.Runtime.Serialization; + using System.Text.Json; + using System.Text.Json.Serialization; + using System.Threading.Tasks; + using BaselineTest; + using global::Azure.Core.Serialization; + using Microsoft.Azure.Cosmos.SDK.EmulatorTests; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + + [SDK.EmulatorTests.TestClass] + public class LinqTranslationWithCustomSerializerBaseline : BaselineTests + { + private static CosmosClient CosmosClient; + private static Database TestDb; + private static Container TestContainer; + + private const int RecordCount = 3; + private const int MaxValue = 500; + private const int MaxStringLength = 100; + private const int PropertyCount = 4; + + [ClassInitialize] + public async static Task Initialize(TestContext textContext) + { + CosmosClient = TestCommon.CreateCosmosClient((cosmosClientBuilder) + => cosmosClientBuilder.WithCustomSerializer(new SystemTextJsonSerializer(new JsonSerializerOptions()))); + + string dbName = $"{nameof(LinqTranslationBaselineTests)}-{Guid.NewGuid():N}"; + TestDb = await CosmosClient.CreateDatabaseAsync(dbName); + } + + [ClassCleanup] + public async static Task Cleanup() + { + if (TestDb != null) + { + await TestDb.DeleteStreamAsync(); + } + } + + [TestInitialize] + public async Task TestInitialize() + { + TestContainer = await TestDb.CreateContainerAsync(new ContainerProperties(id: Guid.NewGuid().ToString(), partitionKeyPath: "/Pk")); + } + + [TestCleanup] + public async Task TestCleanup() + { + await TestContainer.DeleteContainerStreamAsync(); + } + + public override LinqTestOutput ExecuteTest(LinqTestInput input) + { + return LinqTestsCommon.ExecuteTest(input, serializeResultsInBaseline: true); + } + + [TestMethod] + public void TestMemberInitializerDotNet() + { + Func> getQueryCamelCase; + Func> getQueryDefault; + (getQueryCamelCase, getQueryDefault) = this.InsertDataAndGetQueryables(); + + string insertedData = this.GetInsertedData().Result; + + List inputs = new List(); + foreach (bool useCamelCaseSerializer in new bool[] { true, false }) + { + Func> getQuery = useCamelCaseSerializer ? getQueryCamelCase : getQueryDefault; + + List camelCaseSettingInputs = new List + { + // TODO (10/13/23): extend this and other tests cases as more LINQ features are added (GROUP BY, etc.) + new LinqTestInput("Filter w/ constant value, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Where(doc => doc.NumericField == 1), skipVerification : true, inputData: insertedData), + new LinqTestInput("Filter w/ DataObject initializer with constant value, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Where(doc => doc == new DataObjectDotNet() { NumericField = 1, StringField = "1" }), skipVerification : true, inputData: insertedData), + new LinqTestInput("Select w/ DataObject initializer, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Select(doc => new DataObjectDotNet() { NumericField = 1, StringField = "1" }), skipVerification : true, inputData: insertedData), + new LinqTestInput("Deeper than top level reference, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Select(doc => doc.NumericField > 1 ? new DataObjectDotNet() { NumericField = 1, StringField = "1" } : new DataObjectDotNet() { NumericField = 1, StringField = "1" }), skipVerification : true, inputData: insertedData), + + // Negative test case: serializing only field name using custom serializer not currently supported + new LinqTestInput("Filter w/ DataObject initializer with member initialization, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Where(doc => doc == new DataObjectDotNet() { NumericField = doc.NumericField, StringField = doc.StringField }).Select(b => "A"), skipVerification : true, inputData: insertedData) + }; + + inputs.AddRange(camelCaseSettingInputs); + } + + this.ExecuteTestSuite(inputs); + } + + [TestMethod] + public void TestMemberInitializerNewtonsoft() + { + Func> getQueryCamelCase; + Func> getQueryDefault; + (getQueryCamelCase, getQueryDefault) = this.InsertDataAndGetQueryables(); + + string insertedData = this.GetInsertedData().Result; + + List inputs = new List(); + foreach (bool useCamelCaseSerializer in new bool[] { true, false }) + { + Func> getQuery = useCamelCaseSerializer ? getQueryCamelCase : getQueryDefault; + + List camelCaseSettingInputs = new List + { + new LinqTestInput("Filter w/ constant value, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Where(doc => doc.NumericField == 1), skipVerification : true, inputData: insertedData), + new LinqTestInput("Filter w/ DataObject initializer with constant value, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Where(doc => doc == new DataObjectNewtonsoft() { NumericField = 1, StringField = "1" }), skipVerification : true, inputData: insertedData), + new LinqTestInput("Select w/ DataObject initializer, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Select(doc => new DataObjectNewtonsoft() { NumericField = 1, StringField = "1" }), skipVerification : true, inputData: insertedData), + new LinqTestInput("Deeper than top level reference, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Select(doc => doc.NumericField > 1 ? new DataObjectNewtonsoft() { NumericField = 1, StringField = "1" } : new DataObjectNewtonsoft() { NumericField = 1, StringField = "1" }), skipVerification : true, inputData: insertedData), + + // Negative test case: serializing only field name using custom serializer not currently supported + new LinqTestInput("Filter w/ DataObject initializer with member initialization, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Where(doc => doc == new DataObjectNewtonsoft() { NumericField = doc.NumericField, StringField = doc.StringField }).Select(b => "A"), skipVerification : true, inputData: insertedData) + }; + + inputs.AddRange(camelCaseSettingInputs); + } + + this.ExecuteTestSuite(inputs); + } + + [TestMethod] + public void TestMemberInitializerDataMember() + { + Func> getQueryCamelCase; + Func> getQueryDefault; + (getQueryCamelCase, getQueryDefault) = this.InsertDataAndGetQueryables(); + + string insertedData = this.GetInsertedData().Result; + + List inputs = new List(); + foreach (bool useCamelCaseSerializer in new bool[] { true, false }) + { + Func> getQuery = useCamelCaseSerializer ? getQueryCamelCase : getQueryDefault; + + List camelCaseSettingInputs = new List + { + new LinqTestInput("Filter w/ constant value, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Where(doc => doc.NumericField == 1), skipVerification : true, inputData: insertedData), + new LinqTestInput("Filter w/ DataObject initializer with constant value, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Where(doc => doc == new DataObjectDataMember() { NumericField = 1, StringField = "1" }), skipVerification : true, inputData: insertedData), + new LinqTestInput("Select w/ DataObject initializer, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Select(doc => new DataObjectDataMember() { NumericField = 1, StringField = "1" }), skipVerification : true, inputData: insertedData), + new LinqTestInput("Deeper than top level reference, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Select(doc => doc.NumericField > 1 ? new DataObjectDataMember() { NumericField = 1, StringField = "1" } : new DataObjectDataMember() { NumericField = 1, StringField = "1" }), skipVerification : true, inputData: insertedData), + + // Negative test case: serializing only field name using custom serializer not currently supported + new LinqTestInput("Filter w/ DataObject initializer with member initialization, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Where(doc => doc == new DataObjectDataMember() { NumericField = doc.NumericField, StringField = doc.StringField }).Select(b => "A"), skipVerification : true, inputData: insertedData) + }; + + inputs.AddRange(camelCaseSettingInputs); + } + + this.ExecuteTestSuite(inputs); + } + + [TestMethod] + public void TestMemberInitializerMultiSerializer() + { + Func> getQueryCamelCase; + Func> getQueryDefault; + (getQueryCamelCase, getQueryDefault) = this.InsertDataAndGetQueryables(); + + string insertedData = this.GetInsertedData().Result; + + List inputs = new List(); + foreach (bool useCamelCaseSerializer in new bool[] { true, false }) + { + Func> getQuery = useCamelCaseSerializer ? getQueryCamelCase : getQueryDefault; + + List camelCaseSettingInputs = new List + { + new LinqTestInput("Filter w/ constant value, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Where(doc => doc.NumericField == 1), skipVerification : true, inputData: insertedData), + new LinqTestInput("Filter w/ DataObject initializer with constant value, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Where(doc => doc == new DataObjectMultiSerializer() { NumericField = 1, StringField = "1" }), skipVerification : true, inputData: insertedData), + new LinqTestInput("Select w/ DataObject initializer, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Select(doc => new DataObjectMultiSerializer() { NumericField = 1, StringField = "1" }), skipVerification : true, inputData: insertedData), + new LinqTestInput("Deeper than top level reference, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Select(doc => doc.NumericField > 1 ? new DataObjectMultiSerializer() { NumericField = 1, StringField = "1" } : new DataObjectMultiSerializer() { NumericField = 1, StringField = "1" }), skipVerification : true, inputData: insertedData), + + // Negative test case: serializing only field name using custom serializer not currently supported + new LinqTestInput("Filter w/ DataObject initializer with member initialization, camelcase = " + useCamelCaseSerializer, b => getQuery(b).Where(doc => doc == new DataObjectMultiSerializer() { NumericField = doc.NumericField, StringField = doc.StringField }).Select(b => "A"), skipVerification : true, inputData: insertedData) + }; + + inputs.AddRange(camelCaseSettingInputs); + } + + this.ExecuteTestSuite(inputs); + } + + private (Func>, Func>) InsertDataAndGetQueryables() where T : LinqTestObject + { + static T createDataObj(int index, bool camelCase) + { + T obj = (T)Activator.CreateInstance(typeof(T), new object[] + { + index, index.ToString(), $"{index}-{camelCase}", "Test" + }); + return obj; + } + + Func> getQueryCamelCase = LinqTestsCommon.GenerateSerializationTestCosmosData(createDataObj, RecordCount, TestContainer, camelCaseSerialization: true); + Func> getQueryDefault = LinqTestsCommon.GenerateSerializationTestCosmosData(createDataObj, RecordCount, TestContainer, camelCaseSerialization: false); + + return (getQueryCamelCase, getQueryDefault); + } + + private async Task GetInsertedData() + { + List insertedDataList = new List(); + using (FeedIterator feedIterator = TestContainer.GetItemQueryStreamIterator("SELECT * FROM c")) + { + while (feedIterator.HasMoreResults) + { + using (ResponseMessage response = await feedIterator.ReadNextAsync()) + { + response.EnsureSuccessStatusCode(); + using (StreamReader streamReader = new StreamReader(response.Content)) + using (JsonTextReader jsonTextReader = new JsonTextReader(streamReader)) + { + // manual parsing of response object to preserve property names + JObject queryResponseObject = await JObject.LoadAsync(jsonTextReader); + IEnumerable info = queryResponseObject["Documents"].AsEnumerable(); + + foreach (JToken docToken in info) + { + string documentString = "{"; + for (int index = 0; index < PropertyCount; index++) + { + documentString += index == 0 ? String.Empty : ", "; + documentString += docToken.ElementAt(index).ToString(); + } + documentString += "}"; + insertedDataList.Add(documentString); + } + } + } + } + } + + string insertedData = JsonConvert.SerializeObject(insertedDataList.Select(item => item), new JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented }); + return insertedData; + } + + private class SystemTextJsonSerializer : CosmosSerializer + { + private readonly JsonObjectSerializer systemTextJsonSerializer; + + public SystemTextJsonSerializer(JsonSerializerOptions jsonSerializerOptions) + { + this.systemTextJsonSerializer = new JsonObjectSerializer(jsonSerializerOptions); + } + + public override T FromStream(Stream stream) + { + if (stream == null) + throw new ArgumentNullException(nameof(stream)); + + using (stream) + { + if (stream.CanSeek && stream.Length == 0) + { + return default; + } + + if (typeof(Stream).IsAssignableFrom(typeof(T))) + { + return (T)(object)stream; + } + + return (T)this.systemTextJsonSerializer.Deserialize(stream, typeof(T), default); + } + } + + public override Stream ToStream(T input) + { + MemoryStream streamPayload = new MemoryStream(); + this.systemTextJsonSerializer.Serialize(streamPayload, input, typeof(T), default); + streamPayload.Position = 0; + return streamPayload; + } + } + + private class DataObjectDotNet : LinqTestObject + { + [JsonPropertyName("numberValueDotNet")] + public double NumericField { get; set; } + + [JsonPropertyName("stringValueDotNet")] + public string StringField { get; set; } + + public string id { get; set; } + + public string Pk { get; set; } + + public DataObjectDotNet() { } + + public DataObjectDotNet(double numericField, string stringField, string id, string pk) + { + this.NumericField = numericField; + this.StringField = stringField; + this.id = id; + this.Pk = pk; + } + + public override string ToString() + { + return $"{{NumericField:{this.NumericField},StringField:{this.StringField},id:{this.id},Pk:{this.Pk}}}"; + } + } + + private class DataObjectNewtonsoft : LinqTestObject + { + [Newtonsoft.Json.JsonProperty(PropertyName = "NumberValueNewtonsoft")] + public double NumericField { get; set; } + + [Newtonsoft.Json.JsonProperty(PropertyName = "StringValueNewtonsoft")] + public string StringField { get; set; } + + public string id { get; set; } + + public string Pk { get; set; } + + public DataObjectNewtonsoft() { } + + public DataObjectNewtonsoft(double numericField, string stringField, string id, string pk) + { + this.NumericField = numericField; + this.StringField = stringField; + this.id = id; + this.Pk = pk; + } + + public override string ToString() + { + return $"{{NumericField:{this.NumericField},StringField:{this.StringField},id:{this.id},Pk:{this.Pk}}}"; + } + } + + [DataContract] + private class DataObjectDataMember : LinqTestObject + { + [DataMember(Name = "NumericFieldDataMember")] + public double NumericField { get; set; } + + [DataMember(Name = "StringFieldDataMember")] + public string StringField { get; set; } + + [DataMember(Name = "id")] + public string id { get; set; } + + [DataMember(Name = "Pk")] + public string Pk { get; set; } + + public DataObjectDataMember() { } + + public DataObjectDataMember(double numericField, string stringField, string id, string pk) + { + this.NumericField = numericField; + this.StringField = stringField; + this.id = id; + this.Pk = pk; + } + + public override string ToString() + { + return $"{{NumericField:{this.NumericField},StringField:{this.StringField},id:{this.id},Pk:{this.Pk}}}"; + } + } + + private class DataObjectMultiSerializer : LinqTestObject + { + [Newtonsoft.Json.JsonProperty(PropertyName = "NumberValueNewtonsoft")] + [JsonPropertyName("numberValueDotNet")] + public double NumericField { get; set; } + + [Newtonsoft.Json.JsonProperty(PropertyName = "StringValueNewtonsoft")] + [JsonPropertyName("stringValueDotNet")] + public string StringField { get; set; } + + public string id { get; set; } + + public string Pk { get; set; } + + public DataObjectMultiSerializer() { } + + public DataObjectMultiSerializer(double numericField, string stringField, string id, string pk) + { + this.NumericField = numericField; + this.StringField = stringField; + this.id = id; + this.Pk = pk; + } + + public override string ToString() + { + return $"{{NumericField:{this.NumericField},StringField:{this.StringField},id:{this.id},Pk:{this.Pk}}}"; + } + } + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj index 30c29ec5db..7ff30b3cee 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj @@ -1,4 +1,4 @@ - + true true @@ -38,6 +38,10 @@ + + + + @@ -251,7 +255,19 @@ PreserveNewest - PreserveNewest + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest PreserveNewest From a0fb14f1a67a72ee8a0ddfff6f2e759624fe1993 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Thu, 19 Oct 2023 17:05:15 +0530 Subject: [PATCH 217/240] Release 3.36.0 : Fixes Client Telemetry Release Test (#4132) * Client Telemetry Release test fix * get endpoint from env variable * read client telemetry endpoint service from env * updated yaml --- .../ClientTelemetryReleaseTests.cs | 2 -- .../ClientTelemetryTestsBase.cs | 4 +--- azure-pipelines-official.yml | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryReleaseTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryReleaseTests.cs index 7a54f490c0..07230e63a8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryReleaseTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryReleaseTests.cs @@ -4,11 +4,9 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests { - using System; using System.Net.Http; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Fluent; - using Microsoft.Azure.Cosmos.Telemetry; using Microsoft.VisualStudio.TestTools.UnitTesting; /// diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs index 3bb8a53c0c..85e3496731 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs @@ -15,11 +15,9 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Telemetry; - using Microsoft.Azure.Cosmos.Handler; using Microsoft.Azure.Documents; using Newtonsoft.Json.Linq; using Newtonsoft.Json; - using Documents.Rntbd; using System.Globalization; using System.Linq; using Cosmos.Util; @@ -27,7 +25,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests public abstract class ClientTelemetryTestsBase : BaseCosmosClientHelper { - protected static readonly Uri telemetryServiceEndpoint = new Uri("http://dummy.telemetry.service/api/url"); + protected static readonly Uri telemetryServiceEndpoint = new Uri(ConfigurationManager.GetEnvironmentVariable("CLIENT_TELEMETRY_SERVICE_ENDPOINT", "https://dummy.url/api/clienttelemetry")); private static readonly List preferredRegionList = new List { diff --git a/azure-pipelines-official.yml b/azure-pipelines-official.yml index db77d4b0fd..2410dfb61f 100644 --- a/azure-pipelines-official.yml +++ b/azure-pipelines-official.yml @@ -54,6 +54,7 @@ stages: testRunTitle: Microsoft.Azure.Cosmos.EmulatorTests env: COSMOSDB_ACCOUNT_CONNECTION_STRING: $(COSMOSDB_ACCOUNT_CONNECTION_STRING) # Real Account Connection String used by Integration Tests while running as part of release pipeline + CLIENT_TELEMETRY_SERVICE_ENDPOINT: $(CLIENT_TELEMETRY_SERVICE_ENDPOINT) # Client telemetry service url returned by configured account client config API - stage: displayName: Publish From e2ce570b38667373a31efc74abfcf00410b0e56f Mon Sep 17 00:00:00 2001 From: Maya Painter <130110800+Maya-Painter@users.noreply.github.com> Date: Thu, 19 Oct 2023 13:49:50 -0700 Subject: [PATCH 218/240] Update CosmosItemTests.cs (#4141) --- .../Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs index 860c780e41..75cf001b3b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs @@ -1286,7 +1286,7 @@ public async Task QuerySinglePartitionItemStreamTest(int perPKItemCount, int max Newtonsoft.Json.JsonSerializer serializer = new Newtonsoft.Json.JsonSerializer(); ServerSideCumulativeMetrics metrics = response.Diagnostics.GetQueryMetrics(); - Assert.IsTrue(metrics.PartitionedMetrics.Count == 1); + Assert.IsTrue(metrics.PartitionedMetrics.Count > 0); Assert.IsTrue(metrics.CumulativeMetrics.TotalTime > TimeSpan.Zero); Assert.IsTrue(metrics.CumulativeMetrics.QueryPreparationTime > TimeSpan.Zero); @@ -3604,4 +3604,4 @@ private static async Task TestNonePKForNonExistingContainer(Container container) } } } -} \ No newline at end of file +} From b8d9225b986e49b40ca8421846b79d0050a6e6de Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 24 Oct 2023 00:21:57 +0530 Subject: [PATCH 219/240] Release 3.36.0: Fixes client config test and preview pipeline (#4149) (#4150) * Fixed client cpnfig test and preview pipeline * fix telemertry service step --- .../ClientConfigurationDiagnosticTest.cs | 7 +++++- azure-pipelines-official.yml | 22 +++++++++---------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs index 50b0125338..9a5c4255a7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientConfigurationDiagnosticTest.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; + using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; @@ -45,7 +46,11 @@ public async Task ClientConfigTest() ItemResponse response = await this.Container.CreateItemAsync(testItem, new Cosmos.PartitionKey(testItem.pk)); Assert.IsNotNull(response.Diagnostics); ITrace trace = ((CosmosTraceDiagnostics)response.Diagnostics).Value; - Assert.AreEqual(trace.Data.Count, 1); +#if PREVIEW + Assert.AreEqual(trace.Data.Count, 2, string.Join(",", trace.Data.Select(a => $"{a.Key}: {a.Value}"))); // Distributed Tracing Id +#else + Assert.AreEqual(trace.Data.Count, 1, string.Join(",", trace.Data.Select(a => $"{a.Key}: {a.Value}"))); +#endif ClientConfigurationTraceDatum clientConfigurationTraceDatum = (ClientConfigurationTraceDatum)trace.Data["Client Configuration"]; Assert.IsNotNull(clientConfigurationTraceDatum.UserAgentContainer.UserAgent); } diff --git a/azure-pipelines-official.yml b/azure-pipelines-official.yml index 2410dfb61f..4fad394780 100644 --- a/azure-pipelines-official.yml +++ b/azure-pipelines-official.yml @@ -4,10 +4,9 @@ pr: none variables: ReleaseArguments: ' --filter "TestCategory!=Quarantine" --verbosity normal ' - VmImage: windows-latest # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops BuildConfiguration: Release Packaging.EnableSBOMSigning: true - OS: 'Windows' + VmImage: windows-latest # https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops stages: - stage: @@ -15,19 +14,18 @@ stages: jobs: - template: templates/static-tools.yml parameters: - BuildConfiguration: $(BuildConfiguration) - VmImage: $(VmImage) + BuildConfiguration: '${{ variables.BuildConfiguration }}' + VmImage: '${{ variables.VmImage }}' - template: templates/build-test.yml parameters: - BuildConfiguration: $(BuildConfiguration) - Arguments: $(ReleaseArguments) - VmImage: $(VmImage) + BuildConfiguration: '${{ variables.BuildConfiguration }}' + Arguments: '${{ variables.ReleaseArguments }}' + VmImage: '${{ variables.VmImage }}' - job: - displayName: TelemetryToService $(BuildConfiguration) + displayName: TelemetryToService ${{ variables.BuildConfiguration }} timeoutInMinutes: 120 - condition: and(succeeded(), eq('$(OS)', 'Windows')) pool: vmImage: windows-2019 @@ -48,7 +46,7 @@ stages: inputs: command: test projects: 'Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/*.csproj' - arguments: --filter "TestCategory=ClientTelemetryRelease" --verbosity normal --configuration $(BuildConfiguration) /p:OS=$(OS) + arguments: --filter "TestCategory=ClientTelemetryRelease" --verbosity normal --configuration ${{ variables.BuildConfiguration }} /p:OS=Windows nugetConfigPath: NuGet.config publishTestResults: true testRunTitle: Microsoft.Azure.Cosmos.EmulatorTests @@ -62,7 +60,7 @@ stages: - template: templates/nuget-pack.yml parameters: BuildConfiguration: Release - VmImage: $(VmImage) + VmImage: '${{ variables.VmImage }}' ReleasePackage: true - OutputPath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/$(BuildConfiguration)/Microsoft.Azure.Cosmos' + OutputPath: '$(Build.ArtifactStagingDirectory)/bin/AnyCPU/Release/Microsoft.Azure.Cosmos' BlobVersion: $(BlobVersion) \ No newline at end of file From 6de10ddc98d45440d7fd334a55b2f1d171785f28 Mon Sep 17 00:00:00 2001 From: Aditya Date: Tue, 24 Oct 2023 10:07:57 -0700 Subject: [PATCH 220/240] Query : Fixes querying conflicts (#4100) * Initial commit * Update * Updated the test * Updated the test * Sample fix; to validate Suite0. * Skipped the ConflictsTest (which depends on azure cosmosdb account) * Addressed comments * Added Unit Test. * Reverted unnecessary change. --- .../src/Query/v3Query/QueryIterator.cs | 10 +- .../Resource/Container/ContainerCore.Items.cs | 12 +- .../Query/ConflictsE2ETest.cs | 313 ++++++++++++++++++ .../CosmosConflictTests.cs | 45 ++- 4 files changed, 370 insertions(+), 10 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/ConflictsE2ETest.cs diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs index 7dfcea9818..49407f7a4c 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs @@ -6,7 +6,7 @@ namespace Microsoft.Azure.Cosmos.Query { using System; using System.Collections.Generic; - using System.Linq; + using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.CosmosElements; @@ -67,7 +67,8 @@ public static QueryIterator Create( bool isContinuationExpected, bool allowNonValueAggregateQuery, bool forcePassthrough, - PartitionedQueryExecutionInfo partitionedQueryExecutionInfo) + PartitionedQueryExecutionInfo partitionedQueryExecutionInfo, + Documents.ResourceType resourceType) { if (queryRequestOptions == null) { @@ -77,7 +78,7 @@ public static QueryIterator Create( Guid correlatedActivityId = Guid.NewGuid(); CosmosQueryContextCore cosmosQueryContext = new CosmosQueryContextCore( client: client, - resourceTypeEnum: Documents.ResourceType.Document, + resourceTypeEnum: resourceType, operationType: Documents.OperationType.Query, resourceType: typeof(QueryResponseCore), resourceLink: resourceLink, @@ -90,7 +91,8 @@ public static QueryIterator Create( containerCore, client, correlatedActivityId, - queryRequestOptions); + queryRequestOptions, + resourceType: resourceType); DocumentContainer documentContainer = new DocumentContainer(networkAttachedDocumentContainer); CosmosElement requestContinuationToken; diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs index fd9ad03b53..7bca68c8c8 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs @@ -375,7 +375,8 @@ public override async Task TryExecuteQueryAsync( isContinuationExpected: false, allowNonValueAggregateQuery: true, forcePassthrough: true, // Forcing a passthrough, since we don't want to get the query plan nor try to rewrite it. - partitionedQueryExecutionInfo: null); + partitionedQueryExecutionInfo: null, + resourceType: ResourceType.Document); return new QueryPlanIsSupportedResult(passthroughQueryIterator); } @@ -438,7 +439,8 @@ public override async Task TryExecuteQueryAsync( isContinuationExpected: false, allowNonValueAggregateQuery: true, forcePassthrough: false, - partitionedQueryExecutionInfo: queryPlan); + partitionedQueryExecutionInfo: queryPlan, + resourceType: ResourceType.Document); tryExecuteQueryResult = new QueryPlanIsSupportedResult(queryIterator); } @@ -834,7 +836,8 @@ public override FeedIteratorInternal GetItemQueryStreamIteratorInternal( isContinuationExpected: isContinuationExcpected, allowNonValueAggregateQuery: true, forcePassthrough: false, - partitionedQueryExecutionInfo: null); + partitionedQueryExecutionInfo: null, + resourceType: ResourceType.Document); } public override FeedIteratorInternal GetReadFeedIterator( @@ -872,7 +875,8 @@ public override FeedIteratorInternal GetReadFeedIterator( isContinuationExpected: false, allowNonValueAggregateQuery: true, forcePassthrough: false, - partitionedQueryExecutionInfo: null); + partitionedQueryExecutionInfo: null, + resourceType: resourceType); } else { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/ConflictsE2ETest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/ConflictsE2ETest.cs new file mode 100644 index 0000000000..0edd95b22d --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/ConflictsE2ETest.cs @@ -0,0 +1,313 @@ +namespace Microsoft.Azure.Cosmos.EmulatorTests.Query +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Net; + using System.Threading; + using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.CosmosElements; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + /// + /// This is an end to end test that requires connecting to azure cosmos db accounts. + /// + [TestClass] + public class ConflictsE2ETest + { + private const int MaxRetries = 10; + + private const string Database = "Microsoft.Azure.Cosmos.EmulatorTests.Conflicts"; + private const string Collection = "ConflictsTest"; + private const string Key = ""; + private static readonly Endpoint Endpoint1 = new Endpoint("", ConnectionMode.Direct); + private static readonly Endpoint Endpoint2 = new Endpoint("", ConnectionMode.Direct); + + private class Endpoint + { + public Endpoint(string url, ConnectionMode connectionMode) + { + this.Url = url; + this.ConnectionMode = connectionMode; + } + + public ConnectionMode ConnectionMode { get; } + + public string Url { get; } + } + + /// + /// Tests querying conflicts in a cosmosdb collection. + /// + /// + /// This test uses ConflictsTestSettings.json for test configuration. + /// 1. An actual cosmosdb account in Azure is required for this test to run since none of the emulators do not allow for required test setup. + /// 2. Test setup will create a well known database (drop if it exists) and collection. + /// 3. The conditions for generating a conflict are subject to backend non-determinism. For increasing chances of generating a conflict: + /// - Ensure that the account is set to use eventual consistency + /// - Use more than 2 regions in the configuration. + /// + /// + [Ignore] + [TestMethod] + public async Task TestConflicts() + { + Assert.IsTrue(!string.IsNullOrWhiteSpace(Key), "Please specify a valid key"); + + IReadOnlyList<(CosmosClient Client, Container Container)> cosmosContainers = await this.CreateDatabaseAndContainer( + Database, + Collection, + Key, + Endpoint1, + Endpoint2); + + await this.InsertWithoutConflict(cosmosContainers); + await this.InsertWithConflict(cosmosContainers); + await this.VerifyConflict(cosmosContainers); + } + + private async Task VerifyConflict(IReadOnlyList<(CosmosClient Client, Container Container)> cosmosContainers) + { + List> conflictsUsingDefaultIterator = await this.GetConflictsUsingDefaultIterator(cosmosContainers); + List> conflictsUsingQueryWithoutOptions = await this.GetConflictsUsingQueryWithoutOptions(cosmosContainers); + + Assert.AreEqual(conflictsUsingDefaultIterator.Count, conflictsUsingQueryWithoutOptions.Count, "Conflict count should be identical"); + for (int i = 0; i < conflictsUsingDefaultIterator.Count; i++) + { + Assert.AreEqual(string.Join(",", conflictsUsingDefaultIterator[i].ToString()), string.Join(",", conflictsUsingQueryWithoutOptions[i].ToString())); + } + } + + private async Task>> GetConflictsUsingQueryWithoutOptions(IReadOnlyList<(CosmosClient Client, Container Container)> cosmosContainers) + => await this.GetConflicts( + cosmosContainers, + query: @"SELECT * FROM c", + options: null); + + private async Task>> GetConflictsUsingDefaultIterator(IReadOnlyList<(CosmosClient Client, Container Container)> cosmosContainers) + => await this.GetConflicts(cosmosContainers, query: null, options: null); + + private async Task>> GetConflicts( + IReadOnlyList<(CosmosClient Client, Container Container)> cosmosContainers, + string query, + QueryRequestOptions options) + { + List> allConflicts = new List>(); + foreach ((CosmosClient client, Container container) pair in cosmosContainers) + { + List clientReportedConflicts = new List(); + FeedIterator iterator = pair.container.Conflicts.GetConflictQueryIterator(queryText: query, requestOptions: options); + while (iterator.HasMoreResults) + { + FeedResponse page = await iterator.ReadNextAsync(); + clientReportedConflicts.AddRange(page); + } + + allConflicts.Add(clientReportedConflicts); + } + + // Ideally each client will observe exactly 1 conflict. However this is dependent upon regional (eventual) consistency and underlying race condition with this test. + Assert.IsTrue(allConflicts.Any(list => list.Count == 1), "Exactly 1 conflict is expected!"); + + return allConflicts; + } + + /// + /// Inserts a document that is guaranteed to not conflict with any other. + /// + private async Task InsertWithoutConflict(IReadOnlyList<(CosmosClient Client, Container Container)> cosmosContainers) + => await this.InsertFromMultipleClients( + cosmosContainers, + payloadFormat: @"{{""id"" : ""NoConflict_{0}"", ""type"":""noconflict"", ""pk"":""1""}}", + clientFilter: clientIndex => clientIndex == 0); + + /// + /// Insert documents until exactly one conflict is generated. + /// This is a non-deterministic operation (in terms of both duration and outcome) due to backend's behavior. + /// It will terminate the test based on simple heuristic if desired outcome cannot be achieved. + /// + private async Task InsertWithConflict(IReadOnlyList<(CosmosClient Client, Container Container)> cosmosContainers) + => await this.InsertFromMultipleClients( + cosmosContainers, + payloadFormat: @"{{""id"" : ""Conflict_{0}"", ""type"":""conflict"", ""pk"":""1"", ""index"":{1}}}"); + + /// + /// Inserts items from multiple clients. + /// + /// Containers to insert documents to. + /// Format of the document with placeholders for insertion iteration (one round across all clients) and optional client index. + /// Optional filter that determines whether a client should be used for insertion. + /// + private async Task InsertFromMultipleClients( + IReadOnlyList<(CosmosClient Client, Container Container)> cosmosContainers, + string payloadFormat, + Func clientFilter = null) + { + PartitionKey partitionKey = new PartitionKey("1"); + bool retry = true; + int i = 0; + + // To offset the backend specific non-determinism, we change the order in which we use containers to create the items. + // Other mitigations to explore include having more than 2 regions and ordering those randomly while creating items. + IEnumerable containersInOrder = cosmosContainers.Select(pair => pair.Container); + IEnumerable containersInReverseOrder = cosmosContainers.Reverse().Select(pair => pair.Container); + while (retry) + { + int clientIndex = 0; + List responses = new List(); + IEnumerable containers = + i % 2 == 1 ? + containersInOrder : + containersInReverseOrder; + foreach (Container container in containers) + { + bool useClient = clientFilter == null || clientFilter(clientIndex); + if (useClient) + { + ResponseMessage response = await this.CreateItem( + container, + string.Format(payloadFormat, i, clientIndex), + partitionKey); + responses.Add(response); + } + + clientIndex++; + } + + Assert.IsTrue(responses.Count > 0, "At least one client should attempt document creation!"); + + // Sometimes the conflicts may be detected (and rejected) by the backend with status code = Conflict synchronously with the request. + // We keep retrying until all clients are able to "successfully" create item in the backend which will be later detected as conflict. + retry = responses.Any(response => response.StatusCode != HttpStatusCode.Created); + i++; + + // Even with the measures above, the conflicts may continue to get detected (and rejected) by the backend perpetually in a synchronous manner. + // After 3000 tries (which can take upto 5 minutes for 2 regions), we determine that the test is inconclusive, since the setup failed. + if (i > 3000) + { + string expectedResponses = string.Join(",", Enumerable.Repeat("Created", cosmosContainers.Count)); + string actualResponses = string.Join(",", responses.Select(response => response.StatusCode.ToString())); + Assert.Fail($@"Document insertion failed after 3000 tries. Please rerun the test. Expected responses : ""{expectedResponses}"". Actual responses : ""{actualResponses}""."); + } + } + } + + private async Task CreateItem(Container container, string payload, PartitionKey partitionKey) + { + return await this.ExecuteOperationWithRetry( + MaxRetries, + () => container.CreateItemStreamAsync( + this.ToStream(payload), + partitionKey), + // Since the test also creates the database and document collection, first few read/write operations on the collection can return NotFound. + responseMessage => responseMessage.StatusCode == HttpStatusCode.NotFound); + } + + private Stream ToStream(string stringValue) + { + MemoryStream stream = new(); + StreamWriter writer = new(stream); + writer.Write(stringValue); + writer.Flush(); + stream.Position = 0; + return stream; + } + + /// + /// Instantiates client and container pointing to each region. Creates (drops if exists) database, container using one region's connections. + /// + /// Returns the CosmosClient and Container pointing to each region. + private async Task> CreateDatabaseAndContainer( + string database, + string collection, + string key, + params Endpoint[] endpoints) + { + Assert.IsTrue(endpoints?.Length > 1, "At least one endpoint must be specified"); + + HashSet endpointSet = new HashSet(endpoints.Select(endpoint => endpoint.Url)); + Assert.AreEqual(endpoints.Length, endpointSet.Count, "Please specify unique endpoints!"); + + int endpointIndex = 0; + List<(CosmosClient Client, Container Container)> clients = new(); + foreach (Endpoint endpoint in endpoints) + { + CosmosClient client = new CosmosClient(endpoint.Url, key, new CosmosClientOptions { ConnectionMode = endpoint.ConnectionMode }); + + if (endpointIndex == 0) + { + ConsistencyLevel consistencyLevel = await client.GetAccountConsistencyLevelAsync(); + Assert.AreEqual(ConsistencyLevel.Eventual, consistencyLevel, "Only account with eventual consistency is supported by this test."); + } + + DatabaseResponse databaseResponse = await this.ExecuteOperationWithRetry( + MaxRetries, + () => client.CreateDatabaseIfNotExistsAsync(database)); + if (endpointIndex == 0 && databaseResponse.StatusCode == HttpStatusCode.OK) + { + await databaseResponse.Database.DeleteAsync(); + databaseResponse = await this.ExecuteOperationWithRetry( + MaxRetries, + () => client.CreateDatabaseIfNotExistsAsync(database)); + } + + HttpStatusCode expectedStatus = endpointIndex == 0 ? HttpStatusCode.Created : HttpStatusCode.OK; + Assert.AreEqual(expectedStatus, databaseResponse.StatusCode, + $"Endpoint#: {endpointIndex}, Endpoint : {endpoint.Url}. CreateDatabaseIfNotExistsAsync received unexpected response."); + + ContainerResponse containerResponse = await this.ExecuteOperationWithRetry( + MaxRetries, + () => databaseResponse.Database.CreateContainerIfNotExistsAsync( + new ContainerProperties(collection, "/pk") + { + ConflictResolutionPolicy = new ConflictResolutionPolicy() { Mode = ConflictResolutionMode.Custom } + })); + Assert.AreEqual(expectedStatus, databaseResponse.StatusCode, + $"Endpoint#: {endpointIndex}, Endpoint : {endpoint.Url}. CreateContainerIfNotExistsAsync received unexpected response."); + + clients.Add((client, containerResponse.Container)); + endpointIndex++; + } + + return clients; + } + + private async Task ExecuteOperationWithRetry(int maxRetryCount, Func> operation, Func shouldRetryWithoutException = null) + { + for (int i = 0; i < maxRetryCount; i++) + { + try + { + T result = await operation(); + if (shouldRetryWithoutException != null && shouldRetryWithoutException(result)) + { + if (i + 1 < maxRetryCount) + { + await Task.Delay(i * 1000); + continue; + } + + break; + } + + return result; + } + catch (Exception ex) + { + Console.WriteLine($"Attempt {i + 1}. Max Retries {maxRetryCount}. Exception: {ex}."); + if (i + 1 < maxRetryCount) + { + Thread.Sleep(i * 1000); + } + else + { + throw; + } + } + } + + throw new InvalidOperationException($"Operation failed after retries!"); + } + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosConflictTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosConflictTests.cs index 2bb48fc75b..50adab3aef 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosConflictTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosConflictTests.cs @@ -5,15 +5,19 @@ namespace Microsoft.Azure.Cosmos.Tests { using System; + using System.IO; + using System.Net; + using System.Text; using System.Threading; using System.Threading.Tasks; - using Microsoft.Azure.Documents; + using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.Handlers; using Microsoft.Azure.Cosmos.Routing; + using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Newtonsoft.Json.Linq; - using Microsoft.Azure.Cosmos.Tracing; [TestClass] public class CosmosConflictTests @@ -33,6 +37,43 @@ public async Task ConflictsFeedSetsPartitionKeyRangeIdentity() } } + [TestMethod] + public async Task QueryConflicts() + { + ContainerInternal container = CosmosConflictTests.GetMockedContainer(async (request, cancellationToken) => { + Assert.AreEqual(ResourceType.Conflict, request.ResourceType); + ResponseMessage responseMessage = new ResponseMessage(HttpStatusCode.OK) + { + Content = new MemoryStream(Encoding.UTF8.GetBytes(@"{ ""Conflicts"": [{ ""id"": ""Test""}]}")) + }; + return responseMessage; + }); + + { + FeedIterator iterator = container.Conflicts.GetConflictQueryIterator(); + while (iterator.HasMoreResults) + { + FeedResponse responseMessage = await iterator.ReadNextAsync(); + } + } + { + FeedIterator iterator = container.Conflicts.GetConflictQueryIterator("SELECT * FROM c"); + while (iterator.HasMoreResults) + { + FeedResponse responseMessage = await iterator.ReadNextAsync(); + } + } + { + FeedIterator iterator = container.Conflicts.GetConflictQueryIterator( + queryText: "SELECT * FROM c", + requestOptions: new QueryRequestOptions { MaxItemCount = 1 }); + while (iterator.HasMoreResults) + { + FeedResponse responseMessage = await iterator.ReadNextAsync(); + } + } + } + [TestMethod] public async Task ReadCurrentGetsCorrectRID() { From 8253befe99d92c489f8ca7ef6111511fb48dac6b Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 24 Oct 2023 23:40:21 +0530 Subject: [PATCH 221/240] Fixes changelog typo and date (#4155) --- changelog.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 8b08e37210..18cac46b8a 100644 --- a/changelog.md +++ b/changelog.md @@ -13,7 +13,7 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -### [3.36.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.36.0) - 2023-10-17 +### [3.36.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.36.0) - 2023-10-24 #### Fixed - [4039](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4039) GatewayAddressCache: Fixes Unobserved Exception During Background Address Refresh (#4039) @@ -30,7 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 > Note: Refer this [3983](https://github.com/Azure/azure-cosmos-dotnet-v3/issues/3983) for API signature and default values. - [4119](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4119) TriggerOperation: Adds Upsert Operation Support(#4119) -### [3.356.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.36.0-preview) - 2023-10-17 +### [3.36.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.36.0-preview) - 2023-10-24 #### Added - [4056](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4056) Client Telemetry: Adds new public APIs (#4056). WARNING: This is breaking change for preview SDK From 42cc6812489ce98b964ad54b90d68568ca67ba57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 19:05:30 +0000 Subject: [PATCH 222/240] Bump Azure.Identity in /Microsoft.Azure.Cosmos.Samples/Usage/Encryption (#4136) Bumps [Azure.Identity](https://github.com/Azure/azure-sdk-for-net) from 1.5.0 to 1.10.2. - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](https://github.com/Azure/azure-sdk-for-net/compare/Azure.Identity_1.5.0...Azure.Identity_1.10.2) --- updated-dependencies: - dependency-name: Azure.Identity dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Matias Quaranta --- .../Usage/Encryption/Encryption.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/Encryption/Encryption.csproj b/Microsoft.Azure.Cosmos.Samples/Usage/Encryption/Encryption.csproj index 75a2a94922..3d29248400 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/Encryption/Encryption.csproj +++ b/Microsoft.Azure.Cosmos.Samples/Usage/Encryption/Encryption.csproj @@ -8,7 +8,7 @@ latest - + From 083df87e6ebf8cfc25092e8642846f34273158f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 22:10:10 +0000 Subject: [PATCH 223/240] Bump Azure.Identity (#4135) Bumps [Azure.Identity](https://github.com/Azure/azure-sdk-for-net) from 1.5.0 to 1.10.2. - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](https://github.com/Azure/azure-sdk-for-net/compare/Azure.Identity_1.5.0...Azure.Identity_1.10.2) --- updated-dependencies: - dependency-name: Azure.Identity dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .../Usage/ReEncryption/ReEncryption.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/ReEncryption/ReEncryption.csproj b/Microsoft.Azure.Cosmos.Samples/Usage/ReEncryption/ReEncryption.csproj index e29aaac1ea..54c70c4ec6 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/ReEncryption/ReEncryption.csproj +++ b/Microsoft.Azure.Cosmos.Samples/Usage/ReEncryption/ReEncryption.csproj @@ -8,7 +8,7 @@ latest - + From a4836ff452eead0ec6f7c2525bc97b3aaf994f41 Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:31:24 -0700 Subject: [PATCH 224/240] Per Partition Automatic Failover: Fixes Gateway 503 Cold Start Issue (#4073) * Code changes to add retry logic for GW returned 503.9002. * Revert "Code changes to add retry logic for GW returned 503.9002." This reverts commit 53ef5f3c1b038d14dbb1473cafa18223b33af2ce. * Code changes to clean up the PPAF retry logic fix. * Code changes to add retry logic for GW returned 503.9002. * Revert "Code changes to add retry logic for GW returned 503.9002." This reverts commit 53ef5f3c1b038d14dbb1473cafa18223b33af2ce. * Code changes to clean up the PPAF retry logic fix. * Code changes to revert location cache changes. * Code changes ro revert location cache changes. * Code changes to fix some of the failing tests. * Code changes to fix unit tests. * Code changes to add unit tests for client options. * Code changes to draft docs for PPAF design approach. * Code changes to add SDK side design docs for PPAF. * Code changes to modify the PPAF design. * Code changes to fix unit test. * Code changes to rename test name. * Code changes to add some cosmetic changes. * Code changes to enable retry on write for all regions in single master accounts. * Code changes to add code comments. * Code changes to clean up and handle endpoints in location cache. * Code changes to fix unit tests. Added detailed code comments. * Code changes to clean up the account read endpoints generation logic. * Code changes to fix unit tests. * Code changes to disable retry when ppaf is not enabled. Also validated application preferred region. * Code changes to fix unit tests. * Code changes to update md file. * Code changes to remove chache expiry check for account read endpoints. * Code changes to fix unit test. * Code changes to fix more tests. * Code changes to address review comments. * Code changes to fix verbaige in design document. --- .../src/ClientRetryPolicy.cs | 22 ++- .../src/CosmosClientOptions.cs | 12 +- Microsoft.Azure.Cosmos/src/RetryPolicy.cs | 9 +- .../src/Routing/GlobalEndpointManager.cs | 6 +- .../GlobalPartitionEndpointManagerCore.cs | 15 +- .../src/Routing/IGlobalEndpointManager.cs | 2 + .../src/Routing/LocationCache.cs | 41 +++-- .../src/Util/ConfigurationManager.cs | 28 +++- .../ClientRetryPolicyTests.cs | 10 +- .../CosmosClientOptionsUnitTests.cs | 149 +++++++++++++++++- .../LocationCacheTests.cs | 59 +++---- .../GlobalPartitionEndpointManagerTests.cs | 76 +++++++-- ...GlobalPartitionEndpointManagerUnitTests.cs | 4 +- docs/PerPartitionAutomaticFailoverDesign.md | 28 ++++ 14 files changed, 378 insertions(+), 83 deletions(-) create mode 100644 docs/PerPartitionAutomaticFailoverDesign.md diff --git a/Microsoft.Azure.Cosmos/src/ClientRetryPolicy.cs b/Microsoft.Azure.Cosmos/src/ClientRetryPolicy.cs index 2933baa1a9..7cef90d541 100644 --- a/Microsoft.Azure.Cosmos/src/ClientRetryPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/ClientRetryPolicy.cs @@ -28,6 +28,7 @@ internal sealed class ClientRetryPolicy : IDocumentClientRetryPolicy private readonly GlobalEndpointManager globalEndpointManager; private readonly GlobalPartitionEndpointManager partitionKeyRangeLocationCache; private readonly bool enableEndpointDiscovery; + private readonly bool isPertitionLevelFailoverEnabled; private int failoverRetryCount; private int sessionTokenRetryCount; @@ -41,8 +42,9 @@ internal sealed class ClientRetryPolicy : IDocumentClientRetryPolicy public ClientRetryPolicy( GlobalEndpointManager globalEndpointManager, GlobalPartitionEndpointManager partitionKeyRangeLocationCache, + RetryOptions retryOptions, bool enableEndpointDiscovery, - RetryOptions retryOptions) + bool isPertitionLevelFailoverEnabled) { this.throttlingRetry = new ResourceThrottleRetryPolicy( retryOptions.MaxRetryAttemptsOnThrottledRequests, @@ -55,6 +57,7 @@ public ClientRetryPolicy( this.sessionTokenRetryCount = 0; this.serviceUnavailableRetryCount = 0; this.canUseMultipleWriteLocations = false; + this.isPertitionLevelFailoverEnabled = isPertitionLevelFailoverEnabled; } /// @@ -247,8 +250,7 @@ private async Task ShouldRetryInternalAsync( } // Received 503 due to client connect timeout or Gateway - if (statusCode == HttpStatusCode.ServiceUnavailable - && ClientRetryPolicy.IsRetriableServiceUnavailable(subStatusCode)) + if (statusCode == HttpStatusCode.ServiceUnavailable) { DefaultTrace.TraceWarning("ClientRetryPolicy: ServiceUnavailable. Refresh cache and retry. Failed Location: {0}; ResourceAddress: {1}", this.documentServiceRequest?.RequestContext?.LocationEndpointToRoute?.ToString() ?? string.Empty, @@ -265,12 +267,6 @@ private async Task ShouldRetryInternalAsync( return null; } - private static bool IsRetriableServiceUnavailable(SubStatusCodes? subStatusCode) - { - return subStatusCode == SubStatusCodes.Unknown || - (subStatusCode.HasValue && subStatusCode.Value.IsSDKGeneratedSubStatus()); - } - private async Task ShouldRetryOnEndpointFailureAsync( bool isReadRequest, bool markBothReadAndWriteAsUnavailable, @@ -390,7 +386,7 @@ private ShouldRetryResult ShouldRetryOnSessionNotAvailable() /// /// For a ServiceUnavailable (503.0) we could be having a timeout from Direct/TCP locally or a request to Gateway request with a similar response due to an endpoint not yet available. - /// We try and retry the request only if there are other regions available. + /// We try and retry the request only if there are other regions available. The retry logic is applicable for single master write accounts as well. /// private ShouldRetryResult ShouldRetryOnServiceUnavailable() { @@ -401,9 +397,11 @@ private ShouldRetryResult ShouldRetryOnServiceUnavailable() } if (!this.canUseMultipleWriteLocations - && !this.isReadRequest) + && !this.isReadRequest + && !this.isPertitionLevelFailoverEnabled) { - // Write requests on single master cannot be retried, no other regions available + // Write requests on single master cannot be retried if partition level failover is disabled. + // This means there are no other regions available to serve the writes. return ShouldRetryResult.NoRetry(); } diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs index 60ae9298b0..a90a2e04a6 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs @@ -608,7 +608,7 @@ public Func HttpClientFactory /// /// Enable partition key level failover /// - internal bool EnablePartitionLevelFailover { get; set; } = false; + internal bool EnablePartitionLevelFailover { get; set; } = ConfigurationManager.IsPartitionLevelFailoverEnabled(defaultValue: false); /// /// Quorum Read allowed with eventual consistency account or consistent prefix account. @@ -752,6 +752,7 @@ internal virtual ConnectionPolicy GetConnectionPolicy(int clientId) { this.ValidateDirectTCPSettings(); this.ValidateLimitToEndpointSettings(); + this.ValidatePartitionLevelFailoverSettings(); ConnectionPolicy connectionPolicy = new ConnectionPolicy() { @@ -888,6 +889,15 @@ private void ValidateLimitToEndpointSettings() } } + private void ValidatePartitionLevelFailoverSettings() + { + if (this.EnablePartitionLevelFailover + && (this.ApplicationPreferredRegions == null || this.ApplicationPreferredRegions.Count == 0)) + { + throw new ArgumentException($"{nameof(this.ApplicationPreferredRegions)} is required when {nameof(this.EnablePartitionLevelFailover)} is enabled."); + } + } + private void ValidateDirectTCPSettings() { string settingName = string.Empty; diff --git a/Microsoft.Azure.Cosmos/src/RetryPolicy.cs b/Microsoft.Azure.Cosmos/src/RetryPolicy.cs index 4ec05a3b65..47e64f0cbc 100644 --- a/Microsoft.Azure.Cosmos/src/RetryPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/RetryPolicy.cs @@ -13,17 +13,19 @@ internal sealed class RetryPolicy : IRetryPolicyFactory private readonly GlobalPartitionEndpointManager partitionKeyRangeLocationCache; private readonly GlobalEndpointManager globalEndpointManager; private readonly bool enableEndpointDiscovery; + private readonly bool isPertitionLevelFailoverEnabled; private readonly RetryOptions retryOptions; /// /// Initialize the instance of the RetryPolicy class /// public RetryPolicy( - GlobalEndpointManager globalEndpointManager, + GlobalEndpointManager globalEndpointManager, ConnectionPolicy connectionPolicy, GlobalPartitionEndpointManager partitionKeyRangeLocationCache) { this.enableEndpointDiscovery = connectionPolicy.EnableEndpointDiscovery; + this.isPertitionLevelFailoverEnabled = connectionPolicy.EnablePartitionLevelFailover; this.globalEndpointManager = globalEndpointManager; this.retryOptions = connectionPolicy.RetryOptions; this.partitionKeyRangeLocationCache = partitionKeyRangeLocationCache; @@ -37,10 +39,11 @@ public IDocumentClientRetryPolicy GetRequestPolicy() ClientRetryPolicy clientRetryPolicy = new ClientRetryPolicy( this.globalEndpointManager, this.partitionKeyRangeLocationCache, + this.retryOptions, this.enableEndpointDiscovery, - this.retryOptions); + this.isPertitionLevelFailoverEnabled); return clientRetryPolicy; } } -} +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Routing/GlobalEndpointManager.cs b/Microsoft.Azure.Cosmos/src/Routing/GlobalEndpointManager.cs index 956212d5a2..bcaae809f4 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GlobalEndpointManager.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GlobalEndpointManager.cs @@ -89,9 +89,11 @@ public GlobalEndpointManager(IDocumentClientInternal owner, ConnectionPolicy con } } - public ReadOnlyCollection ReadEndpoints => this.locationCache.ReadEndpoints; + public ReadOnlyCollection ReadEndpoints => this.locationCache.ReadEndpoints; + + public ReadOnlyCollection AccountReadEndpoints => this.locationCache.AccountReadEndpoints; - public ReadOnlyCollection WriteEndpoints => this.locationCache.WriteEndpoints; + public ReadOnlyCollection WriteEndpoints => this.locationCache.WriteEndpoints; public int PreferredLocationCount => this.connectionPolicy.PreferredLocations != null ? this.connectionPolicy.PreferredLocations.Count : 0; diff --git a/Microsoft.Azure.Cosmos/src/Routing/GlobalPartitionEndpointManagerCore.cs b/Microsoft.Azure.Cosmos/src/Routing/GlobalPartitionEndpointManagerCore.cs index a4ab1221e6..fe2e256601 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GlobalPartitionEndpointManagerCore.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GlobalPartitionEndpointManagerCore.cs @@ -134,11 +134,20 @@ public override bool TryMarkEndpointUnavailableForPartitionKeyRange( PartitionKeyRangeFailoverInfo partionFailover = this.PartitionKeyRangeToLocation.Value.GetOrAdd( partitionKeyRange, - (_) => new PartitionKeyRangeFailoverInfo(failedLocation)); - + (_) => new PartitionKeyRangeFailoverInfo(failedLocation)); + + // For any single master write accounts, the next locations to fail over will be the read regions configured at the account level. + // For multi master write accounts, since all the regions are treated as write regions, the next locations to fail over + // will be the preferred read regions that are configured in the application preferred regions in the CosmosClientOptions. + bool isSingleMasterWriteAccount = !this.globalEndpointManager.CanUseMultipleWriteLocations(request); + + ReadOnlyCollection nextLocations = isSingleMasterWriteAccount + ? this.globalEndpointManager.AccountReadEndpoints + : this.globalEndpointManager.ReadEndpoints; + // Will return true if it was able to update to a new region if (partionFailover.TryMoveNextLocation( - locations: this.globalEndpointManager.ReadEndpoints, + locations: nextLocations, failedLocation: failedLocation)) { DefaultTrace.TraceInformation("Partition level override added to new location. PartitionKeyRange: {0}, failedLocation: {1}, new location: {2}", diff --git a/Microsoft.Azure.Cosmos/src/Routing/IGlobalEndpointManager.cs b/Microsoft.Azure.Cosmos/src/Routing/IGlobalEndpointManager.cs index dd3d8a2611..83f49cf0de 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/IGlobalEndpointManager.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/IGlobalEndpointManager.cs @@ -13,6 +13,8 @@ internal interface IGlobalEndpointManager : IDisposable { ReadOnlyCollection ReadEndpoints { get; } + ReadOnlyCollection AccountReadEndpoints { get; } + ReadOnlyCollection WriteEndpoints { get; } int PreferredLocationCount { get; } diff --git a/Microsoft.Azure.Cosmos/src/Routing/LocationCache.cs b/Microsoft.Azure.Cosmos/src/Routing/LocationCache.cs index 9c6308d8b6..4480df1826 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/LocationCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/LocationCache.cs @@ -101,6 +101,11 @@ public ReadOnlyCollection ReadEndpoints } } + /// + /// Gets list of account level read endpoints. + /// + public ReadOnlyCollection AccountReadEndpoints => this.locationInfo.AccountReadEndpoints; + /// /// Gets list of write endpoints ordered by /// 1. Preferred location @@ -491,20 +496,35 @@ private void UpdateLocationCache( if (readLocations != null) { - ReadOnlyCollection availableReadLocations; - nextLocationInfo.AvailableReadEndpointByLocation = this.GetEndpointByLocation(readLocations, out availableReadLocations); + nextLocationInfo.AvailableReadEndpointByLocation = this.GetEndpointByLocation( + readLocations, + out ReadOnlyCollection availableReadLocations); + nextLocationInfo.AvailableReadLocations = availableReadLocations; + nextLocationInfo.AccountReadEndpoints = nextLocationInfo.AvailableReadEndpointByLocation.Select(x => x.Value).ToList().AsReadOnly(); } if (writeLocations != null) { - ReadOnlyCollection availableWriteLocations; - nextLocationInfo.AvailableWriteEndpointByLocation = this.GetEndpointByLocation(writeLocations, out availableWriteLocations); + nextLocationInfo.AvailableWriteEndpointByLocation = this.GetEndpointByLocation( + writeLocations, + out ReadOnlyCollection availableWriteLocations); + nextLocationInfo.AvailableWriteLocations = availableWriteLocations; } - nextLocationInfo.WriteEndpoints = this.GetPreferredAvailableEndpoints(nextLocationInfo.AvailableWriteEndpointByLocation, nextLocationInfo.AvailableWriteLocations, OperationType.Write, this.defaultEndpoint); - nextLocationInfo.ReadEndpoints = this.GetPreferredAvailableEndpoints(nextLocationInfo.AvailableReadEndpointByLocation, nextLocationInfo.AvailableReadLocations, OperationType.Read, nextLocationInfo.WriteEndpoints[0]); + nextLocationInfo.WriteEndpoints = this.GetPreferredAvailableEndpoints( + endpointsByLocation: nextLocationInfo.AvailableWriteEndpointByLocation, + orderedLocations: nextLocationInfo.AvailableWriteLocations, + expectedAvailableOperation: OperationType.Write, + fallbackEndpoint: this.defaultEndpoint); + + nextLocationInfo.ReadEndpoints = this.GetPreferredAvailableEndpoints( + endpointsByLocation: nextLocationInfo.AvailableReadEndpointByLocation, + orderedLocations: nextLocationInfo.AvailableReadLocations, + expectedAvailableOperation: OperationType.Read, + fallbackEndpoint: nextLocationInfo.WriteEndpoints[0]); + this.lastCacheUpdateTimestamp = DateTime.UtcNow; DefaultTrace.TraceInformation("Current WriteEndpoints = ({0}) ReadEndpoints = ({1})", @@ -534,8 +554,7 @@ private ReadOnlyCollection GetPreferredAvailableEndpoints(ReadOnlyDictionar foreach (string location in currentLocationInfo.PreferredLocations) { - Uri endpoint; - if (endpointsByLocation.TryGetValue(location, out endpoint)) + if (endpointsByLocation.TryGetValue(location, out Uri endpoint)) { if (this.IsEndpointUnavailable(endpoint, expectedAvailableOperation)) { @@ -560,9 +579,8 @@ private ReadOnlyCollection GetPreferredAvailableEndpoints(ReadOnlyDictionar { foreach (string location in orderedLocations) { - Uri endpoint; if (!string.IsNullOrEmpty(location) && // location is empty during manual failover - endpointsByLocation.TryGetValue(location, out endpoint)) + endpointsByLocation.TryGetValue(location, out Uri endpoint)) { endpoints.Add(endpoint); } @@ -634,6 +652,7 @@ public DatabaseAccountLocationsInfo(ReadOnlyCollection preferredLocation this.AvailableWriteEndpointByLocation = new ReadOnlyDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); this.AvailableReadEndpointByLocation = new ReadOnlyDictionary(new Dictionary(StringComparer.OrdinalIgnoreCase)); this.WriteEndpoints = new List() { defaultEndpoint }.AsReadOnly(); + this.AccountReadEndpoints = new List() { defaultEndpoint }.AsReadOnly(); this.ReadEndpoints = new List() { defaultEndpoint }.AsReadOnly(); } @@ -645,6 +664,7 @@ public DatabaseAccountLocationsInfo(DatabaseAccountLocationsInfo other) this.AvailableWriteEndpointByLocation = other.AvailableWriteEndpointByLocation; this.AvailableReadEndpointByLocation = other.AvailableReadEndpointByLocation; this.WriteEndpoints = other.WriteEndpoints; + this.AccountReadEndpoints = other.AccountReadEndpoints; this.ReadEndpoints = other.ReadEndpoints; } @@ -655,6 +675,7 @@ public DatabaseAccountLocationsInfo(DatabaseAccountLocationsInfo other) public ReadOnlyDictionary AvailableReadEndpointByLocation { get; set; } public ReadOnlyCollection WriteEndpoints { get; set; } public ReadOnlyCollection ReadEndpoints { get; set; } + public ReadOnlyCollection AccountReadEndpoints { get; set; } } [Flags] diff --git a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs index 748f81833a..0b7786d8c3 100644 --- a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs +++ b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs @@ -9,12 +9,19 @@ namespace Microsoft.Azure.Cosmos internal static class ConfigurationManager { /// - /// A read-only string containing the environment variablename for enabling replica validation. - /// This will eventually be removed oncereplica valdiatin is enabled by default for both preview + /// A read-only string containing the environment variable name for enabling replica validation. + /// This will eventually be removed once replica valdiatin is enabled by default for both preview /// and GA. /// internal static readonly string ReplicaConnectivityValidationEnabled = "AZURE_COSMOS_REPLICA_VALIDATION_ENABLED"; + /// + /// A read-only string containing the environment variable name for enabling per partition automatic failover. + /// This will eventually be removed once per partition automatic failover is enabled by default for both preview + /// and GA. + /// + internal static readonly string PartitionLevelFailoverEnabled = "AZURE_COSMOS_PARTITION_LEVEL_FAILOVER_ENABLED"; + public static T GetEnvironmentVariable(string variable, T defaultValue) { string value = Environment.GetEnvironmentVariable(variable); @@ -50,5 +57,22 @@ public static bool IsReplicaAddressValidationEnabled( variable: ConfigurationManager.ReplicaConnectivityValidationEnabled, defaultValue: replicaValidationDefaultValue); } + + /// + /// Gets the boolean value of the partition level failover environment variable. Note that, partition level failover + /// is disabled by default for both preview and GA releases. The user can set the respective environment variable + /// 'AZURE_COSMOS_PARTITION_LEVEL_FAILOVER_ENABLED' to override the value for both preview and GA. The method will + /// eventually be removed, once partition level failover is enabled by default for both preview and GA. + /// + /// A boolean field containing the default value for partition level failover. + /// A boolean flag indicating if partition level failover is enabled. + public static bool IsPartitionLevelFailoverEnabled( + bool defaultValue) + { + return ConfigurationManager + .GetEnvironmentVariable( + variable: ConfigurationManager.PartitionLevelFailoverEnabled, + defaultValue: defaultValue); + } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientRetryPolicyTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientRetryPolicyTests.cs index 0851952f40..cf1c739388 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientRetryPolicyTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ClientRetryPolicyTests.cs @@ -47,7 +47,7 @@ public void MultimasterMetadataWriteRetryTest() multimasterMetadataWriteRetryTest: true); - ClientRetryPolicy retryPolicy = new ClientRetryPolicy(endpointManager, this.partitionKeyRangeLocationCache, enableEndpointDiscovery, new RetryOptions()); + ClientRetryPolicy retryPolicy = new ClientRetryPolicy(endpointManager, this.partitionKeyRangeLocationCache, new RetryOptions(), enableEndpointDiscovery, false); //Creates a metadata write request DocumentServiceRequest request = this.CreateRequest(false, true); @@ -102,8 +102,8 @@ public void Http503SubStatusHandelingTests(int testCode) isPreferredLocationsListEmpty: true); //Create Retry Policy - ClientRetryPolicy retryPolicy = new ClientRetryPolicy(endpointManager, this.partitionKeyRangeLocationCache, enableEndpointDiscovery, new RetryOptions()); - + ClientRetryPolicy retryPolicy = new ClientRetryPolicy(endpointManager, this.partitionKeyRangeLocationCache, new RetryOptions(), enableEndpointDiscovery, false); + CancellationToken cancellationToken = new CancellationToken(); Exception serviceUnavailableException = new Exception(); Mock nameValueCollection = new Mock(); @@ -216,8 +216,8 @@ private async Task ValidateConnectTimeoutTriggersClientRetryPolicy( replicatedResourceClient.GoneAndRetryWithRetryTimeoutInSecondsOverride = 1; this.partitionKeyRangeLocationCache = GlobalPartitionEndpointManagerNoOp.Instance; - - ClientRetryPolicy retryPolicy = new ClientRetryPolicy(mockDocumentClientContext.GlobalEndpointManager, this.partitionKeyRangeLocationCache, enableEndpointDiscovery: true, new RetryOptions()); + + ClientRetryPolicy retryPolicy = new ClientRetryPolicy(mockDocumentClientContext.GlobalEndpointManager, this.partitionKeyRangeLocationCache, new RetryOptions(), enableEndpointDiscovery: true, isPertitionLevelFailoverEnabled: false); INameValueCollection headers = new DictionaryNameValueCollection(); headers.Set(HttpConstants.HttpHeaders.ConsistencyLevel, ConsistencyLevel.BoundedStaleness.ToString()); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs index 04d51ea06c..b625858c09 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosClientOptionsUnitTests.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Cosmos.Tests using System.Linq; using System.Net; using System.Net.Http; - using Cosmos.Telemetry; using global::Azure.Core; using Microsoft.Azure.Cosmos.Fluent; using Microsoft.Azure.Documents; @@ -116,8 +115,7 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() .WithThrottlingRetryOptions(maxRetryWaitTime, maxRetryAttemptsOnThrottledRequests) .WithBulkExecution(true) .WithSerializerOptions(cosmosSerializerOptions) - .WithConsistencyLevel(consistencyLevel) - .WithPartitionLevelFailoverEnabled(); + .WithConsistencyLevel(consistencyLevel); cosmosClient = cosmosClientBuilder.Build(new MockDocumentClient()); clientOptions = cosmosClient.ClientOptions; @@ -140,7 +138,7 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() Assert.IsTrue(object.ReferenceEquals(webProxy, clientOptions.WebProxy)); Assert.IsTrue(clientOptions.AllowBulkExecution); Assert.AreEqual(consistencyLevel, clientOptions.ConsistencyLevel); - Assert.IsTrue(clientOptions.EnablePartitionLevelFailover); + Assert.IsFalse(clientOptions.EnablePartitionLevelFailover); Assert.IsTrue(clientOptions.EnableAdvancedReplicaSelectionForTcp.HasValue && clientOptions.EnableAdvancedReplicaSelectionForTcp.Value); //Verify GetConnectionPolicy returns the correct values @@ -155,7 +153,7 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() Assert.AreEqual(maxRetryAttemptsOnThrottledRequests, policy.RetryOptions.MaxRetryAttemptsOnThrottledRequests); Assert.AreEqual((int)maxRetryWaitTime.TotalSeconds, policy.RetryOptions.MaxRetryWaitTimeInSeconds); Assert.AreEqual((Documents.ConsistencyLevel)consistencyLevel, clientOptions.GetDocumentsConsistencyLevel()); - Assert.IsTrue(policy.EnablePartitionLevelFailover); + Assert.IsFalse(policy.EnablePartitionLevelFailover); Assert.IsTrue(clientOptions.EnableAdvancedReplicaSelectionForTcp.Value); IReadOnlyList preferredLocations = new List() { Regions.AustraliaCentral, Regions.AustraliaCentral2 }; @@ -206,6 +204,147 @@ public void VerifyCosmosConfigurationPropertiesGetUpdated() CollectionAssert.AreEqual(preferredLocations.ToArray(), policy.PreferredLocations.ToArray()); } + /// + /// Test to validate that when the partition level failover is enabled with the preferred regions list is missing, then the client + /// initialization should throw an argument exception and fail. This should hold true for both environment variable and CosmosClientOptions. + /// + [TestMethod] + [Owner("dkunda")] + [DataRow(true, DisplayName = "Validate that when enevironment variable is used to enable PPAF, the outcome of the test should be same.")] + [DataRow(false, DisplayName = "Validate that when CosmosClientOptions is used to enable PPAF, the outcome of the test should be same.")] + public void CosmosClientOptions_WhenPartitionLevelFailoverEnabledAndPreferredRegionsNotSet_ShouldThrowArgumentException(bool useEnvironmentVariable) + { + try + { + if (useEnvironmentVariable) + { + Environment.SetEnvironmentVariable(ConfigurationManager.PartitionLevelFailoverEnabled, "True"); + } + + string endpoint = AccountEndpoint; + string key = MockCosmosUtil.RandomInvalidCorrectlyFormatedAuthKey; + TimeSpan requestTimeout = TimeSpan.FromDays(1); + string userAgentSuffix = "testSuffix"; + RequestHandler preProcessHandler = new TestHandler(); + ApiType apiType = ApiType.Sql; + int maxRetryAttemptsOnThrottledRequests = 9999; + TimeSpan maxRetryWaitTime = TimeSpan.FromHours(6); + CosmosSerializationOptions cosmosSerializerOptions = new CosmosSerializationOptions() + { + IgnoreNullValues = true, + PropertyNamingPolicy = CosmosPropertyNamingPolicy.CamelCase, + }; + + Cosmos.ConsistencyLevel consistencyLevel = Cosmos.ConsistencyLevel.ConsistentPrefix; + CosmosClientBuilder cosmosClientBuilder = new( + accountEndpoint: endpoint, + authKeyOrResourceToken: key); + + cosmosClientBuilder + .WithConnectionModeDirect() + .WithRequestTimeout(requestTimeout) + .WithApplicationName(userAgentSuffix) + .AddCustomHandlers(preProcessHandler) + .WithApiType(apiType) + .WithThrottlingRetryOptions(maxRetryWaitTime, maxRetryAttemptsOnThrottledRequests) + .WithSerializerOptions(cosmosSerializerOptions) + .WithConsistencyLevel(consistencyLevel); + + if (!useEnvironmentVariable) + { + cosmosClientBuilder + .WithPartitionLevelFailoverEnabled(); + } + + ArgumentException exception = Assert.ThrowsException(() => cosmosClientBuilder.Build()); + + Assert.AreEqual( + expected: "ApplicationPreferredRegions is required when EnablePartitionLevelFailover is enabled.", + actual: exception.Message); + } + finally + { + Environment.SetEnvironmentVariable(ConfigurationManager.PartitionLevelFailoverEnabled, null); + } + } + + /// + /// Test to validate that when the partition level failover is enabled with the preferred regions list is provided, then the client + /// initialization should be successful. This holds true for both environment variable and CosmosClientOptions. + /// + [TestMethod] + [Owner("dkunda")] + [DataRow(true, DisplayName = "Validate that when enevironment variable is used to enable PPAF, the outcome of the test should be same.")] + [DataRow(false, DisplayName = "Validate that when CosmosClientOptions is used to enable PPAF, the outcome of the test should be same.")] + public void CosmosClientOptions_WhenPartitionLevelFailoverEnabledAndPreferredRegionsSet_ShouldInitializeSuccessfully(bool useEnvironmentVariable) + { + try + { + if (useEnvironmentVariable) + { + Environment.SetEnvironmentVariable(ConfigurationManager.PartitionLevelFailoverEnabled, "True"); + } + + string endpoint = AccountEndpoint; + string key = MockCosmosUtil.RandomInvalidCorrectlyFormatedAuthKey; + TimeSpan requestTimeout = TimeSpan.FromDays(1); + string userAgentSuffix = "testSuffix"; + RequestHandler preProcessHandler = new TestHandler(); + ApiType apiType = ApiType.Sql; + int maxRetryAttemptsOnThrottledRequests = 9999; + TimeSpan maxRetryWaitTime = TimeSpan.FromHours(6); + CosmosSerializationOptions cosmosSerializerOptions = new CosmosSerializationOptions() + { + IgnoreNullValues = true, + PropertyNamingPolicy = CosmosPropertyNamingPolicy.CamelCase, + }; + + Cosmos.ConsistencyLevel consistencyLevel = Cosmos.ConsistencyLevel.ConsistentPrefix; + CosmosClientBuilder cosmosClientBuilder = new( + accountEndpoint: endpoint, + authKeyOrResourceToken: key); + + cosmosClientBuilder + .WithConnectionModeDirect() + .WithRequestTimeout(requestTimeout) + .WithApplicationName(userAgentSuffix) + .AddCustomHandlers(preProcessHandler) + .WithApiType(apiType) + .WithThrottlingRetryOptions(maxRetryWaitTime, maxRetryAttemptsOnThrottledRequests) + .WithSerializerOptions(cosmosSerializerOptions) + .WithConsistencyLevel(consistencyLevel) + .WithPartitionLevelFailoverEnabled() + .WithApplicationPreferredRegions( + new List() + { + Regions.NorthCentralUS, + Regions.WestUS, + Regions.EastAsia, + }); + + CosmosClientOptions clientOptions = cosmosClientBuilder.Build().ClientOptions; + + Assert.AreEqual(ConnectionMode.Direct, clientOptions.ConnectionMode); + Assert.AreEqual(requestTimeout, clientOptions.RequestTimeout); + Assert.AreEqual(userAgentSuffix, clientOptions.ApplicationName); + Assert.AreEqual(preProcessHandler, clientOptions.CustomHandlers[0]); + Assert.AreEqual(apiType, clientOptions.ApiType); + Assert.AreEqual(maxRetryAttemptsOnThrottledRequests, clientOptions.MaxRetryAttemptsOnRateLimitedRequests); + Assert.AreEqual(maxRetryWaitTime, clientOptions.MaxRetryWaitTimeOnRateLimitedRequests); + Assert.AreEqual(cosmosSerializerOptions.IgnoreNullValues, clientOptions.SerializerOptions.IgnoreNullValues); + Assert.AreEqual(cosmosSerializerOptions.PropertyNamingPolicy, clientOptions.SerializerOptions.PropertyNamingPolicy); + Assert.AreEqual(cosmosSerializerOptions.Indented, clientOptions.SerializerOptions.Indented); + Assert.IsFalse(clientOptions.AllowBulkExecution); + Assert.AreEqual(consistencyLevel, clientOptions.ConsistencyLevel); + Assert.IsTrue(clientOptions.EnablePartitionLevelFailover); + Assert.IsNotNull(clientOptions.ApplicationPreferredRegions); + } + finally + { + Environment.SetEnvironmentVariable(ConfigurationManager.PartitionLevelFailoverEnabled, null); + } + } + [TestMethod] public void VerifyConsisentencyLevels() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/LocationCacheTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/LocationCacheTests.cs index 8273897374..b93107b302 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/LocationCacheTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/LocationCacheTests.cs @@ -131,7 +131,7 @@ private async Task ValidateRetryOnSessionNotAvailabeWithEndpointDiscoveryDisable useMultipleWriteLocations: useMultipleWriteLocations, enableEndpointDiscovery: enableEndpointDiscovery, isPreferredLocationsListEmpty: isPreferredLocationsListEmpty); - ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery, endpointManager); + ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery, partitionLevelFailoverEnabled: false, endpointManager); using (DocumentServiceRequest request = this.CreateRequest(isReadRequest: isReadRequest, isMasterResourceType: false)) { @@ -174,14 +174,16 @@ await BackoffRetryUtility.ExecuteAsync( } private ClientRetryPolicy CreateClientRetryPolicy( - bool enableEndpointDiscovery, + bool enableEndpointDiscovery, + bool partitionLevelFailoverEnabled, GlobalEndpointManager endpointManager) { return new ClientRetryPolicy( endpointManager, this.partitionKeyRangeLocationCache, - enableEndpointDiscovery, - new RetryOptions()); + new RetryOptions(), + enableEndpointDiscovery, + isPertitionLevelFailoverEnabled: partitionLevelFailoverEnabled); } [TestMethod] @@ -203,7 +205,7 @@ private async Task ValidateRetryOnSessionNotAvailabeWithDisableMultipleWriteLoca isPreferredLocationsListEmpty: isPreferredLocationsListEmpty); endpointManager.InitializeAccountPropertiesAndStartBackgroundRefresh(this.databaseAccount); - ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery, endpointManager); + ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery, partitionLevelFailoverEnabled: false, endpointManager); using (DocumentServiceRequest request = this.CreateRequest(isReadRequest: true, isMasterResourceType: false)) { @@ -281,7 +283,7 @@ private async Task ValidateRetryOnReadSessionNotAvailabeWithEnableMultipleWriteL preferedRegionListOverride: preferredList); endpointManager.InitializeAccountPropertiesAndStartBackgroundRefresh(this.databaseAccount); - ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery, endpointManager); + ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery, partitionLevelFailoverEnabled: false, endpointManager); using (DocumentServiceRequest request = this.CreateRequest(isReadRequest: true, isMasterResourceType: false)) { @@ -357,7 +359,7 @@ private async Task ValidateRetryOnWriteSessionNotAvailabeWithEnableMultipleWrite preferedRegionListOverride: preferredList); endpointManager.InitializeAccountPropertiesAndStartBackgroundRefresh(this.databaseAccount); - ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery, endpointManager); + ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery, partitionLevelFailoverEnabled: false, endpointManager); using (DocumentServiceRequest request = this.CreateRequest(isReadRequest: false, isMasterResourceType: false)) { @@ -429,7 +431,7 @@ public async Task ValidateRetryOnWriteForbiddenExceptionAsync() isPreferredLocationsListEmpty: false); endpointManager.InitializeAccountPropertiesAndStartBackgroundRefresh(this.databaseAccount); - ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery: true, endpointManager: endpointManager); + ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery: true, partitionLevelFailoverEnabled: false, endpointManager: endpointManager); using (DocumentServiceRequest request = this.CreateRequest(isReadRequest: false, isMasterResourceType: false)) { @@ -501,7 +503,7 @@ private async Task ValidateRetryOnDatabaseAccountNotFoundAsync(bool enableMultip isPreferredLocationsListEmpty: false); endpointManager.InitializeAccountPropertiesAndStartBackgroundRefresh(this.databaseAccount); - ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery: true, endpointManager: endpointManager); + ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery: true, partitionLevelFailoverEnabled: false, endpointManager: endpointManager); int expectedRetryCount = isReadRequest || enableMultipleWriteLocations ? 2 : 1; @@ -606,7 +608,7 @@ private async Task ValidateRetryOnHttpExceptionAsync(bool enableMultipleWriteLoc enforceSingleMasterSingleWriteLocation: true); endpointManager.InitializeAccountPropertiesAndStartBackgroundRefresh(this.databaseAccount); - ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery: true, endpointManager: endpointManager); + ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery: true, partitionLevelFailoverEnabled: false, endpointManager: endpointManager); using (DocumentServiceRequest request = this.CreateRequest(isReadRequest: isReadRequest, isMasterResourceType: false)) { @@ -676,22 +678,22 @@ await BackoffRetryUtility.ExecuteAsync( } [DataTestMethod] - [DataRow(true, false, false, false, false, DisplayName = "Read request - Single master - no preferred locations - should NOT retry")] - [DataRow(false, false, false, false, false, DisplayName = "Write request - Single master - no preferred locations - should NOT retry")] - [DataRow(true, true, false, false, false, DisplayName = "Read request - Multi master - no preferred locations - should NOT retry")] - [DataRow(false, true, false, false, false, DisplayName = "Write request - Multi master - no preferred locations - should NOT retry")] - [DataRow(true, false, true, true, false, DisplayName = "Read request - Single master - with preferred locations - should retry")] - [DataRow(false, false, true, false, false, DisplayName = "Write request - Single master - with preferred locations - should NOT retry")] - [DataRow(true, true, true, true, false, DisplayName = "Read request - Multi master - with preferred locations - should retry")] - [DataRow(false, true, true, true, false, DisplayName = "Write request - Multi master - with preferred locations - should retry")] - [DataRow(true, false, false, false, true, DisplayName = "Read request - Single master - no preferred locations - should NOT retry")] - [DataRow(false, false, false, false, true, DisplayName = "Write request - Single master - no preferred locations - should NOT retry")] - [DataRow(true, true, false, false, true, DisplayName = "Read request - Multi master - no preferred locations - should NOT retry")] - [DataRow(false, true, false, false, true, DisplayName = "Write request - Multi master - no preferred locations - should NOT retry")] - [DataRow(true, false, true, true, true, DisplayName = "Read request - Single master - with preferred locations - should retry")] - [DataRow(false, false, true, false, true, DisplayName = "Write request - Single master - with preferred locations - should NOT retry")] - [DataRow(true, true, true, true, true, DisplayName = "Read request - Multi master - with preferred locations - should retry")] - [DataRow(false, true, true, true, true, DisplayName = "Write request - Multi master - with preferred locations - should retry")] + [DataRow(true, false, false, false, false, DisplayName = "Read request - Single master - no preferred locations - without partition level failover - should NOT retry")] + [DataRow(false, false, false, false, false, DisplayName = "Write request - Single master - no preferred locations - without partition level failover - should NOT retry")] + [DataRow(true, true, false, false, false, DisplayName = "Read request - Multi master - no preferred locations - without partition level failover - should NOT retry")] + [DataRow(false, true, false, false, false, DisplayName = "Write request - Multi master - no preferred locations - without partition level failover - should NOT retry")] + [DataRow(true, false, true, true, false, DisplayName = "Read request - Single master - with preferred locations - without partition level failover - should retry")] + [DataRow(false, false, true, false, false, DisplayName = "Write request - Single master - with preferred locations - without partition level failover - should NOT retry")] + [DataRow(true, true, true, true, false, DisplayName = "Read request - Multi master - with preferred locations - without partition level failover - should retry")] + [DataRow(false, true, true, true, false, DisplayName = "Write request - Multi master - with preferred locations - without partition level failover - should retry")] + [DataRow(true, false, false, false, true, DisplayName = "Read request - Single master - no preferred locations - with partition level failover - should NOT retry")] + [DataRow(false, false, false, false, true, DisplayName = "Write request - Single master - no preferred locations - with partition level failover - should NOT retry")] + [DataRow(true, true, false, false, true, DisplayName = "Read request - Multi master - no preferred locations - with partition level failover - should NOT retry")] + [DataRow(false, true, false, false, true, DisplayName = "Write request - Multi master - no preferred locations - with partition level failover - should NOT retry")] + [DataRow(true, false, true, true, true, DisplayName = "Read request - Single master - with preferred locations - with partition level failover - should NOT retry")] + [DataRow(false, false, true, true, true, DisplayName = "Write request - Single master - with preferred locations - with partition level failover - should retry")] + [DataRow(true, true, true, true, true, DisplayName = "Read request - Multi master - with preferred locations - with partition level failover - should retry")] + [DataRow(false, true, true, true, true, DisplayName = "Write request - Multi master - with preferred locations - with partition level failover - should retry")] public async Task ClientRetryPolicy_ValidateRetryOnServiceUnavailable( bool isReadRequest, bool useMultipleWriteLocations, @@ -714,8 +716,9 @@ public async Task ClientRetryPolicy_ValidateRetryOnServiceUnavailable( preferedRegionListOverride: preferredList, enforceSingleMasterSingleWriteLocation: true); - endpointManager.InitializeAccountPropertiesAndStartBackgroundRefresh(this.databaseAccount); - ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery, endpointManager); + endpointManager.InitializeAccountPropertiesAndStartBackgroundRefresh(this.databaseAccount); + + ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery, partitionLevelFailoverEnabled: enablePartitionLevelFailover, endpointManager); using (DocumentServiceRequest request = this.CreateRequest(isReadRequest: isReadRequest, isMasterResourceType: false)) { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/PartitionKeyRangeFailoverTests/GlobalPartitionEndpointManagerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/PartitionKeyRangeFailoverTests/GlobalPartitionEndpointManagerTests.cs index a075d439f6..05cbfc8384 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/PartitionKeyRangeFailoverTests/GlobalPartitionEndpointManagerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/PartitionKeyRangeFailoverTests/GlobalPartitionEndpointManagerTests.cs @@ -106,9 +106,13 @@ public async Task TestWriteForbiddenScenarioAsync() } } + /// + /// Test to validate that when the partition level failover is enabled with the preferred regions list provided, if the first + /// region is unavailable for write, then the write should eventually get retried to the next preferred region. + /// [TestMethod] [Timeout(10000)] - public async Task TestServiceUnavailableExceptionScenarioAsync() + public async Task CreateItemAsync_WithPreferredRegionsAndServiceUnavailableForFirstPreferredRegion_ShouldRetryAndSucceedToTheNextPreferredRegion() { GlobalPartitionEndpointManagerTests.SetupAccountAndCacheOperations( out string secondaryRegionNameForUri, @@ -168,16 +172,7 @@ public async Task TestServiceUnavailableExceptionScenarioAsync() Pk = "TestPk" }; - // First create will fail because it is not certain if the payload was sent or not. - try - { - await container.CreateItemAsync(toDoActivity, new Cosmos.PartitionKey(toDoActivity.Pk)); - Assert.Fail("Should throw an exception"); - } - catch (CosmosException ce) when (ce.StatusCode == HttpStatusCode.ServiceUnavailable) - { - Assert.IsNotNull(ce); - } + await container.CreateItemAsync(toDoActivity, new Cosmos.PartitionKey(toDoActivity.Pk)); ItemResponse response = await container.CreateItemAsync(toDoActivity, new Cosmos.PartitionKey(toDoActivity.Pk)); Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); @@ -203,6 +198,65 @@ public async Task TestServiceUnavailableExceptionScenarioAsync() Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); } + /// + /// Test to validate that when the partition level failover is enabled with the preferred regions list is missing, then the client + /// initialization should throw an argument exception and fail. + /// + [TestMethod] + public void CreateItemAsync_WithNoPreferredRegionsAndServiceUnavailable_ShouldThrowArgumentException() + { + GlobalPartitionEndpointManagerTests.SetupAccountAndCacheOperations( + out string secondaryRegionNameForUri, + out string globalEndpoint, + out string secondaryRegionEndpiont, + out string databaseName, + out string containerName, + out ResourceId containerResourceId, + out Mock mockHttpHandler, + out IReadOnlyList primaryRegionPartitionKeyRangeIds, + out TransportAddressUri primaryRegionprimaryReplicaUri); + + Mock mockTransport = new Mock(MockBehavior.Strict); + + MockSetupsHelper.SetupServiceUnavailableException( + mockTransport, + primaryRegionprimaryReplicaUri); + + mockTransport.Setup(x => x.Dispose()); + + // Partition key ranges are the same in both regions so the SDK + // does not need to go the secondary to get the partition key ranges. + // Only the addresses need to be mocked on the secondary + MockSetupsHelper.SetupAddresses( + mockHttpHandler: mockHttpHandler, + partitionKeyRangeId: primaryRegionPartitionKeyRangeIds.First(), + regionEndpoint: secondaryRegionEndpiont, + regionName: secondaryRegionNameForUri, + containerResourceId: containerResourceId, + primaryReplicaUri: out TransportAddressUri secondaryRegionPrimaryReplicaUri); + + MockSetupsHelper.SetupCreateItemResponse( + mockTransport, + secondaryRegionPrimaryReplicaUri); + + CosmosClientOptions cosmosClientOptions = new CosmosClientOptions() + { + EnablePartitionLevelFailover = true, + ConsistencyLevel = Cosmos.ConsistencyLevel.Strong, + HttpClientFactory = () => new HttpClient(new HttpHandlerHelper(mockHttpHandler.Object)), + TransportClientHandlerFactory = (original) => mockTransport.Object, + }; + + ArgumentException exception = Assert.ThrowsException(() => new CosmosClient( + globalEndpoint, + Convert.ToBase64String(Encoding.UTF8.GetBytes(Guid.NewGuid().ToString())), + cosmosClientOptions)); + + Assert.AreEqual( + expected: "ApplicationPreferredRegions is required when EnablePartitionLevelFailover is enabled.", + actual: exception.Message); + } + [TestMethod] [Timeout(10000)] public async Task TestRequestTimeoutExceptionScenarioAsync() diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/PartitionKeyRangeFailoverTests/GlobalPartitionEndpointManagerUnitTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/PartitionKeyRangeFailoverTests/GlobalPartitionEndpointManagerUnitTests.cs index 8f1da91c53..06ca0a4c2c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/PartitionKeyRangeFailoverTests/GlobalPartitionEndpointManagerUnitTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/PartitionKeyRangeFailoverTests/GlobalPartitionEndpointManagerUnitTests.cs @@ -73,13 +73,15 @@ public void VerifyAllReadRegionsAreVisited(int numOfReadRegions) Mock mockEndpointManager = new Mock(MockBehavior.Strict); GlobalPartitionEndpointManagerCore failoverManager = new GlobalPartitionEndpointManagerCore(mockEndpointManager.Object); - List readRegions = new List(); + List readRegions = new (), writeRegions = new(); for(int i = 0; i < numOfReadRegions; i++) { readRegions.Add(new Uri($"https://localhost:{i}/")); } mockEndpointManager.Setup(x => x.ReadEndpoints).Returns(() => new ReadOnlyCollection(readRegions)); + mockEndpointManager.Setup(x => x.AccountReadEndpoints).Returns(() => new ReadOnlyCollection(readRegions)); + mockEndpointManager.Setup(x => x.WriteEndpoints).Returns(() => new ReadOnlyCollection(readRegions)); // Create a random pk range PartitionKeyRange partitionKeyRange = new PartitionKeyRange() diff --git a/docs/PerPartitionAutomaticFailoverDesign.md b/docs/PerPartitionAutomaticFailoverDesign.md new file mode 100644 index 0000000000..fa1425c5d3 --- /dev/null +++ b/docs/PerPartitionAutomaticFailoverDesign.md @@ -0,0 +1,28 @@ +# Working Principles for Per Partition Automatic Failover + +## Table of Contents + +* [Scope.](#scope) +* [Background.](#background) +* [How Does the SDK know Which Region to Fail Over.](#how-does-the-sdk-know-which-region-to-fail-over) +* [References.](#references) + +## Scope + +The scope of the per partition automatic failover design document is applicable for the Cosmos .NET SDK configured only for `Direct` mode at the moment. + +## Background + +Today, the partition level failovers are applicable for multi master write acounts, for a simple reason. If one of the write region fails with a write forbidden 403 exception, then the SDK has the knowledge (by looking up the `ApplicationPreferredRegions`) of the other regions to failover. With the per partition automatic failover, if a partition is in quorum loss, then the backend automatically marks another region as the write region, based on the account configuration. Therefore, any retry for the write requests, to the next preferred region should be successful. + +This idea extends the SDK's retry logic to retry the write requests for single master write accounts, for any service unavailable (status codes 503) errors. + +## How Does the SDK know Which Region to Fail Over + +Right now, the .NET SDK depends upon the `GlobalPartitionEndpointManagerCore` to resolve the endpoints. There is a method `TryMarkEndpointUnavailableForPartitionKeyRange()` within the class, that is responsible to add the override by iterating over the next read regions. This is how the .NET SDK knows which region to fail over. + +## References + +- [SDK not retrying with next region in case address resolution call to Gateway call fails with 503.](https://msdata.visualstudio.com/CosmosDB/_workitems/edit/2475521/) +- [First client write request after failover is failing with 503(21005)](https://msdata.visualstudio.com/CosmosDB/_workitems/edit/2492475/) +- [PPAF Testing in Test, Staging and Prod.](https://microsoft.sharepoint.com/:w:/r/teams/DocumentDB/_layouts/15/doc2.aspx?sourcedoc=%7B7587D267-212F-47BE-AAD6-18FC53482B68%7D&file=PPAF%20Testing%20in%20Test%2C%20Staging%20and%20Prod.docx&action=default&mobileredirect=true) \ No newline at end of file From 646d0061099dbc3e5702f8f5b329c6accc7c9ac3 Mon Sep 17 00:00:00 2001 From: sc978345 <115834537+sc978345@users.noreply.github.com> Date: Mon, 30 Oct 2023 12:20:04 -0500 Subject: [PATCH 225/240] [Internal] Query: Fixes optimalPageSize logic for OFFSET LIMIT in ORDER BY queries (#4158) * Fix logic in CosmosQueryExecutionContextFactory where we determine optimal page size for ORDER BY queries that have an OFFSET/LIMIT clause. Previously, the logic was only being applied to TOP and not OFFSET/LIMIT. * Changes based on PR feedback * Change based on PR feedback --- .../CosmosQueryExecutionContextFactory.cs | 15 +- .../Core/QueryPlan/QueryPartitionProvider.cs | 3 + .../Query/Pipeline/FullPipelineTests.cs | 250 +++++++++++++++++- 3 files changed, 260 insertions(+), 8 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs index adb19c303f..4c43b83e58 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs @@ -551,7 +551,20 @@ private static TryCatch TryCreateSpecializedDocumentQueryEx if (queryInfo.HasOrderBy) { int top; - if (queryInfo.HasTop && (top = partitionedQueryExecutionInfo.QueryInfo.Top.Value) > 0) + if (queryInfo.HasTop && (partitionedQueryExecutionInfo.QueryInfo.Top.Value > 0)) + { + top = partitionedQueryExecutionInfo.QueryInfo.Top.Value; + } + else if (queryInfo.HasLimit && (partitionedQueryExecutionInfo.QueryInfo.Limit.Value > 0)) + { + top = (partitionedQueryExecutionInfo.QueryInfo.Offset ?? 0) + partitionedQueryExecutionInfo.QueryInfo.Limit.Value; + } + else + { + top = 0; + } + + if (top > 0) { // All partitions should initially fetch about 1/nth of the top value. long pageSizeWithTop = (long)Math.Min( diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPartitionProvider.cs b/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPartitionProvider.cs index c62a65b27a..6f95673d80 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPartitionProvider.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/QueryPlan/QueryPartitionProvider.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos.Query.Core.QueryPlan { using System; using System.Collections.Generic; + using System.Diagnostics; using System.Linq; using System.Runtime.InteropServices; using System.Text; @@ -290,6 +291,8 @@ internal TryCatch TryGetPartitionedQueryE MaxDepth = 64, // https://github.com/advisories/GHSA-5crp-9r3c-p9vr }); + Debug.Assert(!(queryInfoInternal.QueryInfo.HasTop && queryInfoInternal.QueryInfo.HasLimit)); + return TryCatch.FromResult(queryInfoInternal); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/FullPipelineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/FullPipelineTests.cs index 0f8f6f2be7..d717b86f89 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/FullPipelineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/FullPipelineTests.cs @@ -7,19 +7,27 @@ namespace Microsoft.Azure.Cosmos.Tests.Query.Pipeline using System; using System.Collections.Generic; using System.Collections.ObjectModel; + using System.IO; using System.Linq; + using System.Threading; using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.ChangeFeed.Pagination; using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.Pagination; + using Microsoft.Azure.Cosmos.Query; using Microsoft.Azure.Cosmos.Query.Core; + using Microsoft.Azure.Cosmos.Query.Core.ExecutionContext; using Microsoft.Azure.Cosmos.Query.Core.Monads; using Microsoft.Azure.Cosmos.Query.Core.Pipeline; using Microsoft.Azure.Cosmos.Query.Core.Pipeline.Pagination; + using Microsoft.Azure.Cosmos.Query.Core.QueryClient; using Microsoft.Azure.Cosmos.Query.Core.QueryPlan; + using Microsoft.Azure.Cosmos.ReadFeed.Pagination; using Microsoft.Azure.Cosmos.Tests.Pagination; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; using Microsoft.VisualStudio.TestTools.UnitTesting; + using Moq; using Newtonsoft.Json; [TestClass] @@ -46,7 +54,7 @@ public async Task TestMerge() MergeTestUtil mergeTest = new MergeTestUtil(); mergeTest.DocumentContainer = await CreateDocumentContainerAsync( documents: documents, - numPartitions: 2, + numSplits: 2, failureConfigs: new FlakyDocumentContainer.FailureConfigs( inject429s: false, injectEmptyPages: false, @@ -249,6 +257,160 @@ public async Task Tracing() Assert.AreEqual(numTraces, rootTrace.Children.Count); } + [TestMethod] + public async Task OffsetLimitPageSize() + { + List documents = new List(); + for (int i = 0; i < 1100; i++) + { + documents.Add(CosmosObject.Parse($"{{\"pk\" : {i} }}")); + } + + MockInMemoryContainer mockInMemoryContainer = new MockInMemoryContainer(new InMemoryContainer(partitionKeyDefinition)); + DocumentContainer documentContainer = await CreateDocumentContainerAsync(documents, mockInMemoryContainer, numSplits: 4); + + // OFFSET/LIMIT with ORDER BY + await this.TestPageSizeAsync("SELECT c.pk FROM c ORDER BY c.pk OFFSET 0 LIMIT 500", expectedPageSize: 315, expectedResults: 500, mockInMemoryContainer, documentContainer); + await this.TestPageSizeAsync("SELECT c.pk FROM c ORDER BY c.pk OFFSET 10000 LIMIT 5000", expectedPageSize: 1000, expectedResults: 0, mockInMemoryContainer, documentContainer); + await this.TestPageSizeAsync("SELECT c.pk FROM c ORDER BY c.pk OFFSET 10 LIMIT 100", expectedPageSize: 70, expectedResults: 100, mockInMemoryContainer, documentContainer); + await this.TestPageSizeAsync("SELECT c.pk FROM c ORDER BY c.pk OFFSET 0 LIMIT 100", expectedPageSize: 65, expectedResults: 100, mockInMemoryContainer, documentContainer); + await this.TestPageSizeAsync("SELECT c.pk FROM c ORDER BY c.pk OFFSET 100 LIMIT 0", expectedPageSize: 65, expectedResults: 0, mockInMemoryContainer, documentContainer); + + // OFFSET/LIMIT without ORDER BY + await this.TestPageSizeAsync("SELECT c.pk FROM c OFFSET 10 LIMIT 100", expectedPageSize: 1000, expectedResults: 100, mockInMemoryContainer, documentContainer); + await this.TestPageSizeAsync("SELECT c.pk FROM c OFFSET 0 LIMIT 100", expectedPageSize: 1000, expectedResults: 100, mockInMemoryContainer, documentContainer); + await this.TestPageSizeAsync("SELECT c.pk FROM c OFFSET 100 LIMIT 0", expectedPageSize: 1000, expectedResults: 0, mockInMemoryContainer, documentContainer); + + // TOP with ORDER BY + await this.TestPageSizeAsync("SELECT TOP 5 c.pk FROM c ORDER BY c.pk", expectedPageSize: 5, expectedResults: 5, mockInMemoryContainer, documentContainer); + await this.TestPageSizeAsync("SELECT TOP 100 c.pk FROM c ORDER BY c.pk", expectedPageSize: 65, expectedResults: 100, mockInMemoryContainer, documentContainer); + await this.TestPageSizeAsync("SELECT TOP 5000 c.pk FROM c ORDER BY c.pk", expectedPageSize: 1000, expectedResults: 1100, mockInMemoryContainer, documentContainer); + await this.TestPageSizeAsync("SELECT TOP 15000 c.pk FROM c ORDER BY c.pk", expectedPageSize: 1000, expectedResults: 1100, mockInMemoryContainer, documentContainer); + + // TOP without ORDER BY + await this.TestPageSizeAsync("SELECT TOP 5 c.pk FROM c", expectedPageSize: 1000, expectedResults: 5, mockInMemoryContainer, documentContainer); + await this.TestPageSizeAsync("SELECT TOP 5000 c.pk FROM c", expectedPageSize: 1000, expectedResults: 1100, mockInMemoryContainer, documentContainer); + await this.TestPageSizeAsync("SELECT TOP 15000 c.pk FROM c", expectedPageSize: 1000, expectedResults: 1100, mockInMemoryContainer, documentContainer); + } + + private async Task TestPageSizeAsync(string query, int expectedPageSize, int expectedResults, MockInMemoryContainer inMemoryContainer, DocumentContainer documentContainer) + { + (CosmosQueryExecutionContextFactory.InputParameters inputParameters, CosmosQueryContextCore cosmosQueryContextCore) = CreateInputParamsAndQueryContext( + query, + partitionKeyDefinition, + null, + new QueryRequestOptions()); + + IQueryPipelineStage queryPipelineStage = CosmosQueryExecutionContextFactory.Create( + documentContainer, + cosmosQueryContextCore, + inputParameters, + NoOpTrace.Singleton); + + List elements = new List(); + while (await queryPipelineStage.MoveNextAsync(NoOpTrace.Singleton)) + { + TryCatch tryGetQueryPage = queryPipelineStage.Current; + tryGetQueryPage.ThrowIfFailed(); + + elements.AddRange(tryGetQueryPage.Result.Documents); + } + + Assert.AreEqual(expected: expectedPageSize, actual: inMemoryContainer.PageSizeSpecified); + Assert.AreEqual(expected: expectedResults, actual: elements.Count); + } + + private static Tuple CreateInputParamsAndQueryContext( + string query, + PartitionKeyDefinition partitionKeyDefinition, + Cosmos.PartitionKey? partitionKeyValue, + QueryRequestOptions queryRequestOptions) + { + CosmosSerializerCore serializerCore = new(); + using StreamReader streamReader = new(serializerCore.ToStreamSqlQuerySpec(new SqlQuerySpec(query), Documents.ResourceType.Document)); + string sqlQuerySpecJsonString = streamReader.ReadToEnd(); + + CosmosQueryExecutionContextFactory.InputParameters inputParameters = new CosmosQueryExecutionContextFactory.InputParameters( + sqlQuerySpec: new SqlQuerySpec(query), + initialUserContinuationToken: null, + initialFeedRange: null, + maxConcurrency: queryRequestOptions.MaxConcurrency, + maxItemCount: queryRequestOptions.MaxItemCount, + maxBufferedItemCount: queryRequestOptions.MaxBufferedItemCount, + partitionKey: partitionKeyValue, + properties: new Dictionary() { { "x-ms-query-partitionkey-definition", partitionKeyDefinition } }, + partitionedQueryExecutionInfo: null, + executionEnvironment: null, + returnResultsInDeterministicOrder: null, + forcePassthrough: false, + enableOptimisticDirectExecution: queryRequestOptions.EnableOptimisticDirectExecution, + testInjections: queryRequestOptions.TestSettings); + + string databaseId = "db1234"; + string resourceLink = $"dbs/{databaseId}/colls"; + + const string suffix = "-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF"; + + List partitionKeyRanges = new List + { + new PartitionKeyRange() { MinInclusive = Documents.Routing.PartitionKeyInternal.MinimumInclusiveEffectivePartitionKey, MaxExclusive = "1F" + suffix }, + new PartitionKeyRange() { MinInclusive = "1F" + suffix, MaxExclusive = "3F" + suffix }, + new PartitionKeyRange() { MinInclusive = "3F" + suffix, MaxExclusive = "5F" + suffix }, + new PartitionKeyRange() { MinInclusive = "5F" + suffix, MaxExclusive = "7F" + suffix }, + new PartitionKeyRange() { MinInclusive = "7F" + suffix, MaxExclusive = "9F" + suffix }, + new PartitionKeyRange() { MinInclusive = "9F" + suffix, MaxExclusive = "BF" + suffix }, + new PartitionKeyRange() { MinInclusive = "BF" + suffix, MaxExclusive = "DF" + suffix }, + new PartitionKeyRange() { MinInclusive = "DF" + suffix, MaxExclusive = Documents.Routing.PartitionKeyInternal.MaximumExclusiveEffectivePartitionKey }, + }; + + Mock mockClient = new Mock(); + + mockClient.Setup(x => x.GetTargetPartitionKeyRangesAsync( + It.IsAny(), + It.IsAny(), + It.IsAny>>(), + It.IsAny(), + It.IsAny())) + .Returns((string resourceLink, string collectionResourceId, IReadOnlyList> providedRanges, bool forceRefresh, ITrace trace) => Task.FromResult(partitionKeyRanges)); + + mockClient.Setup(x => x.TryGetPartitionedQueryExecutionInfoAsync( + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny(), + It.IsAny())) + .Returns((SqlQuerySpec sqlQuerySpec, ResourceType resourceType, PartitionKeyDefinition partitionKeyDefinition, bool requireFormattableOrderByQuery, bool isContinuationExpected, bool allowNonValueAggregateQuery, bool hasLogicalPartitionKey, bool allowDCount, bool useSystemPrefix, Cosmos.GeospatialType geospatialType, CancellationToken cancellationToken) => + { + CosmosSerializerCore serializerCore = new(); + using StreamReader streamReader = new(serializerCore.ToStreamSqlQuerySpec(sqlQuerySpec, Documents.ResourceType.Document)); + string sqlQuerySpecJsonString = streamReader.ReadToEnd(); + + TryCatch queryPlan = OptimisticDirectExecutionQueryBaselineTests.TryGetPartitionedQueryExecutionInfo(sqlQuerySpecJsonString, partitionKeyDefinition); + PartitionedQueryExecutionInfo partitionedQueryExecutionInfo = queryPlan.Succeeded ? queryPlan.Result : throw queryPlan.Exception; + return Task.FromResult(TryCatch.FromResult(partitionedQueryExecutionInfo)); + } + ); + + CosmosQueryContextCore cosmosQueryContextCore = new CosmosQueryContextCore( + client: mockClient.Object, + resourceTypeEnum: Documents.ResourceType.Document, + operationType: Documents.OperationType.Query, + resourceType: typeof(QueryResponseCore), + resourceLink: resourceLink, + isContinuationExpected: true, + allowNonValueAggregateQuery: true, + useSystemPrefix: false, + correlatedActivityId: Guid.NewGuid()); + + return Tuple.Create(inputParameters, cosmosQueryContextCore); + } + internal static async Task> ExecuteQueryAsync( string query, IReadOnlyList documents, @@ -329,13 +491,13 @@ private static async Task> DrainWithStateAsync(string query, return elements; } - internal static Task CreateDocumentContainerAsync( + internal static Task CreateDocumentContainerAsync( IReadOnlyList documents, - int numPartitions = 3, + int numSplits = 3, FlakyDocumentContainer.FailureConfigs failureConfigs = null) { IMonadicDocumentContainer monadicDocumentContainer = CreateMonadicDocumentContainerAsync(failureConfigs); - return CreateDocumentContainerAsync(documents, monadicDocumentContainer, numPartitions); + return CreateDocumentContainerAsync(documents, monadicDocumentContainer, numSplits); } internal static IMonadicDocumentContainer CreateMonadicDocumentContainerAsync(FlakyDocumentContainer.FailureConfigs failureConfigs) @@ -349,14 +511,14 @@ internal static IMonadicDocumentContainer CreateMonadicDocumentContainerAsync(Fl return monadicDocumentContainer; } - internal static async Task CreateDocumentContainerAsync( + internal static async Task CreateDocumentContainerAsync( IReadOnlyList documents, IMonadicDocumentContainer monadicDocumentContainer, - int numPartitions) + int numSplits) { DocumentContainer documentContainer = new DocumentContainer(monadicDocumentContainer); - for (int i = 0; i < numPartitions; i++) + for (int i = 0; i < numSplits; i++) { IReadOnlyList ranges = await documentContainer.GetFeedRangesAsync( trace: NoOpTrace.Singleton, @@ -461,5 +623,79 @@ public async Task ShouldReturnFailure() } } } + + private class MockInMemoryContainer : IMonadicDocumentContainer + { + public int? PageSizeSpecified { get; private set; } + public IMonadicDocumentContainer MonadicDocumentContainer { get; } + + public MockInMemoryContainer(IMonadicDocumentContainer documentContainer) + { + this.MonadicDocumentContainer = documentContainer; + this.PageSizeSpecified = null; + } + + public void Reset() + { + this.PageSizeSpecified = null; + } + + public Task> MonadicChangeFeedAsync(FeedRangeState feedRangeState, ChangeFeedPaginationOptions changeFeedPaginationOptions, ITrace trace, CancellationToken cancellationToken) + { + return this.MonadicDocumentContainer.MonadicChangeFeedAsync(feedRangeState, changeFeedPaginationOptions, trace, cancellationToken); + } + + public Task> MonadicCreateItemAsync(CosmosObject payload, CancellationToken cancellationToken) + { + return this.MonadicDocumentContainer.MonadicCreateItemAsync(payload, cancellationToken); + } + + public Task>> MonadicGetChildRangeAsync(FeedRangeInternal feedRange, ITrace trace, CancellationToken cancellationToken) + { + return this.MonadicDocumentContainer.MonadicGetChildRangeAsync(feedRange, trace, cancellationToken); + } + + public Task>> MonadicGetFeedRangesAsync(ITrace trace, CancellationToken cancellationToken) + { + return this.MonadicDocumentContainer.MonadicGetFeedRangesAsync(trace, cancellationToken); + } + + public Task> MonadicGetResourceIdentifierAsync(ITrace trace, CancellationToken cancellationToken) + { + return this.MonadicDocumentContainer.MonadicGetResourceIdentifierAsync(trace, cancellationToken); + } + + public Task MonadicMergeAsync(FeedRangeInternal feedRange1, FeedRangeInternal feedRange2, CancellationToken cancellationToken) + { + return this.MonadicDocumentContainer.MonadicMergeAsync(feedRange1, feedRange2, cancellationToken); + } + + public Task> MonadicQueryAsync(SqlQuerySpec sqlQuerySpec, FeedRangeState feedRangeState, QueryPaginationOptions queryPaginationOptions, ITrace trace, CancellationToken cancellationToken) + { + this.PageSizeSpecified = queryPaginationOptions.PageSizeLimit; + + return this.MonadicDocumentContainer.MonadicQueryAsync(sqlQuerySpec, feedRangeState, queryPaginationOptions, trace, cancellationToken); + } + + public Task> MonadicReadFeedAsync(FeedRangeState feedRangeState, ReadFeedPaginationOptions readFeedPaginationOptions, ITrace trace, CancellationToken cancellationToken) + { + return this.MonadicDocumentContainer.MonadicReadFeedAsync(feedRangeState, readFeedPaginationOptions, trace, cancellationToken); + } + + public Task> MonadicReadItemAsync(CosmosElement partitionKey, string identifier, CancellationToken cancellationToken) + { + return this.MonadicDocumentContainer.MonadicReadItemAsync(partitionKey, identifier, cancellationToken); + } + + public Task MonadicRefreshProviderAsync(ITrace trace, CancellationToken cancellationToken) + { + return this.MonadicDocumentContainer.MonadicRefreshProviderAsync(trace, cancellationToken); + } + + public Task MonadicSplitAsync(FeedRangeInternal feedRange, CancellationToken cancellationToken) + { + return this.MonadicDocumentContainer.MonadicSplitAsync(feedRange, cancellationToken); + } + } } } From 9175f51fa500ebd5e91196359680891bfd913be0 Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 31 Oct 2023 22:07:48 +0530 Subject: [PATCH 226/240] [Internal] Client Telemetry: Adds telemetry contract (#4161) * add tests * fix tests * remove unreated files --- CODEOWNERS | 1 + .../Contracts/ContractEnforcement.cs | 39 +- .../Contracts/ContractEnforcementTests.cs | 10 + .../Contracts/DotNetSDKTelemetryAPI.json | 356 ++++++++++++++++++ .../Microsoft.Azure.Cosmos.Tests.csproj | 3 + UpdateContracts.ps1 | 8 + 6 files changed, 415 insertions(+), 2 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKTelemetryAPI.json diff --git a/CODEOWNERS b/CODEOWNERS index 6015906184..d7c4173831 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -20,4 +20,5 @@ Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts @kirillg @ki Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Contracts @kirillg @kirankumarkolli @ealsur @FabianMeiswinkel Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @Azure/azure-cosmosdb-lt Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @Azure/azure-cosmosdb-lt +Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKTelemetryAPI.json @Azure/azure-cosmosdb-lt CODEOWNERS @kirillg @kirankumarkolli diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/ContractEnforcement.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/ContractEnforcement.cs index 6c71504738..f0e127495a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/ContractEnforcement.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/ContractEnforcement.cs @@ -130,7 +130,7 @@ private static string GenerateNameWithFieldAttributes(FieldInfo fieldInfo) $"{nameof(fieldInfo.IsStatic)}:{(fieldInfo.IsStatic ? bool.TrueString : bool.FalseString)};"; } - private static TypeTree BuildTypeTree(TypeTree root, Type[] types) + private static TypeTree BuildTypeTree(TypeTree root, Type[] types, BindingFlags bindingflags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly) { IEnumerable subclassTypes = types.Where((type) => type.IsSubclassOf(root.Type)).OrderBy(o => o.FullName, invariantComparer); foreach (Type subclassType in subclassTypes) @@ -139,7 +139,7 @@ private static TypeTree BuildTypeTree(TypeTree root, Type[] types) } IEnumerable> memberInfos = - root.Type.GetMembers(BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly) + root.Type.GetMembers(bindingflags) .Select(memberInfo => new KeyValuePair($"{memberInfo}{string.Join("-", ContractEnforcement.RemoveDebugSpecificAttributes(memberInfo.CustomAttributes))}", memberInfo)) .OrderBy(o => o.Key, invariantComparer); foreach (KeyValuePair memberInfo in memberInfos) @@ -203,6 +203,18 @@ public static void ValidateContractContainBreakingChanges( ContractEnforcement.ValidateJsonAreSame(localJson, baselineJson); } + public static void ValidateTelemetryContractContainBreakingChanges( + string dllName, + string baselinePath, + string breakingChangesPath) + { + string localTelemetryJson = GetCurrentTelemetryContract(dllName); + File.WriteAllText($"Contracts/{breakingChangesPath}", localTelemetryJson); + + string telemetryBaselineJson = GetBaselineContract(baselinePath); + ContractEnforcement.ValidateJsonAreSame(localTelemetryJson, telemetryBaselineJson); + } + public static void ValidatePreviewContractContainBreakingChanges( string dllName, string officialBaselinePath, @@ -238,6 +250,29 @@ public static string GetCurrentContract(string dllName) return localJson; } + public static string GetCurrentTelemetryContract(string dllName) + { + List nonTelemetryModels = new List + { + "AzureVMMetadata", + "Compute" + }; + + TypeTree locally = new TypeTree(typeof(object)); + Assembly assembly = ContractEnforcement.GetAssemblyLocally(dllName); + Type[] exportedTypes = assembly.GetTypes().Where(t => + t!= null && + t.Namespace != null && + t.Namespace.Contains("Microsoft.Azure.Cosmos.Telemetry.Models") && + !nonTelemetryModels.Contains(t.Name)) + .ToArray(); + + ContractEnforcement.BuildTypeTree(locally, exportedTypes, BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly); + + string localJson = JsonConvert.SerializeObject(locally, Formatting.Indented); + return localJson; + } + public static string GetBaselineContract(string baselinePath) { string baselineFile = File.ReadAllText("Contracts/" + baselinePath); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/ContractEnforcementTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/ContractEnforcementTests.cs index 2e3a6457b3..c4fdacc939 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/ContractEnforcementTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/ContractEnforcementTests.cs @@ -10,6 +10,7 @@ public class ContractEnforcementTests { private const string DllName = "Microsoft.Azure.Cosmos.Client"; private const string OfficialBaselinePath = "DotNetSDKAPI.json"; + private const string OfficialTelemetryBaselinePath = "DotNetSDKTelemetryAPI.json"; #if PREVIEW [TestMethod] @@ -30,6 +31,15 @@ public void ContractChanges() baselinePath: OfficialBaselinePath, breakingChangesPath: "DotNetSDKAPIChanges.json"); } + + [TestMethod] + public void TelemetryContractChanges() + { + ContractEnforcement.ValidateTelemetryContractContainBreakingChanges( + dllName: DllName, + baselinePath: OfficialTelemetryBaselinePath, + breakingChangesPath: "DotNetSDKTelemetryAPIChanges.json"); + } #endif [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKTelemetryAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKTelemetryAPI.json new file mode 100644 index 0000000000..bfc2bb20e6 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKTelemetryAPI.json @@ -0,0 +1,356 @@ +{ + "Subclasses": { + "Microsoft.Azure.Cosmos.Telemetry.Models.CacheRefreshInfo;Microsoft.Azure.Cosmos.Telemetry.Models.OperationInfo;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:True": { + "Subclasses": {}, + "Members": { + "Boolean Equals(System.Object)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Boolean Equals(System.Object);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int32 GetHashCode()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Int32 GetHashCode();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, + "Microsoft.Azure.Cosmos.Telemetry.Models.ClientTelemetryProperties;System.Object;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:True": { + "Subclasses": {}, + "Members": { + "Void .ctor(System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.Nullable`1[System.Boolean], System.Collections.Generic.IReadOnlyList`1[System.String], System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.SystemInfo], System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.CacheRefreshInfo], System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.OperationInfo], System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.RequestInfo], System.String)[Newtonsoft.Json.JsonConstructorAttribute()]": { + "Type": "Constructor", + "Attributes": [ + "JsonConstructorAttribute" + ], + "MethodInfo": "[Void .ctor(System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.Nullable`1[System.Boolean], System.Collections.Generic.IReadOnlyList`1[System.String], System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.SystemInfo], System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.CacheRefreshInfo], System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.OperationInfo], System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.RequestInfo], System.String)[Newtonsoft.Json.JsonConstructorAttribute()], Void .ctor(System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.Nullable`1[System.Boolean], System.Collections.Generic.IReadOnlyList`1[System.String], System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.SystemInfo], System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.CacheRefreshInfo], System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.OperationInfo], System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.RequestInfo], System.String)]" + }, + "Void Write(Newtonsoft.Json.JsonWriter)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Void Write(Newtonsoft.Json.JsonWriter);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, + "Microsoft.Azure.Cosmos.Telemetry.Models.MetricInfo;System.Object;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:True": { + "Subclasses": {}, + "Members": { + "Void .ctor(System.String, System.String, Double, Int64, Int64, Int64, System.Collections.Generic.IReadOnlyDictionary`2[System.Double,System.Double])": { + "Type": "Constructor", + "Attributes": [], + "MethodInfo": "[Void .ctor(System.String, System.String, Double, Int64, Int64, Int64, System.Collections.Generic.IReadOnlyDictionary`2[System.Double,System.Double]), Void .ctor(System.String, System.String, Double, Int64, Int64, Int64, System.Collections.Generic.IReadOnlyDictionary`2[System.Double,System.Double])]" + } + }, + "NestedTypes": {} + }, + "Microsoft.Azure.Cosmos.Telemetry.Models.OperationInfo;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:True": { + "Subclasses": { + "Microsoft.Azure.Cosmos.Telemetry.Models.CacheRefreshInfo;Microsoft.Azure.Cosmos.Telemetry.Models.OperationInfo;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:True": { + "Subclasses": {}, + "Members": { + "Boolean Equals(System.Object)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Boolean Equals(System.Object);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int32 GetHashCode()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Int32 GetHashCode();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + } + }, + "Members": { + "Boolean Equals(System.Object)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Boolean Equals(System.Object);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int32 get_SubStatusCode()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Int32 get_SubStatusCode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int32 GetHashCode()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Int32 GetHashCode();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int32 SubStatusCode[Newtonsoft.Json.JsonPropertyAttribute(PropertyName = \"subStatusCode\")]": { + "Type": "Property", + "Attributes": [ + "JsonPropertyAttribute" + ], + "MethodInfo": "Int32 SubStatusCode;CanRead:True;CanWrite:False;Int32 get_SubStatusCode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.Telemetry.Models.OperationInfo Copy()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.Telemetry.Models.OperationInfo Copy();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Nullable`1[System.Int32] get_StatusCode()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.Nullable`1[System.Int32] get_StatusCode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Nullable`1[System.Int32] StatusCode[Newtonsoft.Json.JsonPropertyAttribute(PropertyName = \"statusCode\")]": { + "Type": "Property", + "Attributes": [ + "JsonPropertyAttribute" + ], + "MethodInfo": "System.Nullable`1[System.Int32] StatusCode;CanRead:True;CanWrite:False;System.Nullable`1[System.Int32] get_StatusCode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void .ctor(System.String, System.Nullable`1[System.Boolean], System.String, System.String, System.String, System.String, System.String, System.Nullable`1[System.Int32], Int32, Microsoft.Azure.Cosmos.Telemetry.Models.MetricInfo)": { + "Type": "Constructor", + "Attributes": [], + "MethodInfo": "[Void .ctor(System.String, System.Nullable`1[System.Boolean], System.String, System.String, System.String, System.String, System.String, System.Nullable`1[System.Int32], Int32, Microsoft.Azure.Cosmos.Telemetry.Models.MetricInfo), Void .ctor(System.String, System.Nullable`1[System.Boolean], System.String, System.String, System.String, System.String, System.String, System.Nullable`1[System.Int32], Int32, Microsoft.Azure.Cosmos.Telemetry.Models.MetricInfo)]" + } + }, + "NestedTypes": {} + }, + "Microsoft.Azure.Cosmos.Telemetry.Models.RequestInfo;System.Object;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:True": { + "Subclasses": {}, + "Members": { + "Boolean Equals(System.Object)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Boolean Equals(System.Object);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Double GetP99Latency()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Double GetP99Latency();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Double GetSampleCount()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Double GetSampleCount();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int32 get_SubStatusCode()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Int32 get_SubStatusCode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int32 GetHashCode()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Int32 GetHashCode();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int32 GetHashCodeForSampler()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Int32 GetHashCodeForSampler();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int32 SubStatusCode[Newtonsoft.Json.JsonPropertyAttribute(\"subStatusCode\")]": { + "Type": "Property", + "Attributes": [ + "JsonPropertyAttribute" + ], + "MethodInfo": "Int32 SubStatusCode;CanRead:True;CanWrite:True;Int32 get_SubStatusCode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_SubStatusCode(Int32);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.MetricInfo] get_Metrics()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.MetricInfo] get_Metrics();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.MetricInfo] Metrics[Newtonsoft.Json.JsonPropertyAttribute(\"metricInfo\")]": { + "Type": "Property", + "Attributes": [ + "JsonPropertyAttribute" + ], + "MethodInfo": "System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.MetricInfo] Metrics;CanRead:True;CanWrite:True;System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.MetricInfo] get_Metrics();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_Metrics(System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.MetricInfo]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Nullable`1[System.Int32] get_StatusCode()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.Nullable`1[System.Int32] get_StatusCode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Nullable`1[System.Int32] StatusCode[Newtonsoft.Json.JsonPropertyAttribute(\"statusCode\")]": { + "Type": "Property", + "Attributes": [ + "JsonPropertyAttribute" + ], + "MethodInfo": "System.Nullable`1[System.Int32] StatusCode;CanRead:True;CanWrite:True;System.Nullable`1[System.Int32] get_StatusCode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_StatusCode(System.Nullable`1[System.Int32]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String ContainerName[Newtonsoft.Json.JsonPropertyAttribute(\"containerName\")]": { + "Type": "Property", + "Attributes": [ + "JsonPropertyAttribute" + ], + "MethodInfo": "System.String ContainerName;CanRead:True;CanWrite:True;System.String get_ContainerName();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_ContainerName(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String DatabaseName[Newtonsoft.Json.JsonPropertyAttribute(\"databaseName\")]": { + "Type": "Property", + "Attributes": [ + "JsonPropertyAttribute" + ], + "MethodInfo": "System.String DatabaseName;CanRead:True;CanWrite:True;System.String get_DatabaseName();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_DatabaseName(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String get_ContainerName()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.String get_ContainerName();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String get_DatabaseName()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.String get_DatabaseName();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String get_Operation()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.String get_Operation();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String get_Resource()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.String get_Resource();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String get_Uri()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.String get_Uri();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String Operation[Newtonsoft.Json.JsonPropertyAttribute(\"operation\")]": { + "Type": "Property", + "Attributes": [ + "JsonPropertyAttribute" + ], + "MethodInfo": "System.String Operation;CanRead:True;CanWrite:True;System.String get_Operation();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_Operation(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String Resource[Newtonsoft.Json.JsonPropertyAttribute(\"resource\")]": { + "Type": "Property", + "Attributes": [ + "JsonPropertyAttribute" + ], + "MethodInfo": "System.String Resource;CanRead:True;CanWrite:True;System.String get_Resource();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_Resource(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String ToString()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.String ToString();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String Uri[Newtonsoft.Json.JsonPropertyAttribute(\"uri\")]": { + "Type": "Property", + "Attributes": [ + "JsonPropertyAttribute" + ], + "MethodInfo": "System.String Uri;CanRead:True;CanWrite:True;System.String get_Uri();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_Uri(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void .ctor()": { + "Type": "Constructor", + "Attributes": [], + "MethodInfo": "[Void .ctor(), Void .ctor()]" + }, + "Void set_ContainerName(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_ContainerName(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_DatabaseName(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_DatabaseName(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_Metrics(System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.MetricInfo])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_Metrics(System.Collections.Generic.List`1[Microsoft.Azure.Cosmos.Telemetry.Models.MetricInfo]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_Operation(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_Operation(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_Resource(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_Resource(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_StatusCode(System.Nullable`1[System.Int32])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_StatusCode(System.Nullable`1[System.Int32]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_SubStatusCode(Int32)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_SubStatusCode(Int32);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_Uri(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_Uri(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, + "Microsoft.Azure.Cosmos.Telemetry.Models.SystemInfo;System.Object;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:True": { + "Subclasses": {}, + "Members": { + "Void .ctor(Microsoft.Azure.Cosmos.Telemetry.Models.MetricInfo)": { + "Type": "Constructor", + "Attributes": [], + "MethodInfo": "[Void .ctor(Microsoft.Azure.Cosmos.Telemetry.Models.MetricInfo), Void .ctor(Microsoft.Azure.Cosmos.Telemetry.Models.MetricInfo)]" + } + }, + "NestedTypes": {} + } + }, + "Members": { + "System.Object MemberwiseClone()[System.Runtime.CompilerServices.NullableContextAttribute((Byte)1)]-[System.Runtime.CompilerServices.IntrinsicAttribute()]": { + "Type": "Method", + "Attributes": [ + "IntrinsicAttribute", + "NullableContextAttribute" + ], + "MethodInfo": "System.Object MemberwiseClone();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void Finalize()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Void Finalize();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj index 6f1657f37c..81d0b6797a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj @@ -271,6 +271,9 @@ Always + + Always + PreserveNewest diff --git a/UpdateContracts.ps1 b/UpdateContracts.ps1 index 513860136e..cece416f54 100644 --- a/UpdateContracts.ps1 +++ b/UpdateContracts.ps1 @@ -13,6 +13,14 @@ if(!(Test-Path -Path $updatedContractFile)){ Write-Output ("Updated contract " + $updatedContractFile) } +$updatedContractFile = ".\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Release\net6.0\Contracts\DotNetSDKTelemetryAPIChanges.json" +if(!(Test-Path -Path $updatedContractFile)){ + Write-Error ("The contract file did not get updated with the build. Please fix the test to output the contract file: " + $updatedContractFile) +}else{ + Copy-Item -Path $updatedContractFile -Destination ".\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\Contracts\DotNetSDKTelemetryAPI.json" + Write-Output ("Updated contract " + $updatedContractFile) +} + $updatedContractFolder = ".\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Release\net6.0\BaselineTest\TestOutput\*" if(!(Test-Path -Path $updatedContractFolder)){ Write-Error ("The contract file did not get updated with the build. Please fix the test to output the contract file: " + $updatedContractFile) From 1f81b54a7a9cc3106a39bfd4aa84afb91778c741 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Nov 2023 06:53:33 +0530 Subject: [PATCH 227/240] Client Encryption: Adds Azure.Identity from 1.1.1 to 1.10.2 (#4134) * Bump Azure.Identity in /Microsoft.Azure.Cosmos.Encryption.Custom/src Bumps [Azure.Identity](https://github.com/Azure/azure-sdk-for-net) from 1.1.1 to 1.10.2. - [Release notes](https://github.com/Azure/azure-sdk-for-net/releases) - [Commits](https://github.com/Azure/azure-sdk-for-net/compare/Azure.Identity_1.1.1...Azure.Identity_1.10.2) --- updated-dependencies: - dependency-name: Azure.Identity dependency-type: direct:production ... Signed-off-by: dependabot[bot] * Update Microsoft.Azure.Cosmos.Encryption.Custom.csproj Updated the Azure.Core version --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Santosh Kulkarni <66682828+kr-santosh@users.noreply.github.com> Co-authored-by: Matias Quaranta --- .../src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj b/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj index a9f729c9ab..306cd923a9 100644 --- a/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj +++ b/Microsoft.Azure.Cosmos.Encryption.Custom/src/Microsoft.Azure.Cosmos.Encryption.Custom.csproj @@ -1,4 +1,4 @@ - + netstandard2.0 Microsoft.Azure.Cosmos.Encryption.Custom @@ -35,8 +35,8 @@ - - + + From f379919702a5cc5a7464c402a6704dac5397746d Mon Sep 17 00:00:00 2001 From: Aditya Kotalwar <94020786+akotalwar@users.noreply.github.com> Date: Fri, 3 Nov 2023 09:33:39 -0700 Subject: [PATCH 228/240] [Internal] Query: Removes ForcePassThrough support (#4160) * Remove passThrough from the codebase * Updated TestOptimisticDirectExecutionQueryAsync() to remove all aspects of passThrough from it * Undoing previous change * Removed forcePassThrough from FullPipelineTests.cs * Undoing changes to remove PassThrough * Undoing passThrough removal pt2 * Undoing changes to SanityQueryTests.cs * Updated TestTryExecuteQueryHelper() * Updated comment * Changed boolean location * Removed TryExecuteQueryAsync() * Fixed indentation --- .../CosmosQueryExecutionContextFactory.cs | 66 +++------- .../src/Query/v3Query/QueryIterator.cs | 2 - .../Resource/Container/ContainerCore.Items.cs | 117 ------------------ .../Resource/Container/ContainerInternal.cs | 9 -- .../Query/SanityQueryTests.cs | 99 --------------- ...misticDirectExecutionQueryBaselineTests.cs | 1 - .../Query/Pipeline/FullPipelineTests.cs | 1 - 7 files changed, 18 insertions(+), 277 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs index 4c43b83e58..08e6292a03 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs @@ -161,29 +161,7 @@ private static async Task> TryCreateCoreContextAsy } PartitionedQueryExecutionInfo partitionedQueryExecutionInfo; - if (inputParameters.ForcePassthrough) - { - partitionedQueryExecutionInfo = new PartitionedQueryExecutionInfo() - { - QueryInfo = new QueryInfo() - { - Aggregates = null, - DistinctType = DistinctQueryType.None, - GroupByAliases = null, - GroupByAliasToAggregateType = null, - GroupByExpressions = null, - HasSelectValue = false, - Limit = null, - Offset = null, - OrderBy = null, - OrderByExpressions = null, - RewrittenQuery = null, - Top = null, - }, - QueryRanges = new List>(), - }; - } - else if (queryPlanFromContinuationToken != null) + if (queryPlanFromContinuationToken != null) { partitionedQueryExecutionInfo = queryPlanFromContinuationToken; } @@ -270,26 +248,7 @@ private static async Task> TryCreateFromPartitione inputParameters.InitialFeedRange, trace); - bool singleLogicalPartitionKeyQuery = inputParameters.PartitionKey.HasValue - || ((partitionedQueryExecutionInfo.QueryRanges.Count == 1) - && partitionedQueryExecutionInfo.QueryRanges[0].IsSingleValue); - bool serverStreamingQuery = !partitionedQueryExecutionInfo.QueryInfo.HasAggregates - && !partitionedQueryExecutionInfo.QueryInfo.HasDistinct - && !partitionedQueryExecutionInfo.QueryInfo.HasGroupBy; - bool streamingSinglePartitionQuery = singleLogicalPartitionKeyQuery && serverStreamingQuery; - - bool clientStreamingQuery = - serverStreamingQuery - && !partitionedQueryExecutionInfo.QueryInfo.HasOrderBy - && !partitionedQueryExecutionInfo.QueryInfo.HasTop - && !partitionedQueryExecutionInfo.QueryInfo.HasLimit - && !partitionedQueryExecutionInfo.QueryInfo.HasOffset; - bool streamingCrossContinuationQuery = !singleLogicalPartitionKeyQuery && clientStreamingQuery; - - bool createPassthroughQuery = streamingSinglePartitionQuery || streamingCrossContinuationQuery; - TryCatch tryCreatePipelineStage; - Documents.PartitionKeyRange targetRange = await TryGetTargetRangeOptimisticDirectExecutionAsync( inputParameters, partitionedQueryExecutionInfo, @@ -311,6 +270,22 @@ private static async Task> TryCreateFromPartitione } else { + bool singleLogicalPartitionKeyQuery = inputParameters.PartitionKey.HasValue + || ((partitionedQueryExecutionInfo.QueryRanges.Count == 1) + && partitionedQueryExecutionInfo.QueryRanges[0].IsSingleValue); + bool serverStreamingQuery = !partitionedQueryExecutionInfo.QueryInfo.HasAggregates + && !partitionedQueryExecutionInfo.QueryInfo.HasDistinct + && !partitionedQueryExecutionInfo.QueryInfo.HasGroupBy; + bool streamingSinglePartitionQuery = singleLogicalPartitionKeyQuery && serverStreamingQuery; + + bool clientStreamingQuery = serverStreamingQuery + && !partitionedQueryExecutionInfo.QueryInfo.HasOrderBy + && !partitionedQueryExecutionInfo.QueryInfo.HasTop + && !partitionedQueryExecutionInfo.QueryInfo.HasLimit + && !partitionedQueryExecutionInfo.QueryInfo.HasOffset; + bool streamingCrossContinuationQuery = !singleLogicalPartitionKeyQuery && clientStreamingQuery; + bool createPassthroughQuery = streamingSinglePartitionQuery || streamingCrossContinuationQuery; + if (createPassthroughQuery) { SetTestInjectionPipelineType(inputParameters, Passthrough); @@ -432,7 +407,6 @@ private static TryCatch TryCreateSpecializedDocumentQueryEx inputParameters.PartitionedQueryExecutionInfo, inputParameters.ExecutionEnvironment, inputParameters.ReturnResultsInDeterministicOrder, - inputParameters.ForcePassthrough, inputParameters.EnableOptimisticDirectExecution, inputParameters.TestInjections); } @@ -746,7 +720,7 @@ private static void SetTestInjectionPipelineType(InputParameters inputParameters { responseStats.PipelineType = TestInjections.PipelineType.Specialized; } - else + else { responseStats.PipelineType = TestInjections.PipelineType.Passthrough; } @@ -865,7 +839,6 @@ public InputParameters( PartitionedQueryExecutionInfo partitionedQueryExecutionInfo, ExecutionEnvironment? executionEnvironment, bool? returnResultsInDeterministicOrder, - bool forcePassthrough, bool enableOptimisticDirectExecution, TestInjections testInjections) { @@ -899,7 +872,6 @@ public InputParameters( this.PartitionedQueryExecutionInfo = partitionedQueryExecutionInfo; this.ExecutionEnvironment = executionEnvironment.GetValueOrDefault(InputParameters.DefaultExecutionEnvironment); this.ReturnResultsInDeterministicOrder = returnResultsInDeterministicOrder.GetValueOrDefault(InputParameters.DefaultReturnResultsInDeterministicOrder); - this.ForcePassthrough = forcePassthrough; this.EnableOptimisticDirectExecution = enableOptimisticDirectExecution; this.TestInjections = testInjections; } @@ -916,7 +888,6 @@ public InputParameters( public ExecutionEnvironment ExecutionEnvironment { get; } public bool ReturnResultsInDeterministicOrder { get; } public TestInjections TestInjections { get; } - public bool ForcePassthrough { get; } public bool EnableOptimisticDirectExecution { get; } public InputParameters WithContinuationToken(CosmosElement token) @@ -933,7 +904,6 @@ public InputParameters WithContinuationToken(CosmosElement token) this.PartitionedQueryExecutionInfo, this.ExecutionEnvironment, this.ReturnResultsInDeterministicOrder, - this.ForcePassthrough, this.EnableOptimisticDirectExecution, this.TestInjections); } diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs index 49407f7a4c..344e3e56e4 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/QueryIterator.cs @@ -66,7 +66,6 @@ public static QueryIterator Create( string resourceLink, bool isContinuationExpected, bool allowNonValueAggregateQuery, - bool forcePassthrough, PartitionedQueryExecutionInfo partitionedQueryExecutionInfo, Documents.ResourceType resourceType) { @@ -145,7 +144,6 @@ public static QueryIterator Create( partitionedQueryExecutionInfo: partitionedQueryExecutionInfo, executionEnvironment: queryRequestOptions.ExecutionEnvironment, returnResultsInDeterministicOrder: queryRequestOptions.ReturnResultsInDeterministicOrder, - forcePassthrough: forcePassthrough, enableOptimisticDirectExecution: queryRequestOptions.EnableOptimisticDirectExecution, testInjections: queryRequestOptions.TestSettings); diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs index 7bca68c8c8..13e5425d7d 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.Items.cs @@ -337,121 +337,6 @@ public async Task> ReadManyItemsAsync( cancellationToken); } - /// - /// Used in the compute gateway to support legacy gateway interface. - /// - public override async Task TryExecuteQueryAsync( - QueryFeatures supportedQueryFeatures, - QueryDefinition queryDefinition, - string continuationToken, - FeedRangeInternal feedRangeInternal, - QueryRequestOptions requestOptions, - GeospatialType geospatialType, - CancellationToken cancellationToken = default) - { - if (queryDefinition == null) - { - throw new ArgumentNullException(nameof(queryDefinition)); - } - - if (requestOptions == null) - { - throw new ArgumentNullException(nameof(requestOptions)); - } - - if (feedRangeInternal != null) - { - // The user has scoped down to a physical partition or logical partition. - // In either case let the query execute as a passthrough. - QueryIterator passthroughQueryIterator = QueryIterator.Create( - containerCore: this, - client: this.queryClient, - clientContext: this.ClientContext, - sqlQuerySpec: queryDefinition.ToSqlQuerySpec(), - continuationToken: continuationToken, - feedRangeInternal: feedRangeInternal, - queryRequestOptions: requestOptions, - resourceLink: this.LinkUri, - isContinuationExpected: false, - allowNonValueAggregateQuery: true, - forcePassthrough: true, // Forcing a passthrough, since we don't want to get the query plan nor try to rewrite it. - partitionedQueryExecutionInfo: null, - resourceType: ResourceType.Document); - - return new QueryPlanIsSupportedResult(passthroughQueryIterator); - } - - cancellationToken.ThrowIfCancellationRequested(); - - Documents.PartitionKeyDefinition partitionKeyDefinition; - if (requestOptions.Properties != null - && requestOptions.Properties.TryGetValue("x-ms-query-partitionkey-definition", out object partitionKeyDefinitionObject)) - { - if (!(partitionKeyDefinitionObject is Documents.PartitionKeyDefinition definition)) - { - throw new ArgumentException( - "partitionkeydefinition has invalid type", - nameof(partitionKeyDefinitionObject)); - } - - partitionKeyDefinition = definition; - } - else - { - ContainerQueryProperties containerQueryProperties = await this.queryClient.GetCachedContainerQueryPropertiesAsync( - this.LinkUri, - requestOptions.PartitionKey, - NoOpTrace.Singleton, - cancellationToken); - partitionKeyDefinition = containerQueryProperties.PartitionKeyDefinition; - } - - QueryPlanHandler queryPlanHandler = new QueryPlanHandler(this.queryClient); - - TryCatch<(PartitionedQueryExecutionInfo queryPlan, bool supported)> tryGetQueryInfoAndIfSupported = await queryPlanHandler.TryGetQueryInfoAndIfSupportedAsync( - supportedQueryFeatures, - queryDefinition.ToSqlQuerySpec(), - ResourceType.Document, - partitionKeyDefinition, - requestOptions.PartitionKey.HasValue, - useSystemPrefix: QueryIterator.IsSystemPrefixExpected(requestOptions), - geospatialType: geospatialType, - cancellationToken); - - if (tryGetQueryInfoAndIfSupported.Failed) - { - return new FailedToGetQueryPlanResult(tryGetQueryInfoAndIfSupported.Exception); - } - - (PartitionedQueryExecutionInfo queryPlan, bool supported) = tryGetQueryInfoAndIfSupported.Result; - TryExecuteQueryResult tryExecuteQueryResult; - if (supported) - { - QueryIterator queryIterator = QueryIterator.Create( - containerCore: this, - client: this.queryClient, - clientContext: this.ClientContext, - sqlQuerySpec: queryDefinition.ToSqlQuerySpec(), - continuationToken: continuationToken, - feedRangeInternal: feedRangeInternal, - queryRequestOptions: requestOptions, - resourceLink: this.LinkUri, - isContinuationExpected: false, - allowNonValueAggregateQuery: true, - forcePassthrough: false, - partitionedQueryExecutionInfo: queryPlan, - resourceType: ResourceType.Document); - - tryExecuteQueryResult = new QueryPlanIsSupportedResult(queryIterator); - } - else - { - tryExecuteQueryResult = new QueryPlanNotSupportedResult(queryPlan); - } - - return tryExecuteQueryResult; - } - public override FeedIterator GetItemQueryIterator( string queryText = null, string continuationToken = null, @@ -835,7 +720,6 @@ public override FeedIteratorInternal GetItemQueryStreamIteratorInternal( resourceLink: this.LinkUri, isContinuationExpected: isContinuationExcpected, allowNonValueAggregateQuery: true, - forcePassthrough: false, partitionedQueryExecutionInfo: null, resourceType: ResourceType.Document); } @@ -874,7 +758,6 @@ public override FeedIteratorInternal GetReadFeedIterator( resourceLink: resourceLink, isContinuationExpected: false, allowNonValueAggregateQuery: true, - forcePassthrough: false, partitionedQueryExecutionInfo: null, resourceType: resourceType); } diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInternal.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInternal.cs index 920fc5d694..dc532f6977 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInternal.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInternal.cs @@ -65,15 +65,6 @@ public abstract Task>> GetPartitionKeyPathTo public abstract Task GetRoutingMapAsync(CancellationToken cancellationToken); - public abstract Task TryExecuteQueryAsync( - QueryFeatures supportedQueryFeatures, - QueryDefinition queryDefinition, - string continuationToken, - FeedRangeInternal feedRangeInternal, - QueryRequestOptions requestOptions, - GeospatialType geospatialType, - CancellationToken cancellationToken = default); - public abstract FeedIterator GetStandByFeedIterator( string continuationToken = default, int? maxItemCount = default, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SanityQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SanityQueryTests.cs index 9eecd81e30..2074902249 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SanityQueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/SanityQueryTests.cs @@ -569,105 +569,6 @@ await QueryTestsBase.RunQueryAsync( } } - [TestMethod] - public async Task TestTryExecuteQuery() - { - await this.CreateIngestQueryDeleteAsync( - ConnectionModes.Direct | ConnectionModes.Gateway, - CollectionTypes.SinglePartition, - QueryTestsBase.NoDocuments, - this.TestTryExecuteQueryHelper); - } - - private async Task TestTryExecuteQueryHelper( - Container container, - IReadOnlyList documents) - { - ContainerInternal conatinerCore = (ContainerInlineCore)container; - foreach (int maxDegreeOfParallelism in new int[] { 1, 100 }) - { - foreach (int maxItemCount in new int[] { 10, 100 }) - { - foreach ((string query, QueryFeatures queryFeatures, bool canSupportExpected) in new Tuple[] - { - new Tuple("SELECT * FROM c", QueryFeatures.None, true), - new Tuple("SELECT * FROM c ORDER BY c._ts", QueryFeatures.None, false), - new Tuple("SELECT * FROM c ORDER BY c._ts", QueryFeatures.OrderBy, true), - }) - { - string continuationToken = null; - do - { - ContainerInternal.TryExecuteQueryResult tryExecuteQueryResult = await conatinerCore.TryExecuteQueryAsync( - supportedQueryFeatures: queryFeatures, - queryDefinition: new QueryDefinition(query), - requestOptions: new QueryRequestOptions() - { - MaxConcurrency = maxDegreeOfParallelism, - MaxItemCount = maxItemCount, - }, - feedRangeInternal: null, - continuationToken: continuationToken, - geospatialType: Cosmos.GeospatialType.Geography); - - if (canSupportExpected) - { - Assert.IsTrue(tryExecuteQueryResult is ContainerInternal.QueryPlanIsSupportedResult); - } - else - { - Assert.IsTrue(tryExecuteQueryResult is ContainerInternal.QueryPlanNotSupportedResult); - } - - if (canSupportExpected) - { - ContainerInternal.QueryPlanIsSupportedResult queryPlanIsSupportedResult = (ContainerInternal.QueryPlanIsSupportedResult)tryExecuteQueryResult; - ResponseMessage cosmosQueryResponse = await queryPlanIsSupportedResult.QueryIterator.ReadNextAsync(); - continuationToken = cosmosQueryResponse.ContinuationToken; - } - } while (continuationToken != null); - } - } - } - - { - // Test the syntax error case - ContainerInternal.TryExecuteQueryResult tryExecuteQueryResult = await conatinerCore.TryExecuteQueryAsync( - supportedQueryFeatures: QueryFeatures.None, - queryDefinition: new QueryDefinition("This is not a valid query."), - requestOptions: new QueryRequestOptions() - { - MaxConcurrency = 1, - MaxItemCount = 1, - }, - feedRangeInternal: null, - continuationToken: null, - geospatialType: Cosmos.GeospatialType.Geography); - - Assert.IsTrue(tryExecuteQueryResult is ContainerInternal.FailedToGetQueryPlanResult); - } - - { - // Test that the force passthrough mechanism works - ContainerInternal.TryExecuteQueryResult tryExecuteQueryResult = await conatinerCore.TryExecuteQueryAsync( - supportedQueryFeatures: QueryFeatures.None, // Not supporting any features - queryDefinition: new QueryDefinition("SELECT VALUE [{\"item\": {\"sum\": SUM(c.blah), \"count\": COUNT(c.blah)}}] FROM c"), // Query has aggregates - requestOptions: new QueryRequestOptions() - { - MaxConcurrency = 1, - MaxItemCount = 1, - }, - feedRangeInternal: new FeedRangePartitionKeyRange("0"), // filtering on a PkRangeId. - continuationToken: null, - geospatialType: Cosmos.GeospatialType.Geography); - - Assert.IsTrue(tryExecuteQueryResult is ContainerInternal.QueryPlanIsSupportedResult); - ContainerInternal.QueryPlanIsSupportedResult queryPlanIsSupportedResult = (ContainerInternal.QueryPlanIsSupportedResult)tryExecuteQueryResult; - ResponseMessage response = await queryPlanIsSupportedResult.QueryIterator.ReadNextAsync(); - Assert.IsTrue(response.IsSuccessStatusCode, response.ErrorMessage); - } - } - [TestMethod] public async Task TestMalformedPipelinedContinuationToken() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs index 9076506e64..d9d543c050 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs @@ -801,7 +801,6 @@ public override OptimisticDirectExecutionTestOutput ExecuteTest(OptimisticDirect partitionedQueryExecutionInfo: null, executionEnvironment: null, returnResultsInDeterministicOrder: null, - forcePassthrough: false, enableOptimisticDirectExecution: queryRequestOptions.EnableOptimisticDirectExecution, testInjections: queryRequestOptions.TestSettings); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/FullPipelineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/FullPipelineTests.cs index d717b86f89..b02f19374a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/FullPipelineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Pipeline/FullPipelineTests.cs @@ -342,7 +342,6 @@ private async Task TestPageSizeAsync(string query, int expectedPageSize, int exp partitionedQueryExecutionInfo: null, executionEnvironment: null, returnResultsInDeterministicOrder: null, - forcePassthrough: false, enableOptimisticDirectExecution: queryRequestOptions.EnableOptimisticDirectExecution, testInjections: queryRequestOptions.TestSettings); From f7a4c56f26b0d86ab1c3e9ea3f629ea3bb5ca775 Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Sun, 5 Nov 2023 22:27:16 -0800 Subject: [PATCH 229/240] [Internal] Upgrade Resiliency: Fixes Duplicate Channel and Task Creation. (#4123) * Code changes to fix duplicate channel and thread pool on refresh flow. * Code changes to fix failed tests. * Code changes to add global semaphore for concurrency control in address cache. * Code changes to refactor the refresh async method. * Code changes to address review comments. * Code changes to update summary. --- .../src/Routing/AsyncCacheNonBlocking.cs | 24 ++- .../src/Routing/GatewayAddressCache.cs | 50 ++++- .../CosmosBadReplicaTests.cs | 14 +- .../GatewayAddressCacheTests.cs | 199 +++++++++++++++--- .../MockSetupsHelper.cs | 11 +- .../Routing/AsyncCacheNonBlockingTests.cs | 74 +++---- 6 files changed, 271 insertions(+), 101 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Routing/AsyncCacheNonBlocking.cs b/Microsoft.Azure.Cosmos/src/Routing/AsyncCacheNonBlocking.cs index 9fb908d83f..4025863d19 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/AsyncCacheNonBlocking.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/AsyncCacheNonBlocking.cs @@ -9,7 +9,6 @@ namespace Microsoft.Azure.Cosmos using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Core.Trace; - using Microsoft.Azure.Cosmos.Tracing.TraceData; /// /// This is a thread safe AsyncCache that allows refreshing values in the background. @@ -179,21 +178,26 @@ public bool TryRemove(TKey key) /// /// Refreshes the async non blocking cache on-demand for the given - /// and caches the result for later usage. + /// and caches the result for later usage. Note that this method doesn't control the number + /// of tasks created in parallel, and the concurrency needed to be controlled at the caller. /// /// The requested key to be refreshed. /// A func delegate to be invoked at a later point of time. - public async Task RefreshAsync( + public void Refresh( TKey key, Func> singleValueInitFunc) { if (this.values.TryGetValue(key, out AsyncLazyWithRefreshTask initialLazyValue)) { - await this.UpdateCacheAndGetValueFromBackgroundTaskAsync( - key: key, - initialValue: initialLazyValue, - callbackDelegate: singleValueInitFunc, - operationName: nameof(RefreshAsync)); + Task backgroundRefreshTask = this.GetAsync( + key: key, + singleValueInitFunc: singleValueInitFunc, + forceRefresh: (_) => true); + + Task continuationTask = backgroundRefreshTask + .ContinueWith( + task => DefaultTrace.TraceVerbose("Failed to refresh addresses in the background with exception: {0}", task.Exception), + TaskContinuationOptions.OnlyOnFaulted); } } @@ -250,8 +254,8 @@ private sealed class AsyncLazyWithRefreshTask { private readonly CancellationToken cancellationToken; private readonly Func> createValueFunc; - private readonly object valueLock = new object(); - private readonly object removedFromCacheLock = new object(); + private readonly object valueLock = new (); + private readonly object removedFromCacheLock = new (); private bool removedFromCache = false; private Task value; diff --git a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs index 8bc429070e..f2012fe0bc 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GatewayAddressCache.cs @@ -50,12 +50,14 @@ internal class GatewayAddressCache : IAddressCache, IDisposable private readonly ICosmosAuthorizationTokenProvider tokenProvider; private readonly bool enableTcpConnectionEndpointRediscovery; + private readonly SemaphoreSlim semaphore; private readonly CosmosHttpClient httpClient; private readonly bool isReplicaAddressValidationEnabled; private Tuple masterPartitionAddressCache; private DateTime suboptimalMasterPartitionTimestamp; private bool disposedValue; + private bool validateUnknownReplicas; private IOpenConnectionsHandler openConnectionsHandler; public GatewayAddressCache( @@ -90,8 +92,10 @@ public GatewayAddressCache( Constants.Properties.Protocol, GatewayAddressCache.ProtocolString(this.protocol)); + this.semaphore = new SemaphoreSlim(1, 1); this.openConnectionsHandler = openConnectionsHandler; this.isReplicaAddressValidationEnabled = replicaAddressValidationEnabled; + this.validateUnknownReplicas = false; } public Uri ServiceEndpoint => this.serviceEndpoint; @@ -120,6 +124,14 @@ public async Task OpenConnectionsAsync( List tasks = new (); int batchSize = GatewayAddressCache.DefaultBatchSize; + // By design, the Unknown replicas are validated only when the following two conditions meet: + // 1) The CosmosClient is initiated using the CreateAndInitializaAsync() flow. + // 2) The advanced replica selection feature enabled. + if (shouldOpenRntbdChannels) + { + this.validateUnknownReplicas = true; + } + #if !(NETSTANDARD15 || NETSTANDARD16) #if NETSTANDARD20 // GetEntryAssembly returns null when loaded from native netstandard2.0 @@ -302,11 +314,12 @@ public async Task TryGetAddressesAsync( .ReplicaTransportAddressUris .Any(x => x.ShouldRefreshHealthStatus())) { - Task refreshAddressesInBackgroundTask = Task.Run(async () => + bool slimAcquired = await this.semaphore.WaitAsync(0); + try { - try + if (slimAcquired) { - await this.serverPartitionAddressCache.RefreshAsync( + this.serverPartitionAddressCache.Refresh( key: partitionKeyRangeIdentity, singleValueInitFunc: (currentCachedValue) => this.GetAddressesForRangeIdAsync( request, @@ -315,14 +328,21 @@ await this.serverPartitionAddressCache.RefreshAsync( partitionKeyRangeIdentity.PartitionKeyRangeId, forceRefresh: true)); } - catch (Exception ex) + else { - DefaultTrace.TraceWarning("Failed to refresh addresses in the background for the collection rid: {0} with exception: {1}. '{2}'", + DefaultTrace.TraceVerbose("Failed to refresh addresses in the background for the collection rid: {0}, partition key range id: {1}, because the semaphore is already acquired. '{2}'", partitionKeyRangeIdentity.CollectionRid, - ex, + partitionKeyRangeIdentity.PartitionKeyRangeId, System.Diagnostics.Trace.CorrelationManager.ActivityId); } - }); + } + finally + { + if (slimAcquired) + { + this.semaphore.Release(); + } + } } return addresses; @@ -1008,18 +1028,26 @@ private static PartitionAddressInformation MergeAddresses( /// Returns a list of needed to validate their health status. Validating /// a uri is done by opening Rntbd connection to the backend replica, which is a costly operation by nature. Therefore /// vaidating both Unhealthy and Unknown replicas at the same time could impose a high CPU utilization. To avoid this - /// situation, the RntbdOpenConnectionHandler has good concurrency control mechanism to open the connections gracefully/>. + /// situation, the RntbdOpenConnectionHandler has good concurrency control mechanism to open the connections gracefully. + /// By default, this method only returns the Unhealthy replicas that requires to validate it's connectivity status. The + /// Unknown replicas are validated only when the CosmosClient is initiated using the CreateAndInitializaAsync() flow. /// /// A read only list of s. /// A list of that needs to validate their status. private IEnumerable GetAddressesNeededToValidateStatus( IReadOnlyList transportAddresses) { - return transportAddresses - .Where(address => address + return this.validateUnknownReplicas + ? transportAddresses + .Where(address => address + .GetCurrentHealthState() + .GetHealthStatus() is + TransportAddressHealthState.HealthStatus.UnhealthyPending or + TransportAddressHealthState.HealthStatus.Unknown) + : transportAddresses + .Where(address => address .GetCurrentHealthState() .GetHealthStatus() is - TransportAddressHealthState.HealthStatus.Unknown or TransportAddressHealthState.HealthStatus.UnhealthyPending); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosBadReplicaTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosBadReplicaTests.cs index 151e0690a8..9834f39a47 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosBadReplicaTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosBadReplicaTests.cs @@ -71,11 +71,11 @@ public async Task TestGoneFromServiceScenarioAsync( "44444444444444444", }; - HttpResponseMessage replicaSet1 = MockSetupsHelper.CreateAddresses( - replicaIds1, - partitionKeyRanges.First(), - "eastus", - cRid); + HttpResponseMessage replicaSet1 = MockSetupsHelper.CreateAddresses( + replicaIds1, + partitionKeyRanges.First(), + "eastus", + cRid); // One replica changed on the refresh List replicaIds2 = new List() @@ -176,6 +176,10 @@ public async Task TestGoneFromServiceScenarioAsync( mockTransportClient.VerifyAll(); mockHttpHandler.VerifyAll(); + mockTransportClient + .Setup(x => x.OpenConnectionAsync(It.IsAny())) + .Returns(Task.CompletedTask); + Documents.TransportAddressUri failedReplica = urisVisited.First(); // With replica validation enabled in preview mode, the failed replica will be validated as a part of the flow, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs index c855599465..fded897e42 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayAddressCacheTests.cs @@ -965,7 +965,7 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabled_ShouldValidat { // Arrange. ManualResetEvent manualResetEvent = new(initialState: false); - Mock mockHttpHandler = new (MockBehavior.Strict); + Mock mockHttpHandler = new(MockBehavior.Strict); string oldAddress = "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/4s"; string newAddress = "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/5s"; string addressTobeMarkedUnhealthy = "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/2s"; @@ -987,12 +987,12 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabled_ShouldValidat newAddress, })); - FakeOpenConnectionHandler fakeOpenConnectionHandler = new ( + FakeOpenConnectionHandler fakeOpenConnectionHandler = new( failingIndexes: new HashSet(), manualResetEvent: manualResetEvent); - HttpClient httpClient = new (new HttpHandlerHelper(mockHttpHandler.Object)); - GatewayAddressCache cache = new ( + HttpClient httpClient = new(new HttpHandlerHelper(mockHttpHandler.Object)); + GatewayAddressCache cache = new( new Uri(GatewayAddressCacheTests.DatabaseAccountApiEndpoint), Documents.Client.Protocol.Tcp, this.mockTokenProvider.Object, @@ -1023,10 +1023,10 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabled_ShouldValidat manualResetEvent: manualResetEvent, shouldReset: true); - // Because the Unknown Replicas are now validated aggresively, the health status should be marked as connected. + // Because the Unknown Replicas are not validated, the health status should remain as unknown. Assert.IsNotNull(refreshedUri); Assert.AreEqual( - expected: TransportAddressHealthState.HealthStatus.Connected, + expected: TransportAddressHealthState.HealthStatus.Unknown, actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); GatewayAddressCacheTests.ValidateHealthStatesInDiagnostics( @@ -1076,17 +1076,17 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabled_ShouldValidat GatewayAddressCacheTests.ValidateHealthStatesInDiagnostics( addressInfo: addressInfo, - numberOfConnectedReplicas: 2, - numberOfUnknownReplicas: 1, + numberOfConnectedReplicas: 0, + numberOfUnknownReplicas: 3, numberOfUnhealthyPendingReplicas: 1, numberOfUnhealthyReplicas: 0); GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, expectedTotalFailedAddressesToOpenCount: 0, - expectedTotalHandlerInvocationCount: 2, - expectedTotalReceivedAddressesCount: 6, - expectedTotalSuccessAddressesToOpenCount: 6); + expectedTotalHandlerInvocationCount: 1, + expectedTotalReceivedAddressesCount: 1, + expectedTotalSuccessAddressesToOpenCount: 1); } /// @@ -1099,7 +1099,7 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabled_ShouldValidat public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUriExistsForOneMinute_ShouldForceRefreshUnhealthyReplicas() { // Arrange. - ManualResetEvent manualResetEvent = new (initialState: false); + ManualResetEvent manualResetEvent = new(initialState: false); Mock mockHttpHandler = new(MockBehavior.Strict); string oldAddress = "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/4s"; string newAddress = "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/5s"; @@ -1129,15 +1129,15 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr newAddress, })); - FakeOpenConnectionHandler fakeOpenConnectionHandler = new ( + FakeOpenConnectionHandler fakeOpenConnectionHandler = new( failIndexesByAttempts: new Dictionary>() { - { 0, new HashSet() { 2 } } + { 0, new HashSet() { 1 } } }, manualResetEvent: manualResetEvent); - HttpClient httpClient = new (new HttpHandlerHelper(mockHttpHandler.Object)); - GatewayAddressCache cache = new ( + HttpClient httpClient = new(new HttpHandlerHelper(mockHttpHandler.Object)); + GatewayAddressCache cache = new( new Uri(GatewayAddressCacheTests.DatabaseAccountApiEndpoint), Documents.Client.Protocol.Tcp, this.mockTokenProvider.Object, @@ -1178,14 +1178,14 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, expectedTotalFailedAddressesToOpenCount: 0, - expectedTotalHandlerInvocationCount: 1, - expectedTotalReceivedAddressesCount: 4, - expectedTotalSuccessAddressesToOpenCount: 4); + expectedTotalHandlerInvocationCount: 0, + expectedTotalReceivedAddressesCount: 0, + expectedTotalSuccessAddressesToOpenCount: 0); - // Because the Unknown Replicas are now validated aggresively, the health status should be marked as connected. + // Because the Unknown Replicas are not validated, the health status should remain as unknown. Assert.IsNotNull(refreshedUri); Assert.AreEqual( - expected: TransportAddressHealthState.HealthStatus.Connected, + expected: TransportAddressHealthState.HealthStatus.Unknown, actual: refreshedUri.GetCurrentHealthState().GetHealthStatus()); Assert.AreEqual(4, addressInfo.AllAddresses.Count); @@ -1228,17 +1228,17 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr GatewayAddressCacheTests.ValidateHealthStatesInDiagnostics( addressInfo: addressInfo, - numberOfConnectedReplicas: 2, - numberOfUnknownReplicas: 1, + numberOfConnectedReplicas: 0, + numberOfUnknownReplicas: 3, numberOfUnhealthyPendingReplicas: 1, numberOfUnhealthyReplicas: 0); GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, expectedTotalFailedAddressesToOpenCount: 1, - expectedTotalHandlerInvocationCount: 2, - expectedTotalReceivedAddressesCount: 6, - expectedTotalSuccessAddressesToOpenCount: 5); + expectedTotalHandlerInvocationCount: 1, + expectedTotalReceivedAddressesCount: 1, + expectedTotalSuccessAddressesToOpenCount: 0); // A delay of 2 minute was added to make the replica unhealthy for more than one minute. This // will make sure the unhealthy replica gets a chance to re-validate it's health status. @@ -1263,9 +1263,9 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, expectedTotalFailedAddressesToOpenCount: 1, - expectedTotalHandlerInvocationCount: 3, - expectedTotalReceivedAddressesCount: 7, - expectedTotalSuccessAddressesToOpenCount: 6); + expectedTotalHandlerInvocationCount: 2, + expectedTotalReceivedAddressesCount: 2, + expectedTotalSuccessAddressesToOpenCount: 1); addressInfo = await cache.TryGetAddressesAsync( request: request, @@ -1293,9 +1293,140 @@ public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndUnhealthyUr GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( fakeOpenConnectionHandler: fakeOpenConnectionHandler, expectedTotalFailedAddressesToOpenCount: 1, - expectedTotalHandlerInvocationCount: 3, - expectedTotalReceivedAddressesCount: 7, - expectedTotalSuccessAddressesToOpenCount: 6); + expectedTotalHandlerInvocationCount: 2, + expectedTotalReceivedAddressesCount: 2, + expectedTotalSuccessAddressesToOpenCount: 1); + } + + /// + /// Test to validate that when replica validation is enabled and there exists a replica such that it remained unhealthy for a period of one minute or + /// more, then even though a force refresh is not requested, the unhealthy replicas at least get a chance to re-validate it's status by the + /// on-demand async non-blocking cache refresh flow and eventually marks itself as healthy once the open connection attempt is successful. The purpose + /// of this test to validate the above scenario with high number of concurrent execution and validate that the concurrent executions doesn't create an + /// unbounded number of tasks and the task creation is limited to just one, thus reducing the pressure on the task scheduler drammatically. + /// + [TestMethod] + [Owner("dkunda")] + public async Task TryGetAddressesAsync_WhenReplicaVlidationEnabledAndCSListenerMarksReplicaUnhealthyWithParallelInvocation_ShouldValidateUnhealthyReplicasOnce() + { + // Arrange. + int maxIteration = 2; + ManualResetEvent manualResetEvent = new(initialState: false); + Mock mockHttpHandler = new(MockBehavior.Strict); + string oldAddress = "rntbd://dummytenant.documents.azure.com:14004/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/4s"; + string newAddress = "rntbd://dummytenant.documents.azure.com:14004/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/5s"; + string addressTobeMarkedUnhealthy = "rntbd://dummytenant.documents.azure.com:14002/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/2s"; + mockHttpHandler.SetupSequence(x => x.SendAsync( + It.IsAny(), + It.IsAny())) + .Returns(MockCosmosUtil.CreateHttpResponseOfAddresses(new List() + { + "rntbd://dummytenant.documents.azure.com:14001/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/1p", + addressTobeMarkedUnhealthy, + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/3s", + oldAddress, + })) + .Returns(MockCosmosUtil.CreateHttpResponseOfAddresses(new List() + { + "rntbd://dummytenant.documents.azure.com:14001/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/1p", + addressTobeMarkedUnhealthy, + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/3s", + newAddress, + })) + .Returns(MockCosmosUtil.CreateHttpResponseOfAddresses(new List() + { + "rntbd://dummytenant.documents.azure.com:14001/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/1p", + addressTobeMarkedUnhealthy, + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/3s", + newAddress, + })) + .Returns(MockCosmosUtil.CreateHttpResponseOfAddresses(new List() + { + "rntbd://dummytenant.documents.azure.com:14001/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/1p", + addressTobeMarkedUnhealthy, + "rntbd://dummytenant.documents.azure.com:14003/apps/APPGUID/services/SERVICEGUID/partitions/PARTITIONGUID/replicas/3s", + newAddress, + })); + + FakeOpenConnectionHandler fakeOpenConnectionHandler = new( + failIndexesByAttempts: new Dictionary>(), + manualResetEvent: manualResetEvent, + openConnectionDelayInSeconds: 1); + + HttpClient httpClient = new(new HttpHandlerHelper(mockHttpHandler.Object)); + GatewayAddressCache cache = new( + new Uri(GatewayAddressCacheTests.DatabaseAccountApiEndpoint), + Documents.Client.Protocol.Tcp, + this.mockTokenProvider.Object, + this.mockServiceConfigReader.Object, + MockCosmosUtil.CreateCosmosHttpClient(() => httpClient), + openConnectionsHandler: fakeOpenConnectionHandler, + suboptimalPartitionForceRefreshIntervalInSeconds: 2, + enableTcpConnectionEndpointRediscovery: true, + replicaAddressValidationEnabled: true); + + DocumentServiceRequest request = DocumentServiceRequest.Create(OperationType.Invalid, ResourceType.Address, AuthorizationTokenType.Invalid); + + // Act and Assert. + PartitionAddressInformation addressInfo = default; + TransportAddressUri refreshedUri = default; + + for (int iterationIndex = 1; iterationIndex <= maxIteration; iterationIndex++) + { + List openConnectionTasks = new(); + addressInfo = await cache.TryGetAddressesAsync( + request: request, + partitionKeyRangeIdentity: this.testPartitionKeyRangeIdentity, + serviceIdentity: this.serviceIdentity, + forceRefreshPartitionAddresses: false, + cancellationToken: CancellationToken.None); + + // Mimic the Connection State Listener based approach to mark a replica to unhealthy. + await cache.MarkAddressesToUnhealthyAsync( + new ServerKey( + new Uri( + uriString: addressTobeMarkedUnhealthy))); + + refreshedUri = addressInfo + .Get(Protocol.Tcp)? + .ReplicaTransportAddressUris + .Single(x => x.ToString().Equals(addressTobeMarkedUnhealthy)); + + ReflectionUtils.AddMinuteToDateTimeFieldUsingReflection( + objectName: refreshedUri.GetCurrentHealthState(), + fieldName: "lastUnhealthyTimestamp", + delayInMinutes: -2 * iterationIndex); + + for (int j = 0; j < 500 * iterationIndex; j++) + { + openConnectionTasks + .Add( + cache.TryGetAddressesAsync( + request: request, + partitionKeyRangeIdentity: this.testPartitionKeyRangeIdentity, + serviceIdentity: this.serviceIdentity, + forceRefreshPartitionAddresses: false, + cancellationToken: CancellationToken.None)); + } + + // awaits for the parallel execution to finish. + await Task.WhenAll(openConnectionTasks); + + // This assertion validates that there are no extra tasks created in the thread pool. + Assert.AreEqual(0, ThreadPool.PendingWorkItemCount); + + // Waits until a completion signal from the background task is received. + GatewayAddressCacheTests.WaitForManualResetEventSignal( + manualResetEvent: manualResetEvent, + shouldReset: true); + + GatewayAddressCacheTests.AssertOpenConnectionHandlerAttributes( + fakeOpenConnectionHandler: fakeOpenConnectionHandler, + expectedTotalFailedAddressesToOpenCount: 0, + expectedTotalHandlerInvocationCount: iterationIndex, + expectedTotalReceivedAddressesCount: iterationIndex, + expectedTotalSuccessAddressesToOpenCount: iterationIndex); + } } /// @@ -1577,11 +1708,13 @@ public FakeOpenConnectionHandler( public FakeOpenConnectionHandler( Dictionary> failIndexesByAttempts, - ManualResetEvent manualResetEvent = null) + ManualResetEvent manualResetEvent = null, + int openConnectionDelayInSeconds = 0) { this.useAttemptBasedFailingIndexs = true; this.failIndexesByAttempts = failIndexesByAttempts; this.manualResetEvent = manualResetEvent; + this.openConnectionDelayInSeconds = openConnectionDelayInSeconds; } public int GetTotalSuccessfulInvocationCount() diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/PartitionKeyRangeFailoverTests/MockSetupsHelper.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/PartitionKeyRangeFailoverTests/MockSetupsHelper.cs index ebc0e9c61b..5bf63cd3ba 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/PartitionKeyRangeFailoverTests/MockSetupsHelper.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/PartitionKeyRangeFailoverTests/MockSetupsHelper.cs @@ -279,7 +279,14 @@ internal static HttpResponseMessage CreateAddresses( string regionName, ResourceId containerResourceId) { - string basePhysicalUri = $"rntbd://cdb-ms-prod-{regionName}-fd4.documents.azure.com:14382/apps/9dc0394e-d25f-4c98-baa5-72f1c700bf3e/services/060067c7-a4e9-4465-a412-25cb0104cb58/partitions/2cda760c-f81f-4094-85d0-7bcfb2acc4e6/replicas/"; + int initialPort = 14382; + int[] ports = new int[replicaIds.Count]; + string basePhysicalUri = "rntbd://cdb-ms-prod-{0}-fd4.documents.azure.com:{1}/apps/9dc0394e-d25f-4c98-baa5-72f1c700bf3e/services/060067c7-a4e9-4465-a412-25cb0104cb58/partitions/2cda760c-f81f-4094-85d0-7bcfb2acc4e6/replicas/{2}"; + + for (int i=0; i< replicaIds.Count; i++) + { + ports[i] = initialPort++; + } // Use the partition key range id at the end of each replica id to avoid conflicts when setting up multiple partition key ranges List
addresses = new List
(); @@ -290,7 +297,7 @@ internal static HttpResponseMessage CreateAddresses( { IsPrimary = i == 0, PartitionKeyRangeId = partitionKeyRangeId, - PhysicalUri = basePhysicalUri + repliaId, + PhysicalUri = string.Format(basePhysicalUri, regionName, ports[i], repliaId), Protocol = "rntbd", PartitionIndex = "7718513@164605136" }); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/AsyncCacheNonBlockingTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/AsyncCacheNonBlockingTests.cs index d58ab3db5b..944cb6de8c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/AsyncCacheNonBlockingTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/AsyncCacheNonBlockingTests.cs @@ -394,15 +394,15 @@ await asyncCache.GetAsync( } /// - /// Test to validate that when RefreshAsync() is invoked for a valid existing key, the + /// Test to validate that when Refresh() is invoked for a valid existing key, the /// cache refreshes the key successfully and the new value is updated in the cache. /// [TestMethod] [Owner("dkunda")] - public async Task RefreshAsync_WhenRefreshRequestedForAnExistingKey_ShouldRefreshTheCache() + public async Task Refresh_WhenRefreshRequestedForAnExistingKey_ShouldRefreshTheCache() { // Arrange. - AsyncCacheNonBlocking asyncCache = new (); + AsyncCacheNonBlocking asyncCache = new(); // Act and Assert. string result = await asyncCache.GetAsync( @@ -412,10 +412,14 @@ public async Task RefreshAsync_WhenRefreshRequestedForAnExistingKey_ShouldRefres Assert.AreEqual("value1", result); - await asyncCache.RefreshAsync( + asyncCache.Refresh( "key", (_) => Task.FromResult("value2")); + // Add some delay for the background refresh task to complete. + await Task.Delay( + millisecondsDelay: 50); + result = await asyncCache.GetAsync( "key", (_) => throw new Exception("Should not refresh."), @@ -425,15 +429,15 @@ await asyncCache.RefreshAsync( } /// - /// Test to validate that when a DocumentClientException is thrown during RefreshAsync() operation, + /// Test to validate that when a DocumentClientException is thrown during Refresh() operation, /// then the cache removes the key for which a refresh was requested. /// [TestMethod] [Owner("dkunda")] - public async Task RefreshAsync_WhenThrowsDocumentClientException_ShouldRemoveKeyFromTheCache() + public async Task Refresh_WhenThrowsDocumentClientException_ShouldRemoveKeyFromTheCache() { // Arrange. - AsyncCacheNonBlocking asyncCache = new (); + AsyncCacheNonBlocking asyncCache = new(); // Act and Assert. string result = await asyncCache.GetAsync( @@ -453,23 +457,20 @@ public async Task RefreshAsync_WhenThrowsDocumentClientException_ShouldRemoveKey // and still return the old cached value. Assert.AreEqual("value1", result); - NotFoundException notFoundException = new ( + NotFoundException notFoundException = new( message: "Item was deleted."); - try - { - await asyncCache.RefreshAsync( - "key", - async (_) => - { - await Task.Delay(TimeSpan.FromMilliseconds(5)); - throw notFoundException; - }); - Assert.Fail("Should throw a NotFoundException"); - } - catch (NotFoundException exception) - { - Assert.AreEqual(notFoundException, exception); - } + + asyncCache.Refresh( + "key", + async (_) => + { + await Task.Delay(TimeSpan.FromMilliseconds(5)); + throw notFoundException; + }); + + // Add some delay for the background refresh task to complete. + await Task.Delay( + millisecondsDelay: 50); // Because the key was deleted from the cache, the func delegate should get invoked at // this point and update the value to value2. @@ -482,12 +483,12 @@ await asyncCache.RefreshAsync( } /// - /// Test to validate that when some other Exception is thrown during RefreshAsync() operation, + /// Test to validate that when some other Exception is thrown during Refresh() operation, /// then the cache does not remove the key for which the refresh was originally requested. /// [TestMethod] [Owner("dkunda")] - public async Task RefreshAsync_WhenThrowsOtherException_ShouldNotRemoveKeyFromTheCache() + public async Task Refresh_WhenThrowsOtherException_ShouldNotRemoveKeyFromTheCache() { // Arrange. AsyncCacheNonBlocking asyncCache = new(); @@ -512,21 +513,14 @@ public async Task RefreshAsync_WhenThrowsOtherException_ShouldNotRemoveKeyFromTh Exception exception = new( message: "Timeout exception."); - try - { - await asyncCache.RefreshAsync( - "key", - async (_) => - { - await Task.Delay(TimeSpan.FromMilliseconds(5)); - throw exception; - }); - Assert.Fail("Should throw a NotFoundException"); - } - catch (Exception ex) - { - Assert.AreEqual(ex, exception); - } + + asyncCache.Refresh( + "key", + async (_) => + { + await Task.Delay(TimeSpan.FromMilliseconds(5)); + throw exception; + }); // Because the key should not get deleted from the cache, the func delegate should not get invoked at // this point. From b1918341a6648811f5d92278156f47668a3c360b Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Mon, 6 Nov 2023 13:20:37 -0800 Subject: [PATCH 230/240] [Internal] DocumentClient: Adds TryGetAccountProperties (#4167) * add api * tests * Update test * Rename --- Microsoft.Azure.Cosmos/src/DocumentClient.cs | 17 +++++++++++++++++ .../ClientTests.cs | 18 ++++++++++++++++++ .../InterfaceParityTest.cs | 1 + 3 files changed, 36 insertions(+) diff --git a/Microsoft.Azure.Cosmos/src/DocumentClient.cs b/Microsoft.Azure.Cosmos/src/DocumentClient.cs index 3c261490a7..632c158f96 100644 --- a/Microsoft.Azure.Cosmos/src/DocumentClient.cs +++ b/Microsoft.Azure.Cosmos/src/DocumentClient.cs @@ -1235,6 +1235,23 @@ public virtual Documents.ConsistencyLevel ConsistencyLevel } } + /// + /// Returns the account properties available in the service configuration if the client was initialized. + /// + public bool TryGetCachedAccountProperties(out AccountProperties properties) + { + if (this.isSuccessfullyInitialized + && this.accountServiceConfiguration != null + && this.accountServiceConfiguration.AccountProperties != null) + { + properties = this.accountServiceConfiguration.AccountProperties; + return true; + } + + properties = null; + return false; + } + /// /// Disposes the client for the Azure Cosmos DB service. /// diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs index c8a9a0aff7..9bbbb980e3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTests.cs @@ -290,6 +290,24 @@ public async Task ValidateAzureKeyCredentialDirectModeUpdateAsync() } } + [TestMethod] + public async Task ValidateTryGetAccountProperties() + { + using CosmosClient cosmosClient = new CosmosClient( + ConfigurationManager.AppSettings["GatewayEndpoint"], + ConfigurationManager.AppSettings["MasterKey"] + ); + + Assert.IsFalse(cosmosClient.DocumentClient.TryGetCachedAccountProperties(out AccountProperties propertiesFromMethod)); + + AccountProperties accountProperties = await cosmosClient.ReadAccountAsync(); + + Assert.IsTrue(cosmosClient.DocumentClient.TryGetCachedAccountProperties(out propertiesFromMethod)); + + Assert.AreEqual(accountProperties.Consistency.DefaultConsistencyLevel, propertiesFromMethod.Consistency.DefaultConsistencyLevel); + Assert.AreEqual(accountProperties.Id, propertiesFromMethod.Id); + } + private int TaskStartedCount = 0; private async Task ReadNotFound(Container container) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/InterfaceParityTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/InterfaceParityTest.cs index 281e550d24..9d5e391748 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/InterfaceParityTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/InterfaceParityTest.cs @@ -24,6 +24,7 @@ public void TestAllPublicMethodsExistInIDocumentClient() string[] excludedMethods = new string[] { "OpenAsync", // exposed public methods. + "TryGetCachedAccountProperties", // currently only internal "get_PartitionResolvers", "get_ResourceTokens", // Obsolete getters. "ToString", "Equals", "GetHashCode", "GetType", "get_httpClient" }; From 4db6078dc5eccb7133c5554e4ae35c5636ae9677 Mon Sep 17 00:00:00 2001 From: Maya Painter <130110800+Maya-Painter@users.noreply.github.com> Date: Mon, 6 Nov 2023 17:17:26 -0800 Subject: [PATCH 231/240] Query: Fixes documentation to reflect state of System.Text.Json serializer (#4170) * Update Program.cs * Update Program.cs * Update Program.cs * Update Program.cs --------- Co-authored-by: Matias Quaranta --- .../Usage/SystemTextJson/Program.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/SystemTextJson/Program.cs b/Microsoft.Azure.Cosmos.Samples/Usage/SystemTextJson/Program.cs index ac990a4e28..d66d54f5a2 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/SystemTextJson/Program.cs +++ b/Microsoft.Azure.Cosmos.Samples/Usage/SystemTextJson/Program.cs @@ -177,15 +177,19 @@ private static async Task CleanupAsync() // public class ToDoActivity { + // Note: System.Text.Json attributes such as JsonPropertyName are currently applied on item CRUD operations and non-LINQ queries, but not on LINQ queries [JsonPropertyName("id")] public string Id { get; set; } + // Note: System.Text.Json attributes such as JsonPropertyName are currently applied on item CRUD operations and non-LINQ queries, but not on LINQ queries [JsonPropertyName("partitionKey")] public string PartitionKey { get; set; } + // Note: System.Text.Json attributes such as JsonPropertyName are currently applied on item CRUD operations and non-LINQ queries, but not on LINQ queries [JsonPropertyName("activityId")] public string ActivityId { get; set; } + // Note: System.Text.Json attributes such as JsonPropertyName are currently applied on item CRUD operations and non-LINQ queries, but not on LINQ queries [JsonPropertyName("status")] public string Status { get; set; } } From d287f085e3210c021179882e2a89cba257493661 Mon Sep 17 00:00:00 2001 From: Maya Painter <130110800+Maya-Painter@users.noreply.github.com> Date: Wed, 8 Nov 2023 10:57:25 -0800 Subject: [PATCH 232/240] [Internal] Query: Adds interface for linq serialization functions (#4163) * intial commit * add interface * PR comments and TranslationContext cleanup * update params * fix parameters * PR comments * PR comments * PR comments * simplifying serializer class * interface updates * Update docs * PR comments * PR comments * PR comments - rename and fix assert --- ...smosElementToSqlScalarExpressionVisitor.cs | 93 +++++++ .../src/Linq/DefaultCosmosLinqSerializer.cs | 110 ++++++++ .../src/Linq/ExpressionToSQL.cs | 239 +++++------------- .../src/Linq/ICosmosLinqSerializer.cs | 33 +++ .../src/Linq/QueryUnderConstruction.cs | 8 +- .../src/Linq/SQLTranslator.cs | 1 - .../src/Linq/TranslationContext.cs | 45 ++-- Microsoft.Azure.Cosmos/src/Linq/TypeSystem.cs | 46 +--- .../LinqAttributeContractBaselineTests.cs | 16 +- 9 files changed, 345 insertions(+), 246 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/src/Linq/CosmosElementToSqlScalarExpressionVisitor.cs create mode 100644 Microsoft.Azure.Cosmos/src/Linq/DefaultCosmosLinqSerializer.cs create mode 100644 Microsoft.Azure.Cosmos/src/Linq/ICosmosLinqSerializer.cs diff --git a/Microsoft.Azure.Cosmos/src/Linq/CosmosElementToSqlScalarExpressionVisitor.cs b/Microsoft.Azure.Cosmos/src/Linq/CosmosElementToSqlScalarExpressionVisitor.cs new file mode 100644 index 0000000000..68232330de --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Linq/CosmosElementToSqlScalarExpressionVisitor.cs @@ -0,0 +1,93 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace Microsoft.Azure.Cosmos.Linq +{ + using System; + using System.Collections.Generic; + using System.Collections.Immutable; + using System.Diagnostics; + using Microsoft.Azure.Cosmos.CosmosElements; + using Microsoft.Azure.Cosmos.CosmosElements.Numbers; + using Microsoft.Azure.Cosmos.SqlObjects; + + internal sealed class CosmosElementToSqlScalarExpressionVisitor : ICosmosElementVisitor + { + public static readonly CosmosElementToSqlScalarExpressionVisitor Singleton = new CosmosElementToSqlScalarExpressionVisitor(); + + private CosmosElementToSqlScalarExpressionVisitor() + { + // Private constructor, since this class is a singleton. + } + + public SqlScalarExpression Visit(CosmosArray cosmosArray) + { + List items = new List(); + foreach (CosmosElement item in cosmosArray) + { + items.Add(item.Accept(this)); + } + + return SqlArrayCreateScalarExpression.Create(items.ToImmutableArray()); + } + + public SqlScalarExpression Visit(CosmosBinary cosmosBinary) + { + // Can not convert binary to scalar expression without knowing the API type. + Debug.Fail("CosmosElementToSqlScalarExpressionVisitor Assert", "Unreachable"); + throw new InvalidOperationException(); + } + + public SqlScalarExpression Visit(CosmosBoolean cosmosBoolean) + { + return SqlLiteralScalarExpression.Create(SqlBooleanLiteral.Create(cosmosBoolean.Value)); + } + + public SqlScalarExpression Visit(CosmosGuid cosmosGuid) + { + // Can not convert guid to scalar expression without knowing the API type. + Debug.Fail("CosmosElementToSqlScalarExpressionVisitor Assert", "Unreachable"); + throw new InvalidOperationException(); + } + + public SqlScalarExpression Visit(CosmosNull cosmosNull) + { + return SqlLiteralScalarExpression.Create(SqlNullLiteral.Create()); + } + + public SqlScalarExpression Visit(CosmosNumber cosmosNumber) + { + if (!(cosmosNumber is CosmosNumber64 cosmosNumber64)) + { + throw new ArgumentException($"Unknown {nameof(CosmosNumber)} type: {cosmosNumber.GetType()}."); + } + + return SqlLiteralScalarExpression.Create(SqlNumberLiteral.Create(cosmosNumber64.GetValue())); + } + + public SqlScalarExpression Visit(CosmosObject cosmosObject) + { + List properties = new List(); + foreach (KeyValuePair prop in cosmosObject) + { + SqlPropertyName name = SqlPropertyName.Create(prop.Key); + CosmosElement value = prop.Value; + SqlScalarExpression expression = value.Accept(this); + SqlObjectProperty property = SqlObjectProperty.Create(name, expression); + properties.Add(property); + } + + return SqlObjectCreateScalarExpression.Create(properties.ToImmutableArray()); + } + + public SqlScalarExpression Visit(CosmosString cosmosString) + { + return SqlLiteralScalarExpression.Create(SqlStringLiteral.Create(cosmosString.Value)); + } + + public SqlScalarExpression Visit(CosmosUndefined cosmosUndefined) + { + return SqlLiteralScalarExpression.Create(SqlUndefinedLiteral.Create()); + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Linq/DefaultCosmosLinqSerializer.cs b/Microsoft.Azure.Cosmos/src/Linq/DefaultCosmosLinqSerializer.cs new file mode 100644 index 0000000000..024c33fab0 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Linq/DefaultCosmosLinqSerializer.cs @@ -0,0 +1,110 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace Microsoft.Azure.Cosmos.Linq +{ + using System; + using System.Diagnostics; + using System.Linq; + using System.Linq.Expressions; + using System.Reflection; + using System.Runtime.Serialization; + using Microsoft.Azure.Documents; + using Newtonsoft.Json; + + internal class DefaultCosmosLinqSerializer : ICosmosLinqSerializer + { + public bool RequiresCustomSerialization(MemberExpression memberExpression, Type memberType) + { + // There are two ways to specify a custom attribute + // 1- by specifying the JsonConverterAttribute on a Class/Enum + // [JsonConverter(typeof(StringEnumConverter))] + // Enum MyEnum + // { + // ... + // } + // + // 2- by specifying the JsonConverterAttribute on a property + // class MyClass + // { + // [JsonConverter(typeof(StringEnumConverter))] + // public MyEnum MyEnum; + // } + // + // Newtonsoft gives high precedence to the attribute specified + // on a property over on a type (class/enum) + // so we check both attributes and apply the same precedence rules + // JsonConverterAttribute doesn't allow duplicates so it's safe to + // use FirstOrDefault() + CustomAttributeData memberAttribute = memberExpression.Member.CustomAttributes.FirstOrDefault(ca => ca.AttributeType == typeof(Newtonsoft.Json.JsonConverterAttribute)); + CustomAttributeData typeAttribute = memberType.GetsCustomAttributes().FirstOrDefault(ca => ca.AttributeType == typeof(Newtonsoft.Json.JsonConverterAttribute)); + + return memberAttribute != null || typeAttribute != null; + } + + public string Serialize(object value, MemberExpression memberExpression, Type memberType) + { + CustomAttributeData memberAttribute = memberExpression.Member.CustomAttributes.FirstOrDefault(ca => ca.AttributeType == typeof(Newtonsoft.Json.JsonConverterAttribute)); + CustomAttributeData typeAttribute = memberType.GetsCustomAttributes().FirstOrDefault(ca => ca.AttributeType == typeof(Newtonsoft.Json.JsonConverterAttribute)); + CustomAttributeData converterAttribute = memberAttribute ?? typeAttribute; + + Debug.Assert(converterAttribute.ConstructorArguments.Count > 0, $"{nameof(DefaultCosmosLinqSerializer)} Assert!", "At least one constructor argument exists."); + Type converterType = (Type)converterAttribute.ConstructorArguments[0].Value; + + string serializedValue = converterType.GetConstructor(Type.EmptyTypes) != null + ? JsonConvert.SerializeObject(value, (Newtonsoft.Json.JsonConverter)Activator.CreateInstance(converterType)) + : JsonConvert.SerializeObject(value); + + return serializedValue; + } + + public string SerializeScalarExpression(ConstantExpression inputExpression) + { + return JsonConvert.SerializeObject(inputExpression.Value); + } + + public string SerializeMemberName(MemberInfo memberInfo, CosmosLinqSerializerOptions linqSerializerOptions = null) + { + string memberName = null; + + // Check if Newtonsoft JsonExtensionDataAttribute is present on the member, if so, return empty member name. + Newtonsoft.Json.JsonExtensionDataAttribute jsonExtensionDataAttribute = memberInfo.GetCustomAttribute(true); + if (jsonExtensionDataAttribute != null && jsonExtensionDataAttribute.ReadData) + { + return null; + } + + // Json.Net honors JsonPropertyAttribute more than DataMemberAttribute + // So we check for JsonPropertyAttribute first. + JsonPropertyAttribute jsonPropertyAttribute = memberInfo.GetCustomAttribute(true); + if (jsonPropertyAttribute != null && !string.IsNullOrEmpty(jsonPropertyAttribute.PropertyName)) + { + memberName = jsonPropertyAttribute.PropertyName; + } + else + { + DataContractAttribute dataContractAttribute = memberInfo.DeclaringType.GetCustomAttribute(true); + if (dataContractAttribute != null) + { + DataMemberAttribute dataMemberAttribute = memberInfo.GetCustomAttribute(true); + if (dataMemberAttribute != null && !string.IsNullOrEmpty(dataMemberAttribute.Name)) + { + memberName = dataMemberAttribute.Name; + } + } + } + + if (memberName == null) + { + memberName = memberInfo.Name; + } + + if (linqSerializerOptions != null) + { + memberName = CosmosSerializationUtil.GetStringWithPropertyNamingPolicy(linqSerializerOptions, memberName); + } + + return memberName; + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs b/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs index fef136d8d2..5153f29115 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs @@ -14,7 +14,6 @@ namespace Microsoft.Azure.Cosmos.Linq using System.Linq.Expressions; using System.Reflection; using Microsoft.Azure.Cosmos.CosmosElements; - using Microsoft.Azure.Cosmos.CosmosElements.Numbers; using Microsoft.Azure.Cosmos.Spatial; using Microsoft.Azure.Cosmos.SqlObjects; using Microsoft.Azure.Documents; @@ -94,7 +93,7 @@ public static SqlQuery TranslateQuery( TranslationContext context = new TranslationContext(linqSerializerOptions, parameters); ExpressionToSql.Translate(inputExpression, context); // ignore result here - QueryUnderConstruction query = context.currentQuery; + QueryUnderConstruction query = context.CurrentQuery; query = query.FlattenAsPossible(); SqlQuery result = query.GetSqlQuery(); @@ -159,7 +158,7 @@ private static Collection TranslateInput(ConstantExpression inputExpression, Tra throw new DocumentQueryException(ClientResources.InputIsNotIDocumentQuery); } - context.currentQuery = new QueryUnderConstruction(context.GetGenFreshParameterFunc()); + context.CurrentQuery = new QueryUnderConstruction(context.GetGenFreshParameterFunc()); Type elemType = TypeSystem.GetElementType(inputExpression.Type); context.SetInputParameter(elemType, ParameterSubstitution.InputParameterName); // ignore result @@ -169,7 +168,7 @@ private static Collection TranslateInput(ConstantExpression inputExpression, Tra } /// - /// Get a paramter name to be binded to the a collection from the next lambda. + /// Get a parameter name to be binded to the collection from the next lambda. /// It's merely for readability purpose. If that is not possible, use a default /// parameter name. /// @@ -189,7 +188,7 @@ private static string GetBindingParameterName(TranslationContext context) } } - if (parameterName == null) parameterName = ExpressionToSql.DefaultParameterName; + parameterName ??= ExpressionToSql.DefaultParameterName; return parameterName; } @@ -474,17 +473,17 @@ private static SqlScalarExpression VisitBinary(BinaryExpression inputExpression, if (left is SqlMemberIndexerScalarExpression && right is SqlLiteralScalarExpression literalScalarExpression) { - right = ExpressionToSql.ApplyCustomConverters(inputExpression.Left, literalScalarExpression); + right = ExpressionToSql.ApplyCustomConverters(inputExpression.Left, literalScalarExpression, context); } else if (right is SqlMemberIndexerScalarExpression && left is SqlLiteralScalarExpression sqlLiteralScalarExpression) { - left = ExpressionToSql.ApplyCustomConverters(inputExpression.Right, sqlLiteralScalarExpression); + left = ExpressionToSql.ApplyCustomConverters(inputExpression.Right, sqlLiteralScalarExpression, context); } return SqlBinaryScalarExpression.Create(op, left, right); } - private static SqlScalarExpression ApplyCustomConverters(Expression left, SqlLiteralScalarExpression right) + private static SqlScalarExpression ApplyCustomConverters(Expression left, SqlLiteralScalarExpression right, TranslationContext context) { MemberExpression memberExpression; if (left is UnaryExpression unaryExpression) @@ -504,48 +503,28 @@ private static SqlScalarExpression ApplyCustomConverters(Expression left, SqlLit memberType = memberType.NullableUnderlyingType(); } - // There are two ways to specify a custom attribute - // 1- by specifying the JsonConverterAttribute on a Class/Enum - // [JsonConverter(typeof(StringEnumConverter))] - // Enum MyEnum - // { - // ... - // } - // - // 2- by specifying the JsonConverterAttribute on a property - // class MyClass - // { - // [JsonConverter(typeof(StringEnumConverter))] - // public MyEnum MyEnum; - // } - // - // Newtonsoft gives high precedence to the attribute specified - // on a property over on a type (class/enum) - // so we check both attributes and apply the same precedence rules - // JsonConverterAttribute doesn't allow duplicates so it's safe to - // use FirstOrDefault() - CustomAttributeData memberAttribute = memberExpression.Member.CustomAttributes.Where(ca => ca.AttributeType == typeof(JsonConverterAttribute)).FirstOrDefault(); - CustomAttributeData typeAttribute = memberType.GetsCustomAttributes().Where(ca => ca.AttributeType == typeof(JsonConverterAttribute)).FirstOrDefault(); - - CustomAttributeData converterAttribute = memberAttribute ?? typeAttribute; - if (converterAttribute != null) + bool requiresCustomSerializatior = context.CosmosLinqSerializer.RequiresCustomSerialization(memberExpression, memberType); + if (requiresCustomSerializatior) { - Debug.Assert(converterAttribute.ConstructorArguments.Count > 0); - - Type converterType = (Type)converterAttribute.ConstructorArguments[0].Value; - object value = default(object); // Enum if (memberType.IsEnum()) { - Number64 number64 = ((SqlNumberLiteral)right.Literal).Value; - if (number64.IsDouble) + try { - value = Enum.ToObject(memberType, Number64.ToDouble(number64)); + Number64 number64 = ((SqlNumberLiteral)right.Literal).Value; + if (number64.IsDouble) + { + value = Enum.ToObject(memberType, Number64.ToDouble(number64)); + } + else + { + value = Enum.ToObject(memberType, Number64.ToLong(number64)); + } } - else + catch { - value = Enum.ToObject(memberType, Number64.ToLong(number64)); + value = ((SqlStringLiteral)right.Literal).Value; } } @@ -558,17 +537,7 @@ private static SqlScalarExpression ApplyCustomConverters(Expression left, SqlLit if (value != default(object)) { - string serializedValue; - - if (converterType.GetConstructor(Type.EmptyTypes) != null) - { - serializedValue = JsonConvert.SerializeObject(value, (JsonConverter)Activator.CreateInstance(converterType)); - } - else - { - serializedValue = JsonConvert.SerializeObject(value); - } - + string serializedValue = context.CosmosLinqSerializer.Serialize(value, memberExpression, memberType); return CosmosElement.Parse(serializedValue).Accept(CosmosElementToSqlScalarExpressionVisitor.Singleton); } } @@ -717,17 +686,17 @@ public static SqlScalarExpression VisitConstant(ConstantExpression inputExpressi if (inputExpression.Type.IsNullable()) { - return ExpressionToSql.VisitConstant(Expression.Constant(inputExpression.Value, Nullable.GetUnderlyingType(inputExpression.Type)), context); + return VisitConstant(Expression.Constant(inputExpression.Value, Nullable.GetUnderlyingType(inputExpression.Type)), context); } - if (context.parameters != null && context.parameters.TryGetValue(inputExpression.Value, out string paramName)) + if (context.Parameters != null && context.Parameters.TryGetValue(inputExpression.Value, out string paramName)) { SqlParameter sqlParameter = SqlParameter.Create(paramName); return SqlParameterRefScalarExpression.Create(sqlParameter); } Type constantType = inputExpression.Value.GetType(); - if (constantType.IsValueType()) + if (constantType.IsValueType) { if (inputExpression.Value is bool boolValue) { @@ -764,13 +733,15 @@ public static SqlScalarExpression VisitConstant(ConstantExpression inputExpressi foreach (object item in enumerable) { - arrayItems.Add(ExpressionToSql.VisitConstant(Expression.Constant(item), context)); + arrayItems.Add(VisitConstant(Expression.Constant(item), context)); } return SqlArrayCreateScalarExpression.Create(arrayItems.ToImmutableArray()); } - return CosmosElement.Parse(JsonConvert.SerializeObject(inputExpression.Value)).Accept(CosmosElementToSqlScalarExpressionVisitor.Singleton); + string serializedConstant = context.CosmosLinqSerializer.SerializeScalarExpression(inputExpression); + + return CosmosElement.Parse(serializedConstant).Accept(CosmosElementToSqlScalarExpressionVisitor.Singleton); } private static SqlScalarExpression VisitConditional(ConditionalExpression inputExpression, TranslationContext context) @@ -798,7 +769,7 @@ private static SqlScalarExpression VisitParameter(ParameterExpression inputExpre private static SqlScalarExpression VisitMemberAccess(MemberExpression inputExpression, TranslationContext context) { SqlScalarExpression memberExpression = ExpressionToSql.VisitScalarExpression(inputExpression.Expression, context); - string memberName = inputExpression.Member.GetMemberName(context.linqSerializerOptions); + string memberName = inputExpression.Member.GetMemberName(context); // If the resulting memberName is null, then the indexer should be on the root of the object. if (memberName == null) @@ -809,7 +780,7 @@ private static SqlScalarExpression VisitMemberAccess(MemberExpression inputExpre // if expression is nullable if (inputExpression.Expression.Type.IsNullable()) { - MemberNames memberNames = context.memberNames; + MemberNames memberNames = context.MemberNames; // ignore .Value if (memberName == memberNames.Value) @@ -853,7 +824,7 @@ private static SqlScalarExpression[] VisitExpressionList(ReadOnlyCollectionThe scalar Any collection private static Collection ConvertToScalarAnyCollection(TranslationContext context) { - SqlQuery query = context.currentQuery.FlattenAsPossible().GetSqlQuery(); + SqlQuery query = context.CurrentQuery.FlattenAsPossible().GetSqlQuery(); SqlCollection subqueryCollection = SqlSubqueryCollection.Create(query); ParameterExpression parameterExpression = context.GenFreshParameter(typeof(object), ExpressionToSql.DefaultParameterName); Binding binding = new Binding(parameterExpression, subqueryCollection, isInCollection: false, isInputParameter: true); - context.currentQuery = new QueryUnderConstruction(context.GetGenFreshParameterFunc()); - context.currentQuery.AddBinding(binding); + context.CurrentQuery = new QueryUnderConstruction(context.GetGenFreshParameterFunc()); + context.CurrentQuery.AddBinding(binding); SqlSelectSpec selectSpec = SqlSelectValueSpec.Create( SqlBinaryScalarExpression.Create( @@ -1032,7 +1003,7 @@ private static Collection ConvertToScalarAnyCollection(TranslationContext contex SqlPropertyRefScalarExpression.Create(null, SqlIdentifier.Create(parameterExpression.Name))), SqlLiteralScalarExpression.Create(SqlNumberLiteral.Create(0)))); SqlSelectClause selectClause = SqlSelectClause.Create(selectSpec); - context.currentQuery.AddSelectClause(selectClause); + context.CurrentQuery.AddSelectClause(selectClause); return new Collection(LinqMethods.Any); } @@ -1173,106 +1144,106 @@ private static Collection VisitMethodCall(MethodCallExpression inputExpression, context.PushCollection(collection); Collection result = new Collection(inputExpression.Method.Name); - bool shouldBeOnNewQuery = context.currentQuery.ShouldBeOnNewQuery(inputExpression.Method.Name, inputExpression.Arguments.Count); + bool shouldBeOnNewQuery = context.CurrentQuery.ShouldBeOnNewQuery(inputExpression.Method.Name, inputExpression.Arguments.Count); context.PushSubqueryBinding(shouldBeOnNewQuery); switch (inputExpression.Method.Name) { case LinqMethods.Select: { SqlSelectClause select = ExpressionToSql.VisitSelect(inputExpression.Arguments, context); - context.currentQuery = context.currentQuery.AddSelectClause(select, context); + context.CurrentQuery = context.CurrentQuery.AddSelectClause(select, context); break; } case LinqMethods.Where: { SqlWhereClause where = ExpressionToSql.VisitWhere(inputExpression.Arguments, context); - context.currentQuery = context.currentQuery.AddWhereClause(where, context); + context.CurrentQuery = context.CurrentQuery.AddWhereClause(where, context); break; } case LinqMethods.SelectMany: { - context.currentQuery = context.PackageCurrentQueryIfNeccessary(); + context.CurrentQuery = context.PackageCurrentQueryIfNeccessary(); result = ExpressionToSql.VisitSelectMany(inputExpression.Arguments, context); break; } case LinqMethods.OrderBy: { SqlOrderByClause orderBy = ExpressionToSql.VisitOrderBy(inputExpression.Arguments, false, context); - context.currentQuery = context.currentQuery.AddOrderByClause(orderBy, context); + context.CurrentQuery = context.CurrentQuery.AddOrderByClause(orderBy, context); break; } case LinqMethods.OrderByDescending: { SqlOrderByClause orderBy = ExpressionToSql.VisitOrderBy(inputExpression.Arguments, true, context); - context.currentQuery = context.currentQuery.AddOrderByClause(orderBy, context); + context.CurrentQuery = context.CurrentQuery.AddOrderByClause(orderBy, context); break; } case LinqMethods.ThenBy: { SqlOrderByClause thenBy = ExpressionToSql.VisitOrderBy(inputExpression.Arguments, false, context); - context.currentQuery = context.currentQuery.UpdateOrderByClause(thenBy, context); + context.CurrentQuery = context.CurrentQuery.UpdateOrderByClause(thenBy, context); break; } case LinqMethods.ThenByDescending: { SqlOrderByClause thenBy = ExpressionToSql.VisitOrderBy(inputExpression.Arguments, true, context); - context.currentQuery = context.currentQuery.UpdateOrderByClause(thenBy, context); + context.CurrentQuery = context.CurrentQuery.UpdateOrderByClause(thenBy, context); break; } case LinqMethods.Skip: { SqlOffsetSpec offsetSpec = ExpressionToSql.VisitSkip(inputExpression.Arguments, context); - context.currentQuery = context.currentQuery.AddOffsetSpec(offsetSpec, context); + context.CurrentQuery = context.CurrentQuery.AddOffsetSpec(offsetSpec, context); break; } case LinqMethods.Take: { - if (context.currentQuery.HasOffsetSpec()) + if (context.CurrentQuery.HasOffsetSpec()) { SqlLimitSpec limitSpec = ExpressionToSql.VisitTakeLimit(inputExpression.Arguments, context); - context.currentQuery = context.currentQuery.AddLimitSpec(limitSpec, context); + context.CurrentQuery = context.CurrentQuery.AddLimitSpec(limitSpec, context); } else { SqlTopSpec topSpec = ExpressionToSql.VisitTakeTop(inputExpression.Arguments, context); - context.currentQuery = context.currentQuery.AddTopSpec(topSpec); + context.CurrentQuery = context.CurrentQuery.AddTopSpec(topSpec); } break; } case LinqMethods.Distinct: { SqlSelectClause select = ExpressionToSql.VisitDistinct(inputExpression.Arguments, context); - context.currentQuery = context.currentQuery.AddSelectClause(select, context); + context.CurrentQuery = context.CurrentQuery.AddSelectClause(select, context); break; } case LinqMethods.Max: { SqlSelectClause select = ExpressionToSql.VisitAggregateFunction(inputExpression.Arguments, context, SqlFunctionCallScalarExpression.Names.Max); - context.currentQuery = context.currentQuery.AddSelectClause(select, context); + context.CurrentQuery = context.CurrentQuery.AddSelectClause(select, context); break; } case LinqMethods.Min: { SqlSelectClause select = ExpressionToSql.VisitAggregateFunction(inputExpression.Arguments, context, SqlFunctionCallScalarExpression.Names.Min); - context.currentQuery = context.currentQuery.AddSelectClause(select, context); + context.CurrentQuery = context.CurrentQuery.AddSelectClause(select, context); break; } case LinqMethods.Average: { SqlSelectClause select = ExpressionToSql.VisitAggregateFunction(inputExpression.Arguments, context, SqlFunctionCallScalarExpression.Names.Avg); - context.currentQuery = context.currentQuery.AddSelectClause(select, context); + context.CurrentQuery = context.CurrentQuery.AddSelectClause(select, context); break; } case LinqMethods.Count: { SqlSelectClause select = ExpressionToSql.VisitCount(inputExpression.Arguments, context); - context.currentQuery = context.currentQuery.AddSelectClause(select, context); + context.CurrentQuery = context.CurrentQuery.AddSelectClause(select, context); break; } case LinqMethods.Sum: { SqlSelectClause select = ExpressionToSql.VisitAggregateFunction(inputExpression.Arguments, context, SqlFunctionCallScalarExpression.Names.Sum); - context.currentQuery = context.currentQuery.AddSelectClause(select, context); + context.CurrentQuery = context.CurrentQuery.AddSelectClause(select, context); break; } case LinqMethods.Any: @@ -1282,7 +1253,7 @@ private static Collection VisitMethodCall(MethodCallExpression inputExpression, { // Any is translated to an SELECT VALUE EXISTS() where Any operation itself is treated as a Where. SqlWhereClause where = ExpressionToSql.VisitWhere(inputExpression.Arguments, context); - context.currentQuery = context.currentQuery.AddWhereClause(where, context); + context.CurrentQuery = context.CurrentQuery.AddWhereClause(where, context); } break; } @@ -1509,7 +1480,7 @@ private static SqlScalarExpression VisitScalarExpression(Expression expression, ParameterExpression parameterExpression = context.GenFreshParameter(typeof(object), ExpressionToSql.DefaultParameterName); SqlCollection subqueryCollection = ExpressionToSql.CreateSubquerySqlCollection( - query, context, + query, isMinMaxAvgMethod ? SubqueryKind.ArrayScalarExpression : expressionObjKind.Value); Binding newBinding = new Binding(parameterExpression, subqueryCollection, @@ -1536,9 +1507,8 @@ private static SqlScalarExpression VisitScalarExpression(Expression expression, /// Create a subquery SQL collection object for a SQL query ///
/// The SQL query object - /// The translation context /// The subquery type - private static SqlCollection CreateSubquerySqlCollection(SqlQuery query, TranslationContext context, SubqueryKind subqueryType) + private static SqlCollection CreateSubquerySqlCollection(SqlQuery query, SubqueryKind subqueryType) { SqlCollection subqueryCollection; switch (subqueryType) @@ -1583,18 +1553,18 @@ private static SqlQuery CreateSubquery(Expression expression, ReadOnlyCollection { bool shouldBeOnNewQuery = context.CurrentSubqueryBinding.ShouldBeOnNewQuery; - QueryUnderConstruction queryBeforeVisit = context.currentQuery; - QueryUnderConstruction packagedQuery = new QueryUnderConstruction(context.GetGenFreshParameterFunc(), context.currentQuery); - packagedQuery.fromParameters.SetInputParameter(typeof(object), context.currentQuery.GetInputParameterInContext(shouldBeOnNewQuery).Name, context.InScope); - context.currentQuery = packagedQuery; + QueryUnderConstruction queryBeforeVisit = context.CurrentQuery; + QueryUnderConstruction packagedQuery = new QueryUnderConstruction(context.GetGenFreshParameterFunc(), context.CurrentQuery); + packagedQuery.fromParameters.SetInputParameter(typeof(object), context.CurrentQuery.GetInputParameterInContext(shouldBeOnNewQuery).Name, context.InScope); + context.CurrentQuery = packagedQuery; if (shouldBeOnNewQuery) context.CurrentSubqueryBinding.ShouldBeOnNewQuery = false; Collection collection = ExpressionToSql.VisitCollectionExpression(expression, parameters, context); - QueryUnderConstruction subquery = context.currentQuery.GetSubquery(queryBeforeVisit); + QueryUnderConstruction subquery = context.CurrentQuery.GetSubquery(queryBeforeVisit); context.CurrentSubqueryBinding.ShouldBeOnNewQuery = shouldBeOnNewQuery; - context.currentQuery = queryBeforeVisit; + context.CurrentQuery = queryBeforeVisit; SqlQuery sqlSubquery = subquery.FlattenAsPossible().GetSqlQuery(); return sqlSubquery; @@ -1665,7 +1635,7 @@ private static Collection VisitSelectMany(ReadOnlyCollection argumen SqlCollection subqueryCollection = SqlSubqueryCollection.Create(query); ParameterExpression parameterExpression = context.GenFreshParameter(typeof(object), ExpressionToSql.DefaultParameterName); binding = new Binding(parameterExpression, subqueryCollection, isInCollection: false, isInputParameter: true); - context.currentQuery.fromParameters.Add(binding); + context.CurrentQuery.fromParameters.Add(binding); } return collection; @@ -1902,7 +1872,7 @@ private static SqlSelectClause VisitCount( if (arguments.Count == 2) { SqlWhereClause whereClause = ExpressionToSql.VisitWhere(arguments, context); - context.currentQuery = context.currentQuery.AddWhereClause(whereClause, context); + context.CurrentQuery = context.CurrentQuery.AddWhereClause(whereClause, context); } else if (arguments.Count != 1) { @@ -2004,83 +1974,6 @@ private static SqlInputPathCollection ConvertMemberIndexerToPath(SqlMemberIndexe #endregion LINQ Specific Visitors - private sealed class CosmosElementToSqlScalarExpressionVisitor : ICosmosElementVisitor - { - public static readonly CosmosElementToSqlScalarExpressionVisitor Singleton = new CosmosElementToSqlScalarExpressionVisitor(); - - private CosmosElementToSqlScalarExpressionVisitor() - { - // Private constructor, since this class is a singleton. - } - - public SqlScalarExpression Visit(CosmosArray cosmosArray) - { - List items = new List(); - foreach (CosmosElement item in cosmosArray) - { - items.Add(item.Accept(this)); - } - - return SqlArrayCreateScalarExpression.Create(items.ToImmutableArray()); - } - - public SqlScalarExpression Visit(CosmosBinary cosmosBinary) - { - // Can not convert binary to scalar expression without knowing the API type. - throw new NotImplementedException(); - } - - public SqlScalarExpression Visit(CosmosBoolean cosmosBoolean) - { - return SqlLiteralScalarExpression.Create(SqlBooleanLiteral.Create(cosmosBoolean.Value)); - } - - public SqlScalarExpression Visit(CosmosGuid cosmosGuid) - { - // Can not convert guid to scalar expression without knowing the API type. - throw new NotImplementedException(); - } - - public SqlScalarExpression Visit(CosmosNull cosmosNull) - { - return SqlLiteralScalarExpression.Create(SqlNullLiteral.Create()); - } - - public SqlScalarExpression Visit(CosmosNumber cosmosNumber) - { - if (!(cosmosNumber is CosmosNumber64 cosmosNumber64)) - { - throw new ArgumentException($"Unknown {nameof(CosmosNumber)} type: {cosmosNumber.GetType()}."); - } - - return SqlLiteralScalarExpression.Create(SqlNumberLiteral.Create(cosmosNumber64.GetValue())); - } - - public SqlScalarExpression Visit(CosmosObject cosmosObject) - { - List properties = new List(); - foreach (KeyValuePair prop in cosmosObject) - { - SqlPropertyName name = SqlPropertyName.Create(prop.Key); - CosmosElement value = prop.Value; - SqlScalarExpression expression = value.Accept(this); - SqlObjectProperty property = SqlObjectProperty.Create(name, expression); - properties.Add(property); - } - - return SqlObjectCreateScalarExpression.Create(properties.ToImmutableArray()); - } - - public SqlScalarExpression Visit(CosmosString cosmosString) - { - return SqlLiteralScalarExpression.Create(SqlStringLiteral.Create(cosmosString.Value)); - } - - public SqlScalarExpression Visit(CosmosUndefined cosmosUndefined) - { - return SqlLiteralScalarExpression.Create(SqlUndefinedLiteral.Create()); - } - } private enum SubqueryKind { ArrayScalarExpression, diff --git a/Microsoft.Azure.Cosmos/src/Linq/ICosmosLinqSerializer.cs b/Microsoft.Azure.Cosmos/src/Linq/ICosmosLinqSerializer.cs new file mode 100644 index 0000000000..f31490832d --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Linq/ICosmosLinqSerializer.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace Microsoft.Azure.Cosmos.Linq +{ + using System; + using System.Linq.Expressions; + using System.Reflection; + + internal interface ICosmosLinqSerializer + { + /// + /// Returns true if there are custom attributes on a member expression. + /// + bool RequiresCustomSerialization(MemberExpression memberExpression, Type memberType); + + // TODO : Clean up this interface member for better generalizability + /// + /// Serializes object. + /// + string Serialize(object value, MemberExpression memberExpression, Type memberType); + + /// + /// Serializes a ConstantExpression. + /// + string SerializeScalarExpression(ConstantExpression inputExpression); + + /// + /// Serializes a member name with LINQ serializer options applied. + /// + string SerializeMemberName(MemberInfo memberInfo, CosmosLinqSerializerOptions linqSerializerOptions = null); + } +} diff --git a/Microsoft.Azure.Cosmos/src/Linq/QueryUnderConstruction.cs b/Microsoft.Azure.Cosmos/src/Linq/QueryUnderConstruction.cs index c5c0573a14..d2e19046e1 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/QueryUnderConstruction.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/QueryUnderConstruction.cs @@ -583,13 +583,13 @@ public QueryUnderConstruction AddOrderByClause(SqlOrderByClause orderBy, Transla public QueryUnderConstruction UpdateOrderByClause(SqlOrderByClause thenBy, TranslationContext context) { - List items = new List(context.currentQuery.orderByClause.OrderByItems); + List items = new List(context.CurrentQuery.orderByClause.OrderByItems); items.AddRange(thenBy.OrderByItems); - context.currentQuery.orderByClause = SqlOrderByClause.Create(items.ToImmutableArray()); + context.CurrentQuery.orderByClause = SqlOrderByClause.Create(items.ToImmutableArray()); - foreach (Binding binding in context.CurrentSubqueryBinding.TakeBindings()) context.currentQuery.AddBinding(binding); + foreach (Binding binding in context.CurrentSubqueryBinding.TakeBindings()) context.CurrentQuery.AddBinding(binding); - return context.currentQuery; + return context.CurrentQuery; } public QueryUnderConstruction AddOffsetSpec(SqlOffsetSpec offsetSpec, TranslationContext context) diff --git a/Microsoft.Azure.Cosmos/src/Linq/SQLTranslator.cs b/Microsoft.Azure.Cosmos/src/Linq/SQLTranslator.cs index 8648019219..c0bd6d38a0 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/SQLTranslator.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/SQLTranslator.cs @@ -6,7 +6,6 @@ namespace Microsoft.Azure.Cosmos.Linq using System.Collections.Generic; using System.Linq.Expressions; using Microsoft.Azure.Cosmos.Query.Core; - using Microsoft.Azure.Cosmos.Serializer; using Microsoft.Azure.Cosmos.SqlObjects; ///
diff --git a/Microsoft.Azure.Cosmos/src/Linq/TranslationContext.cs b/Microsoft.Azure.Cosmos/src/Linq/TranslationContext.cs index 8fc95d8701..f5d53bd1e7 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/TranslationContext.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/TranslationContext.cs @@ -7,7 +7,6 @@ namespace Microsoft.Azure.Cosmos.Linq using System; using System.Collections.Generic; using System.Linq.Expressions; - using Microsoft.Azure.Cosmos.Serializer; using Microsoft.Azure.Cosmos.SqlObjects; using static Microsoft.Azure.Cosmos.Linq.ExpressionToSql; using static Microsoft.Azure.Cosmos.Linq.FromParameterBindings; @@ -20,39 +19,54 @@ internal sealed class TranslationContext /// /// Member names for special mapping cases /// - internal readonly MemberNames memberNames; + public readonly MemberNames MemberNames; + + /// + /// The LINQ serializer + /// + public readonly ICosmosLinqSerializer CosmosLinqSerializer; + + /// + /// User-provided LINQ serializer options + /// + public CosmosLinqSerializerOptions LinqSerializerOptions; /// /// Set of parameters in scope at any point; used to generate fresh parameter names if necessary. /// public HashSet InScope; + /// /// Query that is being assembled. /// - public QueryUnderConstruction currentQuery; + public QueryUnderConstruction CurrentQuery; /// /// Dictionary for parameter name and value /// - public IDictionary parameters; + public IDictionary Parameters; /// /// If the FROM clause uses a parameter name, it will be substituted for the parameter used in /// the lambda expressions for the WHERE and SELECT clauses. /// private ParameterSubstitution substitutions; + /// /// We are currently visiting these methods. /// private List methodStack; + /// /// Stack of parameters from lambdas currently in scope. /// private List lambdaParametersStack; + /// /// Stack of collection-valued inputs. /// private List collectionStack; + /// /// The stack of subquery binding information. /// @@ -65,15 +79,14 @@ public TranslationContext(CosmosLinqSerializerOptions linqSerializerOptions, IDi this.methodStack = new List(); this.lambdaParametersStack = new List(); this.collectionStack = new List(); - this.currentQuery = new QueryUnderConstruction(this.GetGenFreshParameterFunc()); + this.CurrentQuery = new QueryUnderConstruction(this.GetGenFreshParameterFunc()); this.subqueryBindingStack = new Stack(); - this.linqSerializerOptions = linqSerializerOptions; - this.parameters = parameters; - this.memberNames = new MemberNames(linqSerializerOptions); + this.LinqSerializerOptions = linqSerializerOptions; + this.Parameters = parameters; + this.MemberNames = new MemberNames(linqSerializerOptions); + this.CosmosLinqSerializer = new DefaultCosmosLinqSerializer(); } - public CosmosLinqSerializerOptions linqSerializerOptions; - public Expression LookupSubstitution(ParameterExpression parameter) { return this.substitutions.Lookup(parameter); @@ -103,12 +116,12 @@ public void PushParameter(ParameterExpression parameter, bool shouldBeOnNewQuery if (last.isOuter) { // substitute - ParameterExpression inputParam = this.currentQuery.GetInputParameterInContext(shouldBeOnNewQuery); + ParameterExpression inputParam = this.CurrentQuery.GetInputParameterInContext(shouldBeOnNewQuery); this.substitutions.AddSubstitution(parameter, inputParam); } else { - this.currentQuery.Bind(parameter, last.inner); + this.CurrentQuery.Bind(parameter, last.inner); } } @@ -182,7 +195,7 @@ public void PopCollection() /// Suggested name for the input parameter. public ParameterExpression SetInputParameter(Type type, string name) { - return this.currentQuery.fromParameters.SetInputParameter(type, name, this.InScope); + return this.CurrentQuery.fromParameters.SetInputParameter(type, name, this.InScope); } /// @@ -193,7 +206,7 @@ public ParameterExpression SetInputParameter(Type type, string name) public void SetFromParameter(ParameterExpression parameter, SqlCollection collection) { Binding binding = new Binding(parameter, collection, isInCollection: true); - this.currentQuery.fromParameters.Add(binding); + this.CurrentQuery.fromParameters.Add(binding); } /// @@ -258,11 +271,11 @@ public QueryUnderConstruction PackageCurrentQueryIfNeccessary() { if (this.CurrentSubqueryBinding.ShouldBeOnNewQuery) { - this.currentQuery = this.currentQuery.PackageQuery(this.InScope); + this.CurrentQuery = this.CurrentQuery.PackageQuery(this.InScope); this.CurrentSubqueryBinding.ShouldBeOnNewQuery = false; } - return this.currentQuery; + return this.CurrentQuery; } public class SubqueryBinding diff --git a/Microsoft.Azure.Cosmos/src/Linq/TypeSystem.cs b/Microsoft.Azure.Cosmos/src/Linq/TypeSystem.cs index 7c8e62d69c..e11c145c71 100644 --- a/Microsoft.Azure.Cosmos/src/Linq/TypeSystem.cs +++ b/Microsoft.Azure.Cosmos/src/Linq/TypeSystem.cs @@ -10,10 +10,7 @@ namespace Microsoft.Azure.Cosmos.Linq using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; - using System.Runtime.Serialization; - using Microsoft.Azure.Cosmos.Serializer; using Microsoft.Azure.Documents; - using Newtonsoft.Json; internal static class TypeSystem { @@ -22,48 +19,9 @@ public static Type GetElementType(Type type) return GetElementType(type, new HashSet()); } - public static string GetMemberName(this MemberInfo memberInfo, CosmosLinqSerializerOptions linqSerializerOptions = null) + public static string GetMemberName(this MemberInfo memberInfo, TranslationContext context) { - string memberName = null; - - // Check if Newtonsoft JsonExtensionDataAttribute is present on the member, if so, return empty member name. - JsonExtensionDataAttribute jsonExtensionDataAttribute = memberInfo.GetCustomAttribute(true); - if (jsonExtensionDataAttribute != null && jsonExtensionDataAttribute.ReadData) - { - return null; - } - - // Json.Net honors JsonPropertyAttribute more than DataMemberAttribute - // So we check for JsonPropertyAttribute first. - JsonPropertyAttribute jsonPropertyAttribute = memberInfo.GetCustomAttribute(true); - if (jsonPropertyAttribute != null && !string.IsNullOrEmpty(jsonPropertyAttribute.PropertyName)) - { - memberName = jsonPropertyAttribute.PropertyName; - } - else - { - DataContractAttribute dataContractAttribute = memberInfo.DeclaringType.GetCustomAttribute(true); - if (dataContractAttribute != null) - { - DataMemberAttribute dataMemberAttribute = memberInfo.GetCustomAttribute(true); - if (dataMemberAttribute != null && !string.IsNullOrEmpty(dataMemberAttribute.Name)) - { - memberName = dataMemberAttribute.Name; - } - } - } - - if (memberName == null) - { - memberName = memberInfo.Name; - } - - if (linqSerializerOptions != null) - { - memberName = CosmosSerializationUtil.GetStringWithPropertyNamingPolicy(linqSerializerOptions, memberName); - } - - return memberName; + return context.CosmosLinqSerializer.SerializeMemberName(memberInfo, context.LinqSerializerOptions); } private static Type GetElementType(Type type, HashSet visitedSet) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqAttributeContractBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqAttributeContractBaselineTests.cs index 7ffc36bdbd..5ea03bf0b6 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqAttributeContractBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqAttributeContractBaselineTests.cs @@ -9,14 +9,13 @@ namespace Microsoft.Azure.Cosmos.Services.Management.Tests.LinqProviderTests using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; - using Newtonsoft.Json; - using Newtonsoft.Json.Linq; - using VisualStudio.TestTools.UnitTesting; + using System.Threading.Tasks; using BaselineTest; using Microsoft.Azure.Cosmos.Linq; using Microsoft.Azure.Cosmos.SDK.EmulatorTests; using Microsoft.Azure.Documents; - using System.Threading.Tasks; + using Newtonsoft.Json; + using VisualStudio.TestTools.UnitTesting; /// /// Class that tests to see that we honor the attributes for members in a class / struct when we create LINQ queries. @@ -173,10 +172,11 @@ public Datum2(string jsonProperty, string dataMember, string defaultMember, stri [TestMethod] public void TestAttributePriority() { - Assert.AreEqual("jsonProperty", TypeSystem.GetMemberName(typeof(Datum).GetMember("JsonProperty").First())); - Assert.AreEqual("dataMember", TypeSystem.GetMemberName(typeof(Datum).GetMember("DataMember").First())); - Assert.AreEqual("Default", TypeSystem.GetMemberName(typeof(Datum).GetMember("Default").First())); - Assert.AreEqual("jsonPropertyHasHigherPriority", TypeSystem.GetMemberName(typeof(Datum).GetMember("JsonPropertyAndDataMember").First())); + ICosmosLinqSerializer cosmosLinqSerializer = new DefaultCosmosLinqSerializer(); + Assert.AreEqual("jsonProperty", cosmosLinqSerializer.SerializeMemberName(typeof(Datum).GetMember("JsonProperty").First())); + Assert.AreEqual("dataMember", cosmosLinqSerializer.SerializeMemberName(typeof(Datum).GetMember("DataMember").First())); + Assert.AreEqual("Default", cosmosLinqSerializer.SerializeMemberName(typeof(Datum).GetMember("Default").First())); + Assert.AreEqual("jsonPropertyHasHigherPriority", cosmosLinqSerializer.SerializeMemberName(typeof(Datum).GetMember("JsonPropertyAndDataMember").First())); } /// From 966b48146436c24b06a8d17293ba5d87580360bf Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Thu, 9 Nov 2023 12:52:11 -0800 Subject: [PATCH 233/240] Routing: Adds ExcludeRegions Feature to RequestOptions (#4128) * adds excludeRegions * suggested changes * removed unused usings * fixed blank line error * removed using * update contracts * fixed test * reverted automatic changes to BaselineTests * requested changes * bug fix * PPOF test fix --- .../src/ClientRetryPolicy.cs | 8 +- .../src/Handler/RequestMessage.cs | 4 +- .../src/RequestOptions/QueryRequestOptions.cs | 1 - .../src/RequestOptions/RequestOptions.cs | 7 + .../src/Routing/GlobalEndpointManager.cs | 5 + .../src/Routing/LocationCache.cs | 62 ++++- .../Contracts/DotNetSDKAPI.json | 19 ++ .../LocationCacheTests.cs | 229 ++++++++++++++++-- 8 files changed, 303 insertions(+), 32 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/ClientRetryPolicy.cs b/Microsoft.Azure.Cosmos/src/ClientRetryPolicy.cs index 7cef90d541..147977e130 100644 --- a/Microsoft.Azure.Cosmos/src/ClientRetryPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/ClientRetryPolicy.cs @@ -246,9 +246,9 @@ private async Task ShouldRetryInternalAsync( if (statusCode == HttpStatusCode.NotFound && subStatusCode == SubStatusCodes.ReadSessionNotAvailable) { - return this.ShouldRetryOnSessionNotAvailable(); + return this.ShouldRetryOnSessionNotAvailable(this.documentServiceRequest); } - + // Received 503 due to client connect timeout or Gateway if (statusCode == HttpStatusCode.ServiceUnavailable) { @@ -330,7 +330,7 @@ private async Task ShouldRetryOnEndpointFailureAsync( return ShouldRetryResult.RetryAfter(retryDelay); } - private ShouldRetryResult ShouldRetryOnSessionNotAvailable() + private ShouldRetryResult ShouldRetryOnSessionNotAvailable(DocumentServiceRequest request) { this.sessionTokenRetryCount++; @@ -343,7 +343,7 @@ private ShouldRetryResult ShouldRetryOnSessionNotAvailable() { if (this.canUseMultipleWriteLocations) { - ReadOnlyCollection endpoints = this.isReadRequest ? this.globalEndpointManager.ReadEndpoints : this.globalEndpointManager.WriteEndpoints; + ReadOnlyCollection endpoints = this.globalEndpointManager.GetApplicableEndpoints(request, this.isReadRequest); if (this.sessionTokenRetryCount > endpoints.Count) { diff --git a/Microsoft.Azure.Cosmos/src/Handler/RequestMessage.cs b/Microsoft.Azure.Cosmos/src/Handler/RequestMessage.cs index 6748e79921..67d3dbdc27 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/RequestMessage.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/RequestMessage.cs @@ -282,7 +282,8 @@ internal DocumentServiceRequest ToDocumentServiceRequest() { this.DocumentServiceRequest.RouteTo(this.PartitionKeyRangeId); } - + + this.DocumentServiceRequest.RequestContext.ExcludeRegions = this.RequestOptions?.ExcludeRegions; this.OnBeforeRequestHandler(this.DocumentServiceRequest); return this.DocumentServiceRequest; } @@ -299,6 +300,7 @@ private static Headers CreateHeaders() private void OnBeforeRequestHandler(DocumentServiceRequest serviceRequest) { + serviceRequest.RequestContext.ExcludeRegions = this.RequestOptions?.ExcludeRegions; this.OnBeforeSendRequestActions?.Invoke(serviceRequest); } diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs index 2b4aba5ac0..a4557da6d2 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs @@ -5,7 +5,6 @@ namespace Microsoft.Azure.Cosmos { using System; - using System.ComponentModel; using System.Text; using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.Query; diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs index e8d4c602ff..dd24f3e45e 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs @@ -69,6 +69,13 @@ public class RequestOptions /// public CosmosThresholdOptions CosmosThresholdOptions { get; set; } + /// + /// List of regions to be excluded routing the request to. + /// This can be used to route a request to a specific region by excluding all other regions. + /// If all regions are excluded, then the request will be routed to the primary/hub region. + /// + public List ExcludeRegions { get; set; } + /// /// Gets or sets the boolean to use effective partition key routing in the cosmos db request. /// diff --git a/Microsoft.Azure.Cosmos/src/Routing/GlobalEndpointManager.cs b/Microsoft.Azure.Cosmos/src/Routing/GlobalEndpointManager.cs index bcaae809f4..e12d99255d 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/GlobalEndpointManager.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/GlobalEndpointManager.cs @@ -362,6 +362,11 @@ public string GetLocation(Uri endpoint) return this.locationCache.GetLocation(endpoint); } + public ReadOnlyCollection GetApplicableEndpoints(DocumentServiceRequest request, bool isReadRequest) + { + return this.locationCache.GetApplicableEndpoints(request, isReadRequest); + } + public bool TryGetLocationForGatewayDiagnostics(Uri endpoint, out string regionName) { return this.locationCache.TryGetLocationForGatewayDiagnostics(endpoint, out regionName); diff --git a/Microsoft.Azure.Cosmos/src/Routing/LocationCache.cs b/Microsoft.Azure.Cosmos/src/Routing/LocationCache.cs index 4480df1826..88a369bd2d 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/LocationCache.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/LocationCache.cs @@ -31,6 +31,7 @@ internal sealed class LocationCache private readonly TimeSpan unavailableLocationsExpirationTime; private readonly int connectionLimit; private readonly ConcurrentDictionary locationUnavailablityInfoByEndpoint; + private readonly RegionNameMapper regionNameMapper; private DatabaseAccountLocationsInfo locationInfo; private DateTime lastCacheUpdateTimestamp; @@ -54,6 +55,7 @@ public LocationCache( this.lastCacheUpdateTimestamp = DateTime.MinValue; this.enableMultipleWriteLocations = false; this.unavailableLocationsExpirationTime = TimeSpan.FromSeconds(LocationCache.DefaultUnavailableLocationsExpirationTimeInSeconds); + this.regionNameMapper = new RegionNameMapper(); #if !(NETSTANDARD15 || NETSTANDARD16) #if NETSTANDARD20 @@ -281,7 +283,7 @@ public Uri ResolveServiceEndpoint(DocumentServiceRequest request) } else { - ReadOnlyCollection endpoints = request.OperationType.IsWriteOperation() ? this.WriteEndpoints : this.ReadEndpoints; + ReadOnlyCollection endpoints = this.GetApplicableEndpoints(request, !request.OperationType.IsWriteOperation()); locationEndpointToRoute = endpoints[locationIndex % endpoints.Count]; } @@ -289,6 +291,64 @@ public Uri ResolveServiceEndpoint(DocumentServiceRequest request) return locationEndpointToRoute; } + public ReadOnlyCollection GetApplicableEndpoints(DocumentServiceRequest request, bool isReadRequest) + { + ReadOnlyCollection endpoints = isReadRequest ? this.ReadEndpoints : this.WriteEndpoints; + + if (request.RequestContext.ExcludeRegions == null || request.RequestContext.ExcludeRegions.Count == 0) + { + return endpoints; + } + + return this.GetApplicableEndpoints( + endpoints, + isReadRequest ? this.locationInfo.AvailableReadEndpointByLocation : this.locationInfo.AvailableWriteEndpointByLocation, + this.defaultEndpoint, + request.RequestContext.ExcludeRegions); + } + + /// + /// Gets applicable endpoints for a request, if there are no applicable endpoints, returns the fallback endpoint + /// + /// + /// + /// + /// + /// a list of applicable endpoints for a request + private ReadOnlyCollection GetApplicableEndpoints( + IReadOnlyList endpoints, + ReadOnlyDictionary regionNameByEndpoint, + Uri fallbackEndpoint, + IReadOnlyList excludeRegions) + { + List applicableEndpoints = new List(endpoints.Count); + HashSet excludeUris = new HashSet(); + + foreach (string region in excludeRegions) + { + string normalizedRegionName = this.regionNameMapper.GetCosmosDBRegionName(region); + if (regionNameByEndpoint.ContainsKey(normalizedRegionName)) + { + excludeUris.Add(regionNameByEndpoint[normalizedRegionName]); + } + } + + foreach (Uri endpoint in endpoints) + { + if (!excludeUris.Contains(endpoint)) + { + applicableEndpoints.Add(endpoint); + } + } + + if (applicableEndpoints.Count == 0) + { + applicableEndpoints.Add(fallbackEndpoint); + } + + return new ReadOnlyCollection(applicableEndpoints); + } + public bool ShouldRefreshEndpoints(out bool canRefreshInBackground) { canRefreshInBackground = true; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 8c8d7d6ae1..46bdf1c170 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -7986,6 +7986,18 @@ "Attributes": [], "MethodInfo": "System.Collections.Generic.IReadOnlyDictionary`2[System.String,System.Object] Properties;CanRead:True;CanWrite:True;System.Collections.Generic.IReadOnlyDictionary`2[System.String,System.Object] get_Properties();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_Properties(System.Collections.Generic.IReadOnlyDictionary`2[System.String,System.Object]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "System.Collections.Generic.List`1[System.String] ExcludeRegions": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.Collections.Generic.List`1[System.String] ExcludeRegions;CanRead:True;CanWrite:True;System.Collections.Generic.List`1[System.String] get_ExcludeRegions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_ExcludeRegions(System.Collections.Generic.List`1[System.String]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Collections.Generic.List`1[System.String] get_ExcludeRegions()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "System.Collections.Generic.List`1[System.String] get_ExcludeRegions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "System.String get_IfMatchEtag()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ @@ -8029,6 +8041,13 @@ ], "MethodInfo": "Void set_CosmosThresholdOptions(Microsoft.Azure.Cosmos.CosmosThresholdOptions);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Void set_ExcludeRegions(System.Collections.Generic.List`1[System.String])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_ExcludeRegions(System.Collections.Generic.List`1[System.String]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Void set_IfMatchEtag(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/LocationCacheTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/LocationCacheTests.cs index b93107b302..06ed0d4026 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/LocationCacheTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/LocationCacheTests.cs @@ -770,11 +770,180 @@ await BackoffRetryUtility.ExecuteAsync( } } + [TestMethod] + [DataRow(true, true, true, DisplayName = "Read request - Multi master - with preferred locations")] + [DataRow(true, true, false, DisplayName = "Read request - Multi master - no preferred locations")] + [DataRow(true, false, true, DisplayName = "Read request - Single master - with preferred locations")] + [DataRow(true, false, false, DisplayName = "Read request - Single master - no preferred locations")] + [DataRow(false, true, true, DisplayName = "Write request - Multi master - with preferred locations")] + [DataRow(false, true, false, DisplayName = "Write request - Multi master - no preferred locations")] + [DataRow(false, false, true, DisplayName = "Write request - Single master - with preferred locations")] + [DataRow(false, false, false, DisplayName = "Write request - Single master - no preferred locations")] + public void VerifyRegionExcludedTest( + bool isReadRequest, + bool useMultipleWriteLocations, + bool usesPreferredLocations) + { + bool enableEndpointDiscovery = true; + + ReadOnlyCollection preferredList = usesPreferredLocations ? + isReadRequest ? + new List { + "location4", + "location2", + "location1" + }.AsReadOnly() : + new List { + "location3", + "location2", + "location1" + }.AsReadOnly() : + isReadRequest ? + new List() { + "default", + "location1", + "location2", + "location4" + }.AsReadOnly() : + new List() { + "default", + "location1", + "location2", + "location3" + }.AsReadOnly(); + + List> excludeRegionCases = isReadRequest ? + new List>() + { + new List {"default"}, new List {"default", "location1"}, new List {"default", "location2"}, new List {"default", "location4"}, + new List {"default", "location1", "location2"}, new List {"default", "location1", "location4"}, new List {"default", "location2", "location4"}, + new List {"default", "location1", "location2", "location4"}, new List { "location1" }, new List {"location1", "location2"}, + new List {"location1", "location4"}, new List {"location1", "location2", "location4"},new List { "location2" }, + new List {"location2", "location4"},new List { "location4" }, + } : + new List>() + { + new List {"default" }, new List {"default", "location1"}, new List {"default", "location2"}, new List {"default", "location3"}, + new List {"default", "location1", "location2"}, new List {"default", "location1", "location3"}, new List {"default", "location2", "location3"}, + new List {"default", "location1", "location2", "location3"}, new List { "location1" }, new List {"location1", "location2"}, + new List {"location1", "location3"}, new List {"location1", "location2", "location3"},new List { "location2" }, + new List {"location2", "location3"},new List { "location3" }, + }; + + foreach (List excludeRegions in excludeRegionCases) + { + using GlobalEndpointManager endpointManager = this.Initialize( + useMultipleWriteLocations: useMultipleWriteLocations, + enableEndpointDiscovery: enableEndpointDiscovery, + isPreferredLocationsListEmpty: false, + preferedRegionListOverride: preferredList, + enforceSingleMasterSingleWriteLocation: true, + isExcludeRegionsTest: true); + + endpointManager.InitializeAccountPropertiesAndStartBackgroundRefresh(this.databaseAccount); + ClientRetryPolicy retryPolicy = this.CreateClientRetryPolicy(enableEndpointDiscovery: true, partitionLevelFailoverEnabled: false, endpointManager: endpointManager); + + using (DocumentServiceRequest request = this.CreateRequest(isReadRequest: isReadRequest, isMasterResourceType: false)) + { + request.RequestContext.ExcludeRegions = excludeRegions; + + ReadOnlyCollection applicableEndpoints = endpointManager.GetApplicableEndpoints(request, isReadRequest); + + Uri endpoint = endpointManager.ResolveServiceEndpoint(request); + ReadOnlyCollection applicableRegions = this.GetApplicableRegions(isReadRequest, useMultipleWriteLocations, usesPreferredLocations, excludeRegions); + + Assert.AreEqual(applicableRegions.Count, applicableEndpoints.Count); + for(int i = 0; i < applicableRegions.Count; i++) + { + Assert.AreEqual(applicableRegions[i], applicableEndpoints[i]); + } + + Assert.AreEqual(applicableRegions[0], endpoint); + } + } + + } + + private ReadOnlyCollection GetApplicableRegions(bool isReadRequest, bool useMultipleWriteLocations, bool usesPreferredLocations, List excludeRegions) + { + if(!isReadRequest && !useMultipleWriteLocations) + { + return new List() {LocationCacheTests.DefaultEndpoint }.AsReadOnly(); + } + + Dictionary readWriteLocations = usesPreferredLocations ? + isReadRequest ? + new Dictionary() + { + {"location4", LocationCacheTests.Location4Endpoint }, + {"location2", LocationCacheTests.Location2Endpoint }, + {"location1", LocationCacheTests.Location1Endpoint }, + } : + useMultipleWriteLocations ? + new Dictionary() + { + {"location3", LocationCacheTests.Location3Endpoint }, + {"location2", LocationCacheTests.Location2Endpoint }, + {"location1", LocationCacheTests.Location1Endpoint }, + } : + new Dictionary() + { + {"default", LocationCacheTests.DefaultEndpoint }, + } : + isReadRequest ? + new Dictionary() + { + {"default", LocationCacheTests.DefaultEndpoint }, + {"location1", LocationCacheTests.Location1Endpoint }, + {"location2", LocationCacheTests.Location2Endpoint }, + {"location4", LocationCacheTests.Location4Endpoint }, + } : + useMultipleWriteLocations ? + new Dictionary() + { + {"default", LocationCacheTests.DefaultEndpoint }, + {"location1", LocationCacheTests.Location1Endpoint }, + {"location2", LocationCacheTests.Location2Endpoint }, + {"location3", LocationCacheTests.Location3Endpoint }, + } : + new Dictionary() + { + {"default", LocationCacheTests.DefaultEndpoint} + }; + + List applicableRegions = new List(); + + foreach (string region in readWriteLocations.Keys) + { + if(!excludeRegions.Contains(region)) + { + applicableRegions.Add(readWriteLocations[region]); + } + } + + if (applicableRegions.Count == 0) + { + applicableRegions.Add(LocationCacheTests.DefaultEndpoint); + } + + return applicableRegions.AsReadOnly(); + } + private static AccountProperties CreateDatabaseAccount( bool useMultipleWriteLocations, - bool enforceSingleMasterSingleWriteLocation) + bool enforceSingleMasterSingleWriteLocation, + bool isExcludeRegionsTest = false) { - Collection writeLocations = new Collection() + Collection writeLocations = isExcludeRegionsTest ? + + new Collection() + { + { new AccountRegion() { Name = "default", Endpoint = LocationCacheTests.DefaultEndpoint.ToString() } }, + { new AccountRegion() { Name = "location1", Endpoint = LocationCacheTests.Location1Endpoint.ToString() } }, + { new AccountRegion() { Name = "location2", Endpoint = LocationCacheTests.Location2Endpoint.ToString() } }, + { new AccountRegion() { Name = "location3", Endpoint = LocationCacheTests.Location3Endpoint.ToString() } }, + } : + new Collection() { { new AccountRegion() { Name = "location1", Endpoint = LocationCacheTests.Location1Endpoint.ToString() } }, { new AccountRegion() { Name = "location2", Endpoint = LocationCacheTests.Location2Endpoint.ToString() } }, @@ -786,21 +955,34 @@ private static AccountProperties CreateDatabaseAccount( { // Some pre-existing tests depend on the account having multiple write locations even on single master setup // Newer tests can correctly define a single master account (single write region) without breaking existing tests - writeLocations = new Collection() - { - { new AccountRegion() { Name = "location1", Endpoint = LocationCacheTests.Location1Endpoint.ToString() } } - }; + writeLocations = isExcludeRegionsTest ? + new Collection() + { + { new AccountRegion() { Name = "default", Endpoint = LocationCacheTests.DefaultEndpoint.ToString() } } + } : + new Collection() + { + { new AccountRegion() { Name = "location1", Endpoint = LocationCacheTests.Location1Endpoint.ToString() } } + } ; } AccountProperties databaseAccount = new AccountProperties() { EnableMultipleWriteLocations = useMultipleWriteLocations, - ReadLocationsInternal = new Collection() - { - { new AccountRegion() { Name = "location1", Endpoint = LocationCacheTests.Location1Endpoint.ToString() } }, - { new AccountRegion() { Name = "location2", Endpoint = LocationCacheTests.Location2Endpoint.ToString() } }, - { new AccountRegion() { Name = "location4", Endpoint = LocationCacheTests.Location4Endpoint.ToString() } }, - }, + ReadLocationsInternal = isExcludeRegionsTest ? + new Collection() + { + { new AccountRegion() { Name = "default", Endpoint = LocationCacheTests.DefaultEndpoint.ToString() } }, + { new AccountRegion() { Name = "location1", Endpoint = LocationCacheTests.Location1Endpoint.ToString() } }, + { new AccountRegion() { Name = "location2", Endpoint = LocationCacheTests.Location2Endpoint.ToString() } }, + { new AccountRegion() { Name = "location4", Endpoint = LocationCacheTests.Location4Endpoint.ToString() } }, + } : + new Collection() + { + { new AccountRegion() { Name = "location1", Endpoint = LocationCacheTests.Location1Endpoint.ToString() } }, + { new AccountRegion() { Name = "location2", Endpoint = LocationCacheTests.Location2Endpoint.ToString() } }, + { new AccountRegion() { Name = "location4", Endpoint = LocationCacheTests.Location4Endpoint.ToString() } }, + }, WriteLocationsInternal = writeLocations }; @@ -813,11 +995,13 @@ private GlobalEndpointManager Initialize( bool isPreferredLocationsListEmpty, bool enforceSingleMasterSingleWriteLocation = false, // Some tests depend on the Initialize to create an account with multiple write locations, even when not multi master ReadOnlyCollection preferedRegionListOverride = null, - bool enablePartitionLevelFailover = false) + bool enablePartitionLevelFailover = false, + bool isExcludeRegionsTest = false) { this.databaseAccount = LocationCacheTests.CreateDatabaseAccount( useMultipleWriteLocations, - enforceSingleMasterSingleWriteLocation); + enforceSingleMasterSingleWriteLocation, + isExcludeRegionsTest); if (isPreferredLocationsListEmpty) { @@ -826,7 +1010,7 @@ private GlobalEndpointManager Initialize( else { // Allow for override at the test method level if needed - this.preferredLocations = preferedRegionListOverride != null ? preferedRegionListOverride : new List() + this.preferredLocations = preferedRegionListOverride ?? new List() { "location1", "location2", @@ -844,8 +1028,8 @@ private GlobalEndpointManager Initialize( this.cache.OnDatabaseAccountRead(this.databaseAccount); this.mockedClient = new Mock(); - mockedClient.Setup(owner => owner.ServiceEndpoint).Returns(LocationCacheTests.DefaultEndpoint); - mockedClient.Setup(owner => owner.GetDatabaseAccountInternalAsync(It.IsAny(), It.IsAny())).ReturnsAsync(this.databaseAccount); + this.mockedClient.Setup(owner => owner.ServiceEndpoint).Returns(LocationCacheTests.DefaultEndpoint); + this.mockedClient.Setup(owner => owner.GetDatabaseAccountInternalAsync(It.IsAny(), It.IsAny())).ReturnsAsync(this.databaseAccount); ConnectionPolicy connectionPolicy = new ConnectionPolicy() { @@ -860,14 +1044,9 @@ private GlobalEndpointManager Initialize( GlobalEndpointManager endpointManager = new GlobalEndpointManager(this.mockedClient.Object, connectionPolicy); - if (enablePartitionLevelFailover) - { - this.partitionKeyRangeLocationCache = new GlobalPartitionEndpointManagerCore(endpointManager); - } - else - { - this.partitionKeyRangeLocationCache = GlobalPartitionEndpointManagerNoOp.Instance; - } + this.partitionKeyRangeLocationCache = enablePartitionLevelFailover + ? new GlobalPartitionEndpointManagerCore(endpointManager) + : GlobalPartitionEndpointManagerNoOp.Instance; return endpointManager; } From 4fee54695bb9d3b4a950473c56529c10e74f7a0d Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Wed, 15 Nov 2023 10:15:42 -0800 Subject: [PATCH 234/240] Upgrade Resiliency: Adds Code to Enable Advanced Replica Selection Feature for Preview (#4180) * Code changes to enable replica validation for preview. * Code changes to enable replica validation for preview and GA. --- Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs index 0b7786d8c3..3c48b1f5ab 100644 --- a/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs +++ b/Microsoft.Azure.Cosmos/src/Util/ConfigurationManager.cs @@ -44,8 +44,6 @@ public static T GetEnvironmentVariable(string variable, T defaultValue) public static bool IsReplicaAddressValidationEnabled( ConnectionPolicy connectionPolicy) { - bool replicaValidationDefaultValue = false; - if (connectionPolicy != null && connectionPolicy.EnableAdvancedReplicaSelectionForTcp.HasValue) { @@ -55,7 +53,7 @@ public static bool IsReplicaAddressValidationEnabled( return ConfigurationManager .GetEnvironmentVariable( variable: ConfigurationManager.ReplicaConnectivityValidationEnabled, - defaultValue: replicaValidationDefaultValue); + defaultValue: true); } /// From f471418c23ac44b28bf2be45804e662357bd391c Mon Sep 17 00:00:00 2001 From: Kiran Kumar Kolli Date: Wed, 15 Nov 2023 12:59:52 -0800 Subject: [PATCH 235/240] VS 17.8 auto runs NuGetAudit and flagging 10.0.2, CosmosDB SDK already mitigated it by changing the MAXDEPATH (#4185) --- Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj index f8afb4af6c..b94151babd 100644 --- a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj +++ b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj @@ -117,7 +117,7 @@ - + From e205d411db41917e4027e0e25c77377e2df3329b Mon Sep 17 00:00:00 2001 From: Kiran Kumar Kolli Date: Wed, 15 Nov 2023 23:30:13 -0800 Subject: [PATCH 236/240] Documentation: Adds Upsert documentation to include status codes for Created vs Replaced (#4186) * Upset status codes clarification * Upgrade Resiliency: Adds Code to Enable Advanced Replica Selection Feature for Preview (#4180) * Code changes to enable replica validation for preview. * Code changes to enable replica validation for preview and GA. --------- Co-authored-by: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> --- .../src/Resource/Container/Container.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs b/Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs index 2978d741bf..5b6f188e89 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs @@ -470,6 +470,13 @@ public abstract Task> ReadItemAsync( /// Check the HTTP status code on the response to check if the operation failed. /// /// https://aka.ms/cosmosdb-dot-net-exceptions#stream-api + /// + /// + /// Upsert result i.e. creation or replace can be identified by the status code: + /// 201 - item created + /// 200 - item replaced + /// + /// /// /// Upsert a Stream containing the item to Cosmos /// @@ -506,6 +513,13 @@ public abstract Task UpsertItemStreamAsync( /// (Optional) representing request cancellation. /// The that was upserted contained within a object representing the service response for the asynchronous operation. /// https://aka.ms/cosmosdb-dot-net-exceptions#typed-api + /// + /// + /// Upsert result i.e. creation or replace can be identified by the status code: + /// 201 - item created + /// 200 - item replaced + /// + /// /// /// /// Date: Thu, 16 Nov 2023 08:21:57 -0800 Subject: [PATCH 237/240] [Internal] Code Analysis: Fixes all warning in source/test/usage projects (#4188) * [Internal] CodeAnalsis: Fixing CA2200 for test projects * Making code warning clean * fixing the usages projects * Removing the insource overrides * One mroe small fix --------- Co-authored-by: Sourabh Jain --- .../Usage/ApplicationInsights/Program.cs | 2 +- .../CustomDiagnosticAndEventListener/Program.cs | 4 ++-- .../ClientCreateAndInitializeTest.cs | 4 ++-- .../QueryTests.cs | 8 ++++---- .../Benchmarks/StopwatchAllocationsBenchmark.cs | 4 ++++ .../Contracts/DirectContractTests.cs | 1 - .../CosmosConflictTests.cs | 4 ++-- .../CosmosHttpClientCoreTests.cs | 11 +++++------ .../GatewayStoreModelTest.cs | 2 ++ .../OptimisticDirectExecutionQueryBaselineTests.cs | 12 +++++++----- .../ServicePointAccessorTests.cs | 6 +++++- 11 files changed, 34 insertions(+), 24 deletions(-) diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/Program.cs b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/Program.cs index 288ce80c64..526452beb2 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/Program.cs +++ b/Microsoft.Azure.Cosmos.Samples/Usage/ApplicationInsights/Program.cs @@ -16,7 +16,7 @@ internal class Program private static readonly string databaseName = "samples"; private static readonly string containerName = "ai-sample"; - private static TelemetryClient? _telemetryClient; + private static TelemetryClient _telemetryClient; static async Task Main() { diff --git a/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/Program.cs b/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/Program.cs index 77580936f7..08d7956f35 100644 --- a/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/Program.cs +++ b/Microsoft.Azure.Cosmos.Samples/Usage/CustomDiagnosticAndEventListener/Program.cs @@ -83,8 +83,8 @@ public static async Task RunCrudDemo(Container container) internal class Item { [JsonProperty("id")] - public string Id { get; set; } + public string? Id { get; set; } - public string Status { get; set; } + public string? Status { get; set; } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs index 8bbb7f5d54..1813700e05 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientCreateAndInitializeTest.cs @@ -138,7 +138,7 @@ public async Task DatabaseIncorrectTest() catch (CosmosException ex) { Assert.IsTrue(ex.StatusCode == HttpStatusCode.NotFound); - throw ex; + throw; } } @@ -156,7 +156,7 @@ public async Task ContainerIncorrectTest() catch (CosmosException ex) { Assert.IsTrue(ex.StatusCode == HttpStatusCode.NotFound); - throw ex; + throw; } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs index 762bbbd945..359bc07715 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs @@ -2135,12 +2135,12 @@ private void TestContinuationLimitHeaders(Database database, bool partitionedCol { if (!(e.InnerException is DocumentClientException exception)) { - throw e; + throw; } if (exception.StatusCode != HttpStatusCode.BadRequest) { - throw e; + throw; } Assert.IsTrue(exception.Message.Contains("continuation token limit specified is not large enough")); @@ -2159,12 +2159,12 @@ private void TestContinuationLimitHeaders(Database database, bool partitionedCol { if (!(e.InnerException is DocumentClientException exception)) { - throw e; + throw; } if (exception.StatusCode != HttpStatusCode.BadRequest) { - throw e; + throw; } Assert.IsTrue(exception.Message.Contains("Please pass in a valid continuation token size limit which must be a positive integer")); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/StopwatchAllocationsBenchmark.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/StopwatchAllocationsBenchmark.cs index 334fc74ecf..0e10faf438 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/StopwatchAllocationsBenchmark.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Benchmarks/StopwatchAllocationsBenchmark.cs @@ -39,12 +39,16 @@ public void ValueStopwatchBoxedAsField() private class StopwatchHolder { +#pragma warning disable CS0414 // Remove unread private members private readonly Stopwatch stopwatch = new Stopwatch(); +#pragma warning restore CS0414 // Remove unread private members } private class ValueStopwatchHolder { +#pragma warning disable CS0414 // Remove unread private members private readonly ValueStopwatch stopwatch = new ValueStopwatch(); +#pragma warning restore CS0414 // Remove unread private members } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DirectContractTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DirectContractTests.cs index 2634ea1bc3..3300c84d60 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DirectContractTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DirectContractTests.cs @@ -37,7 +37,6 @@ public void TestInteropTest() Assert.IsTrue(ServiceInteropWrapper.AssembliesExist.Value); string configJson = "{}"; - IntPtr provider; TryCatch tryCreateServiceProvider = QueryPartitionProvider.TryCreateServiceProvider(configJson); Assert.IsFalse(tryCreateServiceProvider.Failed); // Don't leak on tests diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosConflictTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosConflictTests.cs index 50adab3aef..cbaf45fe88 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosConflictTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosConflictTests.cs @@ -40,13 +40,13 @@ public async Task ConflictsFeedSetsPartitionKeyRangeIdentity() [TestMethod] public async Task QueryConflicts() { - ContainerInternal container = CosmosConflictTests.GetMockedContainer(async (request, cancellationToken) => { + ContainerInternal container = CosmosConflictTests.GetMockedContainer((request, cancellationToken) => { Assert.AreEqual(ResourceType.Conflict, request.ResourceType); ResponseMessage responseMessage = new ResponseMessage(HttpStatusCode.OK) { Content = new MemoryStream(Encoding.UTF8.GetBytes(@"{ ""Conflicts"": [{ ""id"": ""Test""}]}")) }; - return responseMessage; + return Task.FromResult(responseMessage); }); { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs index 03fdb84ead..09401bda13 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/CosmosHttpClientCoreTests.cs @@ -243,7 +243,7 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio public async Task Retry3TimesOnDefaultPolicyTestAsync() { int count = 0; - async Task sendFunc(HttpRequestMessage request, CancellationToken cancellationToken) + Task sendFunc(HttpRequestMessage request, CancellationToken cancellationToken) { count++; @@ -268,7 +268,7 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio cancellationToken: default); } } - catch (Exception ex) + catch (Exception) { //Ignore the exception } @@ -283,7 +283,7 @@ public async Task HttpTimeoutThrow503TestAsync() async Task TestScenarioAsync(HttpMethod method, ResourceType resourceType, HttpTimeoutPolicy timeoutPolicy, Type expectedException, int expectedNumberOfRetrys) { int count = 0; - async Task sendFunc(HttpRequestMessage request, CancellationToken cancellationToken) + Task sendFunc(HttpRequestMessage request, CancellationToken cancellationToken) { count++; @@ -346,7 +346,7 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio public async Task NoRetryOnNoRetryPolicyTestAsync() { int count = 0; - async Task sendFunc(HttpRequestMessage request, CancellationToken cancellationToken) + Task sendFunc(HttpRequestMessage request, CancellationToken cancellationToken) { if(count == 0) { @@ -355,7 +355,6 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio count++; throw new OperationCanceledException("API with exception"); - } DocumentClientEventSource eventSource = DocumentClientEventSource.Instance; @@ -375,7 +374,7 @@ async Task sendFunc(HttpRequestMessage request, Cancellatio cancellationToken: default); } } - catch (Exception ex) + catch (Exception) { //Ignore the exception } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs index e16f176e61..fd9a8a3efd 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/GatewayStoreModelTest.cs @@ -175,11 +175,13 @@ public async Task PassesPropertiesFromDocumentServiceRequest() Func> sendFunc = request => { +#pragma warning disable CS0618 // Type or member is obsolete Assert.AreEqual(properties.Count, request.Properties.Count); foreach (KeyValuePair item in properties) { Assert.AreEqual(item.Value, request.Properties[item.Key]); } +#pragma warning restore CS0618 // Type or member is obsolete return Task.FromResult(new HttpResponseMessage(HttpStatusCode.OK) ); }; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs index d9d543c050..824232c412 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs @@ -144,7 +144,7 @@ public void NegativeOptimisticDirectExecutionOutput() // This test confirms that TestInjection.EnableOptimisticDirectExection is set to false from default. // Check test "TestPipelineForDistributedQueryAsync" to understand why this is done [TestMethod] - public async Task TestDefaultQueryRequestOptionsSettings() + public void TestDefaultQueryRequestOptionsSettings() { QueryRequestOptions requestOptions = new QueryRequestOptions(); bool odeExpectedValue = @@ -644,7 +644,7 @@ internal static TryCatch TryGetPartitionedQueryEx return tryGetQueryPlan; } - private static async Task GetOdePipelineAsync(OptimisticDirectExecutionTestInput input, DocumentContainer documentContainer, QueryRequestOptions queryRequestOptions) + private static Task GetOdePipelineAsync(OptimisticDirectExecutionTestInput input, DocumentContainer documentContainer, QueryRequestOptions queryRequestOptions) { (CosmosQueryExecutionContextFactory.InputParameters inputParameters, CosmosQueryContextCore cosmosQueryContextCore) = CreateInputParamsAndQueryContext(input, queryRequestOptions); @@ -655,7 +655,7 @@ private static async Task GetOdePipelineAsync(OptimisticDir NoOpTrace.Singleton); Assert.IsNotNull(queryPipelineStage); - return queryPipelineStage; + return Task.FromResult(queryPipelineStage); } private static async Task CreateDocumentContainerAsync( @@ -912,6 +912,7 @@ public MergeTestUtil(bool isFailedFallbackPipelineTest) this.IsFailedFallbackPipelineTest = isFailedFallbackPipelineTest; } +#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously public async Task ShouldReturnFailure() { this.MoveNextCounter++; @@ -939,6 +940,7 @@ public async Task ShouldReturnFailure() return null; } +#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously } } @@ -1093,7 +1095,7 @@ public override Task> TryGetOverlappingRangesAs throw new NotImplementedException(); } - public override async Task> TryGetPartitionedQueryExecutionInfoAsync(SqlQuerySpec sqlQuerySpec, ResourceType resourceType, PartitionKeyDefinition partitionKeyDefinition, bool requireFormattableOrderByQuery, bool isContinuationExpected, bool allowNonValueAggregateQuery, bool hasLogicalPartitionKey, bool allowDCount, bool useSystemPrefix, Cosmos.GeospatialType geospatialType, CancellationToken cancellationToken) + public override Task> TryGetPartitionedQueryExecutionInfoAsync(SqlQuerySpec sqlQuerySpec, ResourceType resourceType, PartitionKeyDefinition partitionKeyDefinition, bool requireFormattableOrderByQuery, bool isContinuationExpected, bool allowNonValueAggregateQuery, bool hasLogicalPartitionKey, bool allowDCount, bool useSystemPrefix, Cosmos.GeospatialType geospatialType, CancellationToken cancellationToken) { CosmosSerializerCore serializerCore = new(); using StreamReader streamReader = new(serializerCore.ToStreamSqlQuerySpec(sqlQuerySpec, Documents.ResourceType.Document)); @@ -1101,7 +1103,7 @@ public override async Task> TryGetPartit TryCatch queryPlan = OptimisticDirectExecutionQueryBaselineTests.TryGetPartitionedQueryExecutionInfo(sqlQuerySpecJsonString, partitionKeyDefinition); PartitionedQueryExecutionInfo partitionedQueryExecutionInfo = queryPlan.Succeeded ? queryPlan.Result : throw queryPlan.Exception; - return TryCatch.FromResult(partitionedQueryExecutionInfo); + return Task.FromResult(TryCatch.FromResult(partitionedQueryExecutionInfo)); } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ServicePointAccessorTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ServicePointAccessorTests.cs index 5ff15ed9a3..f9cb21805f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ServicePointAccessorTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/ServicePointAccessorTests.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Cosmos.Tests [TestClass] public class ServicePointAccessorTests { - private static Uri uri = new Uri("https://localhost"); + private static readonly Uri uri = new Uri("https://localhost"); [TestMethod] public void ServicePointAccessor_SetConnectionLimit() @@ -20,7 +20,9 @@ public void ServicePointAccessor_SetConnectionLimit() ServicePointAccessor accessor = ServicePointAccessor.FindServicePoint(ServicePointAccessorTests.uri); Assert.IsNotNull(accessor); accessor.ConnectionLimit = limit; +#pragma warning disable SYSLIB0014 // Type or member is obsolete ServicePoint servicePoint = ServicePointManager.FindServicePoint(ServicePointAccessorTests.uri); +#pragma warning restore SYSLIB0014 // Type or member is obsolete Assert.AreEqual(limit, servicePoint.ConnectionLimit); } @@ -29,7 +31,9 @@ public void ServicePointAccessor_DisableNagle() { ServicePointAccessor accessor = ServicePointAccessor.FindServicePoint(ServicePointAccessorTests.uri); Assert.IsNotNull(accessor); +#pragma warning disable SYSLIB0014 // Type or member is obsolete ServicePoint servicePoint = ServicePointManager.FindServicePoint(ServicePointAccessorTests.uri); +#pragma warning restore SYSLIB0014 // Type or member is obsolete Assert.IsFalse(servicePoint.UseNagleAlgorithm); } } From c6918b472094ca33181f792fb469919025f146e9 Mon Sep 17 00:00:00 2001 From: Debdatta Kunda <87335885+kundadebdatta@users.noreply.github.com> Date: Fri, 17 Nov 2023 15:00:25 -0800 Subject: [PATCH 238/240] 3.37.0: Adds new SDK versions and contract files (#4191) * Updated change log and bumped up the patch version. * Updated change log and bumped up the minor version. * Updated change log to reflect correct version. --- Directory.Build.props | 4 +- .../contracts/API_3.37.0-preview.txt | 1611 +++++++++++++++++ .../contracts/API_3.37.0.txt | 1552 ++++++++++++++++ changelog.md | 11 + 4 files changed, 3176 insertions(+), 2 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.37.0-preview.txt create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.37.0.txt diff --git a/Directory.Build.props b/Directory.Build.props index 514e8e7abb..57ee59de6f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 3.36.0 - 3.36.0 + 3.37.0 + 3.37.0 preview 3.31.5 2.0.3 diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.37.0-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.37.0-preview.txt new file mode 100644 index 0000000000..672794b621 --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.37.0-preview.txt @@ -0,0 +1,1611 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public sealed class ComputedProperty + { + public ComputedProperty(); + public string Name { get; set; } + public string Query { get; set; } + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public Collection ComputedProperties { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public CosmosClientTelemetryOptions CosmosClientTelemetryOptions { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public class CosmosClientTelemetryOptions + { + public CosmosClientTelemetryOptions(); + public CosmosThresholdOptions CosmosThresholdOptions { get; set; } + public bool DisableDistributedTracing { get; set; } + public bool DisableSendingMetricsToService { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual ServerSideCumulativeMetrics GetQueryMetrics(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public class CosmosThresholdOptions + { + public CosmosThresholdOptions(); + public TimeSpan NonPointOperationLatencyThreshold { get; set; } + public TimeSpan PointOperationLatencyThreshold { get; set; } + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable BypassIntegratedCache { get; set; } + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public enum PriorityLevel + { + High = 1, + Low = 2, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public bool EnableOptimisticDirectExecution { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public CosmosThresholdOptions CosmosThresholdOptions { get; set; } + public List ExcludeRegions { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public Nullable PriorityLevel { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public abstract class ServerSideCumulativeMetrics + { + protected ServerSideCumulativeMetrics(); + public abstract ServerSideMetrics CumulativeMetrics { get; } + public abstract IReadOnlyList PartitionedMetrics { get; } + } + public abstract class ServerSideMetrics + { + protected ServerSideMetrics(); + public abstract TimeSpan DocumentLoadTime { get; } + public abstract TimeSpan DocumentWriteTime { get; } + public abstract double IndexHitRatio { get; } + public abstract TimeSpan IndexLookupTime { get; } + public abstract long OutputDocumentCount { get; } + public abstract long OutputDocumentSize { get; } + public abstract TimeSpan QueryPreparationTime { get; } + public abstract long RetrievedDocumentCount { get; } + public abstract long RetrievedDocumentSize { get; } + public abstract TimeSpan RuntimeExecutionTime { get; } + public abstract TimeSpan TotalTime { get; } + public abstract TimeSpan VMExecutionTime { get; } + } + public abstract class ServerSidePartitionedMetrics + { + protected ServerSidePartitionedMetrics(); + public abstract string FeedRange { get; } + public abstract Nullable PartitionKeyRangeId { get; } + public abstract ServerSideMetrics ServerSideMetrics { get; } + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ComputedPropertiesDefinition + { + public T Attach(); + public ComputedPropertiesDefinition WithComputedProperty(string name, string query); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public ComputedPropertiesDefinition WithComputedProperties(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithClientTelemetryOptions(CosmosClientTelemetryOptions options); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool RegexMatch(this object obj, string regularExpression); + public static bool RegexMatch(this object obj, string regularExpression, string searchModifier); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + Upsert = (short)5, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.37.0.txt b/Microsoft.Azure.Cosmos/contracts/API_3.37.0.txt new file mode 100644 index 0000000000..1c02b4efb2 --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.37.0.txt @@ -0,0 +1,1552 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public CosmosClientTelemetryOptions CosmosClientTelemetryOptions { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public class CosmosClientTelemetryOptions + { + public CosmosClientTelemetryOptions(); + public CosmosThresholdOptions CosmosThresholdOptions { get; set; } + public bool DisableDistributedTracing { get; set; } + public bool DisableSendingMetricsToService { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual ServerSideCumulativeMetrics GetQueryMetrics(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public class CosmosThresholdOptions + { + public CosmosThresholdOptions(); + public TimeSpan NonPointOperationLatencyThreshold { get; set; } + public TimeSpan PointOperationLatencyThreshold { get; set; } + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public CosmosThresholdOptions CosmosThresholdOptions { get; set; } + public List ExcludeRegions { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public abstract class ServerSideCumulativeMetrics + { + protected ServerSideCumulativeMetrics(); + public abstract ServerSideMetrics CumulativeMetrics { get; } + public abstract IReadOnlyList PartitionedMetrics { get; } + } + public abstract class ServerSideMetrics + { + protected ServerSideMetrics(); + public abstract TimeSpan DocumentLoadTime { get; } + public abstract TimeSpan DocumentWriteTime { get; } + public abstract double IndexHitRatio { get; } + public abstract TimeSpan IndexLookupTime { get; } + public abstract long OutputDocumentCount { get; } + public abstract long OutputDocumentSize { get; } + public abstract TimeSpan QueryPreparationTime { get; } + public abstract long RetrievedDocumentCount { get; } + public abstract long RetrievedDocumentSize { get; } + public abstract TimeSpan RuntimeExecutionTime { get; } + public abstract TimeSpan TotalTime { get; } + public abstract TimeSpan VMExecutionTime { get; } + } + public abstract class ServerSidePartitionedMetrics + { + protected ServerSidePartitionedMetrics(); + public abstract string FeedRange { get; } + public abstract Nullable PartitionKeyRangeId { get; } + public abstract ServerSideMetrics ServerSideMetrics { get; } + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithClientTelemetryOptions(CosmosClientTelemetryOptions options); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool RegexMatch(this object obj, string regularExpression); + public static bool RegexMatch(this object obj, string regularExpression, string searchModifier); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + Upsert = (short)5, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/changelog.md b/changelog.md index 18cac46b8a..c6f797d1ec 100644 --- a/changelog.md +++ b/changelog.md @@ -13,6 +13,17 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [3.37.0-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.37.0-preview) - 2023-11-17 +### [3.37.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.37.0) - 2023-11-17 + +#### Fixed +- [4100](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4100) Query : Fixes querying conflicts (#4100) +- [4125](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4125) Item Operations: Fixes JsonSerialization exception when MissingMemberHandling = Error on Json default settings when NotFound on Item operations (#4125) + +#### Added +- [4180](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4180) Upgrade Resiliency: Adds Code to Enable Advanced Replica Selection Feature for Preview and GA (#4180) +- [4128](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4128) Routing: Adds ExcludeRegions Feature to RequestOptions (#4128) + ### [3.36.0](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.36.0) - 2023-10-24 #### Fixed From a0f1c30521024791aaf93aa3a07aba77c2f8b1bd Mon Sep 17 00:00:00 2001 From: Matias Quaranta Date: Tue, 21 Nov 2023 14:00:40 -0800 Subject: [PATCH 239/240] [Internal] Versioning: Adds guidance for versioning SDK releases (#4192) * Create versioning.md * Update versioning.md * Update versioning.md * Update versioning.md * Update README.md * Update versioning.md * Update versioning.md * Apply suggestions from code review Co-authored-by: Kevin Pilch * Update versioning.md * Update versioning.md --------- Co-authored-by: Kevin Pilch --- README.md | 2 ++ docs/versioning.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 docs/versioning.md diff --git a/README.md b/README.md index f1dcffa7b9..861235223a 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ using (FeedIterator feedIterator = container.GetItemQueryIterator :information_source: General Availability of an API or feature present in a Preview SDK is not guaranteed on the next GA SDK release following the Preview SDK release when it was introduced. Each Preview API can have an independent GA cycle that can be dependent on the Azure Cosmos DB Service. + +## Major releases + +Major releases are defined by: + +* Significant breaking changes to the API surface of the SDK. +* Significant breaking changes to dependencies + +> :information_source: No new major release is currently planned. + +## Minor releases + +Minor releases are defined by: + +* Changes in the public API surface of the SDK, such as new features, or GAing APIs that were in preview +* Changes in the version of one of the dependencies + +In these cases, the **GA SDK** should **increase the minor version** and **Preview SDK** should **increase the minor version to be one more than GA SDK**. + +For example, if `3.10.0` is being released for **GA SDK**, then `3.11.0-preview.0` should be released for **Preview SDK**. + +## Patch releases + +Patch releases are defined by: + +* No Public API changes +* Includes a subset of the bug fixes reported after the last major release + +In these cases, the **GA SDK** should **increase the patch version** and **Preview SDK** should **increase the preview suffix version**. + +For example, if `3.10.0` is being patched, for **GA SDK** we would release `3.10.1` and for **Preview SDK** we would release `3.11.0-preview.1`. + +If `3.10.1` is being patched, for **GA SDK** we would release `3.10.2` and for **Preview SDK** we would release `3.11.0-preview.2`. + +## Complete full example + +| GA | Preview | +|----------|-----------| +| 3.10.0 | 3.11.0-preview.0 | +| 3.10.1 | 3.11.0-preview.1 | +| 3.10.2 | 3.11.0-preview.2 | +| 3.11.0 | 3.12.0-preview.0 | From fd070235840bedc16decb12c0e46bca4b0e16730 Mon Sep 17 00:00:00 2001 From: Debdatta Kunda Date: Thu, 30 Nov 2023 14:23:11 -0800 Subject: [PATCH 240/240] Code changes to sync up with latest master and direct release 3.32.0. --- .../src/Microsoft.Azure.Cosmos.csproj | 4 +- .../src/RMResources.Designer.cs | 226 +++- Microsoft.Azure.Cosmos/src/RMResources.resx | 70 +- .../src/direct/AuthorizationTokenType.cs | 1 + .../src/direct/BackoffRetryUtility.cs | 115 +- Microsoft.Azure.Cosmos/src/direct/Channel.cs | 8 +- .../src/direct/ClientSideRequestStatistics.cs | 3 +- .../src/direct/ComputedProperty.cs | 85 ++ .../src/direct/Connection.cs | 38 +- .../src/direct/Constants.cs | 117 +- .../src/direct/CustomTypeExtensions.cs | 2 +- .../src/direct/DataMaskingIncludedPath.cs | 21 + .../src/direct/DataMaskingPolicy.cs | 95 ++ .../src/direct/Dispatcher.cs | 1 + .../src/direct/DocumentCollection.cs | 83 +- .../src/direct/DocumentServiceRequest.cs | 79 +- .../GoneAndRetryWithRequestRetryPolicy.cs | 49 +- .../src/direct/GoneAndRetryWithRetryPolicy.cs | 3 + .../src/direct/HttpConstants.cs | Bin 115248 -> 117020 bytes .../src/direct/HttpException.cs | 13 +- .../src/direct/HttpTransportClient.cs | 21 + .../direct/IClientSideRequestStatistics.cs | 7 +- .../src/direct/InAccountRestoreParameters.cs | 13 + Microsoft.Azure.Cosmos/src/direct/Int128.cs | 19 + .../src/direct/JSonSerializable.cs | 5 + .../direct/LinuxSystemUtilizationReader.cs | 2 + .../src/direct/LoadBalancingPartition.cs | 13 +- .../src/direct/LocationNames.cs | 36 +- .../src/direct/NotFoundException.cs | 12 +- .../src/direct/OperationType.cs | 7 +- .../src/direct/PartitionKeyInternal.cs | 182 ++- .../src/direct/PartitionKeyRange.cs | 13 + Microsoft.Azure.Cosmos/src/direct/Paths.cs | 3 + .../src/direct/PathsHelper.cs | 16 +- .../src/direct/PerfCounters.cs | 45 - .../src/direct/PerformanceActivities.cs | 7 - .../src/direct/PreconditionFailedException.cs | 2 + .../src/direct/RegionProximityUtil.cs | 1081 ++++++++++++----- .../src/direct/RequestNameValueCollection.cs | 578 ++++++++- .../src/direct/RequestOptions.cs | 10 + .../src/direct/RequestRetryUtility.cs | 129 +- .../src/direct/RntbdConstants.cs | 33 + .../src/direct/ServiceIdentity.cs | 5 + Microsoft.Azure.Cosmos/src/direct/Snapshot.cs | 4 +- .../src/direct/SnapshotContent.cs | 23 + .../src/direct/StatusCodes.cs | 42 +- .../StoreResponseNameValueCollection.cs | 58 + .../src/direct/TimerPool.cs | 1 + .../src/direct/TransportSerialization.cs | 50 +- .../src/direct/TriggerOperation.cs | 7 +- .../src/direct/ValueStopwatch.cs | 6 +- .../src/direct/WFConstants.cs | Bin 25020 -> 26424 bytes .../direct/WindowsSystemUtilizationReader.cs | 2 + .../src/direct/rntbd2/TransportClient.cs | 8 +- .../CosmosContainerTests.cs | 37 +- ...icrosoft.Azure.Cosmos.EmulatorTests.csproj | 1 - .../Utils/TestCommon.cs | 5 +- 57 files changed, 2853 insertions(+), 643 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/src/direct/ComputedProperty.cs create mode 100644 Microsoft.Azure.Cosmos/src/direct/DataMaskingIncludedPath.cs create mode 100644 Microsoft.Azure.Cosmos/src/direct/DataMaskingPolicy.cs diff --git a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj index b94151babd..5e7b157bbe 100644 --- a/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj +++ b/Microsoft.Azure.Cosmos/src/Microsoft.Azure.Cosmos.csproj @@ -43,6 +43,7 @@ true $(LangVersion) LICENSE + CS1572; CS1573; CS1574; CS1580; CS1570; CS0472 @@ -106,7 +107,6 @@ - @@ -114,11 +114,11 @@ + - diff --git a/Microsoft.Azure.Cosmos/src/RMResources.Designer.cs b/Microsoft.Azure.Cosmos/src/RMResources.Designer.cs index 18f3aa1cdb..9dfc7537eb 100644 --- a/Microsoft.Azure.Cosmos/src/RMResources.Designer.cs +++ b/Microsoft.Azure.Cosmos/src/RMResources.Designer.cs @@ -766,6 +766,28 @@ internal static string EnableMultipleWriteLocationsAndEnableServerlessNotSupport } } + /// + /// Looks up a localized string similar to Cannot set EnableMultipleWriteLocations on an account with EnableTieredStorageV1. + /// + internal static string EnableMultipleWriteLocationsAndEnableTieredStorageV1NotSupported + { + get + { + return ResourceManager.GetString("EnableMultipleWriteLocationsAndEnableTieredStorageV1NotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot set EnableOnlyColdStorageContainersInAccountV1 on an account with EnableMaterializedViews + /// + internal static string EnableOnlyColdStorageContainersInAccountV1AndEnableMaterializedViewsNotSupported + { + get + { + return ResourceManager.GetString("EnableOnlyColdStorageContainersInAccountV1AndEnableMaterializedViewsNotSupported", resourceCulture); + } + } + /// /// Looks up a localized string similar to Accounts configured with default consistency level as 'Strong' cannot be enabled for multiple write locations(i.e. EnableMultipleWriteLocations=true). Consider relaxing default consistency level of the account to enable multiple write locations.. /// @@ -1123,6 +1145,17 @@ internal static string GlobalAndWriteRegionMisMatch } } + /// + /// Looks up a localized string similar to Federation and region are not matching. + /// + internal static string FederationAndRegionMismatch + { + get + { + return ResourceManager.GetString("FederationAndRegionMismatch", resourceCulture); + } + } + /// /// Looks up a localized string similar to Global Strong write barrier has not been met for the request.. /// @@ -1389,13 +1422,24 @@ internal static string InvalidFailoverPriority /// - /// Looks up a localized string similar to Federation cap action is not currently supported. + /// Looks up a localized string similar to The CapUncapMetadata action '{0}' is not currently supported.. /// - internal static string InvalidFederationCapAction + internal static string InvalidFederationCapUncapMetadataAction { get { - return ResourceManager.GetString("InvalidFederationCapAction", resourceCulture); + return ResourceManager.GetString("InvalidFederationCapUncapMetadataAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The CapUncapMetadata source '{0}' is invalid.. + /// + internal static string InvalidFederationCapUncapMetadataSource + { + get + { + return ResourceManager.GetString("InvalidFederationCapUncapMetadataSource", resourceCulture); } } @@ -3232,6 +3276,17 @@ internal static string ServiceUnavailable } } + /// + /// Looks up a localized string similar to Service Unavailable due to high demand in the region. + /// + internal static string ServiceUnavailableDueToHighDemandInRegion + { + get + { + return ResourceManager.GetString("ServiceUnavailableDueToHighDemandInRegion", resourceCulture); + } + } + /// /// Looks up a localized string similar to Could not find service hosting DocumentCollection with ResourceId {0}. /// @@ -3376,13 +3431,13 @@ internal static string SystemDatabaseAccountPitrEnabledNotSupported } /// - /// Looks up a localized string similar to Continuous backup, synapse link, full fidelity change feed and materialized views are currently not supported with cross tenant customer-managed keys features. + /// Looks up a localized string similar to Cross tenant CMK database account doesn't support using delegated identity as the default identity. /// - internal static string CrossTenantCMKDatabaseAccountLogstoreFeaturesNotSupported + internal static string CrossTenantCMKDatabaseAccountDelegatedIdentityNotSupported { get { - return ResourceManager.GetString("CrossTenantCMKDatabaseAccountLogstoreFeaturesNotSupported", resourceCulture); + return ResourceManager.GetString("CrossTenantCMKDatabaseAccountDelegatedIdentityNotSupported", resourceCulture); } } @@ -4146,6 +4201,17 @@ internal static string UpsertsForScriptsWithMultiplePartitionsAreNotSupported } } + /// + /// Looks up a localized string similar to Web socket requests are not supported. + /// + internal static string WebSocketRequestsNotSupported + { + get + { + return ResourceManager.GetString("WebSocketRequestsNotSupported", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cannot offline write region when automatic failover is not enabled. /// @@ -4269,12 +4335,9 @@ internal static string FreeTierNotSupportedForInternalSubscription } } - -#pragma warning disable CS1570 // XML comment has badly formed XML -/// Looks up a localized string similar to Could not resolve DataTransfer state store account for region [{0}].. + /// Looks up a localized string similar to Could not resolve DataTransfer state store account for region [{0}].. /// internal static string DataTransferStateStoreNotResolved -#pragma warning restore CS1570 // XML comment has badly formed XML { get { @@ -4567,5 +4630,148 @@ internal static string InvalidMongoDatabaseName return ResourceManager.GetString("InvalidMongoDatabaseName", resourceCulture); } } + + /// + /// Looks up a localized string similar to Access to your account is currently revoked because the current default identity no longer has permission to the associated Key Vault key; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#default-identity-is-unauthorized-to-access-the-azure-key-vault-key ({0}). + /// + internal static string KeyVaultAuthenticationFailureRevokeMessage + { + get + { + return ResourceManager.GetString("KeyVaultAuthenticationFailureRevokeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Access to your account is currently revoked because the Azure Cosmos DB service is unable to wrap or unwrap the key; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#internal-unwrapping-procedure-error ({0}). + /// + internal static string KeyVaultWrapUnwrapFailureRevokeMessage + { + get + { + return ResourceManager.GetString("KeyVaultWrapUnwrapFailureRevokeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to the correspondent key is not found on the specified Key Vault. + /// + internal static string KeyVaultKeyNotFoundRevokeMessage + { + get + { + return ResourceManager.GetString("KeyVaultKeyNotFoundRevokeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Access to your account is currently revoked because the correspondent Azure Key Vault was not found. + /// + internal static string KeyVaultNotFoundRevokeMessage + { + get + { + return ResourceManager.GetString("KeyVaultNotFoundRevokeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Access to your account is currently revoked because the Azure Key Vault DNS name specified by the account's keyvaultkeyuri property could not be resolved; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#unable-to-resolve-the-key-vaults-dns ({0}). + /// + internal static string KeyVaultDNSNotResolvedRevokeMessage + { + get + { + return ResourceManager.GetString("KeyVaultDNSNotResolvedRevokeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Access to your account is currently revoked because the Azure Cosmos DB service is unable to obtain the AAD authentication token for the account's default identity; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#azure-active-directory-token-acquisition-error ({0}). + /// + internal static string AadClientCredentialsGrantFailureRevokeMessage + { + get + { + return ResourceManager.GetString("AadClientCredentialsGrantFailureRevokeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Access to your account is currently revoked because the Azure Cosmos DB account has an undefined default identity; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#invalid-azure-cosmos-db-default-identity ({0}). + /// + internal static string UndefinedDefaultIdentityRevokeMessage + { + get + { + return ResourceManager.GetString("UndefinedDefaultIdentityRevokeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Access to your account is currently revoked because the Azure Cosmos DB account's key vault key URI does not follow the expected format; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#improper-syntax-detected-on-the-key-vault-uri-property ({0}). + /// + internal static string InvalidKeyVaultKeyURIRevokeMessage + { + get + { + return ResourceManager.GetString("InvalidKeyVaultKeyURIRevokeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Access to your account is currently revoked because the access rules are blocking outbound requests to the Azure Key Vault service; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide ({0}). + /// + internal static string NspOutboundDeniedRevokeMessage + { + get + { + return ResourceManager.GetString("NspOutboundDeniedRevokeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Access to your account is currently revoked; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide + /// + internal static string UnknownSubstatusCodeRevokeMessage + { + get + { + return ResourceManager.GetString("UnknownSubstatusCodeRevokeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your account has access to the customer managed key. + /// + internal static string CmkAccountIsNotRevoked + { + get + { + return ResourceManager.GetString("CmkAccountIsNotRevoked", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot set EnableDataMaskingPolicy on an account with Log Store features. + /// + internal static string EnableDataMaskingPolicyAndEnableLogStoreNotSupported + { + get + { + return ResourceManager.GetString("EnableDataMaskingPolicyAndEnableLogStoreNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DataMaskingPolicy is not supported on this account type. + /// + internal static string DataMaskingPolicyNotSupported + { + get + { + return ResourceManager.GetString("DataMaskingPolicyNotSupported", resourceCulture); + } + } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/RMResources.resx b/Microsoft.Azure.Cosmos/src/RMResources.resx index a630919dc0..2e85bb5a71 100644 --- a/Microsoft.Azure.Cosmos/src/RMResources.resx +++ b/Microsoft.Azure.Cosmos/src/RMResources.resx @@ -744,6 +744,9 @@ Cannot offline write region when automatic failover is not enabled + + Federation {0} and region {1} are not matching. + Cannot add additional regions, since database account provision failed. @@ -1195,6 +1198,9 @@ If you would like to serve this query through continuation tokens, then please r Cannot authorize request since the [Action] to authorize was not found. + + Cross tenant CMK database account doesn't support using delegated identity as the default identity. + System database account {0} cannot be created with Continuous backup mode {0} = GlobalDatabaseAccountId @@ -1238,7 +1244,7 @@ If you would like to serve this query through continuation tokens, then please r The requested scope contains unexpected segments. - + Cannot perform failover as it is disabled for the account. @@ -1322,8 +1328,8 @@ If you would like to serve this query through continuation tokens, then please r Cross-tenant CMK is not supported with System Assigned identities as Default identities. Please use an User Assigned Identity instead. - - Federation cap action is not currently supported. + + The CapUncapMetadata action '{0}' is not currently supported. The given default identity for {0} is not valid. The format for the default identity is not valid, please use 'FirstPartyIdentity'/'SystemAssignedIdentity'/'UserAssignedIdentity=<UA_resource_id>' @@ -1337,4 +1343,62 @@ If you would like to serve this query through continuation tokens, then please r The given default identity for {0} is not valid. The default identity points to an user identity that does not exist in {0}. + + Access to your account is currently revoked because the Azure Cosmos DB service is unable to obtain the AAD authentication token for the account's default identity; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#azure-active-directory-token-acquisition-error ({0}). + + + Access to your account is currently revoked because the Azure Cosmos DB account's key vault key URI does not follow the expected format; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#improper-syntax-detected-on-the-key-vault-uri-property ({0}). + + + Access to your account is currently revoked because the current default identity no longer has permission to the associated Key Vault key; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#default-identity-is-unauthorized-to-access-the-azure-key-vault-key ({0}). + + + Access to your account is currently revoked because the Azure Key Vault DNS name specified by the account's keyvaultkeyuri property could not be resolved; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#unable-to-resolve-the-key-vaults-dns ({0}). + + + Access to your account is currently revoked because the correspondent key is not found on the specified Key Vault; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#azure-key-vault-resource-not-found ({0}). + + + Access to your account is currently revoked because the correspondent Azure Key Vault was not found; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#azure-key-vault-resource-not-found ({0}). + + + Access to your account is currently revoked because the Azure Cosmos DB service is unable to wrap or unwrap the key; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#internal-unwrapping-procedure-error ({0}). + + + Access to your account is currently revoked because the Azure Cosmos DB account has an undefined default identity; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide#invalid-azure-cosmos-db-default-identity ({0}). + + + Access to your account is currently revoked because the access rules are blocking outbound requests to the Azure Key Vault service; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide ({0}). + + + Access to your account is currently revoked; for more details about this error and how to restore access to your account please visit https://learn.microsoft.com/en-us/azure/cosmos-db/cmk-troubleshooting-guide + + + Access to the configured customer managed key confirmed. + + + Web socket requests are not supported + + + Sorry, we are currently experiencing high demand in {0} region, and cannot fulfill your request at this time. Please retry after sometime. If the problem persists, please reach out to support. + {0} = Location + + + Enable TieredStorageV1 and Enable Multiple write locations are not supported together on GlobalDatabaseAccount. + + + Dynamic Data Masking is not supported with Continuous Backup/Analytical Store/Materialized View/Full Fidelity Change Feed. + + + Dynamic Data Masking Policy is not supported on this account type. + + + Enable OnlyColdStorageContainersInAccount V1 and EnableMaterializedViews are not supported together on GlobalDatabaseAccount. + + + The CapUncapMetadata source '{0}' is invalid. + + + The federation document for the federation {0} is in an invalid format. + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/direct/AuthorizationTokenType.cs b/Microsoft.Azure.Cosmos/src/direct/AuthorizationTokenType.cs index 1892160c81..4159928f46 100644 --- a/Microsoft.Azure.Cosmos/src/direct/AuthorizationTokenType.cs +++ b/Microsoft.Azure.Cosmos/src/direct/AuthorizationTokenType.cs @@ -22,6 +22,7 @@ internal enum AuthorizationTokenType AadToken, CompoundToken, SasToken, + TokenCredential } internal static class AuthorizationTokenTypeExtensions diff --git a/Microsoft.Azure.Cosmos/src/direct/BackoffRetryUtility.cs b/Microsoft.Azure.Cosmos/src/direct/BackoffRetryUtility.cs index 2e0e965b1b..e24ef1a939 100644 --- a/Microsoft.Azure.Cosmos/src/direct/BackoffRetryUtility.cs +++ b/Microsoft.Azure.Cosmos/src/direct/BackoffRetryUtility.cs @@ -21,6 +21,9 @@ internal static class BackoffRetryUtility { public const string ExceptionSourceToIgnoreForIgnoreForRetry = "BackoffRetryUtility"; + /// + /// On an exception if this methiod is not attempting another retry it throws the last exception encountered. Not an Aggregation Exception of All Exceptions Encountered. + /// public static Task ExecuteAsync( Func> callbackMethod, IRetryPolicy retryPolicy, @@ -129,6 +132,9 @@ public static Task ExecuteAsync( /// /// Common implementation that handles all the different possible configurations. /// + /// + /// On an exception if this methiod is not attempting another retry it throws the last exception encountered. Not an Aggregation Exception of All Exceptions Encountered. + /// private static async Task ExecuteRetryAsync( Func> callbackMethod, Func> callbackMethodWithParam, @@ -154,75 +160,90 @@ private static async Task ExecuteRetryAsync( while (true) { - cancellationToken.ThrowIfCancellationRequested(); - ExceptionDispatchInfo exception; try { - if (callbackMethod != null) + cancellationToken.ThrowIfCancellationRequested(); + ExceptionDispatchInfo exception; + try { - return await callbackMethod(); + if (callbackMethod != null) + { + return await callbackMethod(); + } + else if (callbackMethodWithParam != null) + { + return await callbackMethodWithParam(param, cancellationToken); + } + + return await callbackMethodWithPolicy(policyArg1); } - else if (callbackMethodWithParam != null) + catch (Exception ex) { - return await callbackMethodWithParam(param, cancellationToken); - } + // this Yield is to "reset" the stack to avoid stack overflows in Framework + // and to keep the total size of the StackTrace down if we fail + await Task.Yield(); - return await callbackMethodWithPolicy(policyArg1); - } - catch (Exception ex) - { - await Task.Yield(); - exception = ExceptionDispatchInfo.Capture(ex); - } + exception = ExceptionDispatchInfo.Capture(ex); + } - ShouldRetryResult result; - if (retryPolicyWithArg != null) - { - ShouldRetryResult resultWithPolicy = await retryPolicyWithArg.ShouldRetryAsync(exception.SourceException, cancellationToken); + ShouldRetryResult result; + if (retryPolicyWithArg != null) + { + ShouldRetryResult resultWithPolicy = await retryPolicyWithArg.ShouldRetryAsync(exception.SourceException, cancellationToken); - policyArg1 = resultWithPolicy.PolicyArg1; - result = resultWithPolicy; - } - else - { - result = await retryPolicy.ShouldRetryAsync(exception.SourceException, cancellationToken); - } + policyArg1 = resultWithPolicy.PolicyArg1; + result = resultWithPolicy; + } + else + { + result = await retryPolicy.ShouldRetryAsync(exception.SourceException, cancellationToken); + } - result.ThrowIfDoneTrying(exception); + result.ThrowIfDoneTrying(exception); - TimeSpan backoffTime = result.BackoffTime; - bool hasBackoffAlternateCallback = inBackoffAlternateCallbackMethod != null || inBackoffAlternateCallbackMethodWithPolicy != null; + TimeSpan backoffTime = result.BackoffTime; + bool hasBackoffAlternateCallback = inBackoffAlternateCallbackMethod != null || inBackoffAlternateCallbackMethodWithPolicy != null; - if (hasBackoffAlternateCallback && result.BackoffTime >= minBackoffForInBackoffCallback) - { - ValueStopwatch stopwatch = ValueStopwatch.StartNew(); - TimeSpan elapsed; - try + if (hasBackoffAlternateCallback && result.BackoffTime >= minBackoffForInBackoffCallback) { - if (inBackoffAlternateCallbackMethod != null) + ValueStopwatch stopwatch = ValueStopwatch.StartNew(); + TimeSpan elapsed; + try + { + if (inBackoffAlternateCallbackMethod != null) + { + return await inBackoffAlternateCallbackMethod(); + } + + return await inBackoffAlternateCallbackMethodWithPolicy(policyArg1); + } + catch (Exception ex) { - return await inBackoffAlternateCallbackMethod(); + elapsed = stopwatch.Elapsed; + DefaultTrace.TraceInformation("Failed inBackoffAlternateCallback with {0}, proceeding with retry. Time taken: {1}ms", ex.ToString(), elapsed.TotalMilliseconds); } - return await inBackoffAlternateCallbackMethodWithPolicy(policyArg1); + backoffTime = result.BackoffTime > elapsed ? result.BackoffTime - elapsed : TimeSpan.Zero; } - catch (Exception ex) + + if (preRetryCallback != null) { - elapsed = stopwatch.Elapsed; - DefaultTrace.TraceInformation("Failed inBackoffAlternateCallback with {0}, proceeding with retry. Time taken: {1}ms", ex.ToString(), elapsed.TotalMilliseconds); + preRetryCallback(exception.SourceException); } - backoffTime = result.BackoffTime > elapsed ? result.BackoffTime - elapsed : TimeSpan.Zero; + if (backoffTime != TimeSpan.Zero) + { + await Task.Delay(backoffTime, cancellationToken); + } } - - if (preRetryCallback != null) + catch { - preRetryCallback(exception.SourceException); - } + // if we're going to completely fail, we want to toss all the async continuation + // stack frames so we don't have a gigantic stack trace (which has serious performance + // implications) + await Task.Yield(); - if (backoffTime != TimeSpan.Zero) - { - await Task.Delay(backoffTime, cancellationToken); + throw; } } } diff --git a/Microsoft.Azure.Cosmos/src/direct/Channel.cs b/Microsoft.Azure.Cosmos/src/direct/Channel.cs index 689d5eba27..b19888a90a 100644 --- a/Microsoft.Azure.Cosmos/src/direct/Channel.cs +++ b/Microsoft.Azure.Cosmos/src/direct/Channel.cs @@ -40,7 +40,7 @@ public Channel( ChannelProperties channelProperties, bool localRegionRequest, SemaphoreSlim openingSlim, IChaosInterceptor chaosInterceptor = null, - Action onChannelOpen = null) + Action onChannelOpen = null) { Debug.Assert(channelProperties != null); this.dispatcher = new Dispatcher(serverUri, @@ -134,7 +134,7 @@ public bool Healthy private Guid ConnectionCorrelationId { get => this.dispatcher.ConnectionCorrelationId; } - private void Initialize(Guid activityId, Action onChannelOpen = null) + private void Initialize(Guid activityId, Action onChannelOpen = null) { this.ThrowIfDisposed(); this.stateLock.EnterWriteLock(); @@ -362,12 +362,12 @@ private void ThrowIfDisposed() } } - private async Task InitializeAsync(Guid activityId, Action onChannelOpen = null) + private async Task InitializeAsync(Guid activityId, Action onChannelOpen = null) { bool slimAcquired = false; try { - onChannelOpen?.Invoke(activityId, this.serverUri, this); + onChannelOpen?.Invoke(activityId, this.ConnectionCorrelationId, this.serverUri, this); this.openArguments.CommonArguments.SetTimeoutCode(TransportErrorCode.ChannelWaitingToOpenTimeout); slimAcquired = await this.openingSlim.WaitAsync(this.openArguments.OpenTimeout).ConfigureAwait(false); diff --git a/Microsoft.Azure.Cosmos/src/direct/ClientSideRequestStatistics.cs b/Microsoft.Azure.Cosmos/src/direct/ClientSideRequestStatistics.cs index 71ec5a0a55..589dd91d2d 100644 --- a/Microsoft.Azure.Cosmos/src/direct/ClientSideRequestStatistics.cs +++ b/Microsoft.Azure.Cosmos/src/direct/ClientSideRequestStatistics.cs @@ -533,4 +533,5 @@ public void AppendToBuilder(StringBuilder stringBuilder) } } } -} \ No newline at end of file +} + diff --git a/Microsoft.Azure.Cosmos/src/direct/ComputedProperty.cs b/Microsoft.Azure.Cosmos/src/direct/ComputedProperty.cs new file mode 100644 index 0000000000..06ca5c0454 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/direct/ComputedProperty.cs @@ -0,0 +1,85 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Documents +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + using System; + using System.Collections.Generic; + + /// + /// Represents computed property that belongs to a collection in the Azure Cosmos DB service. + /// + /// + internal sealed class ComputedProperty : JsonSerializable, ICloneable + { + /// + /// Gets or sets the name of the computed property. + /// + /// + /// The name of the computed property. + /// + /// + /// Name of the computed property should be chosen such that it does not collide with any existing or future document properties. + /// + [JsonProperty(PropertyName = Constants.Properties.Name)] + public string Name + { + get + { + return base.GetValue(Constants.Properties.Name); + } + set + { + base.SetValue(Constants.Properties.Name, value); + } + } + + /// + /// Gets or sets the query for the computed property. + /// + /// + /// The query used to evaluate the value for the computed property. + /// + /// + /// For example: + /// SELECT VALUE LOWER(c.firstName) FROM c + /// + [JsonProperty(PropertyName = Constants.Properties.Query)] + public string Query + { + get + { + return base.GetValue(Constants.Properties.Query); + } + set + { + base.SetValue(Constants.Properties.Query, value); + } + } + + /// + internal override void Validate() + { + // See IncludedPath.cs implementation + base.Validate(); + base.GetValue(Constants.Properties.Name); + base.GetValue(Constants.Properties.Query); + } + + /// + /// Clones a ComputedProperty object + /// + /// + public object Clone() + { + return new ComputedProperty + { + Name = this.Name, + Query = this.Query + }; + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/direct/Connection.cs b/Microsoft.Azure.Cosmos/src/direct/Connection.cs index 8874d6e023..1298d88392 100644 --- a/Microsoft.Azure.Cosmos/src/direct/Connection.cs +++ b/Microsoft.Azure.Cosmos/src/direct/Connection.cs @@ -125,7 +125,7 @@ public Connection( this.serverUri = serverUri; this.hostNameCertificateOverride = hostNameCertificateOverride; this.BufferProvider = new BufferProvider(); - this.dnsResolutionFunction = dnsResolutionFunction ?? Connection.ResolveHostAsync; + this.dnsResolutionFunction = dnsResolutionFunction ?? Connection.ResolveHostIncludingIPv6AddressesAsync; this.lastSendAttemptTime = DateTime.MinValue; this.lastSendTime = DateTime.MinValue; this.lastReceiveTime = DateTime.MinValue; @@ -984,14 +984,44 @@ await Connection.ConnectReuseAddrAsync( return Tuple.Create(await Connection.ConnectUnicastPortAsync(serverUri, address, connectionCorrelationId), false); } - internal static async Task ResolveHostAsync(string hostName) + /// + /// Wrapper method for that allows IPv6 addresses. + /// Used unless internal clients provide a version that might override decision to use IPv6 addresses. + /// + /// + /// + private static Task ResolveHostIncludingIPv6AddressesAsync(string hostName) => Connection.ResolveHostAsync(hostName, includeIPv6Addresses: true); + + internal static async Task ResolveHostAsync(string hostName, bool includeIPv6Addresses) { + // Using Linq for a cold path IPAddress[] serverAddresses = await Dns.GetHostAddressesAsync(hostName); + int serverAddressesCount = serverAddresses.Length; + + if (!includeIPv6Addresses) + { + // Exclude IPv6 addresses + serverAddressesCount = 0; + foreach (IPAddress ipAddress in serverAddresses) + { + if (ipAddress.AddressFamily == AddressFamily.InterNetwork) + { + serverAddresses[serverAddressesCount++] = ipAddress; + } + } + } + int addressIndex = 0; - if (serverAddresses.Length > 1) + if (serverAddressesCount > 1) { - addressIndex = Connection.rng.Value.Next(serverAddresses.Length); + addressIndex = Connection.rng.Value.Next(serverAddressesCount); } + + if (serverAddressesCount == 0) + { + throw new ArgumentOutOfRangeException($"DNS Resolve resulted in no internet addresses. includeIPv6Addresses: {includeIPv6Addresses}"); + } + return serverAddresses[addressIndex]; } diff --git a/Microsoft.Azure.Cosmos/src/direct/Constants.cs b/Microsoft.Azure.Cosmos/src/direct/Constants.cs index 5e39d91a09..0acba36987 100644 --- a/Microsoft.Azure.Cosmos/src/direct/Constants.cs +++ b/Microsoft.Azure.Cosmos/src/direct/Constants.cs @@ -128,6 +128,9 @@ public static class MongoServerVersion public const string Version3_6 = "3.6"; public const string Version4_0 = "4.0"; public const string Version4_2 = "4.2"; + public const string Version5_0 = "5.0"; + public const string Version6_0 = "6.0"; + public const string Version7_0 = "7.0"; } internal static class Indexing @@ -306,6 +309,7 @@ public static class Properties public const string IsManagedReadOnlyAccountKeyResourceStale = "isManagedReadOnlyAccountKeyResourceStale"; public const string UserName = "userName"; public const string Subscriptions = "subscriptions"; + public const string ResourceGroups = "resourceGroups"; public const string Providers = "providers"; public const string RestorableDatabaseAccounts = "restorableDatabaseAccounts"; public const string AsynchronousDeletionRetryCount = "asynchronousDeletionRetryCount"; @@ -313,11 +317,13 @@ public static class Properties public const string MasterValue = "masterValue"; public const string SecondaryValue = "secondaryValue"; - public const string IsSubscriptionInUse = "isSubscriptionInUse"; public const string ArmLocation = "armLocation"; public const string SubscriptionName = "subscriptionName"; + //Throughput Pool + public const string MaxThroughput = "maxThroughput"; + // Query public const string Query = "query"; public const string Parameters = "parameters"; @@ -446,13 +452,16 @@ public static class Properties // CapUncapMetadata public const string Source = "source"; - public const string Reason = "reason"; + public const string Reason = "reason"; public const string IncidentId = "incidentId"; // GeospatialConfig public const string GeospatialType = "type"; public const string GeospatialConfig = "geospatialConfig"; + // ComputedProperties + public const string ComputedProperties = "computedProperties"; + // Unique index. public const string UniqueKeyPolicy = "uniqueKeyPolicy"; public const string UniqueKeys = "uniqueKeys"; @@ -601,11 +610,14 @@ public static class Properties public const string UpdateBackupContainerMetadata = "updateBackupContainerMetadata"; public const string RestoreWithBuiltinDatabaseAccountPicker = "restoreWithBuiltinDatabaseAccountPicker"; public const string RestoreWithSourceGlobalDatabaseAccountInstanceId = "restoreWithSourceGlobalDatabaseAccountInstanceId"; + public const string RestoreWithTTLDisabled = "restoreWithTTLDisabled"; public const string DatabasesToRestore = "databasesToRestore"; public const string DatabaseName = "databaseName"; public const string CollectionNames = "collectionNames"; public const string GraphNames = "graphNames"; public const string TableNames = "tableNames"; + public const string RestoreTillEndOfLogChain = "restoreTillEndOfLogChain"; + public const int TimeToleranceForRestoreTillEndOfLogChain = 1000; //ms // Restore Properties public const string RestoreTimestampInUtc = "restoreTimestampInUtc"; @@ -643,7 +655,7 @@ public static class Properties public const string Message = "message"; public const string ErrorDetails = "errorDetails"; public const string AdditionalErrorInfo = "additionalErrorInfo"; - + //CassandraErrorResource. public const string Target = "target"; @@ -660,7 +672,10 @@ public static class Properties public const string AadToken = "aad"; public const string SasToken = "sas"; public const string TokenVersion = "1.0"; + public const string TokenVersionV2 = "2.0"; public const string AuthSchemaType = "type"; + public const string ResourceTokenV2Label = "ResourceTokenV2Label"; + public const string ResourceTokenV2Context = "ResourceTokenV2Context"; public const string AuthVersion = "ver"; public const string AuthSignature = "sig"; public const string readPermissionMode = "read"; @@ -706,6 +721,7 @@ public static class Properties public const string BitLockerKeysSettingType = "BitLockerKeysSettingType"; public const string BitLockerKeysRotationState = "BitLockerKeysRotationState"; public const string InfrastructureServices = "InfrastructureServices"; + public const string SerializableResourceType = "SerializableResourceType"; // Federation settings public const string AllowReutilizationOfComputeResources = "AllowReutilizationOfComputeResources"; @@ -764,8 +780,8 @@ public static class Properties public const string MsiUserAssignedType = "UserAssigned"; public const string MsiSystemAndUserAssignedType = "SystemAssigned,UserAssigned"; public const string DefaultIdentity = "defaultIdentity"; - public const string MsiDelegatedUserAssignedType = "DelegatedUserAssigned"; - public const string MsiDelegatedSystemAssignedType = "DelegatedSystemAssigned"; + public const string MsiDelegatedUserAssignedType = "DelegatedUserAssigned"; // only used for DefaultMsiProperties + public const string MsiDelegatedSystemAssignedType = "DelegatedSystemAssigned"; // only used for DefaultMsiProperties // ServiceDocument Resource public const string AddressesLink = "addresses"; @@ -857,6 +873,7 @@ public static class Properties public const string OfferLastReplaceTimestamp = "offerLastReplaceTimestamp"; public const string AutopilotSettings = "offerAutopilotSettings"; public const string IsOfferRestorePending = "isOfferRestorePending"; + public const int DefaultContainerCountForSharedThroughput = 25; public const string AutopilotTier = "tier"; public const string AutopilotTargetTier = "targetTier"; @@ -886,7 +903,18 @@ public static class Properties public const string EnableBurstCapacity = "enableBurstCapacity"; public const string EnableUserRateLimitingWithBursting = "enableUserRateLimitingWithBursting"; - public const string BlockOldSdkCallsForBurstCapacityEnabledAccount = "blockOldSdkCallsForBurstCapacityEnabledAccount"; + + // Priority Based Execution can be enabled by setting the naming config enablePriorityBasedThrottling to true + // When user sets EnablePriorityBasedExecution to true in an account PATCH request, enablePriorityBasedThrottling + // is set to true in the account configuration overrrides + public const string EnablePriorityBasedThrottling = "enablePriorityBasedThrottling"; + public const string EnablePriorityBasedExecution = "enablePriorityBasedExecution"; + public const string DefaultPriorityLevel = "defaultPriorityLevel"; + + // Global Rate Limiting + public const string EnableGlobalRateLimiting = "enableGlobalRateLimiting"; + // Cap the global budget for a partition. The value includes provisioned local budget. It cannot exceed 10K. + public const string GRLTargetUtilizationPerPartition = "GRLTargetUtilizationPerPartition"; public const string IsDryRun = "isDryRun"; @@ -929,6 +957,7 @@ public static class Properties public const string ThroughputFraction = "throughputFraction"; public const string PartitionKeyRangeStatus = "status"; public const string Parents = "parents"; + public const string Lsn = "lsn"; public const string NodeStatus = "NodeStatus"; public const string NodeName = "NodeName"; @@ -951,6 +980,9 @@ public static class Properties public const string EncryptionAlgorithm = "encryptionAlgorithm"; public const string ClientEncryptionPolicy = "clientEncryptionPolicy"; + public const string DataMaskingPolicy = "dataMaskingPolicy"; + public const string IsPolicyEnabled = "isPolicyEnabled"; + // ParitionKey Monitor public const string EnablePartitionKeyMonitor = "enablePartitionKeyMonitor"; @@ -1010,6 +1042,9 @@ public static class Properties public const string EnableLogstoreHeadStartSequenceVector = "enableLogStoreHeadStartSequenceVector"; public const string AllowSkippingOpLogFlushInRestore = "allowSkippingOpLogFlushInRestore"; + // Property to allow PITR disabling + public const string AllowPitrDisabling = "allowPITRDisabling"; + // Property to allow migration to analytical store public const string AllowCollectionMigrationToAnalyticalStore = "allowCollectionMigrationToAnalyticalStore"; public const string AllowMongoCollectionMigrationToAnalyticalStore = "allowMongoCollectionMigrationToAnalyticalStore"; @@ -1017,8 +1052,16 @@ public static class Properties // Property to enable storage analytics public const string EnableAnalyticalStorage = "enableAnalyticalStorage"; + // Properties related to Autoscale billing improvements. + public const string EnableAutoscaleThroughputUtilizationReporting = "enableAutoscaleThroughputUtilizationReporting"; // Configuration to report throughput utilization for autoscale billing. + public const string EnablePerRegionAutoscale = "enablePerRegionAutoscale"; //Configuration to enable PerRegion autoscale billing. + public const string EnableThroughputUtilizationPersistence = "enableThroughputUtilizationPersistence"; // configuration to enable throughput utlization persistance for server replica + public const string EnablePerRegionPerPartitionAutoscale = "enablePerRegionPerPartitionAutoscale"; // Property used in RP call to enable/disable the AutoscalePerRegion feature + public const string EnablePerRegionPerPartitionAutoscaleOptIn = "enablePerRegionPerPartitionAutoscaleOptIn"; // config override which will be used to determine if feature can be enabled or not + //properties to enable MaterializedViews public const string EnableMaterializedViews = "enableMaterializedViews"; //at DB account level. + public const string EnableOnlyColdStorageContainersInAccountV1 = "enableOnlyColdStorageContainersInAccountV1"; // property to enable full fidelity change feed (change feed with retention from remote+local storage). public const string EnableFullFidelityChangeFeed = "enableFullFidelityChangeFeed"; @@ -1031,7 +1074,7 @@ public static class Properties public const string ForceDisableFailover = "forceDisableFailover"; public const string EnableAutomaticFailover = "enableAutomaticFailover"; public const string SkipGracefulFailoverAttempt = "skipGracefulFailoverAttempt"; - public const string ForceUngracefulFailover = "forceUngracefulFailover"; + public const string ForceUngracefulFailover = "forceUngraceful"; // Location resource public const string IsEnabled = "isenabled"; @@ -1182,6 +1225,10 @@ public static class Properties // Customer Facing public const string IsVirtualNetworkFilterEnabled = "isVirtualNetworkFilterEnabled"; + // PerPartitionFailover Flags + // Likely Customer Facing + public const string EnablePerPartitionFailoverBehavior = "enablePerPartitionFailoverBehavior"; + // Backend public const string AccountVNETFilterEnabled = "accountVNETFilterEnabled"; public const string VirtualNetworkArmUrl = "virtualNetworkArmUrl"; @@ -1198,7 +1245,7 @@ public static class Properties public const string NspProfileProxyResources = "nspProfileProxyResources"; public const string NspAssociationProxyResource = "nspAssociationProxyResource"; public const string EnableNetworkSecurityPerimeter = "enableNetworkSecurityPerimeter"; - public const string EnableNetworkSecurityPerimeterOutbound = "enableNetworkSecurityPerimeterOutbound"; + public const string EnableConflictResolutionPolicyUpdate = "enableConflictResolutionPolicyUpdate"; // VNET/Subnet Resource(Network Resource Provider) public const string IgnoreMissingVNetServiceEndpoint = "ignoreMissingVNetServiceEndpoint"; @@ -1273,6 +1320,7 @@ public static class Properties // LogStore restore public const string IsRemoteStoreRestoreEnabled = "remoteStoreRestoreEnabled"; public const string RetentionPeriodInSeconds = "retentionPeriodInSeconds"; + public const string EnableRestoreTillEndOfLogChain = "enableRestoreTillEndOfLogChain"; // Remove stale backup blobs public const string BlobNamePrefix = "blobNamePrefix"; @@ -1287,6 +1335,7 @@ public static class Properties public const string RestrictDatabaseOfferContainerCount = "restrictDatabaseOfferContainerCount"; public const string MaxSharedOfferDatabaseCount = "maxSharedOfferDatabaseCount"; public const string MinRUsPerSharedThroughputCollection = "minRUsPerSharedThroughputCollection"; + public const string MaxContainersPerPartition = "maxContainersPerPartition"; // Conflict resolution policy public const string ConflictResolutionPolicy = "conflictResolutionPolicy"; @@ -1503,6 +1552,7 @@ public static class Properties // Mongo Properties public const string GlobalMongoProperties = "globalMongoProperties"; public const string ApiProperties = "apiProperties"; + public const string Disable16MBCapabilityChecks = "disable16MBCapabilityChecks"; // AAD Authentication public const string TrustedAadTenants = "trustedAadTenants"; @@ -1527,7 +1577,11 @@ public static class Properties public const string OldestRestorableTimeInUtc = "oldestRestorableTimeInUtc"; // Private endpoint map management + public const string Telemetry = "telemetry"; public const string DisabledTime = "disabledTime"; + public const string MapVersionBeforeCreation = "mapVersionBeforeCreation"; + public const string MapVersionBeforeDisabled = "mapVersionBeforeDisabled"; + public const string MapVersionBeforeDeletion = "mapVersionBeforeDeletion"; // SystemData public const string SystemData = "systemData"; @@ -1597,6 +1651,8 @@ public static class Properties // Purview-related properties public const string PurviewEnabled = "purviewEnabled"; + public const string AutoAuthPolicyFullPullScheduleIntervalInSeconds = "autoAuthPolicyFullPullScheduleIntervalInSeconds"; + public const int DefaultFullPullScheduleIntervalInSeconds = 7200; // TLS // New values for Self-Service Tls feature. @@ -1616,8 +1672,20 @@ public static class Properties public const string ClientTelemetryConfiguration = "clientTelemetryConfiguration"; public const string ClientTelemetryEnabled = "isEnabled"; public const string ClientTelemetryEndpoint = "endpoint"; + public const string ClientConfigApiRefreshIntervalInMinutes = "refreshIntervalInMinutes"; public const string EnableClientTelemetry = "enableClientTelemetry"; + // Throughput Pool Properties + public const string ThroughputPoolInstanceId = "throughputPoolInstanceId"; + public const string ThroughputPoolId = "throughputPoolId"; + public const string ThroughputPoolName = "throughputPoolName"; + public const string ThroughputPool = "throughputPool"; + public const string ThroughputPools = "throughputPools"; + public const string ThroughputPoolAccountLocation = "accountARMLocation"; + public const string ThroughputPoolAccountInstanceId = "accountInstanceId"; + public const string ThroughputPoolResourceUriTemplate = "subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.DocumentDB/throughputPools/{3}"; + public const string ThroughputPoolAccountUrl = "accountURI"; + public static class FederationOperations { public const string IsCapOperation = "isCapOperation"; @@ -1629,10 +1697,10 @@ public static class FederationCapActions public const string Cap = "Cap"; public const string Uncap = "Uncap"; } - + public static class InAccountUnDeleteNotAllowedReasons { - // Database UnDelete Failure + // Database UnDelete Failure public const string DatabaseLive = "Database already exists. Only deleted resources can be restored within same account."; public const string DatabaseWithSameNameLive = "Database with same name already exist as live database."; @@ -1675,6 +1743,7 @@ public static class SnapshotProperties public const string Keyspace = "keyspace"; public const string LSN = "lsn"; public const string IsMasterResourcesDeletionPending = "isMasterResourcesDeletionPending"; + public const string StorageAccountUris = "storageAccountUris"; } public static class RestoreMetadataResourceProperties @@ -1719,7 +1788,7 @@ public static class InternalIndexingProperties public static class InternalStoreProperties { public const string PropertyName = "internalStoreProperties"; - public const string AllowEnableLocalStoreCompression = "allowEnableLocalStoreCompression"; + public const string EnableBinaryEncodingOfContent = "enableBinaryEncodingOfContent"; } public static class TypeSystemPolicy @@ -1758,6 +1827,7 @@ public static class MsiProperties { public const string Type = "type"; public const string MsiIdentityUrl = "msiIdentityUrl"; + public const string InternalId = "internalId"; public const string ImplicitIdentity = "implicitIdentity"; public const string ExplicitIdentities = "explicitIdentities"; public const string DelegatedIdentities = "delegatedIdentities"; @@ -1955,6 +2025,9 @@ public static class KeyVaultProperties public const string KeyVaultKeyUriVersion = "keyVaultKeyUriVersion"; public const string DataEncryptionKeyStatus = "dataEncryptionKeyStatus"; public const string DataEncryptionKeyRequestOperation = "dataEncryptionKeyRequestOperation"; + public const string KeyVaultUnwrapErrorSubStatusCode = "keyVaultUnwrapErrorSubStatusCode"; + public const string KeyVaultUnwrapError = "keyVaultUnwrapError"; + public const string CustomerManagedKeyStatus = "customerManagedKeyStatus"; } public static class ManagedServiceIdentityProperties @@ -2022,6 +2095,12 @@ public static class SubscriptionsQuotaConstants public const int DefaultMaxRegionsPerGlobalDatabaseAccount = 50; } + public static class OperationProgressConstants + { + public const string IsProgressReportingSupported = "IsProgressReportingSupported"; + public const string ProgressPercentage = "ProgressPercentage"; + } + public static class PolicyConstants { public const string PolicyType = "policytype"; @@ -2115,6 +2194,12 @@ public static class ApiSpecificUrlNames public static string Table = "tables"; } + public static class MigratePartitionConstants + { + public static string SourceFederationId = "sourceFederationId"; + public static string SourceServiceName = "sourceServiceName"; + } + public static class MigratePartitionCallerSource { public static string Test = "Test"; @@ -2146,6 +2231,16 @@ public static class EnvironmentVariables public static class AvailabilityZoneMigrationProperties { public const string DesiredIsZoneRedundantValue = "desiredIsZoneRedundantValue"; + public const string MigrateServerPartitionsOnly = "migrateServerPartitionsOnly"; + public const string MasterSourceFederationId = "masterSourceFederationId"; + } + + public static class RoleNames + { + public const string MasterCluster0 = "MasterCluster0"; + public const string ServerCluster0 = "ServerCluster0"; + public const string FabricInfrastructure = "FabricInfrastructure"; + public const string CosmosDBGateway = "CosmosDBGateway"; } } } diff --git a/Microsoft.Azure.Cosmos/src/direct/CustomTypeExtensions.cs b/Microsoft.Azure.Cosmos/src/direct/CustomTypeExtensions.cs index 45b43e8ad6..d68f898b8c 100644 --- a/Microsoft.Azure.Cosmos/src/direct/CustomTypeExtensions.cs +++ b/Microsoft.Azure.Cosmos/src/direct/CustomTypeExtensions.cs @@ -35,7 +35,7 @@ internal static class CustomTypeExtensions #if COSMOSCLIENT public const string SDKName = "cosmos-netstandard-sdk"; - public const string SDKVersion = "3.31.5"; + public const string SDKVersion = "3.32.0"; #else public const string SDKName = "documentdb-netcore-sdk"; public const string SDKVersion = "2.14.0"; diff --git a/Microsoft.Azure.Cosmos/src/direct/DataMaskingIncludedPath.cs b/Microsoft.Azure.Cosmos/src/direct/DataMaskingIncludedPath.cs new file mode 100644 index 0000000000..4c62c6f623 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/direct/DataMaskingIncludedPath.cs @@ -0,0 +1,21 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Documents +{ + using Newtonsoft.Json; + + internal sealed class DataMaskingIncludedPath : JsonSerializable + { + /// + /// Gets or sets the path to be masked. Must be a top level path, eg. /salary + /// + [JsonProperty(PropertyName = Constants.Properties.Path)] + public string Path + { + get { return this.GetValue(Constants.Properties.Path); } + set { this.SetValue(Constants.Properties.Path, value); } + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/direct/DataMaskingPolicy.cs b/Microsoft.Azure.Cosmos/src/direct/DataMaskingPolicy.cs new file mode 100644 index 0000000000..a783405067 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/direct/DataMaskingPolicy.cs @@ -0,0 +1,95 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Documents +{ + using System; + using System.Collections.ObjectModel; + using System.Globalization; + using Newtonsoft.Json; + + /// + /// Represents the data masking policy for a collection in the Azure Cosmos DB service. + /// + /// + internal sealed class DataMaskingPolicy : JsonSerializable + { + private Collection includedPaths; + private Boolean isPolicyEnabled; + + /// + /// Initializes a new instance of the class for the Azure Cosmos DB service. + /// + public DataMaskingPolicy() + { + } + + /// + /// Paths of the item that need masked along with path-specific settings. + /// + [JsonProperty(PropertyName = Constants.Properties.IncludedPaths)] + public Collection IncludedPaths + { + get + { + if (this.includedPaths == null) + { + this.includedPaths = base.GetObjectCollection(Constants.Properties.IncludedPaths); + if (this.includedPaths == null) + { + this.includedPaths = new Collection(); + } + } + + return this.includedPaths; + } + set + { + if (value == null) + { + throw new ArgumentNullException(string.Format(CultureInfo.CurrentCulture, RMResources.PropertyCannotBeNull, nameof(IncludedPaths))); + } + + this.includedPaths = value; + base.SetObjectCollection(Constants.Properties.IncludedPaths, this.includedPaths); + } + } + + /// + /// Paths of the item that need masked along with path-specific settings. + /// + [JsonProperty(PropertyName = Constants.Properties.IsPolicyEnabled)] + public Boolean IsPolicyEnabled + { + get + { + if (!this.isPolicyEnabled) + { + this.isPolicyEnabled = base.GetValue(Constants.Properties.IsPolicyEnabled, true); + } + + return this.isPolicyEnabled; + } + set + { + if (!value) + { + throw new ArgumentNullException(string.Format(CultureInfo.CurrentCulture, RMResources.PropertyCannotBeNull, nameof(IsPolicyEnabled))); + } + + this.isPolicyEnabled = value; + base.SetValue(Constants.Properties.IsPolicyEnabled, this.IsPolicyEnabled); + } + } + + internal override void OnSave() + { + if (this.includedPaths != null) + { + base.SetObjectCollection(Constants.Properties.IncludedPaths, this.includedPaths); + base.SetValue(Constants.Properties.IsPolicyEnabled, this.isPolicyEnabled); + } + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/direct/Dispatcher.cs b/Microsoft.Azure.Cosmos/src/direct/Dispatcher.cs index 6824830d73..b967f05545 100644 --- a/Microsoft.Azure.Cosmos/src/direct/Dispatcher.cs +++ b/Microsoft.Azure.Cosmos/src/direct/Dispatcher.cs @@ -336,6 +336,7 @@ public async Task CallAsync(ChannelCallArguments args, TransportR this.chaosInterceptor?.OnBeforeConnectionWrite(args); if (this.chaosInterceptor != null && this.chaosInterceptor.OnRequestCall(args, out StoreResponse faultyResponse)) { + transportRequestStats.RecordState(TransportRequestStats.RequestStage.Sent); return faultyResponse; } diff --git a/Microsoft.Azure.Cosmos/src/direct/DocumentCollection.cs b/Microsoft.Azure.Cosmos/src/direct/DocumentCollection.cs index f3a84a8600..2adb2de13e 100644 --- a/Microsoft.Azure.Cosmos/src/direct/DocumentCollection.cs +++ b/Microsoft.Azure.Cosmos/src/direct/DocumentCollection.cs @@ -113,10 +113,12 @@ class DocumentCollection : Resource private MaterializedViewDefinition materializedViewDefinition; private ByokConfig byokConfig; private ClientEncryptionPolicy clientEncryptionPolicy; + private DataMaskingPolicy dataMaskingPolicy; private Collection materializedViews; private EncryptionScopeMetadata encryptionScopeMetadata; private InAccountRestoreParameters restoreParameters; private byte uniqueIndexNameEncodingMode; + private Collection computedProperties; /// /// Initializes a new instance of the class for the Azure Cosmos DB service. @@ -154,6 +156,40 @@ public IndexingPolicy IndexingPolicy } } + /// + /// Gets or sets the collection containing objects in the container. + /// + /// + /// The collection containing objects associated with the container. + /// + [JsonProperty(PropertyName = Constants.Properties.ComputedProperties)] + internal Collection ComputedProperties + { + get + { + if (this.computedProperties == null) + { + this.computedProperties = base.GetValue>(Constants.Properties.ComputedProperties); + if (this.computedProperties == null) + { + this.computedProperties = new Collection(); + } + } + + return this.computedProperties; + } + set + { + if (value == null) + { + throw new ArgumentNullException(string.Format(CultureInfo.CurrentCulture, RMResources.PropertyCannotBeNull, "computedProperties")); + } + + this.computedProperties = value; + base.SetValue(Constants.Properties.ComputedProperties, this.computedProperties); + } + } + /// /// Gets the associated with the collection from the Azure Cosmos DB service. /// @@ -285,12 +321,10 @@ internal byte UniqueIndexNameEncodingMode } set { -#pragma warning disable CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' if(value == null) { throw new ArgumentNullException(string.Format(CultureInfo.CurrentCulture, RMResources.PropertyCannotBeNull, "UniqueIndexNameEncodingMode")); } -#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null' this.uniqueIndexNameEncodingMode = value; this.SetValue(Constants.Properties.UniqueIndexNameEncodingMode, value); } @@ -919,6 +953,36 @@ internal ClientEncryptionPolicy ClientEncryptionPolicy } } + /// + /// Gets the associated with the collection from the Azure Cosmos DB service. + /// + /// + /// The DataMaskingPolicy associated with the collection. + /// + [JsonProperty(PropertyName = Constants.Properties.DataMaskingPolicy, DefaultValueHandling = DefaultValueHandling.Ignore, NullValueHandling = NullValueHandling.Ignore)] + internal DataMaskingPolicy DataMaskingPolicy + { + get + { + if (this.dataMaskingPolicy == null) + { + this.dataMaskingPolicy = base.GetObject(Constants.Properties.DataMaskingPolicy); + } + + return this.dataMaskingPolicy; + } + set + { + if (value == null) + { + throw new ArgumentNullException(string.Format(CultureInfo.CurrentCulture, RMResources.PropertyCannotBeNull, nameof(DataMaskingPolicy))); + } + + this.dataMaskingPolicy = value; + base.SetObject(Constants.Properties.DataMaskingPolicy, value); + } + } + /// /// Gets the materialized views on the collection. /// @@ -1004,6 +1068,11 @@ internal override void Validate() this.UniqueKeyPolicy.Validate(); this.ConflictResolutionPolicy.Validate(); this.UniqueIndexReIndexContext.Validate(); + + foreach (ComputedProperty computedProperty in this.ComputedProperties) + { + computedProperty.Validate(); + } } internal override void OnSave() @@ -1067,11 +1136,21 @@ internal override void OnSave() base.SetObject(Constants.Properties.ClientEncryptionPolicy, this.clientEncryptionPolicy); } + if (this.dataMaskingPolicy != null) + { + base.SetObject(Constants.Properties.DataMaskingPolicy, this.dataMaskingPolicy); + } + if (this.materializedViews != null) { base.SetValueCollection(Constants.Properties.MaterializedViews, this.materializedViews); } + if (this.computedProperties != null) + { + base.SetValueCollection(Constants.Properties.ComputedProperties, this.computedProperties); + } + if (this.restoreParameters != null) { base.SetObject(Constants.Properties.RestoreParams, this.restoreParameters); diff --git a/Microsoft.Azure.Cosmos/src/direct/DocumentServiceRequest.cs b/Microsoft.Azure.Cosmos/src/direct/DocumentServiceRequest.cs index 86a4ab53b4..44ecfc7461 100644 --- a/Microsoft.Azure.Cosmos/src/direct/DocumentServiceRequest.cs +++ b/Microsoft.Azure.Cosmos/src/direct/DocumentServiceRequest.cs @@ -396,6 +396,76 @@ internal string ApiVersion } } + /// + /// StoreModel vs GatewayStoreModel contract for friends. + /// TODO: SDK V3 start using this contract. - https://msdata.visualstudio.com/CosmosDB/_workitems/edit/2470799 + /// + internal static bool IsGatewayMode(ResourceType resourceType, OperationType operationType) + { + if (resourceType == ResourceType.Offer || + (resourceType.IsScript() && operationType != OperationType.ExecuteJavaScript) || + resourceType == ResourceType.PartitionKeyRange || + resourceType == ResourceType.Snapshot || + resourceType == ResourceType.ClientEncryptionKey || + (resourceType == ResourceType.PartitionKey && operationType == OperationType.Delete)) + { + return true; + } + + if (operationType == OperationType.Create + || operationType == OperationType.Upsert) + { + if (resourceType == ResourceType.Database || + resourceType == ResourceType.User || + resourceType == ResourceType.Collection || + resourceType == ResourceType.Permission) + { + return true; + } + else + { + return false; + } + } + else if (operationType == OperationType.Delete) + { + if (resourceType == ResourceType.Database || + resourceType == ResourceType.User || + resourceType == ResourceType.Collection) + { + return true; + } + else + { + return false; + } + } + else if ((operationType == OperationType.Replace) || (operationType == OperationType.CollectionTruncate)) + { + if (resourceType == ResourceType.Collection) + { + return true; + } + else + { + return false; + } + } + else if (operationType == OperationType.Read) + { + if (resourceType == ResourceType.Collection) + { + return true; + } + else + { + return false; + } + } + + return false; + } + public bool ForceNameCacheRefresh { get; set; } /// @@ -473,6 +543,7 @@ public string HttpMethod case OperationType.BatchApply: case OperationType.Batch: case OperationType.QueryPlan: + case OperationType.MetadataCheckAccess: case OperationType.CompleteUserTransaction: return HttpConstants.HttpMethods.Post; @@ -534,12 +605,12 @@ public string HttpMethod case OperationType.ServiceReservation: case OperationType.GetSplitPoints: case OperationType.GetUnwrappedDek: + case OperationType.GetDekProperties: case OperationType.GetFederationConfigurations: case OperationType.GetDatabaseAccountConfigurations: case OperationType.GetStorageServiceConfigurations: case OperationType.ForcePartitionBackup: case OperationType.MasterInitiatedProgressCoordination: - case OperationType.MetadataCheckAccess: case OperationType.CreateSystemSnapshot: case OperationType.CreateRidRangeResources: case OperationType.GetAadGroups: @@ -684,6 +755,12 @@ public bool IsValidAddress(ResourceType resourceType = ResourceType.Unknown) { return true; } +#if !COSMOSCLIENT + else if (this.ResourceType == ResourceType.VectorClock) + { + return true; + } +#endif else { return false; diff --git a/Microsoft.Azure.Cosmos/src/direct/GoneAndRetryWithRequestRetryPolicy.cs b/Microsoft.Azure.Cosmos/src/direct/GoneAndRetryWithRequestRetryPolicy.cs index 5eecfa246e..968e10fcaa 100644 --- a/Microsoft.Azure.Cosmos/src/direct/GoneAndRetryWithRequestRetryPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/direct/GoneAndRetryWithRequestRetryPolicy.cs @@ -5,6 +5,7 @@ namespace Microsoft.Azure.Documents { using System; using System.Diagnostics; + using System.Globalization; using System.Net; using System.Threading; using System.Threading.Tasks; @@ -17,6 +18,32 @@ namespace Microsoft.Azure.Documents internal sealed class GoneAndRetryWithRequestRetryPolicy : IRequestRetryPolicy where TResponse : IRetriableResponse { + struct ErrorOrResponse + { + private Exception exception; + private int statusCode; + + public ErrorOrResponse(Exception ex, TResponse response) + { + exception = ex; + this.statusCode = response != null ? (int)response.StatusCode : 0; + } + + public ErrorOrResponse(Exception ex) + { + exception = ex; + statusCode = 0; + } + + private string ExceptionToString() + { + // If no error code is set, use WithMessageAndData + return statusCode != 0 ? exception?.ToStringWithData() : exception?.ToStringWithMessageAndData(); + } + + public override string ToString() => exception != null ? this.ExceptionToString() : statusCode.ToString(CultureInfo.InvariantCulture); + } + private static readonly ThreadLocal Random = new ThreadLocal(() => new Random()); private const int defaultWaitTimeInMilliSeconds = 30000; @@ -133,8 +160,8 @@ public bool TryHandleResponseSynchronously(DocumentServiceRequest request, TResp if (disableRetryWithPolicy) { DefaultTrace.TraceWarning( - "The GoneAndRetryWithRequestRetryPolicy is configured with disableRetryWithPolicy to true. Retries on 449(RetryWith) exceptions has been disabled. This is by design to allow users to handle the exception: {0}", - exception.ToStringWithMessageAndData()); + "The GoneAndRetryWithRequestRetryPolicy is configured with disableRetryWithPolicy to true. Retries on 449(RetryWith) exceptions has been disabled. This is by design to allow users to handle the exception: {0}", + new ErrorOrResponse(exception)); this.durationTimer.Stop(); shouldRetryResult = ShouldRetryResult.NoRetry(); return true; @@ -174,12 +201,16 @@ public bool TryHandleResponseSynchronously(DocumentServiceRequest request, TResp DefaultTrace.TraceError( "{0} including at least one RetryWithException. " + "Will fail the request with RetryWithException. Exception: {1}. RetryWithException: {2}", - message, exception?.ToStringWithData() ?? response?.StatusCode.ToString(), this.lastRetryWithException.ToStringWithData()); + message, + new ErrorOrResponse(exception, response), + new ErrorOrResponse(this.lastRetryWithException)); exceptionToThrow = this.lastRetryWithException; } else { - DefaultTrace.TraceError("{0}. Will fail the request. {1}", message, exception?.ToStringWithData() ?? response?.StatusCode.ToString()); + DefaultTrace.TraceError("{0}. Will fail the request. {1}", message, + new ErrorOrResponse(exception, response)); + SubStatusCodes exceptionSubStatus = DocumentClientException.GetExceptionSubStatusForGoneRetryPolicy(exception); if (exceptionSubStatus == SubStatusCodes.TimeoutGenerated410) { @@ -236,7 +267,8 @@ public bool TryHandleResponseSynchronously(DocumentServiceRequest request, TResp } else { - DefaultTrace.TraceError("Received retry with exception after backoff/retry. Will fail the request. {0}", exception?.ToStringWithData() ?? response?.StatusCode.ToString()); + DefaultTrace.TraceError("Received retry with exception after backoff/retry. Will fail the request. {0}", new ErrorOrResponse(exception, response)); + exceptionToThrow = exception; } this.durationTimer.Stop(); @@ -306,7 +338,8 @@ public bool TryHandleResponseSynchronously(DocumentServiceRequest request, TResp { // for third InvalidPartitionException, stop retrying. SubStatusCodes exceptionSubStatusCode = DocumentClientException.GetExceptionSubStatusForGoneRetryPolicy(exception); - DefaultTrace.TraceCritical("Received second InvalidPartitionException after backoff/retry. Will fail the request. {0}", exception?.ToStringWithData() ?? response?.StatusCode.ToString()); + DefaultTrace.TraceCritical("Received second InvalidPartitionException after backoff/retry. Will fail the request. {0}", + new ErrorOrResponse(exception, response)); shouldRetryResult = ShouldRetryResult.NoRetry(ServiceUnavailableException.Create(exceptionSubStatusCode, innerException: exception)); return true; } @@ -317,7 +350,7 @@ public bool TryHandleResponseSynchronously(DocumentServiceRequest request, TResp } else { - DefaultTrace.TraceCritical("Received unexpected invalid collection exception, request should be non-null. {0}", exception?.ToStringWithData() ?? response?.StatusCode.ToString()); + DefaultTrace.TraceCritical("Received unexpected invalid collection exception, request should be non-null. {0}", new ErrorOrResponse(exception, response)); shouldRetryResult = ShouldRetryResult.NoRetry(new InternalServerErrorException(exception)); return true; } @@ -344,7 +377,7 @@ public bool TryHandleResponseSynchronously(DocumentServiceRequest request, TResp this.regionRerouteAttemptCount, backoffTime, timeout, - exception?.ToStringWithData() ?? response?.StatusCode.ToString()); + new ErrorOrResponse(exception, response)); shouldRetryResult = ShouldRetryResult.RetryAfter(backoffTime); this.previousException = exception; diff --git a/Microsoft.Azure.Cosmos/src/direct/GoneAndRetryWithRetryPolicy.cs b/Microsoft.Azure.Cosmos/src/direct/GoneAndRetryWithRetryPolicy.cs index d7d4d971aa..f85a722255 100644 --- a/Microsoft.Azure.Cosmos/src/direct/GoneAndRetryWithRetryPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/direct/GoneAndRetryWithRetryPolicy.cs @@ -189,6 +189,8 @@ exception is PartitionKeyRangeGoneException || { DefaultTrace.TraceError("{0}. Will fail the request. {1}", message, exception.ToStringWithData()); SubStatusCodes exceptionSubStatus = DocumentClientException.GetExceptionSubStatusForGoneRetryPolicy(exception); + + if (this.detectConnectivityIssues && this.request.RequestContext.ClientRequestStatistics != null && this.request.RequestContext.ClientRequestStatistics.IsCpuHigh.GetValueOrDefault(false)) @@ -217,6 +219,7 @@ exception is PartitionKeyRangeGoneException || this.request.RequestContext.ClientRequestStatistics != null && this.request.RequestContext.ClientRequestStatistics.FailedReplicas.Count >= GoneAndRetryWithRetryPolicy.minFailedReplicaCountToConsiderConnectivityIssue) { + exceptionToThrow = new ServiceUnavailableException( string.Format( RMResources.ClientUnavailable, diff --git a/Microsoft.Azure.Cosmos/src/direct/HttpConstants.cs b/Microsoft.Azure.Cosmos/src/direct/HttpConstants.cs index fa5ea1d4d1701ebd1dca74b60d0d6d656428d20f..7ea352df96cf1ba8b6c25cda63dd4d0362642ef6 100644 GIT binary patch delta 813 zcmZuvOK1~O6n(cH6G>tm(*%(SriuhV(-_l*pn}GVwOA6H2&I+M$(W>tB$iA?A}A^@ zT?8+9K}4!MMKm#s;19DGDp~1Ly0Z((!i^9=_syV3(yS=dzd=#Tj4gAiKFvSIt!A*_og5+$LFB3*OAHdMdursW#=)}?-5 zoO%kXHQrNG>Y(DOsjXN`tBu=WrXRw;^w9bt@Sy*+x=UkYvn)+cYL@jHBlk|* zH}a@;_cT8qf>)Puc6c8q4=B`egU78~z7-gxOzme7ps^gdHjFZ){GV1G+v9`u`5}za zy=m~!l@V|?yD#8QpG4a7@0&SlIXXx0W*`t)dosFRW|=wqF#|g!WW4#|HB2f$0S`jk AzyJUM delta 104 zcmbO;iG4#0`-TJ3lR46rHh+^|WxV-J00--28E>V@X9Bo3&k6Hrntb3I+vbX!Ut+c| zGG{DdpWG14vR%i4F^zG$K{X@C_GM0tTWY6INMMwjJ|T(GV7tvh#tlqxzQ*<=M;Iem E0M=nCGynhq diff --git a/Microsoft.Azure.Cosmos/src/direct/HttpException.cs b/Microsoft.Azure.Cosmos/src/direct/HttpException.cs index c59d3051c3..9e7e4c82ee 100644 --- a/Microsoft.Azure.Cosmos/src/direct/HttpException.cs +++ b/Microsoft.Azure.Cosmos/src/direct/HttpException.cs @@ -86,7 +86,8 @@ internal DocumentClientException(string message, HttpResponseHeaders responseHeaders, HttpStatusCode? statusCode, Uri requestUri = null, - SubStatusCodes? substatusCode = null) + SubStatusCodes? substatusCode = null, + bool traceCallStack = true) : base(DocumentClientException.MessageWithActivityId(message, responseHeaders), innerException) { this.responseHeaders = new StoreResponseNameValueCollection(); @@ -127,7 +128,8 @@ internal DocumentClientException(string message, "DocumentClientException with status code {0}, message: {1}, inner exception: {2}, and response headers: {3}", this.StatusCode ?? 0, message, - innerException != null ? innerException.ToString() : "null", + innerException != null ? + (traceCallStack ? innerException.ToString() : innerException.ToStringWithMessageAndData()) : "null", SerializeHTTPResponseHeaders(responseHeaders)); } } @@ -220,6 +222,13 @@ internal DocumentClientException(SerializationInfo info, StreamingContext contex info.ToString()); } } + + internal DocumentClientException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + this.LSN = -1; + this.PartitionKeyRangeId = null; + } #endif /// diff --git a/Microsoft.Azure.Cosmos/src/direct/HttpTransportClient.cs b/Microsoft.Azure.Cosmos/src/direct/HttpTransportClient.cs index 6d8e7bdcb0..25419952ef 100644 --- a/Microsoft.Azure.Cosmos/src/direct/HttpTransportClient.cs +++ b/Microsoft.Azure.Cosmos/src/direct/HttpTransportClient.cs @@ -380,6 +380,16 @@ private HttpRequestMessage PrepareHttpMessage( HttpTransportClient.AddHeader(httpRequestMessage.Headers, WFConstants.BackendHeaders.PopulateCapacityType, request.Headers[WFConstants.BackendHeaders.PopulateCapacityType]); } + if (request.Headers[WFConstants.BackendHeaders.ClientIpAddress] != null) + { + HttpTransportClient.AddHeader(httpRequestMessage.Headers, WFConstants.BackendHeaders.ClientIpAddress, request.Headers[WFConstants.BackendHeaders.ClientIpAddress]); + } + + if (request.Headers[WFConstants.BackendHeaders.IsRequestNotAuthorized] != null) + { + HttpTransportClient.AddHeader(httpRequestMessage.Headers, WFConstants.BackendHeaders.IsRequestNotAuthorized, request.Headers[WFConstants.BackendHeaders.IsRequestNotAuthorized]); + } + HttpTransportClient.AddHeader(httpRequestMessage.Headers, HttpConstants.HttpHeaders.IsAutoScaleRequest, request); //Query @@ -478,6 +488,8 @@ private HttpRequestMessage PrepareHttpMessage( HttpTransportClient.AddHeader(httpRequestMessage.Headers, HttpConstants.HttpHeaders.IsMigratedFixedCollection, request); HttpTransportClient.AddHeader(httpRequestMessage.Headers, HttpConstants.HttpHeaders.SetMasterResourcesDeletionPending, request); HttpTransportClient.AddHeader(httpRequestMessage.Headers, HttpConstants.HttpHeaders.HighPriorityForcedBackup, request); + HttpTransportClient.AddHeader(httpRequestMessage.Headers, HttpConstants.HttpHeaders.EnableConflictResolutionPolicyUpdate, request); + HttpTransportClient.AddHeader(httpRequestMessage.Headers, HttpConstants.HttpHeaders.AllowDocumentReadsInOfflineRegion, request); Stream clonedStream = null; if (request.Body != null) @@ -616,6 +628,13 @@ private HttpRequestMessage PrepareHttpMessage( httpRequestMessage.Content = new StreamContent(clonedStream); break; + case OperationType.GetDekProperties: + httpRequestMessage.RequestUri = physicalAddress; + httpRequestMessage.Method = HttpMethod.Post; + Debug.Assert(clonedStream != null); + httpRequestMessage.Content = new StreamContent(clonedStream); + break; + case OperationType.ReadReplicaFromMasterPartition: case OperationType.ReadReplicaFromServerPartition: httpRequestMessage.RequestUri = physicalAddress; @@ -635,6 +654,8 @@ private HttpRequestMessage PrepareHttpMessage( case OperationType.BatchReportThroughputUtilization: case OperationType.ControllerBatchReportCharges: case OperationType.ControllerBatchGetOutput: + case OperationType.ControllerBatchAutoscaleRUsConsumption: + case OperationType.ControllerBatchGetAutoscaleAggregateOutput: httpRequestMessage.RequestUri = HttpTransportClient.GetRootOperationUri(physicalAddress, resourceOperation.operationType); httpRequestMessage.Method = HttpMethod.Post; Debug.Assert(clonedStream != null); diff --git a/Microsoft.Azure.Cosmos/src/direct/IClientSideRequestStatistics.cs b/Microsoft.Azure.Cosmos/src/direct/IClientSideRequestStatistics.cs index ca302839c0..7359b0e856 100644 --- a/Microsoft.Azure.Cosmos/src/direct/IClientSideRequestStatistics.cs +++ b/Microsoft.Azure.Cosmos/src/direct/IClientSideRequestStatistics.cs @@ -12,9 +12,9 @@ internal interface IClientSideRequestStatistics { List ContactedReplicas { get; set; } - HashSet FailedReplicas { get; } + HashSet FailedReplicas { get;} - HashSet<(string, Uri)> RegionsContacted { get; } + HashSet<(string, Uri)> RegionsContacted { get;} bool? IsCpuHigh { get; } @@ -53,4 +53,5 @@ void RecordHttpException(HttpRequestMessage request, ResourceType resourceType, DateTime requestStartTimeUtc); } -} \ No newline at end of file +} + diff --git a/Microsoft.Azure.Cosmos/src/direct/InAccountRestoreParameters.cs b/Microsoft.Azure.Cosmos/src/direct/InAccountRestoreParameters.cs index cee6bb8c83..199261cc91 100644 --- a/Microsoft.Azure.Cosmos/src/direct/InAccountRestoreParameters.cs +++ b/Microsoft.Azure.Cosmos/src/direct/InAccountRestoreParameters.cs @@ -67,6 +67,19 @@ public string SourceBackupLocation set { base.SetValue(Constants.Properties.SourceBackupLocation, value); } } + /// + /// Gets or sets the for triggering the InAccount Restore as part of RestoreParameters + /// + /// + /// A valid value should be true or false + /// + [JsonProperty(PropertyName = Constants.Properties.RestoreWithTTLDisabled)] + public bool RestoreWithTTLDisabled + { + get { return base.GetValue(Constants.Properties.RestoreWithTTLDisabled); } + set { base.SetValue(Constants.Properties.RestoreWithTTLDisabled, value); } + } + internal override void Validate() { base.Validate(); diff --git a/Microsoft.Azure.Cosmos/src/direct/Int128.cs b/Microsoft.Azure.Cosmos/src/direct/Int128.cs index 3aed0d88fa..2c4894fbb9 100644 --- a/Microsoft.Azure.Cosmos/src/direct/Int128.cs +++ b/Microsoft.Azure.Cosmos/src/direct/Int128.cs @@ -74,6 +74,25 @@ public Int128(byte[] data) return left.value < right.value; } + public static bool operator ==(Int128 left, Int128 right) + { + return left.value == right.value; + } + + public static bool operator !=(Int128 left, Int128 right) + { + return left.value != right.value; + } + public override int GetHashCode() + { + return value.GetHashCode(); + } + + public override bool Equals(object obj) + { + return obj is Int128 other && this.Equals(other); + } + public byte[] Bytes { get diff --git a/Microsoft.Azure.Cosmos/src/direct/JSonSerializable.cs b/Microsoft.Azure.Cosmos/src/direct/JSonSerializable.cs index 321215d199..d1a90e6759 100644 --- a/Microsoft.Azure.Cosmos/src/direct/JSonSerializable.cs +++ b/Microsoft.Azure.Cosmos/src/direct/JSonSerializable.cs @@ -821,6 +821,11 @@ internal Dictionary GetObjectDictionary( if (token != null) { Dictionary jobjectDictionary = token.ToObject>(); + if (jobjectDictionary == null) + { + return null; + } + Dictionary objectDictionary = new Dictionary(); foreach (KeyValuePair kvp in jobjectDictionary) { diff --git a/Microsoft.Azure.Cosmos/src/direct/LinuxSystemUtilizationReader.cs b/Microsoft.Azure.Cosmos/src/direct/LinuxSystemUtilizationReader.cs index 3ba0499ba5..20103cc8e3 100644 --- a/Microsoft.Azure.Cosmos/src/direct/LinuxSystemUtilizationReader.cs +++ b/Microsoft.Azure.Cosmos/src/direct/LinuxSystemUtilizationReader.cs @@ -237,6 +237,8 @@ public ProcMemInfoFileParser() : this(DefaultProcMemInfoFilePath) /// /// Allows customization of the proc stat file path to allow testing this on Non-Linux machines /// + /// + /// internal ProcMemInfoFileParser(string procMemInfoFilePath) { if (String.IsNullOrWhiteSpace(procMemInfoFilePath)) diff --git a/Microsoft.Azure.Cosmos/src/direct/LoadBalancingPartition.cs b/Microsoft.Azure.Cosmos/src/direct/LoadBalancingPartition.cs index cf4d749424..6a5664eb01 100644 --- a/Microsoft.Azure.Cosmos/src/direct/LoadBalancingPartition.cs +++ b/Microsoft.Azure.Cosmos/src/direct/LoadBalancingPartition.cs @@ -36,13 +36,13 @@ internal sealed class LoadBalancingPartition : IDisposable // This channel factory delegate is meant for unit testing only and a default implementation is provided. // However it can be extended to support the main line code path if needed. - private readonly Func, IChannel> channelFactory; + private readonly Func, IChannel> channelFactory; public LoadBalancingPartition( Uri serverUri, ChannelProperties channelProperties, bool localRegionRequest, - Func, IChannel> channelFactory = null, + Func, IChannel> channelFactory = null, IChaosInterceptor chaosInterceptor = null) { Debug.Assert(serverUri != null); @@ -188,8 +188,9 @@ public async Task RequestAsync( channelsCreated = targetChannels - this.openChannels.Count; } - Action onChannelOpen = - (Guid createId, Uri serverUri, Channel createdChannel) => this.chaosInterceptor?.OnChannelOpen(createId, serverUri, request, createdChannel); + Action onChannelOpen = + (Guid createId, Guid connectionCorrelationId, Uri serverUri, Channel createdChannel) + => this.chaosInterceptor?.OnChannelOpen(createId, serverUri, request, createdChannel); while (this.openChannels.Count < targetChannels) { @@ -317,7 +318,7 @@ public void Dispose() /// An instance of . private IChannel OpenChannelAndIncrementCapacity( Guid activityId, - Action onChannelOpen = null) + Action onChannelOpen = null) { Debug.Assert(this.capacityLock.IsWriteLockHeld); @@ -364,7 +365,7 @@ private static IChannel CreateAndInitializeChannel( bool localRegionRequest, SemaphoreSlim concurrentOpeningChannelSlim, IChaosInterceptor chaosInterceptor = null, - Action onChannelOpen = null) + Action onChannelOpen = null) { return new Channel( activityId, diff --git a/Microsoft.Azure.Cosmos/src/direct/LocationNames.cs b/Microsoft.Azure.Cosmos/src/direct/LocationNames.cs index f83fd22c37..c2258d7493 100644 --- a/Microsoft.Azure.Cosmos/src/direct/LocationNames.cs +++ b/Microsoft.Azure.Cosmos/src/direct/LocationNames.cs @@ -377,6 +377,38 @@ static class LocationNames /// /// Name of the Azure Mexico Central region in the Azure Cosmos DB service. /// - internal const string MexicoCentral = "Mexico Central"; + public const string MexicoCentral = "Mexico Central"; + + /// + /// Name of the Azure Spain Central region in the Azure Cosmos DB service. + /// + public const string SpainCentral = "Spain Central"; + + /// + /// Name of the Azure Taiwan North region in the Azure Cosmos DB service. + /// + internal const string TaiwanNorth = "Taiwan North"; + + /// + /// Name of the Azure Taiwan Northwest region in the Azure Cosmos DB service. + /// + internal const string TaiwanNorthwest = "Taiwan Northwest"; + + /// + /// Name of the Azure Austria East region in the Azure Cosmos DB service. + /// + internal const string AustriaEast = "Austria East"; + + /// + /// Name of the Azure New Zealand North region in the Azure Cosmos DB service. + /// + internal const string NewZealandNorth = "New Zealand North"; } -} \ No newline at end of file +} + + + + + + + diff --git a/Microsoft.Azure.Cosmos/src/direct/NotFoundException.cs b/Microsoft.Azure.Cosmos/src/direct/NotFoundException.cs index 7eadfeba21..c7b493cdee 100644 --- a/Microsoft.Azure.Cosmos/src/direct/NotFoundException.cs +++ b/Microsoft.Azure.Cosmos/src/direct/NotFoundException.cs @@ -36,14 +36,14 @@ public NotFoundException(string message, Exception innerException) } - public NotFoundException(Exception innerException) - : this(RMResources.NotFound, innerException, null) + public NotFoundException(Exception innerException, bool traceCallStack = true) + : this(RMResources.NotFound, innerException, null, traceCallStack: traceCallStack) { } - public NotFoundException(Exception innerException, SubStatusCodes subStatusCode) - : this(RMResources.NotFound, innerException, headers: null, subStatusCode: subStatusCode) + public NotFoundException(Exception innerException, SubStatusCodes subStatusCode, bool traceCallStack = true) + : this(RMResources.NotFound, innerException, headers: null, subStatusCode: subStatusCode, traceCallStack: traceCallStack) { } @@ -53,8 +53,8 @@ public NotFoundException(string message, INameValueCollection headers, Uri reque SetDescription(); } - public NotFoundException(string message, Exception innerException, HttpResponseHeaders headers, Uri requestUri = null, SubStatusCodes? subStatusCode = null) - : base(message, innerException, headers, HttpStatusCode.NotFound, requestUri, subStatusCode) + public NotFoundException(string message, Exception innerException, HttpResponseHeaders headers, Uri requestUri = null, SubStatusCodes? subStatusCode = null, bool traceCallStack = true) + : base(message, innerException, headers, HttpStatusCode.NotFound, requestUri, subStatusCode, traceCallStack) { SetDescription(); } diff --git a/Microsoft.Azure.Cosmos/src/direct/OperationType.cs b/Microsoft.Azure.Cosmos/src/direct/OperationType.cs index fb4fedfff4..65848b4c88 100644 --- a/Microsoft.Azure.Cosmos/src/direct/OperationType.cs +++ b/Microsoft.Azure.Cosmos/src/direct/OperationType.cs @@ -114,13 +114,13 @@ internal enum OperationType // These names make it unclear what they map to in RequestOperationType. ExecuteJavaScript = -2, + GetConfiguration = -8, #if !COSMOSCLIENT ForceConfigRefresh = -3, ReportThroughputUtilization = -4, ServiceReservation = -5, ControllerBatchReportCharges = -6, ControllerBatchGetOutput = -7, - GetConfiguration = -8, GetStorageAccountKey = -9, GetFederationConfigurations = -10, GetDatabaseAccountConfigurations = -11, @@ -135,6 +135,9 @@ internal enum OperationType GetCustomerManagedKeyStatus = -20, GetBatchCustomerManagedKeyStatus = -21, XPDatabaseAccountMetaData = -22, + ControllerBatchAutoscaleRUsConsumption = -23, + ControllerBatchGetAutoscaleAggregateOutput = -24, + GetDekProperties = -25, #endif } @@ -218,10 +221,10 @@ public static bool IsReadOperation(this OperationType type) type == OperationType.SqlQuery || type == OperationType.Head || type == OperationType.HeadFeed || + type == OperationType.MetadataCheckAccess || type == OperationType.QueryPlan #if !COSMOSCLIENT || - type == OperationType.MetadataCheckAccess || type == OperationType.GetStorageAuthToken #endif ; diff --git a/Microsoft.Azure.Cosmos/src/direct/PartitionKeyInternal.cs b/Microsoft.Azure.Cosmos/src/direct/PartitionKeyInternal.cs index ce5ae5a0eb..daa3cd144b 100644 --- a/Microsoft.Azure.Cosmos/src/direct/PartitionKeyInternal.cs +++ b/Microsoft.Azure.Cosmos/src/direct/PartitionKeyInternal.cs @@ -720,75 +720,20 @@ public static string ToHex(byte[] bytes, int start, int length) return new string(result); } } + + public static string GetMiddleRangeEffectivePartitionKey(string minInclusive, string maxExclusive, PartitionKeyDefinition partitionKeyDefinition) => partitionKeyDefinition.Kind switch + { + PartitionKind.Hash => GetMiddleRangeEffectivePartitionKeyForHash(minInclusive, maxExclusive, partitionKeyDefinition), + PartitionKind.MultiHash => GetMiddleRangeEffectivePartitionKeyForMultiHash(minInclusive, maxExclusive, partitionKeyDefinition), + _ => throw new InternalServerErrorException($"Unexpected PartitionKey Kind {partitionKeyDefinition.Kind}. Can determine middle of range only for hash and multihash partitioning.") + }; - public static string GetMiddleRangeEffectivePartitionKey(string minInclusive, string maxExclusive, PartitionKeyDefinition partitionKeyDefinition) + private static string GetMiddleRangeEffectivePartitionKeyForHash(string minInclusive, string maxExclusive, PartitionKeyDefinition partitionKeyDefinition) { - switch (partitionKeyDefinition.Kind) + switch (partitionKeyDefinition.Version ?? PartitionKeyDefinitionVersion.V1) { - case PartitionKind.Hash: - { - switch (partitionKeyDefinition.Version ?? PartitionKeyDefinitionVersion.V1) - { - case PartitionKeyDefinitionVersion.V2: - { - Int128 min = 0; - if (!minInclusive.Equals(MinimumInclusiveEffectivePartitionKey, StringComparison.Ordinal)) - { - byte[] minBytes = PartitionKeyInternal.HexStringToByteArray(minInclusive); - Array.Reverse(minBytes); - min = new Int128(minBytes); - } - - Int128 max = MaxHashV2Value; - if (!maxExclusive.Equals(MaximumExclusiveEffectivePartitionKey, StringComparison.Ordinal)) - { - byte[] maxBytes = PartitionKeyInternal.HexStringToByteArray(maxExclusive); - Array.Reverse(maxBytes); - max = new Int128(maxBytes); - } - - byte[] midBytes = (min + (max - min) / 2).Bytes; - Array.Reverse(midBytes); - return HexConvert.ToHex(midBytes, 0, midBytes.Length); - } - case PartitionKeyDefinitionVersion.V1: - { - long min = 0; - long max = uint.MaxValue; - if (!minInclusive.Equals(MinimumInclusiveEffectivePartitionKey, StringComparison.Ordinal)) - { -#pragma warning disable 0612 - min = (long)((NumberPartitionKeyComponent)FromHexEncodedBinaryString(minInclusive).Components[0]).Value; -#pragma warning restore 0612 - } - - if (!maxExclusive.Equals(MaximumExclusiveEffectivePartitionKey, StringComparison.Ordinal)) - { -#pragma warning disable 0612 - max = (long)((NumberPartitionKeyComponent)FromHexEncodedBinaryString(maxExclusive).Components[0]).Value; -#pragma warning restore 0612 - } - - return ToHexEncodedBinaryString(new[] { new NumberPartitionKeyComponent((min + max) / 2) }); - } - - default: - throw new InternalServerErrorException("Unexpected PartitionKeyDefinitionVersion"); - } - } - - case PartitionKind.MultiHash: + case PartitionKeyDefinitionVersion.V2: { - if (partitionKeyDefinition.Version == PartitionKeyDefinitionVersion.V1) - { - throw new InternalServerErrorException("Unexpected PartitionKeyDefinitionVersion " + partitionKeyDefinition.Version + " for MultiHash Partition kind"); - } - - //Extract only the first EPK from a multi-path partition key. - //[Given this is invoked for equal range Split, we do not want to split a subrange of a top-level key] - minInclusive = minInclusive.Substring(0, Math.Min(minInclusive.Length, HashV2EPKLength)); - maxExclusive = maxExclusive.Substring(0, Math.Min(maxExclusive.Length, HashV2EPKLength)); - Int128 min = 0; if (!minInclusive.Equals(MinimumInclusiveEffectivePartitionKey, StringComparison.Ordinal)) { @@ -809,10 +754,115 @@ public static string GetMiddleRangeEffectivePartitionKey(string minInclusive, st Array.Reverse(midBytes); return HexConvert.ToHex(midBytes, 0, midBytes.Length); } + case PartitionKeyDefinitionVersion.V1: + { + long min = 0; + long max = uint.MaxValue; + if (!minInclusive.Equals(MinimumInclusiveEffectivePartitionKey, StringComparison.Ordinal)) + { +#pragma warning disable 0612 + min = (long)((NumberPartitionKeyComponent)FromHexEncodedBinaryString(minInclusive).Components[0]).Value; +#pragma warning restore 0612 + } + + if (!maxExclusive.Equals(MaximumExclusiveEffectivePartitionKey, StringComparison.Ordinal)) + { +#pragma warning disable 0612 + max = (long)((NumberPartitionKeyComponent)FromHexEncodedBinaryString(maxExclusive).Components[0]).Value; +#pragma warning restore 0612 + } + + return ToHexEncodedBinaryString(new[] { new NumberPartitionKeyComponent((min + max) / 2) }); + } default: - throw new InternalServerErrorException("Unexpected PartitionKey Kind. Can determine middle of range only for hash and multihash partitioning."); + throw new InternalServerErrorException("Unexpected PartitionKeyDefinitionVersion"); + } + } + + private static IReadOnlyList GetHashValueFromEPKForMultiHash(string epkValueString, PartitionKeyDefinition partitionKeyDefinition) + { + IList hashes = new List(); + int pathCountInEPK = (epkValueString.Length + (HashV2EPKLength - 1))/HashV2EPKLength; + + for (int index = 0; index < partitionKeyDefinition.Paths.Count; index++) + { + if (index < pathCountInEPK) + { + int startIndexForEPK = index * HashV2EPKLength; //Offset it by the length of previously read EPK(s), + + // All EPK value lengths are HashV2EPKLength, however the end EPK value is 'FF' + // FF is a special marker which appears only as a suffix + if (epkValueString.Length - startIndexForEPK < HashV2EPKLength) + { + hashes.Add(MaxHashV2Value); + } + else + { + // Extract the EPK for nth key + string epkSubPart = epkValueString.Substring(startIndexForEPK, HashV2EPKLength); + byte[] maxBytes = PartitionKeyInternal.HexStringToByteArray(epkSubPart); + Array.Reverse(maxBytes); + hashes.Add(new Int128(maxBytes)); + } + } + else // The EPK has less values than Paths.Count in the PkDef, this is empty partitionkey. + { + hashes.Add(0); + } + } + + return (IReadOnlyList)hashes; + } + + //Refer docs/design/elasticity/SubpartitioningContainerSplit.md for implementation detail + private static string GetMiddleRangeEffectivePartitionKeyForMultiHash(string minInclusive, string maxExclusive, PartitionKeyDefinition partitionKeyDefinition) + { + if (partitionKeyDefinition.Version == PartitionKeyDefinitionVersion.V1) + { + throw new InternalServerErrorException("Unexpected PartitionKeyDefinitionVersion " + partitionKeyDefinition.Version + " for MultiHash Partition kind"); + } + + IReadOnlyList minInclusiveHashValues = GetHashValueFromEPKForMultiHash(minInclusive, partitionKeyDefinition); + IReadOnlyList maxExclusiveHashValues = GetHashValueFromEPKForMultiHash(maxExclusive, partitionKeyDefinition); + IList midPointHashValues = new List(partitionKeyDefinition.Paths.Count); + + for (int index = 0; index < partitionKeyDefinition.Paths.Count; index++) + { + Int128 min = minInclusiveHashValues[index]; + Int128 max = maxExclusiveHashValues[index]; + + if (min == max || min + 1 == max) + { + midPointHashValues.Add(min); + } + else + { + /* It is possible, for Example if MinEPK, MaxEPK are [20, 40], [21, 10] respectively, + * the nMinEPKCurrentSubRange = 40 and nMaxEPKCurrentSubRange = 10 + * Since in the above step we are already setting 20 to be first level midPoint, + * for a valid second level midPoint we must look for it the range [40, HashV2Max] + */ + if (min > max) + { + max = MaxHashV2Value; + } + + Int128 midValue = (min + (max - min) / 2); + midPointHashValues.Add(midValue); + break; + } } + + StringBuilder midPointEPKBuilder = new StringBuilder() ; + foreach (Int128 value in midPointHashValues) + { + byte[] midBytes = value.Bytes; + Array.Reverse(midBytes); + midPointEPKBuilder.Append(HexConvert.ToHex(midBytes, 0, midBytes.Length)); + } + + return midPointEPKBuilder.ToString(); } public static string[] GetNEqualRangeEffectivePartitionKeys( diff --git a/Microsoft.Azure.Cosmos/src/direct/PartitionKeyRange.cs b/Microsoft.Azure.Cosmos/src/direct/PartitionKeyRange.cs index 122837d1e1..17f3829476 100644 --- a/Microsoft.Azure.Cosmos/src/direct/PartitionKeyRange.cs +++ b/Microsoft.Azure.Cosmos/src/direct/PartitionKeyRange.cs @@ -95,6 +95,19 @@ internal PartitionKeyRangeStatus Status } } + [JsonProperty(PropertyName = Constants.Properties.Lsn)] + public long LSN + { + get + { + return base.GetValue(Constants.Properties.Lsn); + } + set + { + base.SetValue(Constants.Properties.Lsn, value); + } + } + /// /// Contains ids or parent ranges in the Azure Cosmos DB service. /// For example if range with id '1' splits into '2' and '3', diff --git a/Microsoft.Azure.Cosmos/src/direct/Paths.cs b/Microsoft.Azure.Cosmos/src/direct/Paths.cs index 92ba936786..ef077ac631 100644 --- a/Microsoft.Azure.Cosmos/src/direct/Paths.cs +++ b/Microsoft.Azure.Cosmos/src/direct/Paths.cs @@ -26,6 +26,7 @@ internal static class Paths public const string Operations_GetStorageAccountKey = "getstorageaccountkey"; public const string Operations_GetStorageAccountSas = "getstorageaccountsas"; public const string Operations_GetUnwrappedDek = "getunwrappeddek"; + public const string Operations_GetDekProperties = "getdekproperties"; public const string Operations_GetCustomerManagedKeyStatus = "getcustomermanagedkeystatus"; public const string Operations_ReadReplicaFromMasterPartition = "readreplicafrommasterpartition"; public const string Operations_ReadReplicaFromServerPartition = "readreplicafromserverpartition"; @@ -308,6 +309,8 @@ internal static class Paths // controller service public const string ControllerOperations_BatchGetOutput = "controllerbatchgetoutput"; public const string ControllerOperations_BatchReportCharges = "controllerbatchreportcharges"; + public const string ControllerOperations_BatchAutoscaleRUsConsumption = "controllerbatchautoscalerusconsumption"; + public const string ControllerOperations_BatchGetAutoscaleAggregateOutput = "controllerbatchgetautoscaleaggregateoutput"; // vector clock public const string VectorClockPathSegment = "vectorclock"; diff --git a/Microsoft.Azure.Cosmos/src/direct/PathsHelper.cs b/Microsoft.Azure.Cosmos/src/direct/PathsHelper.cs index 02c3c758c5..c1783aa89e 100644 --- a/Microsoft.Azure.Cosmos/src/direct/PathsHelper.cs +++ b/Microsoft.Azure.Cosmos/src/direct/PathsHelper.cs @@ -1289,6 +1289,10 @@ public static string GeneratePath(ResourceType resourceType, string ownerOrResou { return Paths.DatabaseAccountSegment; } + else if (resourceType == ResourceType.DatabaseAccount && operationType == OperationType.MetadataCheckAccess) + { + return Paths.OperationsPathSegment + "/" + Paths.Operations_MetadataCheckAccess; + } else if (resourceType == ResourceType.DatabaseAccount) { return Paths.DatabaseAccountSegment + "/" + ownerOrResourceId; @@ -1447,6 +1451,10 @@ public static string GenerateRootOperationPath(OperationType operationType) return Paths.OperationsPathSegment + "/" + Paths.ControllerOperations_BatchGetOutput; case OperationType.ControllerBatchReportCharges: return Paths.OperationsPathSegment + "/" + Paths.ControllerOperations_BatchReportCharges; + case OperationType.ControllerBatchAutoscaleRUsConsumption: + return Paths.OperationsPathSegment + "/" + Paths.ControllerOperations_BatchAutoscaleRUsConsumption; + case OperationType.ControllerBatchGetAutoscaleAggregateOutput: + return Paths.OperationsPathSegment + "/" + Paths.ControllerOperations_BatchGetAutoscaleAggregateOutput; case OperationType.GetConfiguration: return Paths.OperationsPathSegment + "/" + Paths.Operations_GetConfiguration; case OperationType.GetFederationConfigurations: @@ -1465,6 +1473,8 @@ public static string GenerateRootOperationPath(OperationType operationType) return Paths.OperationsPathSegment + "/" + Paths.Operations_GetStorageAccountSas; case OperationType.GetUnwrappedDek: return Paths.OperationsPathSegment + "/" + Paths.Operations_GetUnwrappedDek; + case OperationType.GetDekProperties: + return Paths.OperationsPathSegment + "/" + Paths.Operations_GetDekProperties; case OperationType.GetCustomerManagedKeyStatus: return Paths.OperationsPathSegment + "/" + Paths.Operations_GetCustomerManagedKeyStatus; case OperationType.ReadReplicaFromMasterPartition: @@ -1556,6 +1566,8 @@ private static bool IsRootOperation(in StringSegment operationSegment, in String operationTypeSegment.Equals(Paths.ReplicaOperations_BatchReportThroughputUtilization, StringComparison.OrdinalIgnoreCase) || operationTypeSegment.Equals(Paths.ControllerOperations_BatchGetOutput, StringComparison.OrdinalIgnoreCase) || operationTypeSegment.Equals(Paths.ControllerOperations_BatchReportCharges, StringComparison.OrdinalIgnoreCase) || + operationTypeSegment.Equals(Paths.ControllerOperations_BatchAutoscaleRUsConsumption, StringComparison.OrdinalIgnoreCase) || + operationTypeSegment.Equals(Paths.ControllerOperations_BatchGetAutoscaleAggregateOutput, StringComparison.OrdinalIgnoreCase) || operationTypeSegment.Equals(Paths.Operations_GetFederationConfigurations, StringComparison.OrdinalIgnoreCase) || operationTypeSegment.Equals(Paths.Operations_GetStorageServiceConfigurations, StringComparison.OrdinalIgnoreCase) || operationTypeSegment.Equals(Paths.Operations_GetConfiguration, StringComparison.OrdinalIgnoreCase) || @@ -1564,11 +1576,13 @@ private static bool IsRootOperation(in StringSegment operationSegment, in String operationTypeSegment.Equals(Paths.Operations_GetDatabaseAccountConfigurations, StringComparison.OrdinalIgnoreCase) || operationTypeSegment.Equals(Paths.Operations_XPDatabaseAccountMetaData, StringComparison.OrdinalIgnoreCase) || operationTypeSegment.Equals(Paths.Operations_GetUnwrappedDek, StringComparison.OrdinalIgnoreCase) || + operationTypeSegment.Equals(Paths.Operations_GetDekProperties, StringComparison.OrdinalIgnoreCase) || operationTypeSegment.Equals(Paths.Operations_GetCustomerManagedKeyStatus, StringComparison.OrdinalIgnoreCase) || operationTypeSegment.Equals(Paths.Operations_ReadReplicaFromMasterPartition, StringComparison.OrdinalIgnoreCase) || operationTypeSegment.Equals(Paths.Operations_ReadReplicaFromServerPartition, StringComparison.OrdinalIgnoreCase) || operationTypeSegment.Equals(Paths.Operations_MasterInitiatedProgressCoordination, StringComparison.OrdinalIgnoreCase) || - operationTypeSegment.Equals(Paths.Operations_GetAadGroups, StringComparison.OrdinalIgnoreCase); + operationTypeSegment.Equals(Paths.Operations_GetAadGroups, StringComparison.OrdinalIgnoreCase) || + operationTypeSegment.Equals(Paths.Operations_MetadataCheckAccess, StringComparison.OrdinalIgnoreCase); } private static bool IsTopLevelOperationOperation(in StringSegment replicaSegment, in StringSegment addressSegment) diff --git a/Microsoft.Azure.Cosmos/src/direct/PerfCounters.cs b/Microsoft.Azure.Cosmos/src/direct/PerfCounters.cs index d2f409bc3b..77d894adad 100644 --- a/Microsoft.Azure.Cosmos/src/direct/PerfCounters.cs +++ b/Microsoft.Azure.Cosmos/src/direct/PerfCounters.cs @@ -27,8 +27,6 @@ internal sealed class PerfCounters : IDisposable private PerformanceCounter currentFrontendConnections; - private PerformanceCounter fabricResolveServiceFailures; - private PerformanceCounter queryRequestsPerSec; private PerformanceCounter triggerRequestsPerSec; @@ -47,10 +45,6 @@ internal sealed class PerfCounters : IDisposable private PerformanceCounter backendConnectionOpenAverageLatencyBase; - private PerformanceCounter fabricResolveServiceAverageLatency; - - private PerformanceCounter fabricResolveServiceAverageLatencyBase; - private PerformanceCounter routingFailures; private PerformanceCounter backendConnectionOpenFailuresDueToSynRetransmitPerSecond; @@ -119,14 +113,6 @@ public PerformanceCounter CurrentFrontendConnections } } - public PerformanceCounter FabricResolveServiceFailures - { - get - { - return this.fabricResolveServiceFailures; - } - } - public PerformanceCounter QueryRequestsPerSec { get @@ -199,22 +185,6 @@ public PerformanceCounter BackendConnectionOpenAverageLatencyBase } } - public PerformanceCounter FabricResolveServiceAverageLatency - { - get - { - return this.fabricResolveServiceAverageLatency; - } - } - - public PerformanceCounter FabricResolveServiceAverageLatencyBase - { - get - { - return this.fabricResolveServiceAverageLatencyBase; - } - } - public PerformanceCounter RoutingFailures { get @@ -370,9 +340,6 @@ public void InitializePerfCounters() this.currentFrontendConnections = new PerformanceCounter(this.performanceCategory, "Current Frontend Connections", false); this.currentFrontendConnections.RawValue = 0; - this.fabricResolveServiceFailures = new PerformanceCounter(this.performanceCategory, "Fabric Resolve Service Failures", false); - this.fabricResolveServiceFailures.RawValue = 0; - this.queryRequestsPerSec = new PerformanceCounter(this.performanceCategory, "Query Requests/sec", false); this.queryRequestsPerSec.RawValue = 0; @@ -400,12 +367,6 @@ public void InitializePerfCounters() this.backendConnectionOpenAverageLatencyBase = new PerformanceCounter(this.performanceCategory, "Backend Connection Open Average Latency Base", false); this.backendConnectionOpenAverageLatencyBase.RawValue = 0; - this.fabricResolveServiceAverageLatency = new PerformanceCounter(this.performanceCategory, "Fabric Resolve Service Average Latency", false); - this.fabricResolveServiceAverageLatency.RawValue = 0; - - this.fabricResolveServiceAverageLatencyBase = new PerformanceCounter(this.performanceCategory, "Fabric Resolve Service Average Latency Base", false); - this.fabricResolveServiceAverageLatencyBase.RawValue = 0; - this.routingFailures = new PerformanceCounter(this.performanceCategory, "Routing Failures", false); this.routingFailures.RawValue = 0; @@ -432,8 +393,6 @@ public void Dispose() using (this.currentFrontendConnections) { } - using (this.fabricResolveServiceFailures) { } - using (this.queryRequestsPerSec) { } using (this.triggerRequestsPerSec) { } @@ -452,10 +411,6 @@ public void Dispose() using (this.backendConnectionOpenAverageLatencyBase) { } - using (this.fabricResolveServiceAverageLatency) { } - - using (this.fabricResolveServiceAverageLatencyBase) { } - using (this.routingFailures) { } using (this.backendConnectionOpenFailuresDueToSynRetransmitPerSecond) { } diff --git a/Microsoft.Azure.Cosmos/src/direct/PerformanceActivities.cs b/Microsoft.Azure.Cosmos/src/direct/PerformanceActivities.cs index 6214467483..59ad2c2b0c 100644 --- a/Microsoft.Azure.Cosmos/src/direct/PerformanceActivities.cs +++ b/Microsoft.Azure.Cosmos/src/direct/PerformanceActivities.cs @@ -3,13 +3,6 @@ //------------------------------------------------------------ namespace Microsoft.Azure.Documents { - internal sealed class ResolveFabricPerformanceActivity : PerformanceActivity - { - public ResolveFabricPerformanceActivity() - : base(null, null, PerfCounters.Counters.FabricResolveServiceFailures, PerfCounters.Counters.FabricResolveServiceAverageLatency, PerfCounters.Counters.FabricResolveServiceAverageLatencyBase, "ResolveFabric") - { } - } - internal sealed class OpenConnectionPerformanceActivity : PerformanceActivity { public OpenConnectionPerformanceActivity() diff --git a/Microsoft.Azure.Cosmos/src/direct/PreconditionFailedException.cs b/Microsoft.Azure.Cosmos/src/direct/PreconditionFailedException.cs index f6e81d5844..96273c0302 100644 --- a/Microsoft.Azure.Cosmos/src/direct/PreconditionFailedException.cs +++ b/Microsoft.Azure.Cosmos/src/direct/PreconditionFailedException.cs @@ -8,6 +8,7 @@ namespace Microsoft.Azure.Documents using System.Net.Http.Headers; using System.Runtime.Serialization; using Microsoft.Azure.Documents.Collections; + using Newtonsoft.Json; [Serializable] internal sealed class PreconditionFailedException : DocumentClientException @@ -60,6 +61,7 @@ public PreconditionFailedException( } #if !NETSTANDARD16 + [JsonConstructor] private PreconditionFailedException(SerializationInfo info, StreamingContext context) : base(info, context, HttpStatusCode.PreconditionFailed) { diff --git a/Microsoft.Azure.Cosmos/src/direct/RegionProximityUtil.cs b/Microsoft.Azure.Cosmos/src/direct/RegionProximityUtil.cs index 76ade3e8e1..7bfb3d9b4e 100644 --- a/Microsoft.Azure.Cosmos/src/direct/RegionProximityUtil.cs +++ b/Microsoft.Azure.Cosmos/src/direct/RegionProximityUtil.cs @@ -104,6 +104,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 2 }, { LocationNames.AustraliaEast, 6 }, { LocationNames.AustraliaSoutheast, 18 }, + { LocationNames.AustriaEast, 240 }, { LocationNames.BrazilSouth, 314 }, { LocationNames.BrazilSoutheast, 314 }, { LocationNames.CanadaCentral, 204 }, @@ -122,9 +123,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 242 }, { LocationNames.FranceSouth, 230 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 254 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 246 }, { LocationNames.IsraelCentral, 168 }, { LocationNames.ItalyNorth, 240 }, @@ -136,6 +135,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 148 }, { LocationNames.MalaysiaSouth, 94 }, { LocationNames.MexicoCentral, 162 }, + { LocationNames.NewZealandNorth, 100 }, { LocationNames.NorthCentralUS, 192 }, { LocationNames.NorthEurope, 262 }, { LocationNames.NorwayEast, 272 }, @@ -147,10 +147,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 174 }, { LocationNames.SoutheastAsia, 94 }, { LocationNames.SouthIndia, 126 }, + { LocationNames.SpainCentral, 242 }, { LocationNames.SwedenCentral, 272 }, { LocationNames.SwedenSouth, 272 }, { LocationNames.SwitzerlandNorth, 240 }, { LocationNames.SwitzerlandWest, 236 }, + { LocationNames.TaiwanNorth, 120 }, + { LocationNames.TaiwanNorthwest, 120 }, { LocationNames.UAECentral, 168 }, { LocationNames.UAENorth, 168 }, { LocationNames.UKSouth, 250 }, @@ -183,6 +186,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 0 }, { LocationNames.AustraliaEast, 6 }, { LocationNames.AustraliaSoutheast, 18 }, + { LocationNames.AustriaEast, 240 }, { LocationNames.BrazilSouth, 313 }, { LocationNames.BrazilSoutheast, 313 }, { LocationNames.CanadaCentral, 204 }, @@ -201,9 +205,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 242 }, { LocationNames.FranceSouth, 230 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 256 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 246 }, { LocationNames.IsraelCentral, 168 }, { LocationNames.ItalyNorth, 240 }, @@ -215,6 +217,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 148 }, { LocationNames.MalaysiaSouth, 92 }, { LocationNames.MexicoCentral, 162 }, + { LocationNames.NewZealandNorth, 2 }, { LocationNames.NorthCentralUS, 192 }, { LocationNames.NorthEurope, 262 }, { LocationNames.NorwayEast, 272 }, @@ -226,10 +229,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 174 }, { LocationNames.SoutheastAsia, 92 }, { LocationNames.SouthIndia, 124 }, + { LocationNames.SpainCentral, 242 }, { LocationNames.SwedenCentral, 272 }, { LocationNames.SwedenSouth, 272 }, { LocationNames.SwitzerlandNorth, 240 }, { LocationNames.SwitzerlandWest, 236 }, + { LocationNames.TaiwanNorth, 120 }, + { LocationNames.TaiwanNorthwest, 120 }, { LocationNames.UAECentral, 168 }, { LocationNames.UAENorth, 168 }, { LocationNames.UKSouth, 248 }, @@ -262,6 +268,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 6 }, { LocationNames.AustraliaEast, 0 }, { LocationNames.AustraliaSoutheast, 14 }, + { LocationNames.AustriaEast, 236 }, { LocationNames.BrazilSouth, 308 }, { LocationNames.BrazilSoutheast, 308 }, { LocationNames.CanadaCentral, 200 }, @@ -280,9 +287,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 238 }, { LocationNames.FranceSouth, 224 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 250 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 240 }, { LocationNames.IsraelCentral, 164 }, { LocationNames.ItalyNorth, 236 }, @@ -294,6 +299,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 143 }, { LocationNames.MalaysiaSouth, 88 }, { LocationNames.MexicoCentral, 158 }, + { LocationNames.NewZealandNorth, 6 }, { LocationNames.NorthCentralUS, 187 }, { LocationNames.NorthEurope, 258 }, { LocationNames.NorwayEast, 266 }, @@ -305,10 +311,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 170 }, { LocationNames.SoutheastAsia, 88 }, { LocationNames.SouthIndia, 120 }, + { LocationNames.SpainCentral, 238 }, { LocationNames.SwedenCentral, 266 }, { LocationNames.SwedenSouth, 266 }, { LocationNames.SwitzerlandNorth, 236 }, { LocationNames.SwitzerlandWest, 232 }, + { LocationNames.TaiwanNorth, 116 }, + { LocationNames.TaiwanNorthwest, 116 }, { LocationNames.UAECentral, 164 }, { LocationNames.UAENorth, 163 }, { LocationNames.UKSouth, 246 }, @@ -341,6 +350,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 18 }, { LocationNames.AustraliaEast, 14 }, { LocationNames.AustraliaSoutheast, 0 }, + { LocationNames.AustriaEast, 232 }, { LocationNames.BrazilSouth, 320 }, { LocationNames.BrazilSoutheast, 320 }, { LocationNames.CanadaCentral, 210 }, @@ -359,9 +369,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 235 }, { LocationNames.FranceSouth, 222 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 246 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 238 }, { LocationNames.IsraelCentral, 160 }, { LocationNames.ItalyNorth, 232 }, @@ -373,6 +381,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 140 }, { LocationNames.MalaysiaSouth, 85 }, { LocationNames.MexicoCentral, 168 }, + { LocationNames.NewZealandNorth, 18 }, { LocationNames.NorthCentralUS, 198 }, { LocationNames.NorthEurope, 260 }, { LocationNames.NorwayEast, 264 }, @@ -384,10 +393,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 180 }, { LocationNames.SoutheastAsia, 85 }, { LocationNames.SouthIndia, 118 }, + { LocationNames.SpainCentral, 235 }, { LocationNames.SwedenCentral, 264 }, { LocationNames.SwedenSouth, 264 }, { LocationNames.SwitzerlandNorth, 232 }, { LocationNames.SwitzerlandWest, 228 }, + { LocationNames.TaiwanNorth, 118 }, + { LocationNames.TaiwanNorthwest, 118 }, { LocationNames.UAECentral, 160 }, { LocationNames.UAENorth, 160 }, { LocationNames.UKSouth, 242 }, @@ -412,6 +424,88 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUS2EUAP, long.MaxValue }, } }, + { + LocationNames.AustriaEast, + new Dictionary() + { + { LocationNames.AustraliaCentral, 240 }, + { LocationNames.AustraliaCentral2, 240 }, + { LocationNames.AustraliaEast, 236 }, + { LocationNames.AustraliaSoutheast, 232 }, + { LocationNames.AustriaEast, 0 }, + { LocationNames.BrazilSouth, 198 }, + { LocationNames.BrazilSoutheast, 198 }, + { LocationNames.CanadaCentral, 104 }, + { LocationNames.CanadaEast, 114 }, + { LocationNames.CentralIndia, 112 }, + { LocationNames.CentralUS, 112 }, + { LocationNames.ChinaEast, long.MaxValue }, + { LocationNames.ChinaEast2, long.MaxValue }, + { LocationNames.ChinaEast3, long.MaxValue }, + { LocationNames.ChinaNorth, long.MaxValue }, + { LocationNames.ChinaNorth2, long.MaxValue }, + { LocationNames.ChinaNorth3, long.MaxValue }, + { LocationNames.EastAsia, 182 }, + { LocationNames.EastUS, 92 }, + { LocationNames.EastUS2, 94 }, + { LocationNames.EastUSSLV, long.MaxValue }, + { LocationNames.FranceCentral, 14 }, + { LocationNames.FranceSouth, 10 }, + { LocationNames.GermanyNorth, 16 }, + { LocationNames.GermanyWestCentral, 6 }, + { LocationNames.IsraelCentral, 106 }, + { LocationNames.ItalyNorth, 100 }, + { LocationNames.JapanEast, 216 }, + { LocationNames.JapanWest, 216 }, + { LocationNames.JioIndiaCentral, 112 }, + { LocationNames.JioIndiaWest, 112 }, + { LocationNames.KoreaCentral, 210 }, + { LocationNames.KoreaSouth, 204 }, + { LocationNames.MalaysiaSouth, 148 }, + { LocationNames.MexicoCentral, 154 }, + { LocationNames.NewZealandNorth, 240 }, + { LocationNames.NorthCentralUS, 110 }, + { LocationNames.NorthEurope, 31 }, + { LocationNames.NorwayEast, 32 }, + { LocationNames.NorwayWest, 26 }, + { LocationNames.PolandCentral, 12 }, + { LocationNames.QatarCentral, 106 }, + { LocationNames.SouthAfricaNorth, 172 }, + { LocationNames.SouthAfricaWest, 162 }, + { LocationNames.SouthCentralUS, 118 }, + { LocationNames.SoutheastAsia, 148 }, + { LocationNames.SouthIndia, 126 }, + { LocationNames.SpainCentral, 14 }, + { LocationNames.SwedenCentral, 32 }, + { LocationNames.SwedenSouth, 255 }, + { LocationNames.SwitzerlandNorth, 100 }, + { LocationNames.SwitzerlandWest, 4 }, + { LocationNames.TaiwanNorth, 182 }, + { LocationNames.TaiwanNorthwest, 182 }, + { LocationNames.UAECentral, 106 }, + { LocationNames.UAENorth, 108 }, + { LocationNames.UKSouth, 20 }, + { LocationNames.UKWest, 22 }, + { LocationNames.USDoDCentral, long.MaxValue }, + { LocationNames.USDoDEast, long.MaxValue }, + { LocationNames.USGovArizona, long.MaxValue }, + { LocationNames.USGovTexas, long.MaxValue }, + { LocationNames.USGovVirginia, long.MaxValue }, + { LocationNames.USNatEast, long.MaxValue }, + { LocationNames.USNatWest, long.MaxValue }, + { LocationNames.USSecEast, long.MaxValue }, + { LocationNames.USSecWest, long.MaxValue }, + { LocationNames.USSecWestCentral, long.MaxValue }, + { LocationNames.WestCentralUS, 134 }, + { LocationNames.WestEurope, 12 }, + { LocationNames.WestIndia, 116 }, + { LocationNames.WestUS, 150 }, + { LocationNames.WestUS2, 154 }, + { LocationNames.WestUS3, 154 }, + { LocationNames.CentralUSEUAP, long.MaxValue }, + { LocationNames.EastUS2EUAP, long.MaxValue }, + } + }, { LocationNames.BrazilSouth, new Dictionary() @@ -420,6 +514,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 313 }, { LocationNames.AustraliaEast, 308 }, { LocationNames.AustraliaSoutheast, 320 }, + { LocationNames.AustriaEast, 198 }, { LocationNames.BrazilSouth, 0 }, { LocationNames.BrazilSoutheast, 10 }, { LocationNames.CanadaCentral, 132 }, @@ -438,9 +533,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 186 }, { LocationNames.FranceSouth, 200 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 198 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 192 }, { LocationNames.IsraelCentral, 296 }, { LocationNames.ItalyNorth, 198 }, @@ -452,6 +545,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 306 }, { LocationNames.MalaysiaSouth, 328 }, { LocationNames.MexicoCentral, 182 }, + { LocationNames.NewZealandNorth, 314 }, { LocationNames.NorthCentralUS, 138 }, { LocationNames.NorthEurope, 177 }, { LocationNames.NorwayEast, 208 }, @@ -463,10 +557,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 140 }, { LocationNames.SoutheastAsia, 328 }, { LocationNames.SouthIndia, 314 }, + { LocationNames.SpainCentral, 186 }, { LocationNames.SwedenCentral, 208 }, { LocationNames.SwedenSouth, 208 }, { LocationNames.SwitzerlandNorth, 198 }, { LocationNames.SwitzerlandWest, 202 }, + { LocationNames.TaiwanNorth, 320 }, + { LocationNames.TaiwanNorthwest, 320 }, { LocationNames.UAECentral, 296 }, { LocationNames.UAENorth, 298 }, { LocationNames.UKSouth, 181 }, @@ -499,6 +596,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 313 }, { LocationNames.AustraliaEast, 308 }, { LocationNames.AustraliaSoutheast, 320 }, + { LocationNames.AustriaEast, 198 }, { LocationNames.BrazilSouth, 10 }, { LocationNames.BrazilSoutheast, 0 }, { LocationNames.CanadaCentral, 132 }, @@ -517,9 +615,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 186 }, { LocationNames.FranceSouth, 200 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 198 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 192 }, { LocationNames.IsraelCentral, 296 }, { LocationNames.ItalyNorth, 198 }, @@ -531,6 +627,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 306 }, { LocationNames.MalaysiaSouth, 328 }, { LocationNames.MexicoCentral, 182 }, + { LocationNames.NewZealandNorth, 314 }, { LocationNames.NorthCentralUS, 138 }, { LocationNames.NorthEurope, 177 }, { LocationNames.NorwayEast, 208 }, @@ -542,10 +639,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 140 }, { LocationNames.SoutheastAsia, 328 }, { LocationNames.SouthIndia, 314 }, + { LocationNames.SpainCentral, 186 }, { LocationNames.SwedenCentral, 208 }, { LocationNames.SwedenSouth, 208 }, { LocationNames.SwitzerlandNorth, 198 }, { LocationNames.SwitzerlandWest, 202 }, + { LocationNames.TaiwanNorth, 320 }, + { LocationNames.TaiwanNorthwest, 320 }, { LocationNames.UAECentral, 296 }, { LocationNames.UAENorth, 298 }, { LocationNames.UKSouth, 181 }, @@ -578,6 +678,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 204 }, { LocationNames.AustraliaEast, 200 }, { LocationNames.AustraliaSoutheast, 210 }, + { LocationNames.AustriaEast, 104 }, { LocationNames.BrazilSouth, 132 }, { LocationNames.BrazilSoutheast, 132 }, { LocationNames.CanadaCentral, 0 }, @@ -596,9 +697,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 92 }, { LocationNames.FranceSouth, 106 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 104 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 98 }, { LocationNames.IsraelCentral, 201 }, { LocationNames.ItalyNorth, 104 }, @@ -610,6 +709,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 182 }, { LocationNames.MalaysiaSouth, 216 }, { LocationNames.MexicoCentral, 57 }, + { LocationNames.NewZealandNorth, 204 }, { LocationNames.NorthCentralUS, 14 }, { LocationNames.NorthEurope, 84 }, { LocationNames.NorwayEast, 114 }, @@ -621,10 +721,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 42 }, { LocationNames.SoutheastAsia, 216 }, { LocationNames.SouthIndia, 220 }, + { LocationNames.SpainCentral, 92 }, { LocationNames.SwedenCentral, 114 }, { LocationNames.SwedenSouth, 114 }, { LocationNames.SwitzerlandNorth, 104 }, { LocationNames.SwitzerlandWest, 108 }, + { LocationNames.TaiwanNorth, 196 }, + { LocationNames.TaiwanNorthwest, 196 }, { LocationNames.UAECentral, 201 }, { LocationNames.UAENorth, 204 }, { LocationNames.UKSouth, 86 }, @@ -657,6 +760,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 214 }, { LocationNames.AustraliaEast, 210 }, { LocationNames.AustraliaSoutheast, 220 }, + { LocationNames.AustriaEast, 114 }, { LocationNames.BrazilSouth, 141 }, { LocationNames.BrazilSoutheast, 141 }, { LocationNames.CanadaCentral, 12 }, @@ -675,9 +779,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 102 }, { LocationNames.FranceSouth, 116 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 114 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 108 }, { LocationNames.IsraelCentral, 210 }, { LocationNames.ItalyNorth, 114 }, @@ -689,6 +791,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 192 }, { LocationNames.MalaysiaSouth, 224 }, { LocationNames.MexicoCentral, 66 }, + { LocationNames.NewZealandNorth, 214 }, { LocationNames.NorthCentralUS, 24 }, { LocationNames.NorthEurope, 93 }, { LocationNames.NorwayEast, 124 }, @@ -700,10 +803,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 52 }, { LocationNames.SoutheastAsia, 224 }, { LocationNames.SouthIndia, 230 }, + { LocationNames.SpainCentral, 102 }, { LocationNames.SwedenCentral, 124 }, { LocationNames.SwedenSouth, 124 }, { LocationNames.SwitzerlandNorth, 114 }, { LocationNames.SwitzerlandWest, 118 }, + { LocationNames.TaiwanNorth, 206 }, + { LocationNames.TaiwanNorthwest, 206 }, { LocationNames.UAECentral, 210 }, { LocationNames.UAENorth, 214 }, { LocationNames.UKSouth, 96 }, @@ -736,6 +842,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 144 }, { LocationNames.AustraliaEast, 140 }, { LocationNames.AustraliaSoutheast, 136 }, + { LocationNames.AustriaEast, 112 }, { LocationNames.BrazilSouth, 302 }, { LocationNames.BrazilSoutheast, 302 }, { LocationNames.CanadaCentral, 208 }, @@ -754,9 +861,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 116 }, { LocationNames.FranceSouth, 102 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 128 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 118 }, { LocationNames.IsraelCentral, 30 }, { LocationNames.ItalyNorth, 112 }, @@ -768,6 +873,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 106 }, { LocationNames.MalaysiaSouth, 52 }, { LocationNames.MexicoCentral, 212 }, + { LocationNames.NewZealandNorth, 144 }, { LocationNames.NorthCentralUS, 216 }, { LocationNames.NorthEurope, 137 }, { LocationNames.NorwayEast, 146 }, @@ -779,10 +885,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 224 }, { LocationNames.SoutheastAsia, 52 }, { LocationNames.SouthIndia, 22 }, + { LocationNames.SpainCentral, 116 }, { LocationNames.SwedenCentral, 146 }, { LocationNames.SwedenSouth, 146 }, { LocationNames.SwitzerlandNorth, 112 }, { LocationNames.SwitzerlandWest, 110 }, + { LocationNames.TaiwanNorth, 86 }, + { LocationNames.TaiwanNorthwest, 86 }, { LocationNames.UAECentral, 30 }, { LocationNames.UAENorth, 30 }, { LocationNames.UKSouth, 122 }, @@ -815,6 +924,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 184 }, { LocationNames.AustraliaEast, 180 }, { LocationNames.AustraliaSoutheast, 190 }, + { LocationNames.AustriaEast, 112 }, { LocationNames.BrazilSouth, 146 }, { LocationNames.BrazilSoutheast, 146 }, { LocationNames.CanadaCentral, 21 }, @@ -833,9 +943,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 101 }, { LocationNames.FranceSouth, 110 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 118 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 112 }, { LocationNames.IsraelCentral, 216 }, { LocationNames.ItalyNorth, 112 }, @@ -847,6 +955,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 162 }, { LocationNames.MalaysiaSouth, 194 }, { LocationNames.MexicoCentral, 36 }, + { LocationNames.NewZealandNorth, 184 }, { LocationNames.NorthCentralUS, 8 }, { LocationNames.NorthEurope, 92 }, { LocationNames.NorwayEast, 128 }, @@ -858,10 +967,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 22 }, { LocationNames.SoutheastAsia, 194 }, { LocationNames.SouthIndia, 228 }, + { LocationNames.SpainCentral, 101 }, { LocationNames.SwedenCentral, 128 }, { LocationNames.SwedenSouth, 128 }, { LocationNames.SwitzerlandNorth, 112 }, { LocationNames.SwitzerlandWest, 110 }, + { LocationNames.TaiwanNorth, 176 }, + { LocationNames.TaiwanNorthwest, 176 }, { LocationNames.UAECentral, 216 }, { LocationNames.UAENorth, 218 }, { LocationNames.UKSouth, 96 }, @@ -894,6 +1006,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -912,9 +1025,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -926,6 +1037,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -937,10 +1049,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -973,6 +1088,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -991,9 +1107,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -1005,6 +1119,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -1016,10 +1131,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -1052,6 +1170,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -1070,9 +1189,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -1084,6 +1201,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -1095,10 +1213,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -1131,6 +1252,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -1149,9 +1271,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -1163,6 +1283,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -1174,10 +1295,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -1210,6 +1334,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -1228,9 +1353,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -1242,6 +1365,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -1253,10 +1377,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -1289,6 +1416,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -1307,9 +1435,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -1321,6 +1447,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -1332,10 +1459,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -1368,6 +1498,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 120 }, { LocationNames.AustraliaEast, 116 }, { LocationNames.AustraliaSoutheast, 118 }, + { LocationNames.AustriaEast, 182 }, { LocationNames.BrazilSouth, 320 }, { LocationNames.BrazilSoutheast, 320 }, { LocationNames.CanadaCentral, 196 }, @@ -1386,9 +1517,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 184 }, { LocationNames.FranceSouth, 172 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 196 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 188 }, { LocationNames.IsraelCentral, 110 }, { LocationNames.ItalyNorth, 182 }, @@ -1400,6 +1529,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 60 }, { LocationNames.MalaysiaSouth, 33 }, { LocationNames.MexicoCentral, 140 }, + { LocationNames.NewZealandNorth, 120 }, { LocationNames.NorthCentralUS, 184 }, { LocationNames.NorthEurope, 205 }, { LocationNames.NorwayEast, 214 }, @@ -1411,10 +1541,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 182 }, { LocationNames.SoutheastAsia, 33 }, { LocationNames.SouthIndia, 66 }, + { LocationNames.SpainCentral, 184 }, { LocationNames.SwedenCentral, 214 }, { LocationNames.SwedenSouth, 214 }, { LocationNames.SwitzerlandNorth, 182 }, { LocationNames.SwitzerlandWest, 178 }, + { LocationNames.TaiwanNorth, 100 }, + { LocationNames.TaiwanNorthwest, 100 }, { LocationNames.UAECentral, 110 }, { LocationNames.UAENorth, 109 }, { LocationNames.UKSouth, 192 }, @@ -1447,6 +1580,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 205 }, { LocationNames.AustraliaEast, 200 }, { LocationNames.AustraliaSoutheast, 212 }, + { LocationNames.AustriaEast, 92 }, { LocationNames.BrazilSouth, 118 }, { LocationNames.BrazilSoutheast, 118 }, { LocationNames.CanadaCentral, 25 }, @@ -1465,9 +1599,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 80 }, { LocationNames.FranceSouth, 90 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 91 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 86 }, { LocationNames.IsraelCentral, 189 }, { LocationNames.ItalyNorth, 92 }, @@ -1479,6 +1611,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 186 }, { LocationNames.MalaysiaSouth, 218 }, { LocationNames.MexicoCentral, 58 }, + { LocationNames.NewZealandNorth, 205 }, { LocationNames.NorthCentralUS, 19 }, { LocationNames.NorthEurope, 76 }, { LocationNames.NorwayEast, 101 }, @@ -1490,10 +1623,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 32 }, { LocationNames.SoutheastAsia, 218 }, { LocationNames.SouthIndia, 208 }, + { LocationNames.SpainCentral, 80 }, { LocationNames.SwedenCentral, 101 }, { LocationNames.SwedenSouth, 101 }, { LocationNames.SwitzerlandNorth, 92 }, { LocationNames.SwitzerlandWest, 88 }, + { LocationNames.TaiwanNorth, 199 }, + { LocationNames.TaiwanNorthwest, 199 }, { LocationNames.UAECentral, 189 }, { LocationNames.UAENorth, 192 }, { LocationNames.UKSouth, 74 }, @@ -1526,6 +1662,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 200 }, { LocationNames.AustraliaEast, 196 }, { LocationNames.AustraliaSoutheast, 206 }, + { LocationNames.AustriaEast, 94 }, { LocationNames.BrazilSouth, 122 }, { LocationNames.BrazilSoutheast, 122 }, { LocationNames.CanadaCentral, 28 }, @@ -1544,9 +1681,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 80 }, { LocationNames.FranceSouth, 90 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 94 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 90 }, { LocationNames.IsraelCentral, 190 }, { LocationNames.ItalyNorth, 94 }, @@ -1558,6 +1693,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 182 }, { LocationNames.MalaysiaSouth, 226 }, { LocationNames.MexicoCentral, 68 }, + { LocationNames.NewZealandNorth, 200 }, { LocationNames.NorthCentralUS, 22 }, { LocationNames.NorthEurope, 75 }, { LocationNames.NorwayEast, 104 }, @@ -1569,10 +1705,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 26 }, { LocationNames.SoutheastAsia, 226 }, { LocationNames.SouthIndia, 210 }, + { LocationNames.SpainCentral, 80 }, { LocationNames.SwedenCentral, 104 }, { LocationNames.SwedenSouth, 104 }, { LocationNames.SwitzerlandNorth, 94 }, { LocationNames.SwitzerlandWest, 88 }, + { LocationNames.TaiwanNorth, 210 }, + { LocationNames.TaiwanNorthwest, 210 }, { LocationNames.UAECentral, 190 }, { LocationNames.UAENorth, 194 }, { LocationNames.UKSouth, 78 }, @@ -1605,6 +1744,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -1623,9 +1763,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, 0 }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -1637,6 +1775,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -1648,10 +1787,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, 255 }, { LocationNames.SwedenSouth, 255 }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -1684,6 +1826,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 242 }, { LocationNames.AustraliaEast, 238 }, { LocationNames.AustraliaSoutheast, 235 }, + { LocationNames.AustriaEast, 14 }, { LocationNames.BrazilSouth, 186 }, { LocationNames.BrazilSoutheast, 186 }, { LocationNames.CanadaCentral, 92 }, @@ -1702,9 +1845,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 0 }, { LocationNames.FranceSouth, 11 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 20 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 10 }, { LocationNames.IsraelCentral, 108 }, { LocationNames.ItalyNorth, 14 }, @@ -1716,6 +1857,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 206 }, { LocationNames.MalaysiaSouth, 150 }, { LocationNames.MexicoCentral, 140 }, + { LocationNames.NewZealandNorth, 242 }, { LocationNames.NorthCentralUS, 96 }, { LocationNames.NorthEurope, 27 }, { LocationNames.NorwayEast, 30 }, @@ -1727,10 +1869,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 106 }, { LocationNames.SoutheastAsia, 150 }, { LocationNames.SouthIndia, 128 }, + { LocationNames.SpainCentral, 100 }, { LocationNames.SwedenCentral, 30 }, { LocationNames.SwedenSouth, 30 }, { LocationNames.SwitzerlandNorth, 14 }, { LocationNames.SwitzerlandWest, 10 }, + { LocationNames.TaiwanNorth, 184 }, + { LocationNames.TaiwanNorthwest, 184 }, { LocationNames.UAECentral, 108 }, { LocationNames.UAENorth, 112 }, { LocationNames.UKSouth, 7 }, @@ -1763,6 +1908,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 230 }, { LocationNames.AustraliaEast, 224 }, { LocationNames.AustraliaSoutheast, 222 }, + { LocationNames.AustriaEast, 10 }, { LocationNames.BrazilSouth, 200 }, { LocationNames.BrazilSoutheast, 200 }, { LocationNames.CanadaCentral, 106 }, @@ -1781,9 +1927,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 11 }, { LocationNames.FranceSouth, 0 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 26 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 17 }, { LocationNames.IsraelCentral, 96 }, { LocationNames.ItalyNorth, 10 }, @@ -1795,6 +1939,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 193 }, { LocationNames.MalaysiaSouth, 138 }, { LocationNames.MexicoCentral, 146 }, + { LocationNames.NewZealandNorth, 230 }, { LocationNames.NorthCentralUS, 104 }, { LocationNames.NorthEurope, 31 }, { LocationNames.NorwayEast, 42 }, @@ -1806,10 +1951,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 116 }, { LocationNames.SoutheastAsia, 138 }, { LocationNames.SouthIndia, 114 }, + { LocationNames.SpainCentral, 11 }, { LocationNames.SwedenCentral, 42 }, { LocationNames.SwedenSouth, 42 }, { LocationNames.SwitzerlandNorth, 10 }, { LocationNames.SwitzerlandWest, 8 }, + { LocationNames.TaiwanNorth, 172 }, + { LocationNames.TaiwanNorthwest, 172 }, { LocationNames.UAECentral, 96 }, { LocationNames.UAENorth, 98 }, { LocationNames.UKSouth, 16 }, @@ -1834,85 +1982,6 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUS2EUAP, long.MaxValue }, } }, - { - LocationNames.GermanyCentral, - new Dictionary() - { - { LocationNames.AustraliaCentral, long.MaxValue }, - { LocationNames.AustraliaCentral2, long.MaxValue }, - { LocationNames.AustraliaEast, long.MaxValue }, - { LocationNames.AustraliaSoutheast, long.MaxValue }, - { LocationNames.BrazilSouth, long.MaxValue }, - { LocationNames.BrazilSoutheast, long.MaxValue }, - { LocationNames.CanadaCentral, long.MaxValue }, - { LocationNames.CanadaEast, long.MaxValue }, - { LocationNames.CentralIndia, long.MaxValue }, - { LocationNames.CentralUS, long.MaxValue }, - { LocationNames.ChinaEast, long.MaxValue }, - { LocationNames.ChinaEast2, long.MaxValue }, - { LocationNames.ChinaEast3, long.MaxValue }, - { LocationNames.ChinaNorth, long.MaxValue }, - { LocationNames.ChinaNorth2, long.MaxValue }, - { LocationNames.ChinaNorth3, long.MaxValue }, - { LocationNames.EastAsia, long.MaxValue }, - { LocationNames.EastUS, long.MaxValue }, - { LocationNames.EastUS2, long.MaxValue }, - { LocationNames.EastUSSLV, long.MaxValue }, - { LocationNames.FranceCentral, long.MaxValue }, - { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, 0 }, - { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, 10 }, - { LocationNames.GermanyWestCentral, long.MaxValue }, - { LocationNames.IsraelCentral, long.MaxValue }, - { LocationNames.ItalyNorth, long.MaxValue }, - { LocationNames.JapanEast, long.MaxValue }, - { LocationNames.JapanWest, long.MaxValue }, - { LocationNames.JioIndiaCentral, long.MaxValue }, - { LocationNames.JioIndiaWest, long.MaxValue }, - { LocationNames.KoreaCentral, long.MaxValue }, - { LocationNames.KoreaSouth, long.MaxValue }, - { LocationNames.MalaysiaSouth, long.MaxValue }, - { LocationNames.MexicoCentral, long.MaxValue }, - { LocationNames.NorthCentralUS, long.MaxValue }, - { LocationNames.NorthEurope, long.MaxValue }, - { LocationNames.NorwayEast, long.MaxValue }, - { LocationNames.NorwayWest, long.MaxValue }, - { LocationNames.PolandCentral, long.MaxValue }, - { LocationNames.QatarCentral, long.MaxValue }, - { LocationNames.SouthAfricaNorth, long.MaxValue }, - { LocationNames.SouthAfricaWest, long.MaxValue }, - { LocationNames.SouthCentralUS, long.MaxValue }, - { LocationNames.SoutheastAsia, long.MaxValue }, - { LocationNames.SouthIndia, long.MaxValue }, - { LocationNames.SwedenCentral, long.MaxValue }, - { LocationNames.SwedenSouth, long.MaxValue }, - { LocationNames.SwitzerlandNorth, long.MaxValue }, - { LocationNames.SwitzerlandWest, long.MaxValue }, - { LocationNames.UAECentral, long.MaxValue }, - { LocationNames.UAENorth, long.MaxValue }, - { LocationNames.UKSouth, long.MaxValue }, - { LocationNames.UKWest, long.MaxValue }, - { LocationNames.USDoDCentral, long.MaxValue }, - { LocationNames.USDoDEast, long.MaxValue }, - { LocationNames.USGovArizona, long.MaxValue }, - { LocationNames.USGovTexas, long.MaxValue }, - { LocationNames.USGovVirginia, long.MaxValue }, - { LocationNames.USNatEast, long.MaxValue }, - { LocationNames.USNatWest, long.MaxValue }, - { LocationNames.USSecEast, long.MaxValue }, - { LocationNames.USSecWest, long.MaxValue }, - { LocationNames.USSecWestCentral, long.MaxValue }, - { LocationNames.WestCentralUS, long.MaxValue }, - { LocationNames.WestEurope, long.MaxValue }, - { LocationNames.WestIndia, long.MaxValue }, - { LocationNames.WestUS, long.MaxValue }, - { LocationNames.WestUS2, long.MaxValue }, - { LocationNames.WestUS3, long.MaxValue }, - { LocationNames.CentralUSEUAP, long.MaxValue }, - { LocationNames.EastUS2EUAP, long.MaxValue }, - } - }, { LocationNames.GermanyNorth, new Dictionary() @@ -1921,6 +1990,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 256 }, { LocationNames.AustraliaEast, 250 }, { LocationNames.AustraliaSoutheast, 246 }, + { LocationNames.AustriaEast, 16 }, { LocationNames.BrazilSouth, 198 }, { LocationNames.BrazilSoutheast, 198 }, { LocationNames.CanadaCentral, 104 }, @@ -1939,9 +2009,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 20 }, { LocationNames.FranceSouth, 26 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 0 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 10 }, { LocationNames.IsraelCentral, 120 }, { LocationNames.ItalyNorth, 16 }, @@ -1953,6 +2021,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 218 }, { LocationNames.MalaysiaSouth, 162 }, { LocationNames.MexicoCentral, 154 }, + { LocationNames.NewZealandNorth, 254 }, { LocationNames.NorthCentralUS, 112 }, { LocationNames.NorthEurope, 31 }, { LocationNames.NorwayEast, 20 }, @@ -1964,10 +2033,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 120 }, { LocationNames.SoutheastAsia, 162 }, { LocationNames.SouthIndia, 140 }, + { LocationNames.SpainCentral, 20 }, { LocationNames.SwedenCentral, 20 }, { LocationNames.SwedenSouth, 20 }, { LocationNames.SwitzerlandNorth, 16 }, { LocationNames.SwitzerlandWest, 20 }, + { LocationNames.TaiwanNorth, 196 }, + { LocationNames.TaiwanNorthwest, 196 }, { LocationNames.UAECentral, 120 }, { LocationNames.UAENorth, 124 }, { LocationNames.UKSouth, 20 }, @@ -1992,85 +2064,6 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUS2EUAP, long.MaxValue }, } }, - { - LocationNames.GermanyNortheast, - new Dictionary() - { - { LocationNames.AustraliaCentral, long.MaxValue }, - { LocationNames.AustraliaCentral2, long.MaxValue }, - { LocationNames.AustraliaEast, long.MaxValue }, - { LocationNames.AustraliaSoutheast, long.MaxValue }, - { LocationNames.BrazilSouth, long.MaxValue }, - { LocationNames.BrazilSoutheast, long.MaxValue }, - { LocationNames.CanadaCentral, long.MaxValue }, - { LocationNames.CanadaEast, long.MaxValue }, - { LocationNames.CentralIndia, long.MaxValue }, - { LocationNames.CentralUS, long.MaxValue }, - { LocationNames.ChinaEast, long.MaxValue }, - { LocationNames.ChinaEast2, long.MaxValue }, - { LocationNames.ChinaEast3, long.MaxValue }, - { LocationNames.ChinaNorth, long.MaxValue }, - { LocationNames.ChinaNorth2, long.MaxValue }, - { LocationNames.ChinaNorth3, long.MaxValue }, - { LocationNames.EastAsia, long.MaxValue }, - { LocationNames.EastUS, long.MaxValue }, - { LocationNames.EastUS2, long.MaxValue }, - { LocationNames.EastUSSLV, long.MaxValue }, - { LocationNames.FranceCentral, long.MaxValue }, - { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, 10 }, - { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, 0 }, - { LocationNames.GermanyWestCentral, long.MaxValue }, - { LocationNames.IsraelCentral, long.MaxValue }, - { LocationNames.ItalyNorth, long.MaxValue }, - { LocationNames.JapanEast, long.MaxValue }, - { LocationNames.JapanWest, long.MaxValue }, - { LocationNames.JioIndiaCentral, long.MaxValue }, - { LocationNames.JioIndiaWest, long.MaxValue }, - { LocationNames.KoreaCentral, long.MaxValue }, - { LocationNames.KoreaSouth, long.MaxValue }, - { LocationNames.MalaysiaSouth, long.MaxValue }, - { LocationNames.MexicoCentral, long.MaxValue }, - { LocationNames.NorthCentralUS, long.MaxValue }, - { LocationNames.NorthEurope, long.MaxValue }, - { LocationNames.NorwayEast, long.MaxValue }, - { LocationNames.NorwayWest, long.MaxValue }, - { LocationNames.PolandCentral, long.MaxValue }, - { LocationNames.QatarCentral, long.MaxValue }, - { LocationNames.SouthAfricaNorth, long.MaxValue }, - { LocationNames.SouthAfricaWest, long.MaxValue }, - { LocationNames.SouthCentralUS, long.MaxValue }, - { LocationNames.SoutheastAsia, long.MaxValue }, - { LocationNames.SouthIndia, long.MaxValue }, - { LocationNames.SwedenCentral, long.MaxValue }, - { LocationNames.SwedenSouth, long.MaxValue }, - { LocationNames.SwitzerlandNorth, long.MaxValue }, - { LocationNames.SwitzerlandWest, long.MaxValue }, - { LocationNames.UAECentral, long.MaxValue }, - { LocationNames.UAENorth, long.MaxValue }, - { LocationNames.UKSouth, long.MaxValue }, - { LocationNames.UKWest, long.MaxValue }, - { LocationNames.USDoDCentral, long.MaxValue }, - { LocationNames.USDoDEast, long.MaxValue }, - { LocationNames.USGovArizona, long.MaxValue }, - { LocationNames.USGovTexas, long.MaxValue }, - { LocationNames.USGovVirginia, long.MaxValue }, - { LocationNames.USNatEast, long.MaxValue }, - { LocationNames.USNatWest, long.MaxValue }, - { LocationNames.USSecEast, long.MaxValue }, - { LocationNames.USSecWest, long.MaxValue }, - { LocationNames.USSecWestCentral, long.MaxValue }, - { LocationNames.WestCentralUS, long.MaxValue }, - { LocationNames.WestEurope, long.MaxValue }, - { LocationNames.WestIndia, long.MaxValue }, - { LocationNames.WestUS, long.MaxValue }, - { LocationNames.WestUS2, long.MaxValue }, - { LocationNames.WestUS3, long.MaxValue }, - { LocationNames.CentralUSEUAP, long.MaxValue }, - { LocationNames.EastUS2EUAP, long.MaxValue }, - } - }, { LocationNames.GermanyWestCentral, new Dictionary() @@ -2079,6 +2072,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 246 }, { LocationNames.AustraliaEast, 240 }, { LocationNames.AustraliaSoutheast, 238 }, + { LocationNames.AustriaEast, 6 }, { LocationNames.BrazilSouth, 192 }, { LocationNames.BrazilSoutheast, 192 }, { LocationNames.CanadaCentral, 98 }, @@ -2097,9 +2091,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 10 }, { LocationNames.FranceSouth, 17 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 10 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 0 }, { LocationNames.IsraelCentral, 112 }, { LocationNames.ItalyNorth, 6 }, @@ -2111,6 +2103,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 209 }, { LocationNames.MalaysiaSouth, 154 }, { LocationNames.MexicoCentral, 148 }, + { LocationNames.NewZealandNorth, 246 }, { LocationNames.NorthCentralUS, 106 }, { LocationNames.NorthEurope, 25 }, { LocationNames.NorwayEast, 26 }, @@ -2122,10 +2115,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 116 }, { LocationNames.SoutheastAsia, 154 }, { LocationNames.SouthIndia, 130 }, + { LocationNames.SpainCentral, 10 }, { LocationNames.SwedenCentral, 26 }, { LocationNames.SwedenSouth, 26 }, { LocationNames.SwitzerlandNorth, 6 }, { LocationNames.SwitzerlandWest, 10 }, + { LocationNames.TaiwanNorth, 188 }, + { LocationNames.TaiwanNorthwest, 188 }, { LocationNames.UAECentral, 112 }, { LocationNames.UAENorth, 114 }, { LocationNames.UKSouth, 14 }, @@ -2158,6 +2154,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 168 }, { LocationNames.AustraliaEast, 164 }, { LocationNames.AustraliaSoutheast, 160 }, + { LocationNames.AustriaEast, 106 }, { LocationNames.BrazilSouth, 296 }, { LocationNames.BrazilSoutheast, 296 }, { LocationNames.CanadaCentral, 201 }, @@ -2176,9 +2173,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 108 }, { LocationNames.FranceSouth, 96 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 120 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 112 }, { LocationNames.IsraelCentral, 0 }, { LocationNames.ItalyNorth, 106 }, @@ -2190,6 +2185,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 132 }, { LocationNames.MalaysiaSouth, 76 }, { LocationNames.MexicoCentral, 236 }, + { LocationNames.NewZealandNorth, 168 }, { LocationNames.NorthCentralUS, 209 }, { LocationNames.NorthEurope, 129 }, { LocationNames.NorwayEast, 138 }, @@ -2201,10 +2197,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 218 }, { LocationNames.SoutheastAsia, 76 }, { LocationNames.SouthIndia, 46 }, + { LocationNames.SpainCentral, 108 }, { LocationNames.SwedenCentral, 129 }, { LocationNames.SwedenSouth, 129 }, { LocationNames.SwitzerlandNorth, 106 }, { LocationNames.SwitzerlandWest, 102 }, + { LocationNames.TaiwanNorth, 110 }, + { LocationNames.TaiwanNorthwest, 110 }, { LocationNames.UAECentral, 100 }, { LocationNames.UAENorth, 4 }, { LocationNames.UKSouth, 116 }, @@ -2237,6 +2236,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 240 }, { LocationNames.AustraliaEast, 236 }, { LocationNames.AustraliaSoutheast, 232 }, + { LocationNames.AustriaEast, 100 }, { LocationNames.BrazilSouth, 198 }, { LocationNames.BrazilSoutheast, 198 }, { LocationNames.CanadaCentral, 104 }, @@ -2255,9 +2255,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 14 }, { LocationNames.FranceSouth, 10 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 16 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 6 }, { LocationNames.IsraelCentral, 106 }, { LocationNames.ItalyNorth, 0 }, @@ -2269,6 +2267,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 204 }, { LocationNames.MalaysiaSouth, 148 }, { LocationNames.MexicoCentral, 154 }, + { LocationNames.NewZealandNorth, 240 }, { LocationNames.NorthCentralUS, 110 }, { LocationNames.NorthEurope, 31 }, { LocationNames.NorwayEast, 32 }, @@ -2280,10 +2279,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 118 }, { LocationNames.SoutheastAsia, 148 }, { LocationNames.SouthIndia, 126 }, + { LocationNames.SpainCentral, 14 }, { LocationNames.SwedenCentral, 32 }, { LocationNames.SwedenSouth, 255 }, { LocationNames.SwitzerlandNorth, 100 }, { LocationNames.SwitzerlandWest, 4 }, + { LocationNames.TaiwanNorth, 182 }, + { LocationNames.TaiwanNorthwest, 182 }, { LocationNames.UAECentral, 106 }, { LocationNames.UAENorth, 108 }, { LocationNames.UKSouth, 20 }, @@ -2316,6 +2318,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 124 }, { LocationNames.AustraliaEast, 118 }, { LocationNames.AustraliaSoutheast, 130 }, + { LocationNames.AustriaEast, 216 }, { LocationNames.BrazilSouth, 262 }, { LocationNames.BrazilSoutheast, 262 }, { LocationNames.CanadaCentral, 152 }, @@ -2334,9 +2337,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 218 }, { LocationNames.FranceSouth, 204 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 230 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 220 }, { LocationNames.IsraelCentral, 144 }, { LocationNames.ItalyNorth, 216 }, @@ -2348,6 +2349,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 35 }, { LocationNames.MalaysiaSouth, 68 }, { LocationNames.MexicoCentral, 112 }, + { LocationNames.NewZealandNorth, 125 }, { LocationNames.NorthCentralUS, 148 }, { LocationNames.NorthEurope, 223 }, { LocationNames.NorwayEast, 254 }, @@ -2359,10 +2361,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 138 }, { LocationNames.SoutheastAsia, 68 }, { LocationNames.SouthIndia, 100 }, + { LocationNames.SpainCentral, 218 }, { LocationNames.SwedenCentral, 254 }, { LocationNames.SwedenSouth, 254 }, { LocationNames.SwitzerlandNorth, 216 }, { LocationNames.SwitzerlandWest, 212 }, + { LocationNames.TaiwanNorth, 50 }, + { LocationNames.TaiwanNorthwest, 50 }, { LocationNames.UAECentral, 144 }, { LocationNames.UAENorth, 144 }, { LocationNames.UKSouth, 226 }, @@ -2395,6 +2400,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 132 }, { LocationNames.AustraliaEast, 126 }, { LocationNames.AustraliaSoutheast, 138 }, + { LocationNames.AustriaEast, 216 }, { LocationNames.BrazilSouth, 270 }, { LocationNames.BrazilSoutheast, 270 }, { LocationNames.CanadaCentral, 160 }, @@ -2413,9 +2419,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 218 }, { LocationNames.FranceSouth, 206 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 230 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 220 }, { LocationNames.IsraelCentral, 149 }, { LocationNames.ItalyNorth, 216 }, @@ -2427,6 +2431,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 42 }, { LocationNames.MalaysiaSouth, 74 }, { LocationNames.MexicoCentral, 112 }, + { LocationNames.NewZealandNorth, 130 }, { LocationNames.NorthCentralUS, 152 }, { LocationNames.NorthEurope, 236 }, { LocationNames.NorwayEast, 248 }, @@ -2438,10 +2443,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 138 }, { LocationNames.SoutheastAsia, 74 }, { LocationNames.SouthIndia, 104 }, + { LocationNames.SpainCentral, 218 }, { LocationNames.SwedenCentral, 248 }, { LocationNames.SwedenSouth, 248 }, { LocationNames.SwitzerlandNorth, 216 }, { LocationNames.SwitzerlandWest, 210 }, + { LocationNames.TaiwanNorth, 50 }, + { LocationNames.TaiwanNorthwest, 50 }, { LocationNames.UAECentral, 149 }, { LocationNames.UAENorth, 148 }, { LocationNames.UKSouth, 225 }, @@ -2474,6 +2482,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 144 }, { LocationNames.AustraliaEast, 140 }, { LocationNames.AustraliaSoutheast, 136 }, + { LocationNames.AustriaEast, 112 }, { LocationNames.BrazilSouth, 302 }, { LocationNames.BrazilSoutheast, 302 }, { LocationNames.CanadaCentral, 208 }, @@ -2492,9 +2501,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 116 }, { LocationNames.FranceSouth, 102 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 128 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 118 }, { LocationNames.IsraelCentral, 30 }, { LocationNames.ItalyNorth, 112 }, @@ -2506,6 +2513,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 106 }, { LocationNames.MalaysiaSouth, 52 }, { LocationNames.MexicoCentral, 212 }, + { LocationNames.NewZealandNorth, 144 }, { LocationNames.NorthCentralUS, 216 }, { LocationNames.NorthEurope, 137 }, { LocationNames.NorwayEast, 146 }, @@ -2517,10 +2525,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 224 }, { LocationNames.SoutheastAsia, 52 }, { LocationNames.SouthIndia, 22 }, + { LocationNames.SpainCentral, 116 }, { LocationNames.SwedenCentral, 146 }, { LocationNames.SwedenSouth, 146 }, { LocationNames.SwitzerlandNorth, 112 }, { LocationNames.SwitzerlandWest, 110 }, + { LocationNames.TaiwanNorth, 86 }, + { LocationNames.TaiwanNorthwest, 86 }, { LocationNames.UAECentral, 30 }, { LocationNames.UAENorth, 30 }, { LocationNames.UKSouth, 122 }, @@ -2553,6 +2564,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 144 }, { LocationNames.AustraliaEast, 140 }, { LocationNames.AustraliaSoutheast, 136 }, + { LocationNames.AustriaEast, 112 }, { LocationNames.BrazilSouth, 302 }, { LocationNames.BrazilSoutheast, 302 }, { LocationNames.CanadaCentral, 208 }, @@ -2571,9 +2583,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 116 }, { LocationNames.FranceSouth, 102 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 128 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 118 }, { LocationNames.IsraelCentral, 30 }, { LocationNames.ItalyNorth, 112 }, @@ -2585,6 +2595,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 106 }, { LocationNames.MalaysiaSouth, 52 }, { LocationNames.MexicoCentral, 212 }, + { LocationNames.NewZealandNorth, 144 }, { LocationNames.NorthCentralUS, 216 }, { LocationNames.NorthEurope, 137 }, { LocationNames.NorwayEast, 146 }, @@ -2596,10 +2607,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 224 }, { LocationNames.SoutheastAsia, 52 }, { LocationNames.SouthIndia, 22 }, + { LocationNames.SpainCentral, 116 }, { LocationNames.SwedenCentral, 146 }, { LocationNames.SwedenSouth, 146 }, { LocationNames.SwitzerlandNorth, 112 }, { LocationNames.SwitzerlandWest, 110 }, + { LocationNames.TaiwanNorth, 86 }, + { LocationNames.TaiwanNorthwest, 86 }, { LocationNames.UAECentral, 30 }, { LocationNames.UAENorth, 30 }, { LocationNames.UKSouth, 122 }, @@ -2632,6 +2646,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 154 }, { LocationNames.AustraliaEast, 150 }, { LocationNames.AustraliaSoutheast, 146 }, + { LocationNames.AustriaEast, 210 }, { LocationNames.BrazilSouth, 300 }, { LocationNames.BrazilSoutheast, 300 }, { LocationNames.CanadaCentral, 178 }, @@ -2650,9 +2665,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 212 }, { LocationNames.FranceSouth, 200 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 224 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 216 }, { LocationNames.IsraelCentral, 138 }, { LocationNames.ItalyNorth, 210 }, @@ -2664,6 +2677,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 6 }, { LocationNames.MalaysiaSouth, 62 }, { LocationNames.MexicoCentral, 122 }, + { LocationNames.NewZealandNorth, 154 }, { LocationNames.NorthCentralUS, 165 }, { LocationNames.NorthEurope, 233 }, { LocationNames.NorwayEast, 242 }, @@ -2675,10 +2689,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 152 }, { LocationNames.SoutheastAsia, 62 }, { LocationNames.SouthIndia, 95 }, + { LocationNames.SpainCentral, 212 }, { LocationNames.SwedenCentral, 242 }, { LocationNames.SwedenSouth, 242 }, { LocationNames.SwitzerlandNorth, 210 }, { LocationNames.SwitzerlandWest, 206 }, + { LocationNames.TaiwanNorth, 56 }, + { LocationNames.TaiwanNorthwest, 56 }, { LocationNames.UAECentral, 138 }, { LocationNames.UAENorth, 138 }, { LocationNames.UKSouth, 220 }, @@ -2711,6 +2728,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 148 }, { LocationNames.AustraliaEast, 143 }, { LocationNames.AustraliaSoutheast, 140 }, + { LocationNames.AustriaEast, 204 }, { LocationNames.BrazilSouth, 306 }, { LocationNames.BrazilSoutheast, 306 }, { LocationNames.CanadaCentral, 182 }, @@ -2729,9 +2747,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 206 }, { LocationNames.FranceSouth, 193 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 218 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 209 }, { LocationNames.IsraelCentral, 132 }, { LocationNames.ItalyNorth, 204 }, @@ -2743,6 +2759,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 0 }, { LocationNames.MalaysiaSouth, 56 }, { LocationNames.MexicoCentral, 126 }, + { LocationNames.NewZealandNorth, 148 }, { LocationNames.NorthCentralUS, 170 }, { LocationNames.NorthEurope, 226 }, { LocationNames.NorwayEast, 235 }, @@ -2754,10 +2771,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 156 }, { LocationNames.SoutheastAsia, 56 }, { LocationNames.SouthIndia, 88 }, + { LocationNames.SpainCentral, 206 }, { LocationNames.SwedenCentral, 235 }, { LocationNames.SwedenSouth, 235 }, { LocationNames.SwitzerlandNorth, 204 }, { LocationNames.SwitzerlandWest, 200 }, + { LocationNames.TaiwanNorth, 60 }, + { LocationNames.TaiwanNorthwest, 60 }, { LocationNames.UAECentral, 132 }, { LocationNames.UAENorth, 130 }, { LocationNames.UKSouth, 214 }, @@ -2790,6 +2810,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 92 }, { LocationNames.AustraliaEast, 88 }, { LocationNames.AustraliaSoutheast, 85 }, + { LocationNames.AustriaEast, 148 }, { LocationNames.BrazilSouth, 328 }, { LocationNames.BrazilSoutheast, 328 }, { LocationNames.CanadaCentral, 216 }, @@ -2808,9 +2829,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 150 }, { LocationNames.FranceSouth, 138 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 162 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 154 }, { LocationNames.IsraelCentral, 76 }, { LocationNames.ItalyNorth, 148 }, @@ -2822,6 +2841,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 56 }, { LocationNames.MalaysiaSouth, 0 }, { LocationNames.MexicoCentral, 160 }, + { LocationNames.NewZealandNorth, 94 }, { LocationNames.NorthCentralUS, 202 }, { LocationNames.NorthEurope, 172 }, { LocationNames.NorwayEast, 180 }, @@ -2833,10 +2853,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 200 }, { LocationNames.SoutheastAsia, 100 }, { LocationNames.SouthIndia, 34 }, + { LocationNames.SpainCentral, 150 }, { LocationNames.SwedenCentral, 180 }, { LocationNames.SwedenSouth, 180 }, { LocationNames.SwitzerlandNorth, 148 }, { LocationNames.SwitzerlandWest, 144 }, + { LocationNames.TaiwanNorth, 33 }, + { LocationNames.TaiwanNorthwest, 33 }, { LocationNames.UAECentral, 76 }, { LocationNames.UAENorth, 76 }, { LocationNames.UKSouth, 158 }, @@ -2869,6 +2892,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 162 }, { LocationNames.AustraliaEast, 158 }, { LocationNames.AustraliaSoutheast, 168 }, + { LocationNames.AustriaEast, 154 }, { LocationNames.BrazilSouth, 182 }, { LocationNames.BrazilSoutheast, 182 }, { LocationNames.CanadaCentral, 57 }, @@ -2887,9 +2911,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 140 }, { LocationNames.FranceSouth, 146 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 154 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 148 }, { LocationNames.IsraelCentral, 236 }, { LocationNames.ItalyNorth, 154 }, @@ -2901,6 +2923,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 126 }, { LocationNames.MalaysiaSouth, 160 }, { LocationNames.MexicoCentral, 0 }, + { LocationNames.NewZealandNorth, 162 }, { LocationNames.NorthCentralUS, 44 }, { LocationNames.NorthEurope, 136 }, { LocationNames.NorwayEast, 164 }, @@ -2912,10 +2935,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 44 }, { LocationNames.SoutheastAsia, 160 }, { LocationNames.SouthIndia, 192 }, + { LocationNames.SpainCentral, 140 }, { LocationNames.SwedenCentral, 164 }, { LocationNames.SwedenSouth, 164 }, { LocationNames.SwitzerlandNorth, 154 }, { LocationNames.SwitzerlandWest, 146 }, + { LocationNames.TaiwanNorth, 140 }, + { LocationNames.TaiwanNorthwest, 140 }, { LocationNames.UAECentral, 236 }, { LocationNames.UAENorth, 236 }, { LocationNames.UKSouth, 130 }, @@ -2930,12 +2956,94 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.USSecEast, long.MaxValue }, { LocationNames.USSecWest, long.MaxValue }, { LocationNames.USSecWestCentral, long.MaxValue }, - { LocationNames.WestCentralUS, 22 }, - { LocationNames.WestEurope, 142 }, - { LocationNames.WestIndia, 210 }, - { LocationNames.WestUS, 22 }, - { LocationNames.WestUS2, 100 }, - { LocationNames.WestUS3, 100 }, + { LocationNames.WestCentralUS, 22 }, + { LocationNames.WestEurope, 142 }, + { LocationNames.WestIndia, 210 }, + { LocationNames.WestUS, 22 }, + { LocationNames.WestUS2, 100 }, + { LocationNames.WestUS3, 100 }, + { LocationNames.CentralUSEUAP, long.MaxValue }, + { LocationNames.EastUS2EUAP, long.MaxValue }, + } + }, + { + LocationNames.NewZealandNorth, + new Dictionary() + { + { LocationNames.AustraliaCentral, 100 }, + { LocationNames.AustraliaCentral2, 2 }, + { LocationNames.AustraliaEast, 6 }, + { LocationNames.AustraliaSoutheast, 18 }, + { LocationNames.AustriaEast, 240 }, + { LocationNames.BrazilSouth, 314 }, + { LocationNames.BrazilSoutheast, 314 }, + { LocationNames.CanadaCentral, 204 }, + { LocationNames.CanadaEast, 214 }, + { LocationNames.CentralIndia, 144 }, + { LocationNames.CentralUS, 184 }, + { LocationNames.ChinaEast, long.MaxValue }, + { LocationNames.ChinaEast2, long.MaxValue }, + { LocationNames.ChinaEast3, long.MaxValue }, + { LocationNames.ChinaNorth, long.MaxValue }, + { LocationNames.ChinaNorth2, long.MaxValue }, + { LocationNames.ChinaNorth3, long.MaxValue }, + { LocationNames.EastAsia, 120 }, + { LocationNames.EastUS, 205 }, + { LocationNames.EastUS2, 200 }, + { LocationNames.EastUSSLV, long.MaxValue }, + { LocationNames.FranceCentral, 242 }, + { LocationNames.FranceSouth, 230 }, + { LocationNames.GermanyNorth, 254 }, + { LocationNames.GermanyWestCentral, 246 }, + { LocationNames.IsraelCentral, 168 }, + { LocationNames.ItalyNorth, 240 }, + { LocationNames.JapanEast, 125 }, + { LocationNames.JapanWest, 130 }, + { LocationNames.JioIndiaCentral, 144 }, + { LocationNames.JioIndiaWest, 144 }, + { LocationNames.KoreaCentral, 154 }, + { LocationNames.KoreaSouth, 148 }, + { LocationNames.MalaysiaSouth, 94 }, + { LocationNames.MexicoCentral, 162 }, + { LocationNames.NewZealandNorth, 0 }, + { LocationNames.NorthCentralUS, 192 }, + { LocationNames.NorthEurope, 262 }, + { LocationNames.NorwayEast, 272 }, + { LocationNames.NorwayWest, 266 }, + { LocationNames.PolandCentral, 252 }, + { LocationNames.QatarCentral, 168 }, + { LocationNames.SouthAfricaNorth, 390 }, + { LocationNames.SouthAfricaWest, 394 }, + { LocationNames.SouthCentralUS, 174 }, + { LocationNames.SoutheastAsia, 94 }, + { LocationNames.SouthIndia, 126 }, + { LocationNames.SpainCentral, 242 }, + { LocationNames.SwedenCentral, 272 }, + { LocationNames.SwedenSouth, 272 }, + { LocationNames.SwitzerlandNorth, 240 }, + { LocationNames.SwitzerlandWest, 236 }, + { LocationNames.TaiwanNorth, 120 }, + { LocationNames.TaiwanNorthwest, 120 }, + { LocationNames.UAECentral, 168 }, + { LocationNames.UAENorth, 168 }, + { LocationNames.UKSouth, 250 }, + { LocationNames.UKWest, 252 }, + { LocationNames.USDoDCentral, long.MaxValue }, + { LocationNames.USDoDEast, long.MaxValue }, + { LocationNames.USGovArizona, long.MaxValue }, + { LocationNames.USGovTexas, long.MaxValue }, + { LocationNames.USGovVirginia, long.MaxValue }, + { LocationNames.USNatEast, long.MaxValue }, + { LocationNames.USNatWest, long.MaxValue }, + { LocationNames.USSecEast, long.MaxValue }, + { LocationNames.USSecWest, long.MaxValue }, + { LocationNames.USSecWestCentral, long.MaxValue }, + { LocationNames.WestCentralUS, 170 }, + { LocationNames.WestEurope, 252 }, + { LocationNames.WestIndia, 142 }, + { LocationNames.WestUS, 142 }, + { LocationNames.WestUS2, 162 }, + { LocationNames.WestUS3, 162 }, { LocationNames.CentralUSEUAP, long.MaxValue }, { LocationNames.EastUS2EUAP, long.MaxValue }, } @@ -2948,6 +3056,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 192 }, { LocationNames.AustraliaEast, 187 }, { LocationNames.AustraliaSoutheast, 198 }, + { LocationNames.AustriaEast, 110 }, { LocationNames.BrazilSouth, 138 }, { LocationNames.BrazilSoutheast, 138 }, { LocationNames.CanadaCentral, 14 }, @@ -2966,9 +3075,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 96 }, { LocationNames.FranceSouth, 104 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 112 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 106 }, { LocationNames.IsraelCentral, 209 }, { LocationNames.ItalyNorth, 110 }, @@ -2980,6 +3087,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 170 }, { LocationNames.MalaysiaSouth, 202 }, { LocationNames.MexicoCentral, 44 }, + { LocationNames.NewZealandNorth, 192 }, { LocationNames.NorthCentralUS, 0 }, { LocationNames.NorthEurope, 90 }, { LocationNames.NorwayEast, 122 }, @@ -2991,10 +3099,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 30 }, { LocationNames.SoutheastAsia, 202 }, { LocationNames.SouthIndia, 228 }, + { LocationNames.SpainCentral, 96 }, { LocationNames.SwedenCentral, 122 }, { LocationNames.SwedenSouth, 122 }, { LocationNames.SwitzerlandNorth, 110 }, { LocationNames.SwitzerlandWest, 106 }, + { LocationNames.TaiwanNorth, 184 }, + { LocationNames.TaiwanNorthwest, 184 }, { LocationNames.UAECentral, 209 }, { LocationNames.UAENorth, 212 }, { LocationNames.UKSouth, 90 }, @@ -3027,6 +3138,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 262 }, { LocationNames.AustraliaEast, 258 }, { LocationNames.AustraliaSoutheast, 260 }, + { LocationNames.AustriaEast, 31 }, { LocationNames.BrazilSouth, 177 }, { LocationNames.BrazilSoutheast, 177 }, { LocationNames.CanadaCentral, 84 }, @@ -3045,9 +3157,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 27 }, { LocationNames.FranceSouth, 31 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 31 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 25 }, { LocationNames.IsraelCentral, 129 }, { LocationNames.ItalyNorth, 31 }, @@ -3059,6 +3169,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 226 }, { LocationNames.MalaysiaSouth, 172 }, { LocationNames.MexicoCentral, 136 }, + { LocationNames.NewZealandNorth, 262 }, { LocationNames.NorthCentralUS, 90 }, { LocationNames.NorthEurope, 0 }, { LocationNames.NorwayEast, 40 }, @@ -3070,10 +3181,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 106 }, { LocationNames.SoutheastAsia, 172 }, { LocationNames.SouthIndia, 149 }, + { LocationNames.SpainCentral, 27 }, { LocationNames.SwedenCentral, 40 }, { LocationNames.SwedenSouth, 40 }, { LocationNames.SwitzerlandNorth, 31 }, { LocationNames.SwitzerlandWest, 30 }, + { LocationNames.TaiwanNorth, 205 }, + { LocationNames.TaiwanNorthwest, 205 }, { LocationNames.UAECentral, 129 }, { LocationNames.UAENorth, 132 }, { LocationNames.UKSouth, 21 }, @@ -3106,6 +3220,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 272 }, { LocationNames.AustraliaEast, 266 }, { LocationNames.AustraliaSoutheast, 264 }, + { LocationNames.AustriaEast, 32 }, { LocationNames.BrazilSouth, 208 }, { LocationNames.BrazilSoutheast, 208 }, { LocationNames.CanadaCentral, 114 }, @@ -3124,9 +3239,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 30 }, { LocationNames.FranceSouth, 42 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 20 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 26 }, { LocationNames.IsraelCentral, 138 }, { LocationNames.ItalyNorth, 32 }, @@ -3138,6 +3251,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 235 }, { LocationNames.MalaysiaSouth, 180 }, { LocationNames.MexicoCentral, 164 }, + { LocationNames.NewZealandNorth, 272 }, { LocationNames.NorthCentralUS, 122 }, { LocationNames.NorthEurope, 40 }, { LocationNames.NorwayEast, 0 }, @@ -3149,10 +3263,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 132 }, { LocationNames.SoutheastAsia, 180 }, { LocationNames.SouthIndia, 157 }, + { LocationNames.SpainCentral, 30 }, { LocationNames.SwedenCentral, 20 }, { LocationNames.SwedenSouth, 20 }, { LocationNames.SwitzerlandNorth, 32 }, { LocationNames.SwitzerlandWest, 36 }, + { LocationNames.TaiwanNorth, 214 }, + { LocationNames.TaiwanNorthwest, 214 }, { LocationNames.UAECentral, 138 }, { LocationNames.UAENorth, 140 }, { LocationNames.UKSouth, 28 }, @@ -3185,6 +3302,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 266 }, { LocationNames.AustraliaEast, 260 }, { LocationNames.AustraliaSoutheast, 258 }, + { LocationNames.AustriaEast, 26 }, { LocationNames.BrazilSouth, 201 }, { LocationNames.BrazilSoutheast, 201 }, { LocationNames.CanadaCentral, 108 }, @@ -3203,9 +3321,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 24 }, { LocationNames.FranceSouth, 36 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 26 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 20 }, { LocationNames.IsraelCentral, 130 }, { LocationNames.ItalyNorth, 26 }, @@ -3217,6 +3333,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 228 }, { LocationNames.MalaysiaSouth, 174 }, { LocationNames.MexicoCentral, 156 }, + { LocationNames.NewZealandNorth, 266 }, { LocationNames.NorthCentralUS, 114 }, { LocationNames.NorthEurope, 33 }, { LocationNames.NorwayEast, 8 }, @@ -3228,10 +3345,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 124 }, { LocationNames.SoutheastAsia, 174 }, { LocationNames.SouthIndia, 150 }, + { LocationNames.SpainCentral, 24 }, { LocationNames.SwedenCentral, 20 }, { LocationNames.SwedenSouth, 20 }, { LocationNames.SwitzerlandNorth, 26 }, { LocationNames.SwitzerlandWest, 30 }, + { LocationNames.TaiwanNorth, 206 }, + { LocationNames.TaiwanNorthwest, 206 }, { LocationNames.UAECentral, 130 }, { LocationNames.UAENorth, 134 }, { LocationNames.UKSouth, 22 }, @@ -3264,6 +3384,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 252 }, { LocationNames.AustraliaEast, 248 }, { LocationNames.AustraliaSoutheast, 244 }, + { LocationNames.AustriaEast, 12 }, { LocationNames.BrazilSouth, 188 }, { LocationNames.BrazilSoutheast, 188 }, { LocationNames.CanadaCentral, 94 }, @@ -3282,9 +3403,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 10 }, { LocationNames.FranceSouth, 20 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 10 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 8 }, { LocationNames.IsraelCentral, 118 }, { LocationNames.ItalyNorth, 12 }, @@ -3296,6 +3415,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 216 }, { LocationNames.MalaysiaSouth, 160 }, { LocationNames.MexicoCentral, 142 }, + { LocationNames.NewZealandNorth, 252 }, { LocationNames.NorthCentralUS, 102 }, { LocationNames.NorthEurope, 22 }, { LocationNames.NorwayEast, 22 }, @@ -3307,10 +3427,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 112 }, { LocationNames.SoutheastAsia, 160 }, { LocationNames.SouthIndia, 136 }, + { LocationNames.SpainCentral, 10 }, { LocationNames.SwedenCentral, 22 }, { LocationNames.SwedenSouth, 22 }, { LocationNames.SwitzerlandNorth, 12 }, { LocationNames.SwitzerlandWest, 16 }, + { LocationNames.TaiwanNorth, 193 }, + { LocationNames.TaiwanNorthwest, 193 }, { LocationNames.UAECentral, 118 }, { LocationNames.UAENorth, 120 }, { LocationNames.UKSouth, 10 }, @@ -3343,6 +3466,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 168 }, { LocationNames.AustraliaEast, 164 }, { LocationNames.AustraliaSoutheast, 160 }, + { LocationNames.AustriaEast, 106 }, { LocationNames.BrazilSouth, 296 }, { LocationNames.BrazilSoutheast, 296 }, { LocationNames.CanadaCentral, 201 }, @@ -3361,9 +3485,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 108 }, { LocationNames.FranceSouth, 96 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 120 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 112 }, { LocationNames.IsraelCentral, 4 }, { LocationNames.ItalyNorth, 106 }, @@ -3375,6 +3497,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 132 }, { LocationNames.MalaysiaSouth, 76 }, { LocationNames.MexicoCentral, 236 }, + { LocationNames.NewZealandNorth, 168 }, { LocationNames.NorthCentralUS, 209 }, { LocationNames.NorthEurope, 129 }, { LocationNames.NorwayEast, 138 }, @@ -3386,10 +3509,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 218 }, { LocationNames.SoutheastAsia, 76 }, { LocationNames.SouthIndia, 46 }, + { LocationNames.SpainCentral, 108 }, { LocationNames.SwedenCentral, 129 }, { LocationNames.SwedenSouth, 129 }, { LocationNames.SwitzerlandNorth, 106 }, { LocationNames.SwitzerlandWest, 102 }, + { LocationNames.TaiwanNorth, 110 }, + { LocationNames.TaiwanNorthwest, 110 }, { LocationNames.UAECentral, 4 }, { LocationNames.UAENorth, 4 }, { LocationNames.UKSouth, 116 }, @@ -3422,6 +3548,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 391 }, { LocationNames.AustraliaEast, 386 }, { LocationNames.AustraliaSoutheast, 382 }, + { LocationNames.AustriaEast, 172 }, { LocationNames.BrazilSouth, 342 }, { LocationNames.BrazilSoutheast, 342 }, { LocationNames.CanadaCentral, 246 }, @@ -3440,9 +3567,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 166 }, { LocationNames.FranceSouth, 162 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 178 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 178 }, { LocationNames.IsraelCentral, 256 }, { LocationNames.ItalyNorth, 172 }, @@ -3454,6 +3579,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 354 }, { LocationNames.MalaysiaSouth, 298 }, { LocationNames.MexicoCentral, 296 }, + { LocationNames.NewZealandNorth, 390 }, { LocationNames.NorthCentralUS, 253 }, { LocationNames.NorthEurope, 179 }, { LocationNames.NorwayEast, 186 }, @@ -3465,10 +3591,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 264 }, { LocationNames.SoutheastAsia, 298 }, { LocationNames.SouthIndia, 276 }, + { LocationNames.SpainCentral, 166 }, { LocationNames.SwedenCentral, 186 }, { LocationNames.SwedenSouth, 186 }, { LocationNames.SwitzerlandNorth, 172 }, { LocationNames.SwitzerlandWest, 168 }, + { LocationNames.TaiwanNorth, 332 }, + { LocationNames.TaiwanNorthwest, 332 }, { LocationNames.UAECentral, 256 }, { LocationNames.UAENorth, 260 }, { LocationNames.UKSouth, 160 }, @@ -3501,6 +3630,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 392 }, { LocationNames.AustraliaEast, 390 }, { LocationNames.AustraliaSoutheast, 386 }, + { LocationNames.AustriaEast, 162 }, { LocationNames.BrazilSouth, 326 }, { LocationNames.BrazilSoutheast, 326 }, { LocationNames.CanadaCentral, 230 }, @@ -3519,9 +3649,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 150 }, { LocationNames.FranceSouth, 166 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 162 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 156 }, { LocationNames.IsraelCentral, 260 }, { LocationNames.ItalyNorth, 162 }, @@ -3533,6 +3661,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 358 }, { LocationNames.MalaysiaSouth, 302 }, { LocationNames.MexicoCentral, 280 }, + { LocationNames.NewZealandNorth, 394 }, { LocationNames.NorthCentralUS, 236 }, { LocationNames.NorthEurope, 157 }, { LocationNames.NorwayEast, 170 }, @@ -3544,10 +3673,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 248 }, { LocationNames.SoutheastAsia, 302 }, { LocationNames.SouthIndia, 280 }, + { LocationNames.SpainCentral, 150 }, { LocationNames.SwedenCentral, 170 }, { LocationNames.SwedenSouth, 170 }, { LocationNames.SwitzerlandNorth, 162 }, { LocationNames.SwitzerlandWest, 158 }, + { LocationNames.TaiwanNorth, 336 }, + { LocationNames.TaiwanNorthwest, 336 }, { LocationNames.UAECentral, 260 }, { LocationNames.UAENorth, 264 }, { LocationNames.UKSouth, 144 }, @@ -3580,6 +3712,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 174 }, { LocationNames.AustraliaEast, 170 }, { LocationNames.AustraliaSoutheast, 180 }, + { LocationNames.AustriaEast, 118 }, { LocationNames.BrazilSouth, 140 }, { LocationNames.BrazilSoutheast, 140 }, { LocationNames.CanadaCentral, 42 }, @@ -3598,9 +3731,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 106 }, { LocationNames.FranceSouth, 116 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 120 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 116 }, { LocationNames.IsraelCentral, 218 }, { LocationNames.ItalyNorth, 118 }, @@ -3612,6 +3743,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 156 }, { LocationNames.MalaysiaSouth, 200 }, { LocationNames.MexicoCentral, 44 }, + { LocationNames.NewZealandNorth, 174 }, { LocationNames.NorthCentralUS, 30 }, { LocationNames.NorthEurope, 106 }, { LocationNames.NorwayEast, 132 }, @@ -3623,10 +3755,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 0 }, { LocationNames.SoutheastAsia, 200 }, { LocationNames.SouthIndia, 222 }, + { LocationNames.SpainCentral, 106 }, { LocationNames.SwedenCentral, 132 }, { LocationNames.SwedenSouth, 132 }, { LocationNames.SwitzerlandNorth, 118 }, { LocationNames.SwitzerlandWest, 116 }, + { LocationNames.TaiwanNorth, 182 }, + { LocationNames.TaiwanNorthwest, 182 }, { LocationNames.UAECentral, 218 }, { LocationNames.UAENorth, 220 }, { LocationNames.UKSouth, 104 }, @@ -3659,6 +3794,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 92 }, { LocationNames.AustraliaEast, 88 }, { LocationNames.AustraliaSoutheast, 85 }, + { LocationNames.AustriaEast, 148 }, { LocationNames.BrazilSouth, 328 }, { LocationNames.BrazilSoutheast, 328 }, { LocationNames.CanadaCentral, 216 }, @@ -3677,9 +3813,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 150 }, { LocationNames.FranceSouth, 138 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 162 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 154 }, { LocationNames.IsraelCentral, 76 }, { LocationNames.ItalyNorth, 148 }, @@ -3691,6 +3825,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 56 }, { LocationNames.MalaysiaSouth, 100 }, { LocationNames.MexicoCentral, 160 }, + { LocationNames.NewZealandNorth, 94 }, { LocationNames.NorthCentralUS, 202 }, { LocationNames.NorthEurope, 172 }, { LocationNames.NorwayEast, 180 }, @@ -3702,10 +3837,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 200 }, { LocationNames.SoutheastAsia, 0 }, { LocationNames.SouthIndia, 34 }, + { LocationNames.SpainCentral, 150 }, { LocationNames.SwedenCentral, 180 }, { LocationNames.SwedenSouth, 180 }, { LocationNames.SwitzerlandNorth, 148 }, { LocationNames.SwitzerlandWest, 144 }, + { LocationNames.TaiwanNorth, 33 }, + { LocationNames.TaiwanNorthwest, 33 }, { LocationNames.UAECentral, 76 }, { LocationNames.UAENorth, 76 }, { LocationNames.UKSouth, 158 }, @@ -3738,6 +3876,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 124 }, { LocationNames.AustraliaEast, 120 }, { LocationNames.AustraliaSoutheast, 118 }, + { LocationNames.AustriaEast, 126 }, { LocationNames.BrazilSouth, 314 }, { LocationNames.BrazilSoutheast, 314 }, { LocationNames.CanadaCentral, 220 }, @@ -3756,9 +3895,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 128 }, { LocationNames.FranceSouth, 114 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 140 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 130 }, { LocationNames.IsraelCentral, 46 }, { LocationNames.ItalyNorth, 126 }, @@ -3770,6 +3907,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 88 }, { LocationNames.MalaysiaSouth, 34 }, { LocationNames.MexicoCentral, 192 }, + { LocationNames.NewZealandNorth, 126 }, { LocationNames.NorthCentralUS, 228 }, { LocationNames.NorthEurope, 149 }, { LocationNames.NorwayEast, 157 }, @@ -3781,10 +3919,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 222 }, { LocationNames.SoutheastAsia, 34 }, { LocationNames.SouthIndia, 0 }, + { LocationNames.SpainCentral, 128 }, { LocationNames.SwedenCentral, 157 }, { LocationNames.SwedenSouth, 157 }, { LocationNames.SwitzerlandNorth, 126 }, { LocationNames.SwitzerlandWest, 122 }, + { LocationNames.TaiwanNorth, 66 }, + { LocationNames.TaiwanNorthwest, 66 }, { LocationNames.UAECentral, 46 }, { LocationNames.UAENorth, 46 }, { LocationNames.UKSouth, 134 }, @@ -3809,6 +3950,88 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUS2EUAP, long.MaxValue }, } }, + { + LocationNames.SpainCentral, + new Dictionary() + { + { LocationNames.AustraliaCentral, 242 }, + { LocationNames.AustraliaCentral2, 242 }, + { LocationNames.AustraliaEast, 238 }, + { LocationNames.AustraliaSoutheast, 235 }, + { LocationNames.AustriaEast, 14 }, + { LocationNames.BrazilSouth, 186 }, + { LocationNames.BrazilSoutheast, 186 }, + { LocationNames.CanadaCentral, 92 }, + { LocationNames.CanadaEast, 102 }, + { LocationNames.CentralIndia, 116 }, + { LocationNames.CentralUS, 101 }, + { LocationNames.ChinaEast, long.MaxValue }, + { LocationNames.ChinaEast2, long.MaxValue }, + { LocationNames.ChinaEast3, long.MaxValue }, + { LocationNames.ChinaNorth, long.MaxValue }, + { LocationNames.ChinaNorth2, long.MaxValue }, + { LocationNames.ChinaNorth3, long.MaxValue }, + { LocationNames.EastAsia, 184 }, + { LocationNames.EastUS, 80 }, + { LocationNames.EastUS2, 80 }, + { LocationNames.EastUSSLV, long.MaxValue }, + { LocationNames.FranceCentral, 100 }, + { LocationNames.FranceSouth, 11 }, + { LocationNames.GermanyNorth, 20 }, + { LocationNames.GermanyWestCentral, 10 }, + { LocationNames.IsraelCentral, 108 }, + { LocationNames.ItalyNorth, 14 }, + { LocationNames.JapanEast, 218 }, + { LocationNames.JapanWest, 218 }, + { LocationNames.JioIndiaCentral, 116 }, + { LocationNames.JioIndiaWest, 116 }, + { LocationNames.KoreaCentral, 212 }, + { LocationNames.KoreaSouth, 206 }, + { LocationNames.MalaysiaSouth, 150 }, + { LocationNames.MexicoCentral, 140 }, + { LocationNames.NewZealandNorth, 242 }, + { LocationNames.NorthCentralUS, 96 }, + { LocationNames.NorthEurope, 27 }, + { LocationNames.NorwayEast, 30 }, + { LocationNames.NorwayWest, 24 }, + { LocationNames.PolandCentral, 10 }, + { LocationNames.QatarCentral, 108 }, + { LocationNames.SouthAfricaNorth, 166 }, + { LocationNames.SouthAfricaWest, 150 }, + { LocationNames.SouthCentralUS, 106 }, + { LocationNames.SoutheastAsia, 150 }, + { LocationNames.SouthIndia, 128 }, + { LocationNames.SpainCentral, 0 }, + { LocationNames.SwedenCentral, 30 }, + { LocationNames.SwedenSouth, 30 }, + { LocationNames.SwitzerlandNorth, 14 }, + { LocationNames.SwitzerlandWest, 10 }, + { LocationNames.TaiwanNorth, 184 }, + { LocationNames.TaiwanNorthwest, 184 }, + { LocationNames.UAECentral, 108 }, + { LocationNames.UAENorth, 112 }, + { LocationNames.UKSouth, 7 }, + { LocationNames.UKWest, 8 }, + { LocationNames.USDoDCentral, long.MaxValue }, + { LocationNames.USDoDEast, long.MaxValue }, + { LocationNames.USGovArizona, long.MaxValue }, + { LocationNames.USGovTexas, long.MaxValue }, + { LocationNames.USGovVirginia, long.MaxValue }, + { LocationNames.USNatEast, long.MaxValue }, + { LocationNames.USNatWest, long.MaxValue }, + { LocationNames.USSecEast, long.MaxValue }, + { LocationNames.USSecWest, long.MaxValue }, + { LocationNames.USSecWestCentral, long.MaxValue }, + { LocationNames.WestCentralUS, 119 }, + { LocationNames.WestEurope, 10 }, + { LocationNames.WestIndia, 118 }, + { LocationNames.WestUS, 138 }, + { LocationNames.WestUS2, 140 }, + { LocationNames.WestUS3, 140 }, + { LocationNames.CentralUSEUAP, long.MaxValue }, + { LocationNames.EastUS2EUAP, long.MaxValue }, + } + }, { LocationNames.SwedenCentral, new Dictionary() @@ -3817,6 +4040,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 272 }, { LocationNames.AustraliaEast, 266 }, { LocationNames.AustraliaSoutheast, 264 }, + { LocationNames.AustriaEast, 32 }, { LocationNames.BrazilSouth, 208 }, { LocationNames.BrazilSoutheast, 208 }, { LocationNames.CanadaCentral, 114 }, @@ -3835,9 +4059,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, 255 }, { LocationNames.FranceCentral, 30 }, { LocationNames.FranceSouth, 42 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 20 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 26 }, { LocationNames.IsraelCentral, 129 }, { LocationNames.ItalyNorth, 32 }, @@ -3849,6 +4071,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 235 }, { LocationNames.MalaysiaSouth, 180 }, { LocationNames.MexicoCentral, 164 }, + { LocationNames.NewZealandNorth, 272 }, { LocationNames.NorthCentralUS, 122 }, { LocationNames.NorthEurope, 40 }, { LocationNames.NorwayEast, 10 }, @@ -3860,10 +4083,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 132 }, { LocationNames.SoutheastAsia, 180 }, { LocationNames.SouthIndia, 157 }, + { LocationNames.SpainCentral, 30 }, { LocationNames.SwedenCentral, 0 }, { LocationNames.SwedenSouth, 10 }, { LocationNames.SwitzerlandNorth, 32 }, { LocationNames.SwitzerlandWest, 36 }, + { LocationNames.TaiwanNorth, 214 }, + { LocationNames.TaiwanNorthwest, 214 }, { LocationNames.UAECentral, 138 }, { LocationNames.UAENorth, 140 }, { LocationNames.UKSouth, 28 }, @@ -3896,6 +4122,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 272 }, { LocationNames.AustraliaEast, 266 }, { LocationNames.AustraliaSoutheast, 264 }, + { LocationNames.AustriaEast, 255 }, { LocationNames.BrazilSouth, 208 }, { LocationNames.BrazilSoutheast, 208 }, { LocationNames.CanadaCentral, 114 }, @@ -3914,9 +4141,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, 255 }, { LocationNames.FranceCentral, 30 }, { LocationNames.FranceSouth, 42 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 20 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 26 }, { LocationNames.IsraelCentral, 129 }, { LocationNames.ItalyNorth, 255 }, @@ -3928,6 +4153,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 235 }, { LocationNames.MalaysiaSouth, 180 }, { LocationNames.MexicoCentral, 164 }, + { LocationNames.NewZealandNorth, 272 }, { LocationNames.NorthCentralUS, 122 }, { LocationNames.NorthEurope, 40 }, { LocationNames.NorwayEast, 10 }, @@ -3939,10 +4165,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 132 }, { LocationNames.SoutheastAsia, 180 }, { LocationNames.SouthIndia, 157 }, + { LocationNames.SpainCentral, 30 }, { LocationNames.SwedenCentral, 5 }, { LocationNames.SwedenSouth, 0 }, { LocationNames.SwitzerlandNorth, 32 }, { LocationNames.SwitzerlandWest, 36 }, + { LocationNames.TaiwanNorth, 214 }, + { LocationNames.TaiwanNorthwest, 214 }, { LocationNames.UAECentral, 138 }, { LocationNames.UAENorth, 140 }, { LocationNames.UKSouth, 28 }, @@ -3975,6 +4204,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 240 }, { LocationNames.AustraliaEast, 236 }, { LocationNames.AustraliaSoutheast, 232 }, + { LocationNames.AustriaEast, 100 }, { LocationNames.BrazilSouth, 198 }, { LocationNames.BrazilSoutheast, 198 }, { LocationNames.CanadaCentral, 104 }, @@ -3993,9 +4223,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 14 }, { LocationNames.FranceSouth, 10 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 16 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 6 }, { LocationNames.IsraelCentral, 106 }, { LocationNames.ItalyNorth, 100 }, @@ -4007,6 +4235,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 204 }, { LocationNames.MalaysiaSouth, 148 }, { LocationNames.MexicoCentral, 154 }, + { LocationNames.NewZealandNorth, 240 }, { LocationNames.NorthCentralUS, 110 }, { LocationNames.NorthEurope, 31 }, { LocationNames.NorwayEast, 32 }, @@ -4018,10 +4247,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 118 }, { LocationNames.SoutheastAsia, 148 }, { LocationNames.SouthIndia, 126 }, + { LocationNames.SpainCentral, 14 }, { LocationNames.SwedenCentral, 32 }, { LocationNames.SwedenSouth, 255 }, { LocationNames.SwitzerlandNorth, 0 }, { LocationNames.SwitzerlandWest, 4 }, + { LocationNames.TaiwanNorth, 182 }, + { LocationNames.TaiwanNorthwest, 182 }, { LocationNames.UAECentral, 106 }, { LocationNames.UAENorth, 108 }, { LocationNames.UKSouth, 20 }, @@ -4054,6 +4286,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 236 }, { LocationNames.AustraliaEast, 232 }, { LocationNames.AustraliaSoutheast, 228 }, + { LocationNames.AustriaEast, 4 }, { LocationNames.BrazilSouth, 202 }, { LocationNames.BrazilSoutheast, 202 }, { LocationNames.CanadaCentral, 108 }, @@ -4072,9 +4305,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 10 }, { LocationNames.FranceSouth, 8 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 20 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 10 }, { LocationNames.IsraelCentral, 102 }, { LocationNames.ItalyNorth, 4 }, @@ -4086,6 +4317,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 200 }, { LocationNames.MalaysiaSouth, 144 }, { LocationNames.MexicoCentral, 146 }, + { LocationNames.NewZealandNorth, 236 }, { LocationNames.NorthCentralUS, 106 }, { LocationNames.NorthEurope, 30 }, { LocationNames.NorwayEast, 36 }, @@ -4097,10 +4329,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 116 }, { LocationNames.SoutheastAsia, 144 }, { LocationNames.SouthIndia, 122 }, + { LocationNames.SpainCentral, 10 }, { LocationNames.SwedenCentral, 36 }, { LocationNames.SwedenSouth, 36 }, { LocationNames.SwitzerlandNorth, 4 }, { LocationNames.SwitzerlandWest, 0 }, + { LocationNames.TaiwanNorth, 178 }, + { LocationNames.TaiwanNorthwest, 178 }, { LocationNames.UAECentral, 102 }, { LocationNames.UAENorth, 106 }, { LocationNames.UKSouth, 16 }, @@ -4125,6 +4360,170 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUS2EUAP, long.MaxValue }, } }, + { + LocationNames.TaiwanNorth, + new Dictionary() + { + { LocationNames.AustraliaCentral, 120 }, + { LocationNames.AustraliaCentral2, 120 }, + { LocationNames.AustraliaEast, 116 }, + { LocationNames.AustraliaSoutheast, 118 }, + { LocationNames.AustriaEast, 182 }, + { LocationNames.BrazilSouth, 320 }, + { LocationNames.BrazilSoutheast, 320 }, + { LocationNames.CanadaCentral, 196 }, + { LocationNames.CanadaEast, 206 }, + { LocationNames.CentralIndia, 86 }, + { LocationNames.CentralUS, 176 }, + { LocationNames.ChinaEast, long.MaxValue }, + { LocationNames.ChinaEast2, long.MaxValue }, + { LocationNames.ChinaEast3, long.MaxValue }, + { LocationNames.ChinaNorth, long.MaxValue }, + { LocationNames.ChinaNorth2, long.MaxValue }, + { LocationNames.ChinaNorth3, long.MaxValue }, + { LocationNames.EastAsia, 100 }, + { LocationNames.EastUS, 199 }, + { LocationNames.EastUS2, 210 }, + { LocationNames.EastUSSLV, long.MaxValue }, + { LocationNames.FranceCentral, 184 }, + { LocationNames.FranceSouth, 172 }, + { LocationNames.GermanyNorth, 196 }, + { LocationNames.GermanyWestCentral, 188 }, + { LocationNames.IsraelCentral, 110 }, + { LocationNames.ItalyNorth, 182 }, + { LocationNames.JapanEast, 50 }, + { LocationNames.JapanWest, 50 }, + { LocationNames.JioIndiaCentral, 86 }, + { LocationNames.JioIndiaWest, 86 }, + { LocationNames.KoreaCentral, 56 }, + { LocationNames.KoreaSouth, 60 }, + { LocationNames.MalaysiaSouth, 33 }, + { LocationNames.MexicoCentral, 140 }, + { LocationNames.NewZealandNorth, 120 }, + { LocationNames.NorthCentralUS, 184 }, + { LocationNames.NorthEurope, 205 }, + { LocationNames.NorwayEast, 214 }, + { LocationNames.NorwayWest, 206 }, + { LocationNames.PolandCentral, 193 }, + { LocationNames.QatarCentral, 110 }, + { LocationNames.SouthAfricaNorth, 332 }, + { LocationNames.SouthAfricaWest, 336 }, + { LocationNames.SouthCentralUS, 182 }, + { LocationNames.SoutheastAsia, 33 }, + { LocationNames.SouthIndia, 66 }, + { LocationNames.SpainCentral, 184 }, + { LocationNames.SwedenCentral, 214 }, + { LocationNames.SwedenSouth, 214 }, + { LocationNames.SwitzerlandNorth, 182 }, + { LocationNames.SwitzerlandWest, 178 }, + { LocationNames.TaiwanNorth, 0 }, + { LocationNames.TaiwanNorthwest, 100 }, + { LocationNames.UAECentral, 110 }, + { LocationNames.UAENorth, 109 }, + { LocationNames.UKSouth, 192 }, + { LocationNames.UKWest, 194 }, + { LocationNames.USDoDCentral, long.MaxValue }, + { LocationNames.USDoDEast, long.MaxValue }, + { LocationNames.USGovArizona, long.MaxValue }, + { LocationNames.USGovTexas, long.MaxValue }, + { LocationNames.USGovVirginia, long.MaxValue }, + { LocationNames.USNatEast, long.MaxValue }, + { LocationNames.USNatWest, long.MaxValue }, + { LocationNames.USSecEast, long.MaxValue }, + { LocationNames.USSecWest, long.MaxValue }, + { LocationNames.USSecWestCentral, long.MaxValue }, + { LocationNames.WestCentralUS, 162 }, + { LocationNames.WestEurope, 193 }, + { LocationNames.WestIndia, 84 }, + { LocationNames.WestUS, 148 }, + { LocationNames.WestUS2, 140 }, + { LocationNames.WestUS3, 140 }, + { LocationNames.CentralUSEUAP, long.MaxValue }, + { LocationNames.EastUS2EUAP, long.MaxValue }, + } + }, + { + LocationNames.TaiwanNorthwest, + new Dictionary() + { + { LocationNames.AustraliaCentral, 120 }, + { LocationNames.AustraliaCentral2, 120 }, + { LocationNames.AustraliaEast, 116 }, + { LocationNames.AustraliaSoutheast, 118 }, + { LocationNames.AustriaEast, 182 }, + { LocationNames.BrazilSouth, 320 }, + { LocationNames.BrazilSoutheast, 320 }, + { LocationNames.CanadaCentral, 196 }, + { LocationNames.CanadaEast, 206 }, + { LocationNames.CentralIndia, 86 }, + { LocationNames.CentralUS, 176 }, + { LocationNames.ChinaEast, long.MaxValue }, + { LocationNames.ChinaEast2, long.MaxValue }, + { LocationNames.ChinaEast3, long.MaxValue }, + { LocationNames.ChinaNorth, long.MaxValue }, + { LocationNames.ChinaNorth2, long.MaxValue }, + { LocationNames.ChinaNorth3, long.MaxValue }, + { LocationNames.EastAsia, 100 }, + { LocationNames.EastUS, 199 }, + { LocationNames.EastUS2, 210 }, + { LocationNames.EastUSSLV, long.MaxValue }, + { LocationNames.FranceCentral, 184 }, + { LocationNames.FranceSouth, 172 }, + { LocationNames.GermanyNorth, 196 }, + { LocationNames.GermanyWestCentral, 188 }, + { LocationNames.IsraelCentral, 110 }, + { LocationNames.ItalyNorth, 182 }, + { LocationNames.JapanEast, 50 }, + { LocationNames.JapanWest, 50 }, + { LocationNames.JioIndiaCentral, 86 }, + { LocationNames.JioIndiaWest, 86 }, + { LocationNames.KoreaCentral, 56 }, + { LocationNames.KoreaSouth, 60 }, + { LocationNames.MalaysiaSouth, 33 }, + { LocationNames.MexicoCentral, 140 }, + { LocationNames.NewZealandNorth, 120 }, + { LocationNames.NorthCentralUS, 184 }, + { LocationNames.NorthEurope, 205 }, + { LocationNames.NorwayEast, 214 }, + { LocationNames.NorwayWest, 206 }, + { LocationNames.PolandCentral, 193 }, + { LocationNames.QatarCentral, 110 }, + { LocationNames.SouthAfricaNorth, 332 }, + { LocationNames.SouthAfricaWest, 336 }, + { LocationNames.SouthCentralUS, 182 }, + { LocationNames.SoutheastAsia, 33 }, + { LocationNames.SouthIndia, 66 }, + { LocationNames.SpainCentral, 184 }, + { LocationNames.SwedenCentral, 214 }, + { LocationNames.SwedenSouth, 214 }, + { LocationNames.SwitzerlandNorth, 182 }, + { LocationNames.SwitzerlandWest, 178 }, + { LocationNames.TaiwanNorth, 100 }, + { LocationNames.TaiwanNorthwest, 0 }, + { LocationNames.UAECentral, 110 }, + { LocationNames.UAENorth, 109 }, + { LocationNames.UKSouth, 192 }, + { LocationNames.UKWest, 194 }, + { LocationNames.USDoDCentral, long.MaxValue }, + { LocationNames.USDoDEast, long.MaxValue }, + { LocationNames.USGovArizona, long.MaxValue }, + { LocationNames.USGovTexas, long.MaxValue }, + { LocationNames.USGovVirginia, long.MaxValue }, + { LocationNames.USNatEast, long.MaxValue }, + { LocationNames.USNatWest, long.MaxValue }, + { LocationNames.USSecEast, long.MaxValue }, + { LocationNames.USSecWest, long.MaxValue }, + { LocationNames.USSecWestCentral, long.MaxValue }, + { LocationNames.WestCentralUS, 162 }, + { LocationNames.WestEurope, 193 }, + { LocationNames.WestIndia, 84 }, + { LocationNames.WestUS, 148 }, + { LocationNames.WestUS2, 140 }, + { LocationNames.WestUS3, 140 }, + { LocationNames.CentralUSEUAP, long.MaxValue }, + { LocationNames.EastUS2EUAP, long.MaxValue }, + } + }, { LocationNames.UAECentral, new Dictionary() @@ -4133,6 +4532,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 168 }, { LocationNames.AustraliaEast, 164 }, { LocationNames.AustraliaSoutheast, 160 }, + { LocationNames.AustriaEast, 106 }, { LocationNames.BrazilSouth, 296 }, { LocationNames.BrazilSoutheast, 296 }, { LocationNames.CanadaCentral, 201 }, @@ -4151,9 +4551,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 108 }, { LocationNames.FranceSouth, 96 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 120 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 112 }, { LocationNames.IsraelCentral, 100 }, { LocationNames.ItalyNorth, 106 }, @@ -4165,6 +4563,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 132 }, { LocationNames.MalaysiaSouth, 76 }, { LocationNames.MexicoCentral, 236 }, + { LocationNames.NewZealandNorth, 168 }, { LocationNames.NorthCentralUS, 209 }, { LocationNames.NorthEurope, 129 }, { LocationNames.NorwayEast, 138 }, @@ -4176,10 +4575,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 218 }, { LocationNames.SoutheastAsia, 76 }, { LocationNames.SouthIndia, 46 }, + { LocationNames.SpainCentral, 108 }, { LocationNames.SwedenCentral, 129 }, { LocationNames.SwedenSouth, 129 }, { LocationNames.SwitzerlandNorth, 106 }, { LocationNames.SwitzerlandWest, 102 }, + { LocationNames.TaiwanNorth, 110 }, + { LocationNames.TaiwanNorthwest, 110 }, { LocationNames.UAECentral, 0 }, { LocationNames.UAENorth, 4 }, { LocationNames.UKSouth, 116 }, @@ -4212,6 +4614,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 168 }, { LocationNames.AustraliaEast, 163 }, { LocationNames.AustraliaSoutheast, 160 }, + { LocationNames.AustriaEast, 108 }, { LocationNames.BrazilSouth, 298 }, { LocationNames.BrazilSoutheast, 298 }, { LocationNames.CanadaCentral, 204 }, @@ -4230,9 +4633,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 112 }, { LocationNames.FranceSouth, 98 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 124 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 114 }, { LocationNames.IsraelCentral, 4 }, { LocationNames.ItalyNorth, 108 }, @@ -4244,6 +4645,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 130 }, { LocationNames.MalaysiaSouth, 76 }, { LocationNames.MexicoCentral, 236 }, + { LocationNames.NewZealandNorth, 168 }, { LocationNames.NorthCentralUS, 212 }, { LocationNames.NorthEurope, 132 }, { LocationNames.NorwayEast, 140 }, @@ -4255,10 +4657,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 220 }, { LocationNames.SoutheastAsia, 76 }, { LocationNames.SouthIndia, 46 }, + { LocationNames.SpainCentral, 112 }, { LocationNames.SwedenCentral, 140 }, { LocationNames.SwedenSouth, 140 }, { LocationNames.SwitzerlandNorth, 108 }, { LocationNames.SwitzerlandWest, 106 }, + { LocationNames.TaiwanNorth, 109 }, + { LocationNames.TaiwanNorthwest, 109 }, { LocationNames.UAECentral, 4 }, { LocationNames.UAENorth, 0 }, { LocationNames.UKSouth, 120 }, @@ -4291,6 +4696,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 248 }, { LocationNames.AustraliaEast, 246 }, { LocationNames.AustraliaSoutheast, 242 }, + { LocationNames.AustriaEast, 20 }, { LocationNames.BrazilSouth, 181 }, { LocationNames.BrazilSoutheast, 181 }, { LocationNames.CanadaCentral, 86 }, @@ -4309,9 +4715,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 7 }, { LocationNames.FranceSouth, 16 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 20 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 14 }, { LocationNames.IsraelCentral, 116 }, { LocationNames.ItalyNorth, 20 }, @@ -4323,6 +4727,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 214 }, { LocationNames.MalaysiaSouth, 158 }, { LocationNames.MexicoCentral, 130 }, + { LocationNames.NewZealandNorth, 250 }, { LocationNames.NorthCentralUS, 90 }, { LocationNames.NorthEurope, 21 }, { LocationNames.NorwayEast, 28 }, @@ -4334,10 +4739,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 104 }, { LocationNames.SoutheastAsia, 158 }, { LocationNames.SouthIndia, 134 }, + { LocationNames.SpainCentral, 7 }, { LocationNames.SwedenCentral, 21 }, { LocationNames.SwedenSouth, 21 }, { LocationNames.SwitzerlandNorth, 20 }, { LocationNames.SwitzerlandWest, 16 }, + { LocationNames.TaiwanNorth, 192 }, + { LocationNames.TaiwanNorthwest, 192 }, { LocationNames.UAECentral, 116 }, { LocationNames.UAENorth, 120 }, { LocationNames.UKSouth, 0 }, @@ -4370,6 +4778,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 252 }, { LocationNames.AustraliaEast, 248 }, { LocationNames.AustraliaSoutheast, 245 }, + { LocationNames.AustriaEast, 22 }, { LocationNames.BrazilSouth, 184 }, { LocationNames.BrazilSoutheast, 184 }, { LocationNames.CanadaCentral, 90 }, @@ -4388,9 +4797,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 8 }, { LocationNames.FranceSouth, 18 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 22 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 18 }, { LocationNames.IsraelCentral, 118 }, { LocationNames.ItalyNorth, 22 }, @@ -4402,6 +4809,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 216 }, { LocationNames.MalaysiaSouth, 161 }, { LocationNames.MexicoCentral, 132 }, + { LocationNames.NewZealandNorth, 252 }, { LocationNames.NorthCentralUS, 92 }, { LocationNames.NorthEurope, 17 }, { LocationNames.NorwayEast, 30 }, @@ -4413,10 +4821,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 106 }, { LocationNames.SoutheastAsia, 161 }, { LocationNames.SouthIndia, 138 }, + { LocationNames.SpainCentral, 8 }, { LocationNames.SwedenCentral, 30 }, { LocationNames.SwedenSouth, 30 }, { LocationNames.SwitzerlandNorth, 22 }, { LocationNames.SwitzerlandWest, 18 }, + { LocationNames.TaiwanNorth, 194 }, + { LocationNames.TaiwanNorthwest, 194 }, { LocationNames.UAECentral, 118 }, { LocationNames.UAENorth, 122 }, { LocationNames.UKSouth, 4 }, @@ -4449,6 +4860,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -4467,9 +4879,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -4481,6 +4891,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -4492,10 +4903,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -4528,6 +4942,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -4546,9 +4961,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -4560,6 +4973,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -4571,10 +4985,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -4607,6 +5024,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -4625,9 +5043,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -4639,6 +5055,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -4650,10 +5067,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -4686,6 +5106,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -4704,9 +5125,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -4718,6 +5137,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -4729,10 +5149,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -4765,6 +5188,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -4783,9 +5207,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -4797,6 +5219,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -4808,10 +5231,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -4844,6 +5270,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -4862,9 +5289,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -4876,6 +5301,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -4887,10 +5313,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -4923,6 +5352,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -4941,9 +5371,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -4955,6 +5383,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -4966,10 +5395,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -5002,6 +5434,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -5020,9 +5453,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -5034,6 +5465,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -5045,10 +5477,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -5081,6 +5516,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -5099,9 +5535,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -5113,6 +5547,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -5124,10 +5559,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -5160,6 +5598,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -5178,9 +5617,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -5192,6 +5629,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -5203,10 +5641,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -5239,6 +5680,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 170 }, { LocationNames.AustraliaEast, 166 }, { LocationNames.AustraliaSoutheast, 176 }, + { LocationNames.AustriaEast, 134 }, { LocationNames.BrazilSouth, 160 }, { LocationNames.BrazilSoutheast, 160 }, { LocationNames.CanadaCentral, 36 }, @@ -5257,9 +5699,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 119 }, { LocationNames.FranceSouth, 126 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 132 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 126 }, { LocationNames.IsraelCentral, 230 }, { LocationNames.ItalyNorth, 134 }, @@ -5271,6 +5711,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 148 }, { LocationNames.MalaysiaSouth, 180 }, { LocationNames.MexicoCentral, 22 }, + { LocationNames.NewZealandNorth, 170 }, { LocationNames.NorthCentralUS, 22 }, { LocationNames.NorthEurope, 110 }, { LocationNames.NorwayEast, 142 }, @@ -5282,10 +5723,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 22 }, { LocationNames.SoutheastAsia, 180 }, { LocationNames.SouthIndia, 212 }, + { LocationNames.SpainCentral, 119 }, { LocationNames.SwedenCentral, 142 }, { LocationNames.SwedenSouth, 142 }, { LocationNames.SwitzerlandNorth, 134 }, { LocationNames.SwitzerlandWest, 126 }, + { LocationNames.TaiwanNorth, 162 }, + { LocationNames.TaiwanNorthwest, 162 }, { LocationNames.UAECentral, 230 }, { LocationNames.UAENorth, 234 }, { LocationNames.UKSouth, 110 }, @@ -5318,6 +5762,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 252 }, { LocationNames.AustraliaEast, 248 }, { LocationNames.AustraliaSoutheast, 244 }, + { LocationNames.AustriaEast, 12 }, { LocationNames.BrazilSouth, 188 }, { LocationNames.BrazilSoutheast, 188 }, { LocationNames.CanadaCentral, 94 }, @@ -5336,9 +5781,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 10 }, { LocationNames.FranceSouth, 20 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 10 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 8 }, { LocationNames.IsraelCentral, 118 }, { LocationNames.ItalyNorth, 12 }, @@ -5350,6 +5793,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 216 }, { LocationNames.MalaysiaSouth, 160 }, { LocationNames.MexicoCentral, 142 }, + { LocationNames.NewZealandNorth, 252 }, { LocationNames.NorthCentralUS, 102 }, { LocationNames.NorthEurope, 22 }, { LocationNames.NorwayEast, 22 }, @@ -5361,10 +5805,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 112 }, { LocationNames.SoutheastAsia, 160 }, { LocationNames.SouthIndia, 136 }, + { LocationNames.SpainCentral, 10 }, { LocationNames.SwedenCentral, 22 }, { LocationNames.SwedenSouth, 22 }, { LocationNames.SwitzerlandNorth, 12 }, { LocationNames.SwitzerlandWest, 16 }, + { LocationNames.TaiwanNorth, 193 }, + { LocationNames.TaiwanNorthwest, 193 }, { LocationNames.UAECentral, 118 }, { LocationNames.UAENorth, 120 }, { LocationNames.UKSouth, 10 }, @@ -5397,6 +5844,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 142 }, { LocationNames.AustraliaEast, 138 }, { LocationNames.AustraliaSoutheast, 134 }, + { LocationNames.AustriaEast, 116 }, { LocationNames.BrazilSouth, 304 }, { LocationNames.BrazilSoutheast, 304 }, { LocationNames.CanadaCentral, 210 }, @@ -5415,9 +5863,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 118 }, { LocationNames.FranceSouth, 106 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 130 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 122 }, { LocationNames.IsraelCentral, 28 }, { LocationNames.ItalyNorth, 116 }, @@ -5429,6 +5875,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 106 }, { LocationNames.MalaysiaSouth, 50 }, { LocationNames.MexicoCentral, 210 }, + { LocationNames.NewZealandNorth, 142 }, { LocationNames.NorthCentralUS, 218 }, { LocationNames.NorthEurope, 139 }, { LocationNames.NorwayEast, 146 }, @@ -5440,10 +5887,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 226 }, { LocationNames.SoutheastAsia, 50 }, { LocationNames.SouthIndia, 20 }, + { LocationNames.SpainCentral, 118 }, { LocationNames.SwedenCentral, 146 }, { LocationNames.SwedenSouth, 146 }, { LocationNames.SwitzerlandNorth, 116 }, { LocationNames.SwitzerlandWest, 112 }, + { LocationNames.TaiwanNorth, 84 }, + { LocationNames.TaiwanNorthwest, 84 }, { LocationNames.UAECentral, 28 }, { LocationNames.UAENorth, 28 }, { LocationNames.UKSouth, 126 }, @@ -5476,6 +5926,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 142 }, { LocationNames.AustraliaEast, 138 }, { LocationNames.AustraliaSoutheast, 148 }, + { LocationNames.AustriaEast, 150 }, { LocationNames.BrazilSouth, 172 }, { LocationNames.BrazilSoutheast, 172 }, { LocationNames.CanadaCentral, 64 }, @@ -5494,9 +5945,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 138 }, { LocationNames.FranceSouth, 148 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 153 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 148 }, { LocationNames.IsraelCentral, 244 }, { LocationNames.ItalyNorth, 150 }, @@ -5508,6 +5957,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 134 }, { LocationNames.MalaysiaSouth, 168 }, { LocationNames.MexicoCentral, 22 }, + { LocationNames.NewZealandNorth, 142 }, { LocationNames.NorthCentralUS, 50 }, { LocationNames.NorthEurope, 133 }, { LocationNames.NorwayEast, 163 }, @@ -5519,10 +5969,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 34 }, { LocationNames.SoutheastAsia, 168 }, { LocationNames.SouthIndia, 200 }, + { LocationNames.SpainCentral, 138 }, { LocationNames.SwedenCentral, 163 }, { LocationNames.SwedenSouth, 163 }, { LocationNames.SwitzerlandNorth, 150 }, { LocationNames.SwitzerlandWest, 147 }, + { LocationNames.TaiwanNorth, 148 }, + { LocationNames.TaiwanNorthwest, 148 }, { LocationNames.UAECentral, 244 }, { LocationNames.UAENorth, 244 }, { LocationNames.UKSouth, 136 }, @@ -5555,6 +6008,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 162 }, { LocationNames.AustraliaEast, 158 }, { LocationNames.AustraliaSoutheast, 168 }, + { LocationNames.AustriaEast, 154 }, { LocationNames.BrazilSouth, 182 }, { LocationNames.BrazilSoutheast, 182 }, { LocationNames.CanadaCentral, 57 }, @@ -5573,9 +6027,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 140 }, { LocationNames.FranceSouth, 146 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 154 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 148 }, { LocationNames.IsraelCentral, 236 }, { LocationNames.ItalyNorth, 154 }, @@ -5587,6 +6039,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 126 }, { LocationNames.MalaysiaSouth, 160 }, { LocationNames.MexicoCentral, 100 }, + { LocationNames.NewZealandNorth, 162 }, { LocationNames.NorthCentralUS, 44 }, { LocationNames.NorthEurope, 136 }, { LocationNames.NorwayEast, 164 }, @@ -5598,10 +6051,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 44 }, { LocationNames.SoutheastAsia, 160 }, { LocationNames.SouthIndia, 192 }, + { LocationNames.SpainCentral, 140 }, { LocationNames.SwedenCentral, 164 }, { LocationNames.SwedenSouth, 164 }, { LocationNames.SwitzerlandNorth, 154 }, { LocationNames.SwitzerlandWest, 146 }, + { LocationNames.TaiwanNorth, 140 }, + { LocationNames.TaiwanNorthwest, 140 }, { LocationNames.UAECentral, 236 }, { LocationNames.UAENorth, 236 }, { LocationNames.UKSouth, 130 }, @@ -5621,7 +6077,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.WestIndia, 210 }, { LocationNames.WestUS, 22 }, { LocationNames.WestUS2, 0 }, - { LocationNames.WestUS3, 100 }, + { LocationNames.WestUS3, 32 }, { LocationNames.CentralUSEUAP, long.MaxValue }, { LocationNames.EastUS2EUAP, long.MaxValue }, } @@ -5634,6 +6090,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, 162 }, { LocationNames.AustraliaEast, 158 }, { LocationNames.AustraliaSoutheast, 168 }, + { LocationNames.AustriaEast, 154 }, { LocationNames.BrazilSouth, 182 }, { LocationNames.BrazilSoutheast, 182 }, { LocationNames.CanadaCentral, 57 }, @@ -5652,9 +6109,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, long.MaxValue }, { LocationNames.FranceCentral, 140 }, { LocationNames.FranceSouth, 146 }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, 154 }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, 148 }, { LocationNames.IsraelCentral, 236 }, { LocationNames.ItalyNorth, 154 }, @@ -5666,6 +6121,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, 126 }, { LocationNames.MalaysiaSouth, 160 }, { LocationNames.MexicoCentral, 100 }, + { LocationNames.NewZealandNorth, 162 }, { LocationNames.NorthCentralUS, 44 }, { LocationNames.NorthEurope, 136 }, { LocationNames.NorwayEast, 164 }, @@ -5677,10 +6133,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, 44 }, { LocationNames.SoutheastAsia, 160 }, { LocationNames.SouthIndia, 192 }, + { LocationNames.SpainCentral, 140 }, { LocationNames.SwedenCentral, 164 }, { LocationNames.SwedenSouth, 164 }, { LocationNames.SwitzerlandNorth, 154 }, { LocationNames.SwitzerlandWest, 146 }, + { LocationNames.TaiwanNorth, 140 }, + { LocationNames.TaiwanNorthwest, 140 }, { LocationNames.UAECentral, 236 }, { LocationNames.UAENorth, 236 }, { LocationNames.UKSouth, 130 }, @@ -5699,7 +6158,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.WestEurope, 142 }, { LocationNames.WestIndia, 210 }, { LocationNames.WestUS, 22 }, - { LocationNames.WestUS2, 100 }, + { LocationNames.WestUS2, 32 }, { LocationNames.WestUS3, 0 }, { LocationNames.CentralUSEUAP, long.MaxValue }, { LocationNames.EastUS2EUAP, long.MaxValue }, @@ -5713,6 +6172,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -5731,9 +6191,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, 255 }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -5745,6 +6203,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -5756,10 +6215,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, @@ -5792,6 +6254,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.AustraliaCentral2, long.MaxValue }, { LocationNames.AustraliaEast, long.MaxValue }, { LocationNames.AustraliaSoutheast, long.MaxValue }, + { LocationNames.AustriaEast, long.MaxValue }, { LocationNames.BrazilSouth, long.MaxValue }, { LocationNames.BrazilSoutheast, long.MaxValue }, { LocationNames.CanadaCentral, long.MaxValue }, @@ -5810,9 +6273,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.EastUSSLV, 255 }, { LocationNames.FranceCentral, long.MaxValue }, { LocationNames.FranceSouth, long.MaxValue }, - { LocationNames.GermanyCentral, long.MaxValue }, { LocationNames.GermanyNorth, long.MaxValue }, - { LocationNames.GermanyNortheast, long.MaxValue }, { LocationNames.GermanyWestCentral, long.MaxValue }, { LocationNames.IsraelCentral, long.MaxValue }, { LocationNames.ItalyNorth, long.MaxValue }, @@ -5824,6 +6285,7 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.KoreaSouth, long.MaxValue }, { LocationNames.MalaysiaSouth, long.MaxValue }, { LocationNames.MexicoCentral, long.MaxValue }, + { LocationNames.NewZealandNorth, long.MaxValue }, { LocationNames.NorthCentralUS, long.MaxValue }, { LocationNames.NorthEurope, long.MaxValue }, { LocationNames.NorwayEast, long.MaxValue }, @@ -5835,10 +6297,13 @@ public static List GeneratePreferredRegionList(string sourceRegion) { LocationNames.SouthCentralUS, long.MaxValue }, { LocationNames.SoutheastAsia, long.MaxValue }, { LocationNames.SouthIndia, long.MaxValue }, + { LocationNames.SpainCentral, long.MaxValue }, { LocationNames.SwedenCentral, long.MaxValue }, { LocationNames.SwedenSouth, long.MaxValue }, { LocationNames.SwitzerlandNorth, long.MaxValue }, { LocationNames.SwitzerlandWest, long.MaxValue }, + { LocationNames.TaiwanNorth, long.MaxValue }, + { LocationNames.TaiwanNorthwest, long.MaxValue }, { LocationNames.UAECentral, long.MaxValue }, { LocationNames.UAENorth, long.MaxValue }, { LocationNames.UKSouth, long.MaxValue }, diff --git a/Microsoft.Azure.Cosmos/src/direct/RequestNameValueCollection.cs b/Microsoft.Azure.Cosmos/src/direct/RequestNameValueCollection.cs index fe3a2042db..4e2072deb4 100644 --- a/Microsoft.Azure.Cosmos/src/direct/RequestNameValueCollection.cs +++ b/Microsoft.Azure.Cosmos/src/direct/RequestNameValueCollection.cs @@ -37,7 +37,9 @@ internal class RequestNameValueCollection : INameValueCollection private NameValueCollection nameValueCollection = null; public string A_IM { get; set; } + public string ActivityId { get; set; } public string AddResourcePropertiesToResponse { get; set; } + public string AllowDocumentReadsInOfflineRegion { get; set; } public string AllowRestoreParamsUpdate { get; set; } public string AllowTentativeWrites { get; set; } public string Authorization { get; set; } @@ -50,6 +52,7 @@ internal class RequestNameValueCollection : INameValueCollection public string CanThrottle { get; set; } public string ChangeFeedStartFullFidelityIfNoneMatch { get; set; } public string ChangeFeedWireFormatVersion { get; set; } + public string ClientIpAddress { get; set; } public string ClientRetryAttemptCount { get; set; } public string CollectionChildResourceContentLimitInKB { get; set; } public string CollectionChildResourceNameLimitInBytes { get; set; } @@ -65,6 +68,8 @@ internal class RequestNameValueCollection : INameValueCollection public string DisableRUPerMinuteUsage { get; set; } public string EffectivePartitionKey { get; set; } public string EmitVerboseTracesInQuery { get; set; } + public string EnableConflictResolutionPolicyUpdate { get; set; } + public string EnableCrossPartitionQuery { get; set; } public string EnableDynamicRidRangeAllocation { get; set; } public string EnableLogging { get; set; } public string EnableLowPrecisionOrderBy { get; set; } @@ -96,6 +101,7 @@ internal class RequestNameValueCollection : INameValueCollection public string IsBatchOrdered { get; set; } public string IsCassandraAlterTypeRequest { get; set; } public string IsClientEncrypted { get; set; } + public string IsContinuationExpected { get; set; } public string IsFanoutRequest { get; set; } public string IsInternalServerlessRequest { get; set; } public string IsMaterializedViewBuild { get; set; } @@ -103,6 +109,7 @@ internal class RequestNameValueCollection : INameValueCollection public string IsMigratedFixedCollection { get; set; } public string IsOfferStorageRefreshRequest { get; set; } public string IsReadOnlyScript { get; set; } + public string IsRequestNotAuthorized { get; set; } public string IsRetriedWriteRequest { get; set; } public string IsRUPerGBEnforcementRequest { get; set; } public string IsServerlessStorageRefreshRequest { get; set; } @@ -118,6 +125,7 @@ internal class RequestNameValueCollection : INameValueCollection public string OfferReplaceRURedistribution { get; set; } public string OptimisticDirectExecute { get; set; } public string PageSize { get; set; } + public string ParallelizeCrossPartitionQuery { get; set; } public string PartitionCount { get; set; } public string PartitionKey { get; set; } public string PartitionKeyRangeId { get; set; } @@ -126,6 +134,7 @@ internal class RequestNameValueCollection : INameValueCollection public string PopulateByokEncryptionProgress { get; set; } public string PopulateCapacityType { get; set; } public string PopulateCollectionThroughputInfo { get; set; } + public string PopulateCurrentPartitionThroughputInfo { get; set; } public string PopulateHighestTentativeWriteLLSN { get; set; } public string PopulateIndexMetrics { get; set; } public string PopulateIndexMetricsV2 { get; set; } @@ -149,6 +158,7 @@ internal class RequestNameValueCollection : INameValueCollection public string PriorityLevel { get; set; } public string ProfileRequest { get; set; } public string PruneCollectionSchemas { get; set; } + public string QueryVersion { get; set; } public string RbacAction { get; set; } public string RbacResource { get; set; } public string RbacUserId { get; set; } @@ -179,8 +189,10 @@ internal class RequestNameValueCollection : INameValueCollection public string SkipAdjustThroughputFractionsForOfferReplace { get; set; } public string SkipRefreshDatabaseAccountConfigs { get; set; } public string SourceCollectionIfMatch { get; set; } + public string SqlQueryForPartitionKeyExtraction { get; set; } public string StartEpk { get; set; } public string StartId { get; set; } + public string SupportedQueryFeatures { get; set; } public string SupportedSerializationFormats { get; set; } public string SupportSpatialLegacyCoordinates { get; set; } public string SystemDocumentType { get; set; } @@ -227,6 +239,23 @@ public RequestNameValueCollection(IDictionary requestHeaders) } } + /// + /// Only process known headers. + /// + /// + /// Non thread safe. Does not support requestHeaders modification while running this method. + /// + public static RequestNameValueCollection BuildRequestNameValueCollectionWithKnownHeadersOnly(IDictionary requestHeaders) + { + RequestNameValueCollection requestNameValueCollection = new RequestNameValueCollection(); + foreach (KeyValuePair keyValue in requestHeaders) + { + requestNameValueCollection.UpdateHelper(keyValue.Key, value: keyValue.Value, throwIfAlreadyExists: false, ignoreNotCommonHeaders: true); + } + + return requestNameValueCollection; + } + /// /// Only process known headers. Ignores nameValueCollection changes by switching to per field assignment if InvalidOperationException happens while iterating over the keys. /// @@ -410,12 +439,23 @@ public static RequestNameValueCollection BuildRequestNameValueCollectionWithKnow requestNameValueCollection.OptimisticDirectExecute = nameValueCollection[HttpConstants.HttpHeaders.OptimisticDirectExecute]; requestNameValueCollection.PopulateMinGLSNForDocumentOperations = nameValueCollection[WFConstants.BackendHeaders.PopulateMinGLSNForDocumentOperations]; requestNameValueCollection.PopulateHighestTentativeWriteLLSN = nameValueCollection[WFConstants.BackendHeaders.PopulateHighestTentativeWriteLLSN]; + requestNameValueCollection.PopulateCapacityType = nameValueCollection[WFConstants.BackendHeaders.PopulateCapacityType]; requestNameValueCollection.TraceParent = nameValueCollection[HttpConstants.HttpHeaders.TraceParent]; requestNameValueCollection.TraceState = nameValueCollection[HttpConstants.HttpHeaders.TraceState]; - requestNameValueCollection.PopulateCapacityType = nameValueCollection[WFConstants.BackendHeaders.PopulateCapacityType]; + requestNameValueCollection.EnableConflictResolutionPolicyUpdate = nameValueCollection[HttpConstants.HttpHeaders.EnableConflictResolutionPolicyUpdate]; + requestNameValueCollection.ClientIpAddress = nameValueCollection[WFConstants.BackendHeaders.ClientIpAddress]; + requestNameValueCollection.IsRequestNotAuthorized = nameValueCollection[WFConstants.BackendHeaders.IsRequestNotAuthorized]; + requestNameValueCollection.PopulateCurrentPartitionThroughputInfo = nameValueCollection[WFConstants.BackendHeaders.PopulateCurrentPartitionThroughputInfo]; requestNameValueCollection.IfMatch = nameValueCollection[HttpConstants.HttpHeaders.IfMatch]; requestNameValueCollection.NoRetryOn449StatusCode = nameValueCollection[HttpConstants.HttpHeaders.NoRetryOn449StatusCode]; requestNameValueCollection.SkipAdjustThroughputFractionsForOfferReplace = nameValueCollection[HttpConstants.HttpHeaders.SkipAdjustThroughputFractionsForOfferReplace]; + requestNameValueCollection.SqlQueryForPartitionKeyExtraction = nameValueCollection[HttpConstants.HttpHeaders.SqlQueryForPartitionKeyExtraction]; + requestNameValueCollection.EnableCrossPartitionQuery = nameValueCollection[HttpConstants.HttpHeaders.EnableCrossPartitionQuery]; + requestNameValueCollection.IsContinuationExpected = nameValueCollection[HttpConstants.HttpHeaders.IsContinuationExpected]; + requestNameValueCollection.ParallelizeCrossPartitionQuery = nameValueCollection[HttpConstants.HttpHeaders.ParallelizeCrossPartitionQuery]; + requestNameValueCollection.SupportedQueryFeatures = nameValueCollection[HttpConstants.HttpHeaders.SupportedQueryFeatures]; + requestNameValueCollection.QueryVersion = nameValueCollection[HttpConstants.HttpHeaders.QueryVersion]; + requestNameValueCollection.ActivityId = nameValueCollection[HttpConstants.HttpHeaders.ActivityId]; } return requestNameValueCollection; @@ -453,7 +493,9 @@ public void Clear() } this.A_IM = null; + this.ActivityId = null; this.AddResourcePropertiesToResponse = null; + this.AllowDocumentReadsInOfflineRegion = null; this.AllowRestoreParamsUpdate = null; this.AllowTentativeWrites = null; this.Authorization = null; @@ -466,6 +508,7 @@ public void Clear() this.CanThrottle = null; this.ChangeFeedStartFullFidelityIfNoneMatch = null; this.ChangeFeedWireFormatVersion = null; + this.ClientIpAddress = null; this.ClientRetryAttemptCount = null; this.CollectionChildResourceContentLimitInKB = null; this.CollectionChildResourceNameLimitInBytes = null; @@ -481,6 +524,8 @@ public void Clear() this.DisableRUPerMinuteUsage = null; this.EffectivePartitionKey = null; this.EmitVerboseTracesInQuery = null; + this.EnableConflictResolutionPolicyUpdate = null; + this.EnableCrossPartitionQuery = null; this.EnableDynamicRidRangeAllocation = null; this.EnableLogging = null; this.EnableLowPrecisionOrderBy = null; @@ -512,6 +557,7 @@ public void Clear() this.IsBatchOrdered = null; this.IsCassandraAlterTypeRequest = null; this.IsClientEncrypted = null; + this.IsContinuationExpected = null; this.IsFanoutRequest = null; this.IsInternalServerlessRequest = null; this.IsMaterializedViewBuild = null; @@ -519,6 +565,7 @@ public void Clear() this.IsMigratedFixedCollection = null; this.IsOfferStorageRefreshRequest = null; this.IsReadOnlyScript = null; + this.IsRequestNotAuthorized = null; this.IsRetriedWriteRequest = null; this.IsRUPerGBEnforcementRequest = null; this.IsServerlessStorageRefreshRequest = null; @@ -534,6 +581,7 @@ public void Clear() this.OfferReplaceRURedistribution = null; this.OptimisticDirectExecute = null; this.PageSize = null; + this.ParallelizeCrossPartitionQuery = null; this.PartitionCount = null; this.PartitionKey = null; this.PartitionKeyRangeId = null; @@ -542,6 +590,7 @@ public void Clear() this.PopulateByokEncryptionProgress = null; this.PopulateCapacityType = null; this.PopulateCollectionThroughputInfo = null; + this.PopulateCurrentPartitionThroughputInfo = null; this.PopulateHighestTentativeWriteLLSN = null; this.PopulateIndexMetrics = null; this.PopulateIndexMetricsV2 = null; @@ -565,6 +614,7 @@ public void Clear() this.PriorityLevel = null; this.ProfileRequest = null; this.PruneCollectionSchemas = null; + this.QueryVersion = null; this.RbacAction = null; this.RbacResource = null; this.RbacUserId = null; @@ -595,8 +645,10 @@ public void Clear() this.SkipAdjustThroughputFractionsForOfferReplace = null; this.SkipRefreshDatabaseAccountConfigs = null; this.SourceCollectionIfMatch = null; + this.SqlQueryForPartitionKeyExtraction = null; this.StartEpk = null; this.StartId = null; + this.SupportedQueryFeatures = null; this.SupportedSerializationFormats = null; this.SupportSpatialLegacyCoordinates = null; this.SystemDocumentType = null; @@ -630,7 +682,9 @@ public INameValueCollection Clone() RequestNameValueCollection cloneHeaders = new RequestNameValueCollection() { A_IM = this.A_IM, + ActivityId = this.ActivityId, AddResourcePropertiesToResponse = this.AddResourcePropertiesToResponse, + AllowDocumentReadsInOfflineRegion = this.AllowDocumentReadsInOfflineRegion, AllowRestoreParamsUpdate = this.AllowRestoreParamsUpdate, AllowTentativeWrites = this.AllowTentativeWrites, Authorization = this.Authorization, @@ -643,6 +697,7 @@ public INameValueCollection Clone() CanThrottle = this.CanThrottle, ChangeFeedStartFullFidelityIfNoneMatch = this.ChangeFeedStartFullFidelityIfNoneMatch, ChangeFeedWireFormatVersion = this.ChangeFeedWireFormatVersion, + ClientIpAddress = this.ClientIpAddress, ClientRetryAttemptCount = this.ClientRetryAttemptCount, CollectionChildResourceContentLimitInKB = this.CollectionChildResourceContentLimitInKB, CollectionChildResourceNameLimitInBytes = this.CollectionChildResourceNameLimitInBytes, @@ -658,6 +713,8 @@ public INameValueCollection Clone() DisableRUPerMinuteUsage = this.DisableRUPerMinuteUsage, EffectivePartitionKey = this.EffectivePartitionKey, EmitVerboseTracesInQuery = this.EmitVerboseTracesInQuery, + EnableConflictResolutionPolicyUpdate = this.EnableConflictResolutionPolicyUpdate, + EnableCrossPartitionQuery = this.EnableCrossPartitionQuery, EnableDynamicRidRangeAllocation = this.EnableDynamicRidRangeAllocation, EnableLogging = this.EnableLogging, EnableLowPrecisionOrderBy = this.EnableLowPrecisionOrderBy, @@ -689,6 +746,7 @@ public INameValueCollection Clone() IsBatchOrdered = this.IsBatchOrdered, IsCassandraAlterTypeRequest = this.IsCassandraAlterTypeRequest, IsClientEncrypted = this.IsClientEncrypted, + IsContinuationExpected = this.IsContinuationExpected, IsFanoutRequest = this.IsFanoutRequest, IsInternalServerlessRequest = this.IsInternalServerlessRequest, IsMaterializedViewBuild = this.IsMaterializedViewBuild, @@ -696,6 +754,7 @@ public INameValueCollection Clone() IsMigratedFixedCollection = this.IsMigratedFixedCollection, IsOfferStorageRefreshRequest = this.IsOfferStorageRefreshRequest, IsReadOnlyScript = this.IsReadOnlyScript, + IsRequestNotAuthorized = this.IsRequestNotAuthorized, IsRetriedWriteRequest = this.IsRetriedWriteRequest, IsRUPerGBEnforcementRequest = this.IsRUPerGBEnforcementRequest, IsServerlessStorageRefreshRequest = this.IsServerlessStorageRefreshRequest, @@ -711,6 +770,7 @@ public INameValueCollection Clone() OfferReplaceRURedistribution = this.OfferReplaceRURedistribution, OptimisticDirectExecute = this.OptimisticDirectExecute, PageSize = this.PageSize, + ParallelizeCrossPartitionQuery = this.ParallelizeCrossPartitionQuery, PartitionCount = this.PartitionCount, PartitionKey = this.PartitionKey, PartitionKeyRangeId = this.PartitionKeyRangeId, @@ -719,6 +779,7 @@ public INameValueCollection Clone() PopulateByokEncryptionProgress = this.PopulateByokEncryptionProgress, PopulateCapacityType = this.PopulateCapacityType, PopulateCollectionThroughputInfo = this.PopulateCollectionThroughputInfo, + PopulateCurrentPartitionThroughputInfo = this.PopulateCurrentPartitionThroughputInfo, PopulateHighestTentativeWriteLLSN = this.PopulateHighestTentativeWriteLLSN, PopulateIndexMetrics = this.PopulateIndexMetrics, PopulateIndexMetricsV2 = this.PopulateIndexMetricsV2, @@ -742,6 +803,7 @@ public INameValueCollection Clone() PriorityLevel = this.PriorityLevel, ProfileRequest = this.ProfileRequest, PruneCollectionSchemas = this.PruneCollectionSchemas, + QueryVersion = this.QueryVersion, RbacAction = this.RbacAction, RbacResource = this.RbacResource, RbacUserId = this.RbacUserId, @@ -772,8 +834,10 @@ public INameValueCollection Clone() SkipAdjustThroughputFractionsForOfferReplace = this.SkipAdjustThroughputFractionsForOfferReplace, SkipRefreshDatabaseAccountConfigs = this.SkipRefreshDatabaseAccountConfigs, SourceCollectionIfMatch = this.SourceCollectionIfMatch, + SqlQueryForPartitionKeyExtraction = this.SqlQueryForPartitionKeyExtraction, StartEpk = this.StartEpk, StartId = this.StartId, + SupportedQueryFeatures = this.SupportedQueryFeatures, SupportedSerializationFormats = this.SupportedSerializationFormats, SupportSpatialLegacyCoordinates = this.SupportSpatialLegacyCoordinates, SystemDocumentType = this.SystemDocumentType, @@ -1488,6 +1552,10 @@ public IEnumerable Keys() { yield return WFConstants.BackendHeaders.PopulateHighestTentativeWriteLLSN; } + if (this.PopulateCapacityType != null) + { + yield return WFConstants.BackendHeaders.PopulateCapacityType; + } if (this.TraceParent != null) { yield return HttpConstants.HttpHeaders.TraceParent; @@ -1496,9 +1564,25 @@ public IEnumerable Keys() { yield return HttpConstants.HttpHeaders.TraceState; } - if (this.PopulateCapacityType != null) + if (this.EnableConflictResolutionPolicyUpdate != null) { - yield return WFConstants.BackendHeaders.PopulateCapacityType; + yield return HttpConstants.HttpHeaders.EnableConflictResolutionPolicyUpdate; + } + if (this.ClientIpAddress != null) + { + yield return WFConstants.BackendHeaders.ClientIpAddress; + } + if (this.IsRequestNotAuthorized != null) + { + yield return WFConstants.BackendHeaders.IsRequestNotAuthorized; + } + if (this.AllowDocumentReadsInOfflineRegion != null) + { + yield return HttpConstants.HttpHeaders.AllowDocumentReadsInOfflineRegion; + } + if (this.PopulateCurrentPartitionThroughputInfo != null) + { + yield return WFConstants.BackendHeaders.PopulateCurrentPartitionThroughputInfo; } if (this.IfMatch != null) { @@ -1512,6 +1596,34 @@ public IEnumerable Keys() { yield return HttpConstants.HttpHeaders.SkipAdjustThroughputFractionsForOfferReplace; } + if (this.SqlQueryForPartitionKeyExtraction != null) + { + yield return HttpConstants.HttpHeaders.SqlQueryForPartitionKeyExtraction; + } + if (this.EnableCrossPartitionQuery != null) + { + yield return HttpConstants.HttpHeaders.EnableCrossPartitionQuery; + } + if (this.IsContinuationExpected != null) + { + yield return HttpConstants.HttpHeaders.IsContinuationExpected; + } + if (this.ParallelizeCrossPartitionQuery != null) + { + yield return HttpConstants.HttpHeaders.ParallelizeCrossPartitionQuery; + } + if (this.SupportedQueryFeatures != null) + { + yield return HttpConstants.HttpHeaders.SupportedQueryFeatures; + } + if (this.QueryVersion != null) + { + yield return HttpConstants.HttpHeaders.QueryVersion; + } + if (this.ActivityId != null) + { + yield return HttpConstants.HttpHeaders.ActivityId; + } if (this.notCommonHeaders != null) { @@ -2190,6 +2302,10 @@ public NameValueCollection ToNameValueCollection() { this.nameValueCollection.Add(WFConstants.BackendHeaders.PopulateHighestTentativeWriteLLSN, this.PopulateHighestTentativeWriteLLSN); } + if (this.PopulateCapacityType != null) + { + this.nameValueCollection.Add(WFConstants.BackendHeaders.PopulateCapacityType, this.PopulateCapacityType); + } if (this.TraceParent != null) { this.nameValueCollection.Add(HttpConstants.HttpHeaders.TraceParent, this.TraceParent); @@ -2198,9 +2314,25 @@ public NameValueCollection ToNameValueCollection() { this.nameValueCollection.Add(HttpConstants.HttpHeaders.TraceState, this.TraceState); } - if (this.PopulateCapacityType != null) + if (this.EnableConflictResolutionPolicyUpdate != null) { - this.nameValueCollection.Add(WFConstants.BackendHeaders.PopulateCapacityType, this.PopulateCapacityType); + this.nameValueCollection.Add(HttpConstants.HttpHeaders.EnableConflictResolutionPolicyUpdate, this.EnableConflictResolutionPolicyUpdate); + } + if (this.ClientIpAddress != null) + { + this.nameValueCollection.Add(WFConstants.BackendHeaders.ClientIpAddress, this.ClientIpAddress); + } + if (this.IsRequestNotAuthorized != null) + { + this.nameValueCollection.Add(WFConstants.BackendHeaders.IsRequestNotAuthorized, this.IsRequestNotAuthorized); + } + if (this.AllowDocumentReadsInOfflineRegion != null) + { + this.nameValueCollection.Add(HttpConstants.HttpHeaders.AllowDocumentReadsInOfflineRegion, this.AllowDocumentReadsInOfflineRegion); + } + if (this.PopulateCurrentPartitionThroughputInfo != null) + { + this.nameValueCollection.Add(WFConstants.BackendHeaders.PopulateCurrentPartitionThroughputInfo, this.PopulateCurrentPartitionThroughputInfo); } if (this.IfMatch != null) { @@ -2214,6 +2346,34 @@ public NameValueCollection ToNameValueCollection() { this.nameValueCollection.Add(HttpConstants.HttpHeaders.SkipAdjustThroughputFractionsForOfferReplace, this.SkipAdjustThroughputFractionsForOfferReplace); } + if (this.SqlQueryForPartitionKeyExtraction != null) + { + this.nameValueCollection.Add(HttpConstants.HttpHeaders.SqlQueryForPartitionKeyExtraction, this.SqlQueryForPartitionKeyExtraction); + } + if (this.EnableCrossPartitionQuery != null) + { + this.nameValueCollection.Add(HttpConstants.HttpHeaders.EnableCrossPartitionQuery, this.EnableCrossPartitionQuery); + } + if (this.IsContinuationExpected != null) + { + this.nameValueCollection.Add(HttpConstants.HttpHeaders.IsContinuationExpected, this.IsContinuationExpected); + } + if (this.ParallelizeCrossPartitionQuery != null) + { + this.nameValueCollection.Add(HttpConstants.HttpHeaders.ParallelizeCrossPartitionQuery, this.ParallelizeCrossPartitionQuery); + } + if (this.SupportedQueryFeatures != null) + { + this.nameValueCollection.Add(HttpConstants.HttpHeaders.SupportedQueryFeatures, this.SupportedQueryFeatures); + } + if (this.QueryVersion != null) + { + this.nameValueCollection.Add(HttpConstants.HttpHeaders.QueryVersion, this.QueryVersion); + } + if (this.ActivityId != null) + { + this.nameValueCollection.Add(HttpConstants.HttpHeaders.ActivityId, this.ActivityId); + } if (this.notCommonHeaders != null) { foreach (KeyValuePair keyValuePair in this.notCommonHeaders) @@ -2300,6 +2460,14 @@ public string Get(string key) break; case 11: + if (object.ReferenceEquals(HttpConstants.HttpHeaders.EndId, key)) + { + return this.EndId; + } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.TraceParent, key)) + { + return this.TraceParent; + } if (string.Equals(HttpConstants.HttpHeaders.EndId, key, StringComparison.OrdinalIgnoreCase)) { return this.EndId; @@ -2422,6 +2590,10 @@ public string Get(string key) { return this.NoRetryOn449StatusCode; } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.ActivityId, key)) + { + return this.ActivityId; + } if (string.Equals(HttpConstants.HttpHeaders.CanThrottle, key, StringComparison.OrdinalIgnoreCase)) { return this.CanThrottle; @@ -2442,6 +2614,11 @@ public string Get(string key) return this.NoRetryOn449StatusCode; } + if (string.Equals(HttpConstants.HttpHeaders.ActivityId, key, StringComparison.OrdinalIgnoreCase)) + { + return this.ActivityId; + } + break; case 17: if (object.ReferenceEquals(HttpConstants.HttpHeaders.Continuation, key)) @@ -2723,6 +2900,10 @@ public string Get(string key) { return this.ResourceTypes; } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.QueryVersion, key)) + { + return this.QueryVersion; + } if (string.Equals(WFConstants.BackendHeaders.ResourceSchemaName, key, StringComparison.OrdinalIgnoreCase)) { return this.ResourceSchemaName; @@ -2753,6 +2934,11 @@ public string Get(string key) return this.ResourceTypes; } + if (string.Equals(HttpConstants.HttpHeaders.QueryVersion, key, StringComparison.OrdinalIgnoreCase)) + { + return this.QueryVersion; + } + break; case 26: if (object.ReferenceEquals(WFConstants.BackendHeaders.CollectionPartitionIndex, key)) @@ -2867,6 +3053,13 @@ public string Get(string key) return this.UseSystemBudget; } + break; + case 29: + if (string.Equals(WFConstants.BackendHeaders.ClientIpAddress, key, StringComparison.OrdinalIgnoreCase)) + { + return this.ClientIpAddress; + } + break; case 30: if (object.ReferenceEquals(HttpConstants.HttpHeaders.ResourceTokenExpiry, key)) @@ -3224,6 +3417,10 @@ public string Get(string key) { return this.PruneCollectionSchemas; } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.SupportedQueryFeatures, key)) + { + return this.SupportedQueryFeatures; + } if (string.Equals(HttpConstants.HttpHeaders.PostTriggerInclude, key, StringComparison.OrdinalIgnoreCase)) { return this.PostTriggerInclude; @@ -3259,6 +3456,11 @@ public string Get(string key) return this.PruneCollectionSchemas; } + if (string.Equals(HttpConstants.HttpHeaders.SupportedQueryFeatures, key, StringComparison.OrdinalIgnoreCase)) + { + return this.SupportedQueryFeatures; + } + break; case 37: if (object.ReferenceEquals(HttpConstants.HttpHeaders.EnableLogging, key)) @@ -3277,6 +3479,10 @@ public string Get(string key) { return this.BuilderClientIdentifier; } + if (object.ReferenceEquals(WFConstants.BackendHeaders.IsRequestNotAuthorized, key)) + { + return this.IsRequestNotAuthorized; + } if (string.Equals(HttpConstants.HttpHeaders.EnableLogging, key, StringComparison.OrdinalIgnoreCase)) { return this.EnableLogging; @@ -3297,6 +3503,11 @@ public string Get(string key) return this.BuilderClientIdentifier; } + if (string.Equals(WFConstants.BackendHeaders.IsRequestNotAuthorized, key, StringComparison.OrdinalIgnoreCase)) + { + return this.IsRequestNotAuthorized; + } + break; case 38: if (object.ReferenceEquals(HttpConstants.HttpHeaders.MigrateOfferToAutopilot, key)) @@ -3409,6 +3620,10 @@ public string Get(string key) { return this.ChangeFeedWireFormatVersion; } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.EnableCrossPartitionQuery, key)) + { + return this.EnableCrossPartitionQuery; + } if (string.Equals(WFConstants.BackendHeaders.MergeCheckPointGLSN, key, StringComparison.OrdinalIgnoreCase)) { return this.MergeCheckPointGLSN; @@ -3424,6 +3639,11 @@ public string Get(string key) return this.ChangeFeedWireFormatVersion; } + if (string.Equals(HttpConstants.HttpHeaders.EnableCrossPartitionQuery, key, StringComparison.OrdinalIgnoreCase)) + { + return this.EnableCrossPartitionQuery; + } + break; case 43: if (object.ReferenceEquals(HttpConstants.HttpHeaders.DisableRUPerMinuteUsage, key)) @@ -3481,6 +3701,10 @@ public string Get(string key) { return this.PopulateOldestActiveSchemaId; } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.IsContinuationExpected, key)) + { + return this.IsContinuationExpected; + } if (string.Equals(HttpConstants.HttpHeaders.ContentSerializationFormat, key, StringComparison.OrdinalIgnoreCase)) { return this.ContentSerializationFormat; @@ -3491,6 +3715,11 @@ public string Get(string key) return this.PopulateOldestActiveSchemaId; } + if (string.Equals(HttpConstants.HttpHeaders.IsContinuationExpected, key, StringComparison.OrdinalIgnoreCase)) + { + return this.IsContinuationExpected; + } + break; case 45: if (object.ReferenceEquals(HttpConstants.HttpHeaders.ChangeFeedStartFullFidelityIfNoneMatch, key)) @@ -3701,11 +3930,24 @@ public string Get(string key) break; case 52: + if (object.ReferenceEquals(HttpConstants.HttpHeaders.OfferReplaceRURedistribution, key)) + { + return this.OfferReplaceRURedistribution; + } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.ParallelizeCrossPartitionQuery, key)) + { + return this.ParallelizeCrossPartitionQuery; + } if (string.Equals(HttpConstants.HttpHeaders.OfferReplaceRURedistribution, key, StringComparison.OrdinalIgnoreCase)) { return this.OfferReplaceRURedistribution; } + if (string.Equals(HttpConstants.HttpHeaders.ParallelizeCrossPartitionQuery, key, StringComparison.OrdinalIgnoreCase)) + { + return this.ParallelizeCrossPartitionQuery; + } + break; case 53: if (object.ReferenceEquals(HttpConstants.HttpHeaders.IsRUPerGBEnforcementRequest, key)) @@ -3745,6 +3987,10 @@ public string Get(string key) { return this.IsMaterializedViewSourceSchemaReplaceBatchRequest; } + if (object.ReferenceEquals(WFConstants.BackendHeaders.PopulateCurrentPartitionThroughputInfo, key)) + { + return this.PopulateCurrentPartitionThroughputInfo; + } if (string.Equals(HttpConstants.HttpHeaders.IncludePhysicalPartitionThroughputInfo, key, StringComparison.OrdinalIgnoreCase)) { return this.IncludePhysicalPartitionThroughputInfo; @@ -3755,13 +4001,31 @@ public string Get(string key) return this.IsMaterializedViewSourceSchemaReplaceBatchRequest; } + if (string.Equals(WFConstants.BackendHeaders.PopulateCurrentPartitionThroughputInfo, key, StringComparison.OrdinalIgnoreCase)) + { + return this.PopulateCurrentPartitionThroughputInfo; + } + break; case 55: + if (object.ReferenceEquals(HttpConstants.HttpHeaders.UpdateOfferStateToRestorePending, key)) + { + return this.UpdateOfferStateToRestorePending; + } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.SqlQueryForPartitionKeyExtraction, key)) + { + return this.SqlQueryForPartitionKeyExtraction; + } if (string.Equals(HttpConstants.HttpHeaders.UpdateOfferStateToRestorePending, key, StringComparison.OrdinalIgnoreCase)) { return this.UpdateOfferStateToRestorePending; } + if (string.Equals(HttpConstants.HttpHeaders.SqlQueryForPartitionKeyExtraction, key, StringComparison.OrdinalIgnoreCase)) + { + return this.SqlQueryForPartitionKeyExtraction; + } + break; case 56: if (string.Equals(WFConstants.BackendHeaders.CollectionChildResourceContentLimitInKB, key, StringComparison.OrdinalIgnoreCase)) @@ -3807,11 +4071,33 @@ public string Get(string key) break; case 59: + if (object.ReferenceEquals(HttpConstants.HttpHeaders.UpdateMaxThroughputEverProvisioned, key)) + { + return this.UpdateMaxThroughputEverProvisioned; + } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.EnableConflictResolutionPolicyUpdate, key)) + { + return this.EnableConflictResolutionPolicyUpdate; + } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.AllowDocumentReadsInOfflineRegion, key)) + { + return this.AllowDocumentReadsInOfflineRegion; + } if (string.Equals(HttpConstants.HttpHeaders.UpdateMaxThroughputEverProvisioned, key, StringComparison.OrdinalIgnoreCase)) { return this.UpdateMaxThroughputEverProvisioned; } + if (string.Equals(HttpConstants.HttpHeaders.EnableConflictResolutionPolicyUpdate, key, StringComparison.OrdinalIgnoreCase)) + { + return this.EnableConflictResolutionPolicyUpdate; + } + + if (string.Equals(HttpConstants.HttpHeaders.AllowDocumentReadsInOfflineRegion, key, StringComparison.OrdinalIgnoreCase)) + { + return this.AllowDocumentReadsInOfflineRegion; + } + break; case 61: if (string.Equals(HttpConstants.HttpHeaders.IsServerlessStorageRefreshRequest, key, StringComparison.OrdinalIgnoreCase)) @@ -3977,6 +4263,26 @@ public void UpdateHelper( } break; case 11: + if (object.ReferenceEquals(HttpConstants.HttpHeaders.EndId, key)) + { + if (throwIfAlreadyExists && this.EndId != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.EndId = value; + return; + } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.TraceParent, key)) + { + if (throwIfAlreadyExists && this.TraceParent != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.TraceParent = value; + return; + } if (string.Equals(HttpConstants.HttpHeaders.EndId, key, StringComparison.OrdinalIgnoreCase)) { if (throwIfAlreadyExists && this.EndId != null) @@ -4237,6 +4543,16 @@ public void UpdateHelper( this.NoRetryOn449StatusCode = value; return; } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.ActivityId, key)) + { + if (throwIfAlreadyExists && this.ActivityId != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.ActivityId = value; + return; + } if (string.Equals(HttpConstants.HttpHeaders.CanThrottle, key, StringComparison.OrdinalIgnoreCase)) { if (throwIfAlreadyExists && this.CanThrottle != null) @@ -4277,6 +4593,16 @@ public void UpdateHelper( this.NoRetryOn449StatusCode = value; return; } + if (string.Equals(HttpConstants.HttpHeaders.ActivityId, key, StringComparison.OrdinalIgnoreCase)) + { + if (throwIfAlreadyExists && this.ActivityId != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.ActivityId = value; + return; + } break; case 17: if (object.ReferenceEquals(HttpConstants.HttpHeaders.Continuation, key)) @@ -4885,6 +5211,16 @@ public void UpdateHelper( this.ResourceTypes = value; return; } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.QueryVersion, key)) + { + if (throwIfAlreadyExists && this.QueryVersion != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.QueryVersion = value; + return; + } if (string.Equals(WFConstants.BackendHeaders.ResourceSchemaName, key, StringComparison.OrdinalIgnoreCase)) { if (throwIfAlreadyExists && this.ResourceSchemaName != null) @@ -4945,6 +5281,16 @@ public void UpdateHelper( this.ResourceTypes = value; return; } + if (string.Equals(HttpConstants.HttpHeaders.QueryVersion, key, StringComparison.OrdinalIgnoreCase)) + { + if (throwIfAlreadyExists && this.QueryVersion != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.QueryVersion = value; + return; + } break; case 26: if (object.ReferenceEquals(WFConstants.BackendHeaders.CollectionPartitionIndex, key)) @@ -5192,6 +5538,18 @@ public void UpdateHelper( return; } break; + case 29: + if (string.Equals(WFConstants.BackendHeaders.ClientIpAddress, key, StringComparison.OrdinalIgnoreCase)) + { + if (throwIfAlreadyExists && this.ClientIpAddress != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.ClientIpAddress = value; + return; + } + break; case 30: if (object.ReferenceEquals(HttpConstants.HttpHeaders.ResourceTokenExpiry, key)) { @@ -5975,6 +6333,16 @@ public void UpdateHelper( this.PruneCollectionSchemas = value; return; } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.SupportedQueryFeatures, key)) + { + if (throwIfAlreadyExists && this.SupportedQueryFeatures != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.SupportedQueryFeatures = value; + return; + } if (string.Equals(HttpConstants.HttpHeaders.PostTriggerInclude, key, StringComparison.OrdinalIgnoreCase)) { if (throwIfAlreadyExists && this.PostTriggerInclude != null) @@ -6045,6 +6413,16 @@ public void UpdateHelper( this.PruneCollectionSchemas = value; return; } + if (string.Equals(HttpConstants.HttpHeaders.SupportedQueryFeatures, key, StringComparison.OrdinalIgnoreCase)) + { + if (throwIfAlreadyExists && this.SupportedQueryFeatures != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.SupportedQueryFeatures = value; + return; + } break; case 37: if (object.ReferenceEquals(HttpConstants.HttpHeaders.EnableLogging, key)) @@ -6087,6 +6465,16 @@ public void UpdateHelper( this.BuilderClientIdentifier = value; return; } + if (object.ReferenceEquals(WFConstants.BackendHeaders.IsRequestNotAuthorized, key)) + { + if (throwIfAlreadyExists && this.IsRequestNotAuthorized != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.IsRequestNotAuthorized = value; + return; + } if (string.Equals(HttpConstants.HttpHeaders.EnableLogging, key, StringComparison.OrdinalIgnoreCase)) { if (throwIfAlreadyExists && this.EnableLogging != null) @@ -6127,6 +6515,16 @@ public void UpdateHelper( this.BuilderClientIdentifier = value; return; } + if (string.Equals(WFConstants.BackendHeaders.IsRequestNotAuthorized, key, StringComparison.OrdinalIgnoreCase)) + { + if (throwIfAlreadyExists && this.IsRequestNotAuthorized != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.IsRequestNotAuthorized = value; + return; + } break; case 38: if (object.ReferenceEquals(HttpConstants.HttpHeaders.MigrateOfferToAutopilot, key)) @@ -6367,6 +6765,16 @@ public void UpdateHelper( this.ChangeFeedWireFormatVersion = value; return; } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.EnableCrossPartitionQuery, key)) + { + if (throwIfAlreadyExists && this.EnableCrossPartitionQuery != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.EnableCrossPartitionQuery = value; + return; + } if (string.Equals(WFConstants.BackendHeaders.MergeCheckPointGLSN, key, StringComparison.OrdinalIgnoreCase)) { if (throwIfAlreadyExists && this.MergeCheckPointGLSN != null) @@ -6397,6 +6805,16 @@ public void UpdateHelper( this.ChangeFeedWireFormatVersion = value; return; } + if (string.Equals(HttpConstants.HttpHeaders.EnableCrossPartitionQuery, key, StringComparison.OrdinalIgnoreCase)) + { + if (throwIfAlreadyExists && this.EnableCrossPartitionQuery != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.EnableCrossPartitionQuery = value; + return; + } break; case 43: if (object.ReferenceEquals(HttpConstants.HttpHeaders.DisableRUPerMinuteUsage, key)) @@ -6521,6 +6939,16 @@ public void UpdateHelper( this.PopulateOldestActiveSchemaId = value; return; } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.IsContinuationExpected, key)) + { + if (throwIfAlreadyExists && this.IsContinuationExpected != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.IsContinuationExpected = value; + return; + } if (string.Equals(HttpConstants.HttpHeaders.ContentSerializationFormat, key, StringComparison.OrdinalIgnoreCase)) { if (throwIfAlreadyExists && this.ContentSerializationFormat != null) @@ -6541,6 +6969,16 @@ public void UpdateHelper( this.PopulateOldestActiveSchemaId = value; return; } + if (string.Equals(HttpConstants.HttpHeaders.IsContinuationExpected, key, StringComparison.OrdinalIgnoreCase)) + { + if (throwIfAlreadyExists && this.IsContinuationExpected != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.IsContinuationExpected = value; + return; + } break; case 45: if (object.ReferenceEquals(HttpConstants.HttpHeaders.ChangeFeedStartFullFidelityIfNoneMatch, key)) @@ -6987,6 +7425,26 @@ public void UpdateHelper( } break; case 52: + if (object.ReferenceEquals(HttpConstants.HttpHeaders.OfferReplaceRURedistribution, key)) + { + if (throwIfAlreadyExists && this.OfferReplaceRURedistribution != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.OfferReplaceRURedistribution = value; + return; + } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.ParallelizeCrossPartitionQuery, key)) + { + if (throwIfAlreadyExists && this.ParallelizeCrossPartitionQuery != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.ParallelizeCrossPartitionQuery = value; + return; + } if (string.Equals(HttpConstants.HttpHeaders.OfferReplaceRURedistribution, key, StringComparison.OrdinalIgnoreCase)) { if (throwIfAlreadyExists && this.OfferReplaceRURedistribution != null) @@ -6997,6 +7455,16 @@ public void UpdateHelper( this.OfferReplaceRURedistribution = value; return; } + if (string.Equals(HttpConstants.HttpHeaders.ParallelizeCrossPartitionQuery, key, StringComparison.OrdinalIgnoreCase)) + { + if (throwIfAlreadyExists && this.ParallelizeCrossPartitionQuery != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.ParallelizeCrossPartitionQuery = value; + return; + } break; case 53: if (object.ReferenceEquals(HttpConstants.HttpHeaders.IsRUPerGBEnforcementRequest, key)) @@ -7081,6 +7549,16 @@ public void UpdateHelper( this.IsMaterializedViewSourceSchemaReplaceBatchRequest = value; return; } + if (object.ReferenceEquals(WFConstants.BackendHeaders.PopulateCurrentPartitionThroughputInfo, key)) + { + if (throwIfAlreadyExists && this.PopulateCurrentPartitionThroughputInfo != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.PopulateCurrentPartitionThroughputInfo = value; + return; + } if (string.Equals(HttpConstants.HttpHeaders.IncludePhysicalPartitionThroughputInfo, key, StringComparison.OrdinalIgnoreCase)) { if (throwIfAlreadyExists && this.IncludePhysicalPartitionThroughputInfo != null) @@ -7101,8 +7579,38 @@ public void UpdateHelper( this.IsMaterializedViewSourceSchemaReplaceBatchRequest = value; return; } + if (string.Equals(WFConstants.BackendHeaders.PopulateCurrentPartitionThroughputInfo, key, StringComparison.OrdinalIgnoreCase)) + { + if (throwIfAlreadyExists && this.PopulateCurrentPartitionThroughputInfo != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.PopulateCurrentPartitionThroughputInfo = value; + return; + } break; case 55: + if (object.ReferenceEquals(HttpConstants.HttpHeaders.UpdateOfferStateToRestorePending, key)) + { + if (throwIfAlreadyExists && this.UpdateOfferStateToRestorePending != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.UpdateOfferStateToRestorePending = value; + return; + } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.SqlQueryForPartitionKeyExtraction, key)) + { + if (throwIfAlreadyExists && this.SqlQueryForPartitionKeyExtraction != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.SqlQueryForPartitionKeyExtraction = value; + return; + } if (string.Equals(HttpConstants.HttpHeaders.UpdateOfferStateToRestorePending, key, StringComparison.OrdinalIgnoreCase)) { if (throwIfAlreadyExists && this.UpdateOfferStateToRestorePending != null) @@ -7113,6 +7621,16 @@ public void UpdateHelper( this.UpdateOfferStateToRestorePending = value; return; } + if (string.Equals(HttpConstants.HttpHeaders.SqlQueryForPartitionKeyExtraction, key, StringComparison.OrdinalIgnoreCase)) + { + if (throwIfAlreadyExists && this.SqlQueryForPartitionKeyExtraction != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.SqlQueryForPartitionKeyExtraction = value; + return; + } break; case 56: if (string.Equals(WFConstants.BackendHeaders.CollectionChildResourceContentLimitInKB, key, StringComparison.OrdinalIgnoreCase)) @@ -7201,6 +7719,36 @@ public void UpdateHelper( } break; case 59: + if (object.ReferenceEquals(HttpConstants.HttpHeaders.UpdateMaxThroughputEverProvisioned, key)) + { + if (throwIfAlreadyExists && this.UpdateMaxThroughputEverProvisioned != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.UpdateMaxThroughputEverProvisioned = value; + return; + } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.EnableConflictResolutionPolicyUpdate, key)) + { + if (throwIfAlreadyExists && this.EnableConflictResolutionPolicyUpdate != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.EnableConflictResolutionPolicyUpdate = value; + return; + } + if (object.ReferenceEquals(HttpConstants.HttpHeaders.AllowDocumentReadsInOfflineRegion, key)) + { + if (throwIfAlreadyExists && this.AllowDocumentReadsInOfflineRegion != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.AllowDocumentReadsInOfflineRegion = value; + return; + } if (string.Equals(HttpConstants.HttpHeaders.UpdateMaxThroughputEverProvisioned, key, StringComparison.OrdinalIgnoreCase)) { if (throwIfAlreadyExists && this.UpdateMaxThroughputEverProvisioned != null) @@ -7211,6 +7759,26 @@ public void UpdateHelper( this.UpdateMaxThroughputEverProvisioned = value; return; } + if (string.Equals(HttpConstants.HttpHeaders.EnableConflictResolutionPolicyUpdate, key, StringComparison.OrdinalIgnoreCase)) + { + if (throwIfAlreadyExists && this.EnableConflictResolutionPolicyUpdate != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.EnableConflictResolutionPolicyUpdate = value; + return; + } + if (string.Equals(HttpConstants.HttpHeaders.AllowDocumentReadsInOfflineRegion, key, StringComparison.OrdinalIgnoreCase)) + { + if (throwIfAlreadyExists && this.AllowDocumentReadsInOfflineRegion != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.AllowDocumentReadsInOfflineRegion = value; + return; + } break; case 61: if (string.Equals(HttpConstants.HttpHeaders.IsServerlessStorageRefreshRequest, key, StringComparison.OrdinalIgnoreCase)) diff --git a/Microsoft.Azure.Cosmos/src/direct/RequestOptions.cs b/Microsoft.Azure.Cosmos/src/direct/RequestOptions.cs index 7700911c57..a473107bed 100644 --- a/Microsoft.Azure.Cosmos/src/direct/RequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/direct/RequestOptions.cs @@ -555,6 +555,16 @@ sealed class RequestOptions /// internal bool PopulateRestoreStatus { get; set; } + /// + /// Gets or sets the for document create requests in the Azure Cosmos DB service. + /// + /// + /// + /// PopulateCapacityType is used to return the capacity type of the request. + /// + /// + internal bool PopulateCapacityType { get; set; } + /// /// Gets or sets exclude system properties. /// ExcludeSystemProperties indicates whether system properties diff --git a/Microsoft.Azure.Cosmos/src/direct/RequestRetryUtility.cs b/Microsoft.Azure.Cosmos/src/direct/RequestRetryUtility.cs index 072de737bb..92cdbfd7de 100644 --- a/Microsoft.Azure.Cosmos/src/direct/RequestRetryUtility.cs +++ b/Microsoft.Azure.Cosmos/src/direct/RequestRetryUtility.cs @@ -64,85 +64,104 @@ public static async Task ProcessRequestAsync= minBackoffForInBackoffCallback.Value) - { - Stopwatch stopwatch = new Stopwatch(); - try + return response; + } + + TimeSpan backoffTime = shouldRetry.BackoffTime; + if (inBackoffAlternateCallbackMethod != null && backoffTime >= minBackoffForInBackoffCallback.Value) { - stopwatch.Start(); - IRetriableResponse inBackoffResponse = await inBackoffAlternateCallbackMethod(); - stopwatch.Stop(); - ShouldRetryResult shouldRetryInBackOff = null; - Debug.Assert(inBackoffResponse != null); - if (!policy.TryHandleResponseSynchronously( - request: request, - response: inBackoffResponse, - exception: null, - shouldRetryResult: out shouldRetryInBackOff)) + Stopwatch stopwatch = new Stopwatch(); + try { - shouldRetryInBackOff = await policy.ShouldRetryAsync( + stopwatch.Start(); + IRetriableResponse inBackoffResponse = await inBackoffAlternateCallbackMethod(); + stopwatch.Stop(); + ShouldRetryResult shouldRetryInBackOff = null; + Debug.Assert(inBackoffResponse != null); + if (!policy.TryHandleResponseSynchronously( request: request, response: inBackoffResponse, exception: null, - cancellationToken: cancellationToken); - } + shouldRetryResult: out shouldRetryInBackOff)) + { + shouldRetryInBackOff = await policy.ShouldRetryAsync( + request: request, + response: inBackoffResponse, + exception: null, + cancellationToken: cancellationToken); + } + + if (!shouldRetryInBackOff.ShouldRetry) + { + return inBackoffResponse; + } - if (!shouldRetryInBackOff.ShouldRetry) + DefaultTrace.TraceInformation("Failed inBackoffAlternateCallback with response, proceeding with retry. Time taken: {0}ms", stopwatch.ElapsedMilliseconds); + } + catch (Exception ex) { - return inBackoffResponse; + stopwatch.Stop(); + DefaultTrace.TraceInformation("Failed inBackoffAlternateCallback with {0}, proceeding with retry. Time taken: {1}ms", ex.ToString(), stopwatch.ElapsedMilliseconds); } - DefaultTrace.TraceInformation("Failed inBackoffAlternateCallback with response, proceeding with retry. Time taken: {0}ms", stopwatch.ElapsedMilliseconds); + backoffTime = shouldRetry.BackoffTime > stopwatch.Elapsed ? shouldRetry.BackoffTime - stopwatch.Elapsed : TimeSpan.Zero; } - catch (Exception ex) + + if (backoffTime != TimeSpan.Zero) { - stopwatch.Stop(); - DefaultTrace.TraceInformation("Failed inBackoffAlternateCallback with {0}, proceeding with retry. Time taken: {1}ms", ex.ToString(), stopwatch.ElapsedMilliseconds); + await Task.Delay(backoffTime, cancellationToken); } - backoffTime = shouldRetry.BackoffTime > stopwatch.Elapsed ? shouldRetry.BackoffTime - stopwatch.Elapsed : TimeSpan.Zero; + // if we're going to retry, force an additional async continuation so we don't have a gigantic + // stack built up by all these retries + await Task.Yield(); } - - if (backoffTime != TimeSpan.Zero) + catch { - await Task.Delay(backoffTime, cancellationToken); + // if we're going to completely fail, we want to toss all the async continuation + // stack frames so we don't have a gigantic stack trace (which has serious performance + // implications) + await Task.Yield(); + + throw; } } } diff --git a/Microsoft.Azure.Cosmos/src/direct/RntbdConstants.cs b/Microsoft.Azure.Cosmos/src/direct/RntbdConstants.cs index c50d43388b..64ead265bc 100644 --- a/Microsoft.Azure.Cosmos/src/direct/RntbdConstants.cs +++ b/Microsoft.Azure.Cosmos/src/direct/RntbdConstants.cs @@ -497,6 +497,14 @@ public enum RequestIdentifiers : ushort PopulateCapacityType = 0x00CB, TraceParent = 0x00CC, TraceState = 0x00CD, + GlobalDatabaseAccountName = 0x00CE, + EnableConflictResolutionPolicyUpdate = 0x00CF, + ClientIpAddress = 0x00D0, + IsRequestNotAuthorized = 0x00D1, + StartEpkHash = 0x00D2, + EndEpkHash = 0x00D3, + AllowDocumentReadsInOfflineRegion = 0x00D4, + PopulateCurrentPartitionThroughputInfo = 0x00D5, } public sealed class Request : RntbdTokenStream @@ -692,6 +700,14 @@ public sealed class Request : RntbdTokenStream public RntbdToken populateCapacityType; public RntbdToken traceParent; public RntbdToken traceState; + public RntbdToken globalDatabaseAccountName; + public RntbdToken enableConflictResolutionPolicyUpdate; + public RntbdToken clientIpAddress; + public RntbdToken isRequestNotAuthorized; + public RntbdToken startEpkHash; + public RntbdToken endEpkHash; + public RntbdToken allowDocumentReadsInOfflineRegion; + public RntbdToken populateCurrentPartitionThroughputInfo; public Request() { @@ -884,6 +900,14 @@ public Request() this.populateCapacityType = new RntbdToken(false, RntbdTokenTypes.Byte, (ushort)RequestIdentifiers.PopulateCapacityType); this.traceParent = new RntbdToken(false, RntbdTokenTypes.String, (ushort)RequestIdentifiers.TraceParent); this.traceState = new RntbdToken(false, RntbdTokenTypes.String, (ushort)RequestIdentifiers.TraceState); + this.globalDatabaseAccountName = new RntbdToken(false, RntbdTokenTypes.String, (ushort)RequestIdentifiers.GlobalDatabaseAccountName); + this.enableConflictResolutionPolicyUpdate = new RntbdToken(false, RntbdTokenTypes.Byte, (ushort)RequestIdentifiers.EnableConflictResolutionPolicyUpdate); + this.clientIpAddress = new RntbdToken(false, RntbdTokenTypes.String, (ushort)RequestIdentifiers.ClientIpAddress); + this.isRequestNotAuthorized = new RntbdToken(false, RntbdTokenTypes.Byte, (ushort)RequestIdentifiers.IsRequestNotAuthorized); + this.startEpkHash = new RntbdToken(false, RntbdTokenTypes.Bytes, (ushort)RequestIdentifiers.StartEpkHash); + this.endEpkHash = new RntbdToken(false, RntbdTokenTypes.Bytes, (ushort)RequestIdentifiers.EndEpkHash); + this.allowDocumentReadsInOfflineRegion = new RntbdToken(false, RntbdTokenTypes.Byte, (ushort)RequestIdentifiers.AllowDocumentReadsInOfflineRegion); + this.populateCurrentPartitionThroughputInfo = new RntbdToken(false, RntbdTokenTypes.Byte, (ushort)RequestIdentifiers.PopulateCurrentPartitionThroughputInfo); this.tokens = new RntbdToken[] { @@ -1093,6 +1117,14 @@ public Request() this.populateCapacityType, this.traceParent, this.traceState, + this.globalDatabaseAccountName, + this.enableConflictResolutionPolicyUpdate, + this.clientIpAddress, + this.isRequestNotAuthorized, + this.startEpkHash, + this.endEpkHash, + this.allowDocumentReadsInOfflineRegion, + this.populateCurrentPartitionThroughputInfo, }; } } @@ -1183,6 +1215,7 @@ public enum ResponseIdentifiers : ushort MinGLSNForDocumentOperations = 0x0068, MinGLSNForTombstoneOperations = 0x0069, HighestTentativeWriteLLSN = 0x0070, + PartitionThroughputInfo = 0x0071, } // diff --git a/Microsoft.Azure.Cosmos/src/direct/ServiceIdentity.cs b/Microsoft.Azure.Cosmos/src/direct/ServiceIdentity.cs index a1ce19d574..1d82ec0bbd 100644 --- a/Microsoft.Azure.Cosmos/src/direct/ServiceIdentity.cs +++ b/Microsoft.Azure.Cosmos/src/direct/ServiceIdentity.cs @@ -3,6 +3,7 @@ //------------------------------------------------------------ namespace Microsoft.Azure.Documents { + using Newtonsoft.Json; using System; internal interface IServiceIdentity @@ -19,6 +20,7 @@ internal sealed class ServiceIdentity : IServiceIdentity /// /// Needed for TestForWhiteListedPersistedTypes to succeed /// + [JsonConstructor] private ServiceIdentity() { } @@ -30,18 +32,21 @@ public ServiceIdentity(string federationId, Uri serviceName, bool isMasterServic this.IsMasterService = isMasterService; } + [JsonProperty] public string FederationId { get; private set; } + [JsonProperty] public Uri ServiceName { get; private set; } + [JsonProperty] public bool IsMasterService { get; diff --git a/Microsoft.Azure.Cosmos/src/direct/Snapshot.cs b/Microsoft.Azure.Cosmos/src/direct/Snapshot.cs index ba5b7001a3..bfa014b899 100644 --- a/Microsoft.Azure.Cosmos/src/direct/Snapshot.cs +++ b/Microsoft.Azure.Cosmos/src/direct/Snapshot.cs @@ -39,9 +39,7 @@ namespace Microsoft.Azure.Documents #endif class Snapshot : Resource { -#pragma warning disable CS0108 // Member hides inherited member; missing new keyword - private static DateTime UnixStartTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); -#pragma warning restore CS0108 // Member hides inherited member; missing new keyword + private new static DateTime UnixStartTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); private SnapshotContent snapshotContent; diff --git a/Microsoft.Azure.Cosmos/src/direct/SnapshotContent.cs b/Microsoft.Azure.Cosmos/src/direct/SnapshotContent.cs index e019a29ba8..dc74d8ba14 100644 --- a/Microsoft.Azure.Cosmos/src/direct/SnapshotContent.cs +++ b/Microsoft.Azure.Cosmos/src/direct/SnapshotContent.cs @@ -25,6 +25,7 @@ internal sealed class SnapshotContent : JsonSerializable private IList partitionKeyRangeResourceIds; private IList dataDirectories; + private IList storageAccountUris; // If Snapshot contains ClientEncryptionKeys this will be set private IList serializedClientEncryptionKeys; @@ -386,6 +387,28 @@ internal set } } + /// + /// Gets the list of StorageAccountUris. + /// + [JsonProperty(PropertyName = Constants.SnapshotProperties.StorageAccountUris)] + public IList StorageAccountUris + { + get + { + if (this.storageAccountUris == null) + { + this.storageAccountUris = base.GetValue>(Constants.SnapshotProperties.StorageAccountUris); + } + + return this.storageAccountUris; + } + internal set + { + this.storageAccountUris = value; + base.SetValue(Constants.SnapshotProperties.StorageAccountUris, value); + } + } + [JsonIgnore] public IList ClientEncryptionKeysList { diff --git a/Microsoft.Azure.Cosmos/src/direct/StatusCodes.cs b/Microsoft.Azure.Cosmos/src/direct/StatusCodes.cs index 1c519662ff..6248082c74 100644 --- a/Microsoft.Azure.Cosmos/src/direct/StatusCodes.cs +++ b/Microsoft.Azure.Cosmos/src/direct/StatusCodes.cs @@ -8,6 +8,8 @@ namespace Microsoft.Azure.Documents { internal enum StatusCodes { + Processing = 102, + // Success Ok = 200, Created = 201, @@ -77,6 +79,7 @@ internal enum SubStatusCodes PartitionMigrationSourcePartitionDeletedInMaster = 1034, PartitionMigrationSharedThroughputDatabasePartitionResourceNotFoundInMaster = 1035, PartitionMigrationPartitionResourceNotFoundInMaster = 1036, + PartitionMigrationFailedToUpdateDNS = 1037, // 403: Forbidden Substatus. WriteForbidden = 3, @@ -106,9 +109,18 @@ internal enum SubStatusCodes InsufficientBindablePartitions = 1007, ComputeFederationNotFound = 1012, OperationPaused = 9001, - ServiceIsOffline = 9002, InsufficientCapacity = 9003, + // Federation Buildout / Expansion error codes + AggregatedHealthStateError = 6001, // - Aggregated health state is Error + ApplicationHealthStateError = 6002, // - Any application is in Warning or Error state + HealthStateError = 6003, // - Any health events in Error state are found + UnhealthyEventFound = 6004, // - Any unhealthy evaluations are found (except for Warning evaluations on Nodes) + ClusterHealthEmpty = 6005, // Cluster Health States is empty + AllocationFailed = 6006, // Allocation failed for federation + OperationResultNull = 6007, // Null operation result + OperationResultUnexpected = 6008, // Null operation result + //412: PreCondition Failed SplitIsDisabled = 2001, CollectionsInPartitionGotUpdated = 2002, @@ -139,17 +151,29 @@ internal enum SubStatusCodes PartitionMigrationSourceAndTargetFederationSubregionIsNotSame = 2024, PartitionMigrationFailedToCreatePartitionMigrationLocks = 2025, PartitionMigrationFailedToResolvePartitionInformation = 2026, - PartitionMigrationTopologyHasWriteRegionEmpty = 2027, PartitionMigrationIsDisableOnTheGlobalDatabaseAccount = 2028, PartitionMigrationIsDisableOnTheRunnerAccount = 2029, PartitionMigrationCanNotProceedForInactiveRegionalDatabaseAccount = 2030, PartitionMigrationDidNotCompleteWaitForFullSyncInTenRetries = 2031, + PartitionMigrationCanNotProceedForDeletingRegionalDatabaseAccount = 2032, + PartitionMigrationCanNotProceedForDeletionFailedRegionalDatabaseAccount = 2033, + PartitionMigrationCanNotAcquireRegionalDatabaseAccountPartitionMigrationLock = 2034, + PartitionMigrationIsDisabledOnReadyForDecommissionFederation = 2035, + PartitionMigrationCanNotAcquirePartitionLock = 2036, + PartitionMigrationCanNotAcquirePartitionKeyRangesLock = 2037, + PartitionMigrationCanNotProceedForDeletingGlobalDatabaseAccount = 2038, + PartitionMigrationCanNotProceedForDeletionFailedGlobalDatabaseAccount = 2039, + PartitionMigrationCanNotProceedForRevokedGlobalDatabaseAccount = 2040, + PartitionMigrationMasterServiceTopologyHasWriteRegionEmpty = 2041, + PartitionMigrationWriteRegionServiceTopologyHasWriteRegionEmpty = 2042, + PartitionMigrationIsDisabledOnFinalizingDecommissionFederation = 2043, // 500: InternalServerError ConfigurationNameNotEmpty = 3001, ConfigurationOperationCancelled = 3002, InvalidAccountConfiguration = 3003, FederationDoesnotExistOrIsLocked = 3004, + PartitionFailoverErrorCode = 3010, // 429: Request Rate Too Large PrepareTimeLimitExceeded = 3207, @@ -177,6 +201,7 @@ internal enum SubStatusCodes InvalidKeyVaultSecretURI = 4014, // Indicates the Key Vault secret URI is invalid. UndefinedDefaultIdentity = 4015, // Indicates that the account has an undefined default identity. NspOutboundDenied = 4016, // Indicates that the account's NSP is blocking outbound requests to Key Vault. + KeyVaultNotFound = 4017, // Indicates that the Key Vault could not be found by the system. // Keep in sync with Microsoft.Azure.Cosmos.ServiceFramework.Security.AadAuthentication.AadSubStatusCodes // 401 : Unauthorized Exception (User-side errors start with 50) @@ -227,7 +252,11 @@ internal enum SubStatusCodes // 401 Unauthorized Exception (mutual TLS client auth failed) MutualTlsClientAuthFailed = 5600, + // 200 OK.GW response to GET DocService request. + LocationsModified = 5700, // Indicates locations derived from topology have been modified due to region being offlined. + // SDK Codes (Client) + // IMPORTANT - keep these consistent with Java SDK as well TransportGenerated410 = 20001, TimeoutGenerated410 = 20002, TransportGenerated503 = 20003, @@ -235,8 +264,10 @@ internal enum SubStatusCodes Client_ThreadStarvation = 20005, Channel_Closed = 20006, MalformedContinuationToken = 20007, + // EndToEndOperationCancelled = 20008 - cancellation by e2e retry policy - currently only applicable in Java //SDK Codes (Server) + // IMPORTANT - keep these consistent with Java SDK as well Server_NameCacheIsStaleExceededRetryLimit = 21001, Server_PartitionKeyRangeGoneExceededRetryLimit = 21002, Server_CompletingSplitExceededRetryLimit = 21003, @@ -245,7 +276,12 @@ internal enum SubStatusCodes Server_GlobalStrongWriteBarrierNotMet = 21006, Server_ReadQuorumNotMet = 21007, ServerGenerated503 = 21008, - Server_NoValidStoreResponse = 21009 + Server_NoValidStoreResponse = 21009, + // ServerGenerated408 = 21010 - currently only applicable in Java + + // Data Transfer Application related + MissingPartitionKeyInDataTransfer = 22001, + InvalidPartitionKeyInDataTransfer = 22002 } internal static class StatusCodesExtensions diff --git a/Microsoft.Azure.Cosmos/src/direct/StoreResponseNameValueCollection.cs b/Microsoft.Azure.Cosmos/src/direct/StoreResponseNameValueCollection.cs index 9b2b968c93..e6fefde124 100644 --- a/Microsoft.Azure.Cosmos/src/direct/StoreResponseNameValueCollection.cs +++ b/Microsoft.Azure.Cosmos/src/direct/StoreResponseNameValueCollection.cs @@ -91,6 +91,7 @@ internal class StoreResponseNameValueCollection : INameValueCollection, IEnumera public string OwnerFullName { get; set; } public string OwnerId { get; set; } public string PartitionKeyRangeId { get; set; } + public string PartitionThroughputInfo { get; set; } public string PendingPKDelete { get; set; } public string PhysicalPartitionId { get; set; } public string QueryExecutionInfo { get; set; } @@ -215,6 +216,7 @@ public void Clear() this.OwnerFullName = null; this.OwnerId = null; this.PartitionKeyRangeId = null; + this.PartitionThroughputInfo = null; this.PendingPKDelete = null; this.PhysicalPartitionId = null; this.QueryExecutionInfo = null; @@ -311,6 +313,7 @@ public INameValueCollection Clone() OwnerFullName = this.OwnerFullName, OwnerId = this.OwnerId, PartitionKeyRangeId = this.PartitionKeyRangeId, + PartitionThroughputInfo = this.PartitionThroughputInfo, PendingPKDelete = this.PendingPKDelete, PhysicalPartitionId = this.PhysicalPartitionId, QueryExecutionInfo = this.QueryExecutionInfo, @@ -691,6 +694,10 @@ IEnumerator> IEnumerable(WFConstants.BackendHeaders.HighestTentativeWriteLLSN, this.HighestTentativeWriteLLSN); } + if (this.PartitionThroughputInfo != null) + { + yield return new KeyValuePair(WFConstants.BackendHeaders.PartitionThroughputInfo, this.PartitionThroughputInfo); + } if (this.lazyNotCommonHeaders != null) { @@ -1046,6 +1053,10 @@ public IEnumerable Keys() { yield return WFConstants.BackendHeaders.HighestTentativeWriteLLSN; } + if (this.PartitionThroughputInfo != null) + { + yield return WFConstants.BackendHeaders.PartitionThroughputInfo; + } if (this.lazyNotCommonHeaders != null) { @@ -1400,6 +1411,10 @@ public NameValueCollection ToNameValueCollection() { this.nameValueCollection.Add(WFConstants.BackendHeaders.HighestTentativeWriteLLSN, this.HighestTentativeWriteLLSN); } + if (this.PartitionThroughputInfo != null) + { + this.nameValueCollection.Add(WFConstants.BackendHeaders.PartitionThroughputInfo, this.PartitionThroughputInfo); + } if(this.lazyNotCommonHeaders != null) { foreach (KeyValuePair keyValuePair in this.lazyNotCommonHeaders) @@ -2055,6 +2070,10 @@ public string Get(string key) { return this.MergeProgressBlocked; } + if (object.ReferenceEquals(WFConstants.BackendHeaders.PartitionThroughputInfo, key)) + { + return this.PartitionThroughputInfo; + } if (string.Equals(WFConstants.BackendHeaders.IsRUPerMinuteUsed, key, StringComparison.OrdinalIgnoreCase)) { return this.IsRUPerMinuteUsed; @@ -2070,6 +2089,11 @@ public string Get(string key) return this.MergeProgressBlocked; } + if (string.Equals(WFConstants.BackendHeaders.PartitionThroughputInfo, key, StringComparison.OrdinalIgnoreCase)) + { + return this.PartitionThroughputInfo; + } + break; case 38: if (object.ReferenceEquals(WFConstants.BackendHeaders.VectorClockLocalProgress, key)) @@ -2110,6 +2134,10 @@ public string Get(string key) break; case 40: + if (object.ReferenceEquals(WFConstants.BackendHeaders.SoftMaxAllowedThroughput, key)) + { + return this.SoftMaxAllowedThroughput; + } if (object.ReferenceEquals(WFConstants.BackendHeaders.HighestTentativeWriteLLSN, key)) { return this.HighestTentativeWriteLLSN; @@ -3550,6 +3578,16 @@ public void UpdateHelper( this.MergeProgressBlocked = value; return; } + if (object.ReferenceEquals(WFConstants.BackendHeaders.PartitionThroughputInfo, key)) + { + if (throwIfAlreadyExists && this.PartitionThroughputInfo != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.PartitionThroughputInfo = value; + return; + } if (string.Equals(WFConstants.BackendHeaders.IsRUPerMinuteUsed, key, StringComparison.OrdinalIgnoreCase)) { if (throwIfAlreadyExists && this.IsRUPerMinuteUsed != null) @@ -3580,6 +3618,16 @@ public void UpdateHelper( this.MergeProgressBlocked = value; return; } + if (string.Equals(WFConstants.BackendHeaders.PartitionThroughputInfo, key, StringComparison.OrdinalIgnoreCase)) + { + if (throwIfAlreadyExists && this.PartitionThroughputInfo != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.PartitionThroughputInfo = value; + return; + } break; case 38: if (object.ReferenceEquals(WFConstants.BackendHeaders.VectorClockLocalProgress, key)) @@ -3664,6 +3712,16 @@ public void UpdateHelper( } break; case 40: + if (object.ReferenceEquals(WFConstants.BackendHeaders.SoftMaxAllowedThroughput, key)) + { + if (throwIfAlreadyExists && this.SoftMaxAllowedThroughput != null) + { + throw new ArgumentException($"The {key} already exists in the collection"); + } + + this.SoftMaxAllowedThroughput = value; + return; + } if (object.ReferenceEquals(WFConstants.BackendHeaders.HighestTentativeWriteLLSN, key)) { if (throwIfAlreadyExists && this.HighestTentativeWriteLLSN != null) diff --git a/Microsoft.Azure.Cosmos/src/direct/TimerPool.cs b/Microsoft.Azure.Cosmos/src/direct/TimerPool.cs index 8d9304997a..3c8d6166a5 100644 --- a/Microsoft.Azure.Cosmos/src/direct/TimerPool.cs +++ b/Microsoft.Azure.Cosmos/src/direct/TimerPool.cs @@ -199,6 +199,7 @@ public PooledTimer GetPooledTimer(int timeoutInSeconds) /// /// get a timer with timeout specified as a TimeSpan /// + /// /// public PooledTimer GetPooledTimer(TimeSpan timeout) { diff --git a/Microsoft.Azure.Cosmos/src/direct/TransportSerialization.cs b/Microsoft.Azure.Cosmos/src/direct/TransportSerialization.cs index 8b68361ed3..0ddfdc2f3c 100644 --- a/Microsoft.Azure.Cosmos/src/direct/TransportSerialization.cs +++ b/Microsoft.Azure.Cosmos/src/direct/TransportSerialization.cs @@ -108,9 +108,15 @@ internal static SerializedRequest BuildRequestForProxy( ResourceOperation resourceOperation, Guid activityId, BufferProvider bufferProvider, + string globalDatabaseAccountName, out int headerSize, out int? bodySize) { + if (string.IsNullOrEmpty(globalDatabaseAccountName)) + { + throw new ArgumentNullException(nameof(globalDatabaseAccountName)); + } + RntbdConstants.Request rntbdRequest = new(); // for proxy, transportRequestId and replicapath are optional. @@ -127,6 +133,13 @@ internal static SerializedRequest BuildRequestForProxy( rntbdRequest.tokens[tokenIndex] = rntbdRequest.tokens[0]; rntbdRequest.tokens[0] = rntbdRequest.effectivePartitionKey; + // Account name is the second token + tokenIndex = Array.IndexOf(rntbdRequest.tokens, rntbdRequest.globalDatabaseAccountName); + rntbdRequest.tokens[tokenIndex] = rntbdRequest.tokens[1]; + rntbdRequest.tokens[1] = rntbdRequest.globalDatabaseAccountName; + rntbdRequest.globalDatabaseAccountName.value.valueBytes = BytesSerializer.GetBytesForString(globalDatabaseAccountName, rntbdRequest); + rntbdRequest.globalDatabaseAccountName.isPresent = true; + return BuildRequestCore( request, ref rntbdRequest, @@ -272,6 +285,8 @@ private static SerializedRequest BuildRequestCore( TransportSerialization.AddIsMaterializedViewSourceSchemaReplaceBatchRequest(requestHeaders, rntbdRequest); TransportSerialization.AddIsCassandraAlterTypeRequest(request, rntbdRequest); TransportSerialization.AddHighPriorityForcedBackup(requestHeaders, rntbdRequest); + TransportSerialization.AddEnableConflictResolutionPolicyUpdate(requestHeaders, rntbdRequest); + TransportSerialization.AddAllowDocumentReadsInOfflineRegion(requestHeaders, rntbdRequest); TransportSerialization.FillTokenFromHeader(request, HttpConstants.HttpHeaders.Authorization, requestHeaders.Authorization, rntbdRequest.authorizationToken, rntbdRequest); TransportSerialization.FillTokenFromHeader(request, HttpConstants.HttpHeaders.SessionToken, requestHeaders.SessionToken, rntbdRequest.sessionToken, rntbdRequest); @@ -355,6 +370,11 @@ private static SerializedRequest BuildRequestCore( TransportSerialization.FillTokenFromHeader(request, WFConstants.BackendHeaders.PopulateCapacityType, requestHeaders.PopulateCapacityType, rntbdRequest.populateCapacityType, rntbdRequest); TransportSerialization.FillTokenFromHeader(request, HttpConstants.HttpHeaders.TraceParent, requestHeaders.TraceParent, rntbdRequest.traceParent, rntbdRequest); TransportSerialization.FillTokenFromHeader(request, HttpConstants.HttpHeaders.TraceState, requestHeaders.TraceState, rntbdRequest.traceState, rntbdRequest); + TransportSerialization.FillTokenFromHeader(request, WFConstants.BackendHeaders.ClientIpAddress, requestHeaders.ClientIpAddress, rntbdRequest.clientIpAddress, rntbdRequest); + TransportSerialization.FillTokenFromHeader(request, WFConstants.BackendHeaders.IsRequestNotAuthorized, requestHeaders.IsRequestNotAuthorized, rntbdRequest.isRequestNotAuthorized, rntbdRequest); + TransportSerialization.FillTokenFromHeader(request, WFConstants.BackendHeaders.StartEpkHash, headerStringValue: null, rntbdRequest.startEpkHash, rntbdRequest); + TransportSerialization.FillTokenFromHeader(request, WFConstants.BackendHeaders.EndEpkHash, headerStringValue: null, rntbdRequest.endEpkHash, rntbdRequest); + TransportSerialization.FillTokenFromHeader(request, WFConstants.BackendHeaders.PopulateCurrentPartitionThroughputInfo, requestHeaders.PopulateCurrentPartitionThroughputInfo, rntbdRequest.populateCurrentPartitionThroughputInfo, rntbdRequest); // will be null in case of direct, which is fine - BE will use the value from the connection context message. // When this is used in Gateway, the header value will be populated with the proxied HTTP request's header, and @@ -547,8 +567,10 @@ private static RntbdConstants.RntbdOperationType GetRntbdOperationType(Operation return RntbdConstants.RntbdOperationType.Batch; case OperationType.CompleteUserTransaction: return RntbdConstants.RntbdOperationType.CompleteUserTransaction; + case OperationType.MetadataCheckAccess: + return RntbdConstants.RntbdOperationType.MetadataCheckAccess; #if !COSMOSCLIENT - case OperationType.Crash: + case OperationType.Crash: return RntbdConstants.RntbdOperationType.Crash; case OperationType.Pause: return RntbdConstants.RntbdOperationType.Pause; @@ -606,8 +628,6 @@ private static RntbdConstants.RntbdOperationType GetRntbdOperationType(Operation return RntbdConstants.RntbdOperationType.ForcePartitionBackup; case OperationType.MasterInitiatedProgressCoordination: return RntbdConstants.RntbdOperationType.MasterInitiatedProgressCoordination; - case OperationType.MetadataCheckAccess: - return RntbdConstants.RntbdOperationType.MetadataCheckAccess; case OperationType.CreateSystemSnapshot: return RntbdConstants.RntbdOperationType.CreateSystemSnapshot; case OperationType.CreateRidRangeResources: @@ -2585,6 +2605,18 @@ private static void AddHighPriorityForcedBackup(RequestNameValueCollection reque } } + private static void AddEnableConflictResolutionPolicyUpdate(RequestNameValueCollection requestHeaders, RntbdConstants.Request rntbdRequest) + { + if (!string.IsNullOrEmpty(requestHeaders.EnableConflictResolutionPolicyUpdate)) + { + rntbdRequest.enableConflictResolutionPolicyUpdate.value.valueByte = (requestHeaders.EnableConflictResolutionPolicyUpdate. + Equals(bool.TrueString, StringComparison.OrdinalIgnoreCase)) + ? (byte)0x01 + : (byte)0x00; + rntbdRequest.enableConflictResolutionPolicyUpdate.isPresent = true; + } + } + private static void AddPriorityLevelHeader(DocumentServiceRequest request, string headerName, string headerStringValue, RequestNameValueCollection requestHeaders, RntbdConstants.Request rntbdRequest) { PriorityLevel priorityLevel = PriorityLevel.High; @@ -2632,5 +2664,17 @@ private static void AddPriorityLevelHeader(DocumentServiceRequest request, strin rntbdRequest.priorityLevel.value.valueByte = (byte) rntbdPriorityLevel; rntbdRequest.priorityLevel.isPresent = true; } + + private static void AddAllowDocumentReadsInOfflineRegion(RequestNameValueCollection requestHeaders, RntbdConstants.Request rntbdRequest) + { + if (!string.IsNullOrEmpty(requestHeaders.AllowDocumentReadsInOfflineRegion)) + { + rntbdRequest.allowDocumentReadsInOfflineRegion.value.valueByte = (requestHeaders.AllowDocumentReadsInOfflineRegion. + Equals(bool.TrueString, StringComparison.OrdinalIgnoreCase)) + ? (byte)0x01 + : (byte)0x00; + rntbdRequest.allowDocumentReadsInOfflineRegion.isPresent = true; + } + } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/direct/TriggerOperation.cs b/Microsoft.Azure.Cosmos/src/direct/TriggerOperation.cs index efdd9e3c45..d9d183730a 100644 --- a/Microsoft.Azure.Cosmos/src/direct/TriggerOperation.cs +++ b/Microsoft.Azure.Cosmos/src/direct/TriggerOperation.cs @@ -36,6 +36,11 @@ enum TriggerOperation : short /// /// Specifies replace operations only. /// - Replace = 0x4 + Replace = 0x4, + + /// + /// Specifies upsert operations only. + /// + Upsert = 0x5 } } diff --git a/Microsoft.Azure.Cosmos/src/direct/ValueStopwatch.cs b/Microsoft.Azure.Cosmos/src/direct/ValueStopwatch.cs index 962f01779b..852456c5e3 100644 --- a/Microsoft.Azure.Cosmos/src/direct/ValueStopwatch.cs +++ b/Microsoft.Azure.Cosmos/src/direct/ValueStopwatch.cs @@ -27,9 +27,7 @@ internal struct ValueStopwatch /// public static readonly bool IsHighResolution = Stopwatch.IsHighResolution; -#pragma warning disable CS1570 // XML comment has badly formed XML -#pragma warning disable CS1570 // XML comment has badly formed XML -/// + /// /// We pack everything into a single long, so using this doesn't inflate any objects with it as a field. /// /// State is interpreted as follows @@ -47,8 +45,6 @@ internal struct ValueStopwatch /// to account for any existing duration. /// private long state; -#pragma warning restore CS1570 // XML comment has badly formed XML -#pragma warning restore CS1570 // XML comment has badly formed XML /// public readonly bool IsRunning diff --git a/Microsoft.Azure.Cosmos/src/direct/WFConstants.cs b/Microsoft.Azure.Cosmos/src/direct/WFConstants.cs index f50dbf45a02944e5681325cf25b4878454af07f8..918c6cad9b81641ebdc0952c77abeb8636e47746 100644 GIT binary patch delta 470 zcmdmUm~qEB#tjx4`pyjb40#M`3^@#$49N^73_%R348=gP9EMULFB2>q0Oo__D<_{; zvA0bH>PTcr0;)-6&;^R3noxwrgaRZJ3{}H7>u4lcaF;R^0U^k+lF5kz!jmVdim-cv z9g{zKVS*`&{6iD*$wyR0ChN%tO;%77LQ%_Tr9AnWi4a`g!AW3pS3=F?1Un;Pkhj1# zFnBT)FgP-#Fr-YrsH-WN4E8WYMi;220O*lKuiY|5z&g}@*H1x5*jAJF+F zK;57q$pEs8fI6xeQYSxjQJ#Fyjcf7?FCNJ}uo{pl=&Ck~c~4#^$i`U&)a?qiDSI-b zjr3##TRusU*@-~YN`SVff@FYn22iAUa$&GHw<|C#Qc!h>f?S+}MYZ%~w#01!KP`6i delta 22 ecmdmSj&aXn#tjx4o82@+EGB0qS50n8+Xet}`w7ti diff --git a/Microsoft.Azure.Cosmos/src/direct/WindowsSystemUtilizationReader.cs b/Microsoft.Azure.Cosmos/src/direct/WindowsSystemUtilizationReader.cs index 6baffbcaa0..35c64dd1cf 100644 --- a/Microsoft.Azure.Cosmos/src/direct/WindowsSystemUtilizationReader.cs +++ b/Microsoft.Azure.Cosmos/src/direct/WindowsSystemUtilizationReader.cs @@ -85,6 +85,8 @@ private static class NativeMethods /// /// https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-globalmemorystatusex /// + /// + /// /// /// [DllImport("kernel32.dll", SetLastError = true)] diff --git a/Microsoft.Azure.Cosmos/src/direct/rntbd2/TransportClient.cs b/Microsoft.Azure.Cosmos/src/direct/rntbd2/TransportClient.cs index e6c61819f8..87ec56777d 100644 --- a/Microsoft.Azure.Cosmos/src/direct/rntbd2/TransportClient.cs +++ b/Microsoft.Azure.Cosmos/src/direct/rntbd2/TransportClient.cs @@ -148,10 +148,6 @@ internal override async Task InvokeStoreAsync( resourceOperation, activityId, transportRequestStats); transportRequestStats.RecordState(TransportRequestStats.RequestStage.Completed); storeResponse.TransportRequestStats = transportRequestStats; - -#if NETSTANDARD2_0_OR_GREATER - recorder?.Record(physicalAddress.Uri, storeResponse: storeResponse); -#endif } catch (TransportException ex) { @@ -275,13 +271,15 @@ internal override async Task InvokeStoreAsync( recorder?.Record(physicalAddress.Uri, documentClientException: exception); throw; } + + // Record the information of the sucessfull response in the end, it also make sure it is not getting called twice. + recorder?.Record(physicalAddress.Uri, storeResponse: storeResponse); #else catch (DocumentClientException) { throw; } #endif - return storeResponse; } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs index 5615f1dc34..4bb3eb27b6 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs @@ -18,6 +18,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using Microsoft.VisualStudio.TestTools.UnitTesting; using Newtonsoft.Json; using Newtonsoft.Json.Linq; + using ClientEncryptionIncludedPath = Microsoft.Azure.Cosmos.ClientEncryptionIncludedPath; [TestClass] public class CosmosContainerTests @@ -1384,7 +1385,7 @@ public async Task ClientEncryptionPolicyTest() EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256", EncryptionType = "Deterministic" }, - new ClientEncryptionIncludedPath() + new Microsoft.Azure.Cosmos.ClientEncryptionIncludedPath() { Path = "/path2", ClientEncryptionKeyId = "dekId2", @@ -1397,7 +1398,7 @@ public async Task ClientEncryptionPolicyTest() { Id = containerName, PartitionKey = new Documents.PartitionKeyDefinition() { Paths = new Collection { partitionKeyPath }, Kind = Documents.PartitionKind.Hash }, - ClientEncryptionPolicy = new ClientEncryptionPolicy(includedPaths:paths,policyFormatVersion:2) + ClientEncryptionPolicy = new Microsoft.Azure.Cosmos.ClientEncryptionPolicy(includedPaths:paths,policyFormatVersion:2) }; ContainerResponse containerResponse = await this.cosmosDatabase.CreateContainerIfNotExistsAsync(setting); @@ -1406,7 +1407,7 @@ public async Task ClientEncryptionPolicyTest() ContainerProperties responseSettings = containerResponse; Assert.AreEqual(3, responseSettings.ClientEncryptionPolicy.IncludedPaths.Count()); - ClientEncryptionIncludedPath includedPath = responseSettings.ClientEncryptionPolicy.IncludedPaths.ElementAt(0); + Microsoft.Azure.Cosmos.ClientEncryptionIncludedPath includedPath = responseSettings.ClientEncryptionPolicy.IncludedPaths.ElementAt(0); Assert.AreEqual(partitionKeyPath, includedPath.Path); Assert.AreEqual("dekId1", includedPath.ClientEncryptionKeyId); Assert.AreEqual("AEAD_AES_256_CBC_HMAC_SHA256", includedPath.EncryptionAlgorithm); @@ -1431,16 +1432,16 @@ public async Task ClientEncryptionPolicyTest() // version 1 test. containerName = Guid.NewGuid().ToString(); partitionKeyPath = "/users"; - paths = new Collection() + paths = new Collection() { - new ClientEncryptionIncludedPath() + new Microsoft.Azure.Cosmos.ClientEncryptionIncludedPath() { Path = "/path1", ClientEncryptionKeyId = "dekId1", EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256", EncryptionType = "Randomized" }, - new ClientEncryptionIncludedPath() + new Microsoft.Azure.Cosmos.ClientEncryptionIncludedPath() { Path = "/path2", ClientEncryptionKeyId = "dekId2", @@ -1453,7 +1454,7 @@ public async Task ClientEncryptionPolicyTest() { Id = containerName, PartitionKey = new Documents.PartitionKeyDefinition() { Paths = new Collection { partitionKeyPath }, Kind = Documents.PartitionKind.Hash }, - ClientEncryptionPolicy = new ClientEncryptionPolicy(paths) + ClientEncryptionPolicy = new Microsoft.Azure.Cosmos.ClientEncryptionPolicy(paths) }; containerResponse = await this.cosmosDatabase.CreateContainerIfNotExistsAsync(setting); @@ -1585,7 +1586,7 @@ public async Task ClientEncryptionPolicyFailureTest() EncryptionAlgorithm = "AEAD_AES_256_CBC_HMAC_SHA256", EncryptionType = "Randomized" }, - new ClientEncryptionIncludedPath() + new Microsoft.Azure.Cosmos.ClientEncryptionIncludedPath() { Path = "/path1", ClientEncryptionKeyId = "dekId1", @@ -1598,7 +1599,7 @@ public async Task ClientEncryptionPolicyFailureTest() { Id = containerName, PartitionKey = new Documents.PartitionKeyDefinition() { Paths = new Collection { partitionKeyPath }, Kind = Documents.PartitionKind.Hash }, - ClientEncryptionPolicy = new ClientEncryptionPolicy(includedPaths: pathsToEncryptWithPartitionKey, policyFormatVersion: 2) + ClientEncryptionPolicy = new Microsoft.Azure.Cosmos.ClientEncryptionPolicy(includedPaths: pathsToEncryptWithPartitionKey, policyFormatVersion: 2) }; await this.cosmosDatabase.CreateContainerAsync(setting); @@ -1633,7 +1634,7 @@ public async Task ClientEncryptionPolicyFailureTest() { Id = containerName, PartitionKey = new Documents.PartitionKeyDefinition() { Paths = new Collection { partitionKeyPath }, Kind = Documents.PartitionKind.Hash }, - ClientEncryptionPolicy = new ClientEncryptionPolicy(includedPaths: pathsToEncryptWithPartitionKey, policyFormatVersion: 2) + ClientEncryptionPolicy = new Microsoft.Azure.Cosmos.ClientEncryptionPolicy(includedPaths: pathsToEncryptWithPartitionKey, policyFormatVersion: 2) }; await this.cosmosDatabase.CreateContainerAsync(setting); @@ -1647,9 +1648,9 @@ public async Task ClientEncryptionPolicyFailureTest() // failure due to policy format version 1. for Pk and Id try { - Collection pathsToEncryptWithPartitionKey = new Collection() + Collection pathsToEncryptWithPartitionKey = new Collection() { - new ClientEncryptionIncludedPath() + new Microsoft.Azure.Cosmos.ClientEncryptionIncludedPath() { Path = partitionKeyPath, ClientEncryptionKeyId = "dekId1", @@ -1662,7 +1663,7 @@ public async Task ClientEncryptionPolicyFailureTest() { Id = containerName, PartitionKey = new Documents.PartitionKeyDefinition() { Paths = new Collection { partitionKeyPath }, Kind = Documents.PartitionKind.Hash }, - ClientEncryptionPolicy = new ClientEncryptionPolicy(pathsToEncryptWithPartitionKey) + ClientEncryptionPolicy = new Microsoft.Azure.Cosmos.ClientEncryptionPolicy(pathsToEncryptWithPartitionKey) }; await this.cosmosDatabase.CreateContainerAsync(setting); @@ -1675,9 +1676,9 @@ public async Task ClientEncryptionPolicyFailureTest() try { - Collection pathsToEncryptWithPartitionKey = new Collection() + Collection pathsToEncryptWithPartitionKey = new Collection() { - new ClientEncryptionIncludedPath() + new Microsoft.Azure.Cosmos.ClientEncryptionIncludedPath() { Path = "/id", ClientEncryptionKeyId = "dekId1", @@ -1690,7 +1691,7 @@ public async Task ClientEncryptionPolicyFailureTest() { Id = containerName, PartitionKey = new Documents.PartitionKeyDefinition() { Paths = new Collection { partitionKeyPath }, Kind = Documents.PartitionKind.Hash }, - ClientEncryptionPolicy = new ClientEncryptionPolicy(pathsToEncryptWithPartitionKey) + ClientEncryptionPolicy = new Microsoft.Azure.Cosmos.ClientEncryptionPolicy(pathsToEncryptWithPartitionKey) }; await this.cosmosDatabase.CreateContainerAsync(setting); @@ -1719,7 +1720,7 @@ public async Task ClientEncryptionPolicyFailureTest() { Id = containerName, PartitionKeyPaths = new Collection { "/path1", "/id" }, - ClientEncryptionPolicy = new ClientEncryptionPolicy(includedPaths: pathsToEncryptWithPartitionKey, policyFormatVersion: 2) + ClientEncryptionPolicy = new Microsoft.Azure.Cosmos.ClientEncryptionPolicy(includedPaths: pathsToEncryptWithPartitionKey, policyFormatVersion: 2) }; await this.cosmosDatabase.CreateContainerAsync(setting); @@ -1748,7 +1749,7 @@ public async Task ClientEncryptionPolicyFailureTest() { Id = containerName, PartitionKeyPaths = new Collection { partitionKeyPath, "/path1" }, - ClientEncryptionPolicy = new ClientEncryptionPolicy(includedPaths: pathsToEncryptWithPartitionKey, policyFormatVersion: 2) + ClientEncryptionPolicy = new Microsoft.Azure.Cosmos.ClientEncryptionPolicy(includedPaths: pathsToEncryptWithPartitionKey, policyFormatVersion: 2) }; await this.cosmosDatabase.CreateContainerAsync(setting); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj index 7ff30b3cee..ada11a75c0 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Microsoft.Azure.Cosmos.EmulatorTests.csproj @@ -19,7 +19,6 @@ - diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs index c43a1aaf79..9d2d56ef55 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/TestCommon.cs @@ -144,10 +144,11 @@ internal static CosmosClient CreateCosmosClient( if(enableDistributingTracing) { - cosmosClientBuilder.WithDistributedTracingOptions(new DistributedTracingOptions() + // TODO: Check with Sourabh for potential fixes. + /*cosmosClientBuilder.WithDistributedTracingOptions(new DistributedTracingOptions() { LatencyThresholdForDiagnosticEvent = TimeSpan.FromMilliseconds(0) - }); + });*/ } return cosmosClientBuilder.Build();
@@ -45,17 +82,8 @@ public MetricsCollectorProvider(BenchmarkConfig config, MeterProvider meterProvi /// Benchmark configuration. /// Metrics collector. /// Thrown if provided benchmark operation is not covered supported to collect metrics. - public IMetricsCollector GetMetricsCollector(IBenchmarkOperation benchmarkOperation, BenchmarkConfig config) + public IMetricsCollector GetMetricsCollector(IBenchmarkOperation benchmarkOperation) { - MetricCollectionWindow metricCollectionWindow = this.metricCollectionWindow; - - // Reset metricCollectionWindow and flush. - if (!metricCollectionWindow.IsValid) - { - this.meterProvider.ForceFlush(); - metricCollectionWindow.Reset(config); - } - return benchmarkOperation.OperationType switch { BenchmarkOperationType.Insert => this.insertOperationMetricsCollector, diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/ParallelExecutionStrategy.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/ParallelExecutionStrategy.cs index 2348d4a995..d32052e3fe 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/ParallelExecutionStrategy.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/ParallelExecutionStrategy.cs @@ -43,6 +43,7 @@ await warmupExecutor.ExecuteAsync( benchmarkConfig, metricsCollectorProvider); + Utility.TeePrint("Starting execution {0} tasks", serialExecutorConcurrency); IExecutor[] executors = new IExecutor[serialExecutorConcurrency]; for (int i = 0; i < serialExecutorConcurrency; i++) { @@ -113,9 +114,8 @@ private async Task LogOutputStats( using (ConsoleColorContext ct = new ConsoleColorContext(ConsoleColor.Green)) { - Console.WriteLine(); - Console.WriteLine("Summary:"); - Console.WriteLine("--------------------------------------------------------------------- "); + Utility.TeeTraceInformation("Summary:"); + Utility.TeeTraceInformation("--------------------------------------------------------------------- "); lastSummary.Print(lastSummary.failedOpsCount + lastSummary.successfulOpsCount); // Skip first 5 and last 5 counters as outliers @@ -128,7 +128,6 @@ private async Task LogOutputStats( if (summaryCounters.Length > 10) { - Console.WriteLine(); Utility.TeeTraceInformation("After Excluding outliers"); runSummary.Top10PercentAverageRps = Math.Round(summaryCounters.Take((int)(0.1 * summaryCounters.Length)).Average(), 0); @@ -160,7 +159,7 @@ private async Task LogOutputStats( Utility.TeeTraceInformation("Please adjust ItemCount high to run of at-least 1M"); } - Console.WriteLine("--------------------------------------------------------------------- "); + Utility.TeeTraceInformation("--------------------------------------------------------------------- "); return runSummary; } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/SerialOperationExecutor.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/SerialOperationExecutor.cs index b33218f65b..3bb84e26fa 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/SerialOperationExecutor.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/SerialOperationExecutor.cs @@ -50,8 +50,7 @@ public async Task ExecuteAsync( int currentIterationCount = 0; do { - IMetricsCollector metricsCollector = metricsCollectorProvider.GetMetricsCollector(this.operation, benchmarkConfig); - + IMetricsCollector metricsCollector = metricsCollectorProvider.GetMetricsCollector(this.operation); OperationResult? operationResult = null; await this.operation.PrepareAsync(); @@ -115,7 +114,8 @@ public async Task ExecuteAsync( } catch (Exception e) { - Trace.TraceInformation($"Error: {e.Message}"); + Utility.TraceError("Error:", e); + } finally { diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/TelemetrySpan.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/TelemetrySpan.cs index fff2acac3e..4f8785860d 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/TelemetrySpan.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/TelemetrySpan.cs @@ -63,11 +63,11 @@ public void Dispose() if(this.isFailed) { - this.recordSuccessOpLatencyAction?.Invoke(TimeSpan.FromMilliseconds(this.stopwatch.Elapsed.TotalMilliseconds)); + this.recordSuccessOpLatencyAction?.Invoke(this.stopwatch.Elapsed); } else { - this.recordSuccessOpLatencyAction?.Invoke(TimeSpan.FromMilliseconds(this.stopwatch.Elapsed.TotalMilliseconds)); + this.recordSuccessOpLatencyAction?.Invoke(this.stopwatch.Elapsed); } } @@ -76,7 +76,9 @@ public void Dispose() operationResult.DatabseName, operationResult.ContainerName, (int)this.stopwatch.ElapsedMilliseconds, - operationResult.LazyDiagnostics); + operationResult.LazyDiagnostics, + this.benchmarkConfig.DiagnosticLatencyThresholdInMs); + } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs index 2e7687932f..744d53f2af 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs @@ -7,6 +7,7 @@ namespace CosmosBenchmark using System; using System.Collections.Generic; using System.Diagnostics; + using System.Diagnostics.Tracing; using System.IO; using System.Linq; using System.Net; @@ -15,6 +16,7 @@ namespace CosmosBenchmark using System.Threading; using System.Threading.Tasks; using Azure.Monitor.OpenTelemetry.Exporter; + using CosmosBenchmark.Fx; using Microsoft.Azure.Cosmos; using Microsoft.Extensions.Logging; using Newtonsoft.Json.Linq; @@ -44,6 +46,12 @@ public static async Task Main(string[] args) ThreadPool.SetMinThreads(config.MinThreadPoolSize, config.MinThreadPoolSize); + DiagnosticDataListener diagnosticDataListener = null; + if (!string.IsNullOrEmpty(config.DiagnosticsStorageConnectionString)) + { + diagnosticDataListener = new DiagnosticDataListener(config); + } + if (config.EnableLatencyPercentiles) { TelemetrySpan.IncludePercentile = true; @@ -55,13 +63,22 @@ public static async Task Main(string[] args) Program program = new Program(); RunSummary runSummary = await program.ExecuteAsync(config, metricsCollectorProvider); + + if (!string.IsNullOrEmpty(config.DiagnosticsStorageConnectionString)) + { + diagnosticDataListener.UploadDiagnostcs(); + } + } + catch (Exception e) + { + Utility.TeeTraceInformation("Exception ocured:" + e.ToString()); } finally { - Console.WriteLine($"{nameof(CosmosBenchmark)} completed successfully."); + Utility.TeeTraceInformation($"{nameof(CosmosBenchmark)} completed successfully."); if (Debugger.IsAttached) { - Console.WriteLine("Press any key to exit..."); + Utility.TeeTraceInformation("Press any key to exit..."); Console.ReadLine(); } } @@ -113,11 +130,11 @@ private static async Task AddAzureInfoToRunSummary() JObject jObject = JObject.Parse(jsonVmInfo); RunSummary.AzureVmInfo = jObject; RunSummary.Location = jObject["compute"]["location"].ToString(); - Console.WriteLine($"Azure VM Location:{RunSummary.Location}"); + Utility.TeeTraceInformation($"Azure VM Location:{RunSummary.Location}"); } - catch(Exception e) + catch (Exception e) { - Console.WriteLine("Failed to get Azure VM info:" + e.ToString()); + Utility.TeeTraceInformation("Failed to get Azure VM info:" + e.ToString()); } } @@ -151,11 +168,15 @@ private async Task ExecuteAsync(BenchmarkConfig config, $"Container {config.Container} must have a configured throughput."); } - Console.WriteLine($"Using container {config.Container} with {currentContainerThroughput} RU/s"); + Container resultContainer = await GetResultContainer(config, cosmosClient); + + BenchmarkProgress benchmarkProgressItem = await CreateBenchmarkProgressItem(resultContainer); + + Utility.TeeTraceInformation($"Using container {config.Container} with {currentContainerThroughput} RU/s"); int taskCount = config.GetTaskCount(currentContainerThroughput.Value); - Console.WriteLine("Starting Inserts with {0} tasks", taskCount); - Console.WriteLine(); + Utility.TeePrint("Starting Inserts with {0} tasks", taskCount); + string partitionKeyPath = containerResponse.Resource.PartitionKeyPath; int opsPerTask = config.ItemCount / taskCount; @@ -184,7 +205,7 @@ private async Task ExecuteAsync(BenchmarkConfig config, if (config.CleanupOnFinish) { - Console.WriteLine($"Deleting Database {config.Database}"); + Utility.TeeTraceInformation($"Deleting Database {config.Database}"); await database.DeleteStreamAsync(); } @@ -196,8 +217,11 @@ private async Task ExecuteAsync(BenchmarkConfig config, } runSummary.ConsistencyLevel = consistencyLevel; + + BenchmarkProgress benchmarkProgress = await CompleteBenchmarkProgressStatus(benchmarkProgressItem, resultContainer); if (config.PublishResults) { + Utility.TeeTraceInformation("Publishing results"); runSummary.Diagnostics = CosmosDiagnosticsLogger.GetDiagnostics(); await this.PublishResults( config, @@ -228,6 +252,7 @@ private async Task PublishResults( Container resultContainer = cosmosClient.GetContainer(config.ResultsDatabase, config.ResultsContainer); await resultContainer.CreateItemAsync(runSummary, new PartitionKey(runSummary.pk)); } + } private Func GetBenchmarkFactory( @@ -301,24 +326,60 @@ private static async Task CreatePartitionedContainerAsync(Ben { Microsoft.Azure.Cosmos.Database database = await cosmosClient.CreateDatabaseIfNotExistsAsync(options.Database); - Container container = database.GetContainer(options.Container); + // Show user cost of running this test + double estimatedCostPerMonth = 0.06 * options.Throughput; + double estimatedCostPerHour = estimatedCostPerMonth / (24 * 30); + Utility.TeeTraceInformation($"The container will cost an estimated ${Math.Round(estimatedCostPerHour, 2)} per hour (${Math.Round(estimatedCostPerMonth, 2)} per month)"); + Utility.TeeTraceInformation("Press enter to continue ..."); + Console.ReadLine(); - try - { - return await container.ReadContainerAsync(); - } - catch (CosmosException ex) when (ex.StatusCode == HttpStatusCode.NotFound) + string partitionKeyPath = options.PartitionKeyPath; + return await database.CreateContainerIfNotExistsAsync(options.Container, partitionKeyPath, options.Throughput); + } + + /// + /// Creating a progress item in ComsosDb when the benchmark start + /// + /// An instance of that represents operations performed on a database container. + private static async Task CreateBenchmarkProgressItem(Container resultContainer) + { + BenchmarkProgress benchmarkProgress = new BenchmarkProgress { - // Show user cost of running this test - double estimatedCostPerMonth = 0.06 * options.Throughput; - double estimatedCostPerHour = estimatedCostPerMonth / (24 * 30); - Console.WriteLine($"The container will cost an estimated ${Math.Round(estimatedCostPerHour, 2)} per hour (${Math.Round(estimatedCostPerMonth, 2)} per month)"); - Console.WriteLine("Press enter to continue ..."); - Console.ReadLine(); - - string partitionKeyPath = options.PartitionKeyPath; - return await database.CreateContainerAsync(options.Container, partitionKeyPath, options.Throughput); - } + id = Environment.MachineName, + MachineName = Environment.MachineName, + JobStatus = "STARTED", + JobStartTime = DateTime.Now + }; + + ItemResponse itemResponse = await resultContainer.UpsertItemAsync( + benchmarkProgress, new PartitionKey(benchmarkProgress.id)); + + return itemResponse.Resource; + } + + /// + /// Change a progress item status to Complete in ComsosDb when the benchmark compleated + /// + /// An instance of that represents operations performed on a database container. + /// An instance of that represents the document to be modified. + public static async Task CompleteBenchmarkProgressStatus(BenchmarkProgress benchmarkProgress, Container resultContainer) + { + benchmarkProgress.JobStatus = "COMPLETED"; + benchmarkProgress.JobEndTime = DateTime.Now; + ItemResponse itemResponse = await resultContainer.UpsertItemAsync(benchmarkProgress); + return itemResponse.Resource; + } + + /// + /// Configure and prepare the Cosmos DB Container instance for the result container. + /// + /// An instance of containing the benchmark tool input parameters. + /// An instance of that represents operations performed on a CosmosDb database. + private static async Task GetResultContainer(BenchmarkConfig config, CosmosClient cosmosClient) + { + Database database = cosmosClient.GetDatabase(config.ResultsDatabase ?? config.Database); + ContainerResponse containerResponse = await database.CreateContainerIfNotExistsAsync(id: config.ResultsContainer, partitionKeyPath: "/id"); + return containerResponse.Container; } private static void ClearCoreSdkListeners() diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/README.md b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/README.md index 8aac52daad..5a2bac1937 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/README.md +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/README.md @@ -54,6 +54,7 @@ cd 'azure-cosmos-dotnet-v3/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark' dotnet build --configuration Release -p:"OSSProjectRef=true;ShouldUnsetParentConfigurationAndPlatform=false" ``` + For PerfRuns with reports (INTERNAL) ``` @@ -127,3 +128,7 @@ Copyright (C) 2019 CosmosBenchmark ## Running on Azure If you want to quickly get results, you can use our [guide to leverage Azure Container Instances](./AzureContainerInstances/README.md) to execute the benchmarks in any number of Azure regions with very little setup required. + +## Running on Azure VM + +If you want to execute benchmarking on multiple machines with one ARM Template, you can use our [guide to leverage Azure Virtual Machines](./AzureVmBenchmark/README.md). diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Utility.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Utility.cs index d743bd391d..6d278f3d3a 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Utility.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Utility.cs @@ -16,6 +16,12 @@ public static void TeeTraceInformation(string payload) Trace.TraceInformation(payload); } + public static void TraceError(string payload, Exception e) + { + Console.WriteLine($"{payload}: {e.Message} {e.StackTrace}"); + Trace.TraceError(payload); + } + public static void TeePrint(string format, params object[] arg) { string payload = string.Format(format, arg); diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/CosmosBenchmarkTests/CosmosBenchmarkTests.csproj b/Microsoft.Azure.Cosmos.Samples/Tools/CosmosBenchmarkTests/CosmosBenchmarkTests.csproj new file mode 100644 index 0000000000..7da26827a5 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/CosmosBenchmarkTests/CosmosBenchmarkTests.csproj @@ -0,0 +1,23 @@ + + + + net6.0 + enable + enable + + false + true + + + + + + + + + + + + + + diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/CosmosBenchmarkTests/Fx/DiagnosticDataListenerTests.cs b/Microsoft.Azure.Cosmos.Samples/Tools/CosmosBenchmarkTests/Fx/DiagnosticDataListenerTests.cs new file mode 100644 index 0000000000..9c453cf2e6 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/CosmosBenchmarkTests/Fx/DiagnosticDataListenerTests.cs @@ -0,0 +1,54 @@ +namespace CosmosBenchmark.Fx.Tests +{ + using CosmosBenchmark.Fx; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using System.IO; + using Moq; + using Azure.Storage.Blobs; + + [TestClass] + public class DiagnosticDataListenerTests + { + private DiagnosticDataListener listener; + + [TestInitialize] + public void Setup() + { + this.listener = new DiagnosticDataListener(); + } + + [TestCleanup] + public void Cleanup() + { + string[] diagnosticFiles = Directory.GetFiles(".", "BenchmarkDiagnostics.out*"); + foreach (string file in diagnosticFiles) + { + File.Delete(file); + } + } + + + /// + /// The scenario tested here is to ensure + /// that all created files with captured diagnostic + /// data are successfully uploaded to the Blob storage + /// + [TestMethod] + public void UploadDiagnostics_WhenFilesExist_ShouldUploadFilesToBlobStorage() + { + for (int i = 0; i < 10; i++) + { + string fileName = $"BenchmarkDiagnostics.out-{i}"; + File.Create(fileName).Close(); + } + int filesCount = Directory.GetFiles(".", $"{DiagnosticDataListener.DiagnosticsFileName}*").Length; + + Mock mockContainer = new Mock(); + Mock mockClient = new Mock(); + mockContainer.Setup(mock => mock.GetBlobClient(It.IsAny())).Returns(mockClient.Object); + + this.listener.UploadDiagnostcs(mockContainer.Object, "prefix"); + mockClient.Verify(mock => mock.Upload(It.IsAny(), true, default), Times.Exactly(filesCount)); + } + } +} From 3aced24beac2bc63f0ad84944bcb87ea3429d9a6 Mon Sep 17 00:00:00 2001 From: David Chaava Date: Tue, 29 Aug 2023 21:04:53 +0200 Subject: [PATCH 182/240] [Internal] Benchmark tool: Adds feature to the dashboard that generate plots queries for metrics with a workload name prefix, depending on the benchmark workload type. #4048 (#4053) * Merge remote-tracking branch 'origin/master' into users/v-dchaava/benchmark-diagnostics/3889 * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/README.md * add metrics prefixes * fix chart metrics names * fix dashboard queries according selected workload type --------- Co-authored-by: David Chaava --- .../Benchmark/AzureVmBenchmark/azuredeploy.json | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json index 347857cf82..594d4c9756 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/azuredeploy.json @@ -209,10 +209,11 @@ "customScriptUrl": "[concat('https://raw.githubusercontent.com/Azure/azure-cosmos-dotnet-v3/',parameters('benchmarkingToolsBranchName'),'/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/custom-script.sh')]", "vmScriptExtensionScriptName": "execute.sh", "convertedDatetime": "[dateTimeFromEpoch(parameters('startDate'))]", + "metricsPrefix" : "[if(startsWith(parameters('workloadType'), 'Read'), 'Read', if(startsWith(parameters('workloadType'), 'Query'), 'Query', if(startsWith(parameters('workloadType'), 'Insert'), 'Insert', '')))]", "appInsightsResourceIds": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', resourceGroup().name, '/providers/microsoft.insights/components/', parameters('applicationInsightsName'))]", - "chart0Expression": "[concat('customMetrics\n| where name == \"ReadOperationLatencyInMs\" and timestamp > ago(1d)\n| summarize\n percentile(value, 50),\n percentile(value, 75),\n percentile(value, 90),\n percentile(value, 95)\n by ts = bin(timestamp, ', parameters('metricsReportingIntervalInSec'), 's)\n| render timechart \n\n')]", - "chart1Expression": "[concat('customMetrics\n| where name == \"ReadOperationLatencyInMs\" and timestamp > ago(1d)\n| summarize\n percentile(value, 99),\n percentile(value, 99.9),\n percentile(value, 99.99)\n by ts = bin(timestamp, ', parameters('metricsReportingIntervalInSec'), 's)\n| render timechart \n\n')]", - "chart2Expression": "[concat('customMetrics\n| where name == \"ReadOperationRps\" and timestamp > ago(1d)\n| summarize\n avg(value)\n by ts = bin(timestamp, ', parameters('metricsReportingIntervalInSec'), 's)\n| render timechart \n\n')]" + "chart0Expression": "[concat('customMetrics\n| where name == \"', variables('metricsPrefix'), 'OperationLatencyInMs\" and timestamp > ago(1d)\n| summarize\n percentile(value, 50),\n percentile(value, 75),\n percentile(value, 90),\n percentile(value, 95)\n by ts = bin(timestamp, ', parameters('metricsReportingIntervalInSec'), 's)\n| render timechart \n\n')]", + "chart1Expression": "[concat('customMetrics\n| where name == \"', variables('metricsPrefix'), 'OperationLatencyInMs\" and timestamp > ago(1d)\n| summarize\n percentile(value, 99),\n percentile(value, 99.9),\n percentile(value, 99.99)\n by ts = bin(timestamp, ', parameters('metricsReportingIntervalInSec'), 's)\n| render timechart \n\n')]", + "chart2Expression": "[concat('customMetrics\n| where name == \"', variables('metricsPrefix'), 'OperationRps\" and timestamp > ago(1d)\n| summarize\n avg(value)\n by ts = bin(timestamp, ', parameters('metricsReportingIntervalInSec'), 's)\n| render timechart \n\n')]" }, "resources": [ @@ -776,7 +777,7 @@ }, { "name": "Query", - "value": "customMetrics\n| where name == \"ReadOperationFailure\" and timestamp > ago(1d)\n| summarize\n sum(value)\n by ts = bin(timestamp, 1s)\n | render timechart\n", + "value": "[concat('customMetrics\n| where name == \"', variables('metricsPrefix'), 'OperationFailure\" and timestamp > ago(1d)\n| summarize\n sum(value)\n by ts = bin(timestamp, 1s)\n | render timechart\n')]", "isOptional": true }, { @@ -834,7 +835,7 @@ "type": "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart", "settings": { "content": { - "Query": "customMetrics\n| where name == \"ReadOperationFailure\" and timestamp > ago(1d)\n| summarize\n sum(value)\n by ts = bin(timestamp, 1s)\n | render timechart\n\n", + "Query": "[concat('customMetrics\n| where name == \"', variables('metricsPrefix'), 'OperationFailure\" and timestamp > ago(1d)\n| summarize\n sum(value)\n by ts = bin(timestamp, 1s)\n | render timechart\n\n')]", "Dimensions": { "xAxis": { "name": "ts", @@ -903,7 +904,7 @@ }, { "name": "Query", - "value": "customMetrics\n| where name == \"ReadOperationSuccess\" and timestamp > ago(1d)\n| summarize\n sum(value)\n by ts = bin(timestamp, 1s)\n | render timechart\n", + "value": "[concat('customMetrics\n| where name == \"', variables('metricsPrefix'), 'OperationSuccess\" and timestamp > ago(1d)\n| summarize\n sum(value)\n by ts = bin(timestamp, 1s)\n | render timechart\n')]", "isOptional": true }, { @@ -961,7 +962,7 @@ "type": "Extension/Microsoft_OperationsManagementSuite_Workspace/PartType/LogsDashboardPart", "settings": { "content": { - "Query": "customMetrics\n| where name == \"ReadOperationSuccess\" and timestamp > ago(1d)\n| summarize\n sum(value)\n by ts = bin(timestamp, 1s)\n | render timechart\n\n", + "Query": "[concat('customMetrics\n| where name == \"', variables('metricsPrefix'), 'OperationSuccess\" and timestamp > ago(1d)\n| summarize\n sum(value)\n by ts = bin(timestamp, 1s)\n | render timechart\n\n')]", "Dimensions": { "xAxis": { "name": "ts", From c72ebc85746ea0c0c0ee3689e83ad23027751e2a Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Thu, 31 Aug 2023 23:25:30 +0530 Subject: [PATCH 183/240] [Internal] Client Telemetry: Adds client config api call to get latest flag status (#4050) * first draft * tets fix * fix dependent projects * reduce refresh time in tests * fix tests and added comments * fix diagnostic handler fix * fix test * adding test * ret pushmove console * fix test * provide options to enable/disable this featire in benchmark and ctl proj * updated trace message Co-authored-by: Matias Quaranta * remove import * updated traces Co-authored-by: Matias Quaranta * test fix * remove null assignment * fix test --------- Co-authored-by: Matias Quaranta --- .../Tools/Benchmark/BenchmarkConfig.cs | 40 ++----- .../Tools/CTL/CTLConfig.cs | 11 +- .../Tools/CTL/Program.cs | 14 --- .../src/ConnectionPolicy.cs | 5 +- .../src/Handler/DiagnosticsHandler.cs | 4 +- .../src/Handler/DiagnosticsHandlerHelper.cs | 59 +++++++--- .../Settings/AccountClientConfiguration.cs | 29 +++++ .../Settings/ClientTelemetryConfiguration.cs | 27 +++++ .../src/Telemetry/ClientTelemetry.cs | 16 ++- .../src/Telemetry/ClientTelemetryOptions.cs | 67 +---------- .../src/Telemetry/ClientTelemetryProcessor.cs | 12 +- .../src/Telemetry/TelemetryToServiceHelper.cs | 110 ++++++++++++++---- .../ClientSideRequestStatisticsTraceDatum.cs | 2 +- .../ClientTelemetryReleaseTests.cs | 11 +- .../ClientTelemetryTests.cs | 27 ++++- .../ClientTelemetryTestsBase.cs | 74 ++++-------- .../SynchronizationContextTests.cs | 43 +++++-- .../Utils/HttpHandlerHelper.cs | 2 + .../Utils/Util.cs | 14 --- .../Mocks/HttpHandlerHelper.cs | 67 +++++++++++ .../Mocks/MockDocumentClient.cs | 42 ++++++- .../DiagnosticHandlerHelperTests.cs | 75 ++++++++++++ .../Telemetry/ClientTelemetryTests.cs | 22 +--- 23 files changed, 500 insertions(+), 273 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/src/Resource/Settings/AccountClientConfiguration.cs create mode 100644 Microsoft.Azure.Cosmos/src/Resource/Settings/ClientTelemetryConfiguration.cs create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/HttpHandlerHelper.cs create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Diagnostics/DiagnosticHandlerHelperTests.cs diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs index f69c305096..e3ec5c23bb 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkConfig.cs @@ -10,6 +10,7 @@ namespace CosmosBenchmark using System.Linq; using System.Runtime; using CommandLine; + using Microsoft.Azure.Cosmos.Telemetry; using Microsoft.Azure.Documents.Client; using Newtonsoft.Json; @@ -102,18 +103,12 @@ public class BenchmarkConfig [Option(Required = false, HelpText = "Disable core SDK logging")] public bool DisableCoreSdkLogging { get; set; } - [Option(Required = false, HelpText = "Enable Client Telemetry")] - public bool EnableTelemetry { get; set; } - [Option(Required = false, HelpText = "Enable Distributed Tracing")] public bool EnableDistributedTracing { get; set; } [Option(Required = false, HelpText = "Client Telemetry Schedule in Seconds")] public int TelemetryScheduleInSec { get; set; } - [Option(Required = false, HelpText = "Client Telemetry Endpoint")] - public string TelemetryEndpoint { get; set; } - [Option(Required = false, HelpText = "Endpoint to publish results to")] public string ResultsEndpoint { get; set; } @@ -143,6 +138,9 @@ public class BenchmarkConfig [Option(Required = false, HelpText = "Application Insights connection string")] public string AppInsightsConnectionString { get; set; } + [Option(Required = false, HelpText = "Enable Client Telemetry Feature in SDK. Make sure you enable it from the portal also.")] + public bool EnableClientTelemetry { get; set; } = true; + internal int GetTaskCount(int containerThroughput) { int taskCount = this.DegreeOfParallelism; @@ -210,35 +208,21 @@ private string GetUserAgentPrefix() internal Microsoft.Azure.Cosmos.CosmosClient CreateCosmosClient(string accountKey) { + // Overwrite the default timespan if configured + if(this.TelemetryScheduleInSec > 0) + { + ClientTelemetryOptions.DefaultIntervalForTelemetryJob = TimeSpan.FromSeconds(this.TelemetryScheduleInSec); + } + Microsoft.Azure.Cosmos.CosmosClientOptions clientOptions = new Microsoft.Azure.Cosmos.CosmosClientOptions() { ApplicationName = this.GetUserAgentPrefix(), MaxRetryAttemptsOnRateLimitedRequests = 0, MaxRequestsPerTcpConnection = this.MaxRequestsPerTcpConnection, - MaxTcpConnectionsPerEndpoint = this.MaxTcpConnectionsPerEndpoint + MaxTcpConnectionsPerEndpoint = this.MaxTcpConnectionsPerEndpoint, + EnableClientTelemetry = this.EnableClientTelemetry }; - if (this.EnableTelemetry) - { - Environment.SetEnvironmentVariable( - Microsoft.Azure.Cosmos.Telemetry.ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, - "true"); - - if (this.TelemetryScheduleInSec > 0) - { - Environment.SetEnvironmentVariable( - Microsoft.Azure.Cosmos.Telemetry.ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, - Convert.ToString(this.TelemetryScheduleInSec)); - } - - if (!string.IsNullOrEmpty(this.TelemetryEndpoint)) - { - Environment.SetEnvironmentVariable( - Microsoft.Azure.Cosmos.Telemetry.ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, - this.TelemetryEndpoint); - } - } - if (!string.IsNullOrWhiteSpace(this.ConsistencyLevel)) { clientOptions.ConsistencyLevel = (Microsoft.Azure.Cosmos.ConsistencyLevel)Enum.Parse(typeof(Microsoft.Azure.Cosmos.ConsistencyLevel), this.ConsistencyLevel, ignoreCase: true); diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/CTL/CTLConfig.cs b/Microsoft.Azure.Cosmos.Samples/Tools/CTL/CTLConfig.cs index 05064003ce..98bba7b700 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/CTL/CTLConfig.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/CTL/CTLConfig.cs @@ -97,18 +97,15 @@ public string DiagnosticsThresholdDuration [Option("ctl_logging_context", Required = false, HelpText = "Defines a custom context to use on metrics")] public string LogginContext { get; set; } = string.Empty; - [Option("ctl_telemetry_endpoint", Required = false, HelpText = "telemetry juno end point")] - public string TelemetryEndpoint { get; set; } - - [Option("ctl_telemetry_schedule_in_sec", Required = false, HelpText = "telemetry task schedule time in sec")] - public string TelemetryScheduleInSeconds { get; set; } - [Option("ctl_reservoir_type", Required = false, HelpText = "Defines the reservoir type. Valid values are: Uniform, SlidingWindow and ExponentialDecay. The default value is SlidingWindow.")] public ReservoirTypes ReservoirType { get; set; } = ReservoirTypes.SlidingWindow; [Option("ctl_reservoir_sample_size", Required = false, HelpText = "The reservoir sample size.")] public int ReservoirSampleSize { get; set; } = 1028; + [Option("ctl_enable_client_telemetry", Required = false, HelpText = "Enable Client Telemetry Feature in SDK. Make sure you enable it from the portal also.")] + public bool EnableClientTelemetry { get; set; } = true; + internal TimeSpan RunningTimeDurationAsTimespan { get; private set; } = TimeSpan.FromHours(10); internal TimeSpan DiagnosticsThresholdDurationAsTimespan { get; private set; } = TimeSpan.FromSeconds(60); @@ -133,7 +130,7 @@ internal CosmosClient CreateCosmosClient() CosmosClientOptions clientOptions = new CosmosClientOptions() { ApplicationName = CTLConfig.UserAgentSuffix, - EnableClientTelemetry = true + EnableClientTelemetry = this.EnableClientTelemetry }; if (this.UseGatewayMode) diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/CTL/Program.cs b/Microsoft.Azure.Cosmos.Samples/Tools/CTL/Program.cs index 62f1eb913f..b42f651df1 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/CTL/Program.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/CTL/Program.cs @@ -29,8 +29,6 @@ public static async Task Main(string[] args) { CTLConfig config = CTLConfig.From(args); - SetEnvironmentVariables(config); - if (config.OutputEventTraces) { EnableTraceSourcesToConsole(); @@ -54,12 +52,6 @@ await scenario.InitializeAsync( logger.LogInformation("Initialization completed."); - if(client.ClientOptions.EnableClientTelemetry.GetValueOrDefault()) { - logger.LogInformation("Telemetry is enabled for CTL."); - } else { - logger.LogInformation("Telemetry is disabled for CTL."); - } - List tasks = new List { scenario.RunAsync( @@ -148,12 +140,6 @@ await scenario.InitializeAsync( } } - private static void SetEnvironmentVariables(CTLConfig config) - { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, config.TelemetryEndpoint); - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, config.TelemetryScheduleInSeconds); - } - private static IMetricsRoot ConfigureReporting( CTLConfig config, ILogger logger) diff --git a/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs b/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs index c8c1d9db93..8451918e9b 100644 --- a/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs +++ b/Microsoft.Azure.Cosmos/src/ConnectionPolicy.cs @@ -48,7 +48,7 @@ public ConnectionPolicy() this.MaxConnectionLimit = defaultMaxConcurrentConnectionLimit; this.RetryOptions = new RetryOptions(); this.EnableReadRequestsFallback = null; - this.EnableClientTelemetry = ClientTelemetryOptions.IsClientTelemetryEnabled(); + this.EnableClientTelemetry = false; // by default feature flag is off this.ServerCertificateCustomValidationCallback = null; } @@ -211,6 +211,9 @@ public bool EnableTcpConnectionEndpointRediscovery set; } + /// + /// Gets or sets the flag to enable client telemetry feature. + /// internal bool EnableClientTelemetry { get; diff --git a/Microsoft.Azure.Cosmos/src/Handler/DiagnosticsHandler.cs b/Microsoft.Azure.Cosmos/src/Handler/DiagnosticsHandler.cs index f361987f92..de93fca27b 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/DiagnosticsHandler.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/DiagnosticsHandler.cs @@ -4,6 +4,7 @@ namespace Microsoft.Azure.Cosmos.Handlers { + using System; using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Handler; @@ -25,7 +26,8 @@ public override async Task SendAsync( ResponseMessage responseMessage = await base.SendAsync(request, cancellationToken); // Record the diagnostics on the response to get the CPU of when the request was executing - SystemUsageHistory systemUsageHistory = DiagnosticsHandlerHelper.Instance.GetDiagnosticsSystemHistory(); + SystemUsageHistory systemUsageHistory = DiagnosticsHandlerHelper.GetInstance().GetDiagnosticsSystemHistory(); + if (systemUsageHistory != null) { request.Trace.AddDatum( diff --git a/Microsoft.Azure.Cosmos/src/Handler/DiagnosticsHandlerHelper.cs b/Microsoft.Azure.Cosmos/src/Handler/DiagnosticsHandlerHelper.cs index 1007234125..cdc3c2bac3 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/DiagnosticsHandlerHelper.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/DiagnosticsHandlerHelper.cs @@ -8,7 +8,6 @@ namespace Microsoft.Azure.Cosmos.Handler using System.Collections.Generic; using Documents.Rntbd; using Microsoft.Azure.Cosmos.Core.Trace; - using Microsoft.Azure.Cosmos.Telemetry; /// /// This is a helper class that creates a single static instance to avoid each @@ -22,34 +21,69 @@ internal class DiagnosticsHandlerHelper private const string Telemetrykey = "telemetry"; public static readonly TimeSpan DiagnosticsRefreshInterval = TimeSpan.FromSeconds(10); - private readonly SystemUsageRecorder diagnosticSystemUsageRecorder = new SystemUsageRecorder( + private static readonly SystemUsageRecorder DiagnosticSystemUsageRecorder = new SystemUsageRecorder( identifier: Diagnostickey, historyLength: 6, refreshInterval: DiagnosticsHandlerHelper.DiagnosticsRefreshInterval); private static readonly TimeSpan ClientTelemetryRefreshInterval = TimeSpan.FromSeconds(5); - private readonly SystemUsageRecorder telemetrySystemUsageRecorder = new SystemUsageRecorder( + private static readonly SystemUsageRecorder TelemetrySystemUsageRecorder = new SystemUsageRecorder( identifier: Telemetrykey, historyLength: 120, refreshInterval: DiagnosticsHandlerHelper.ClientTelemetryRefreshInterval); - private static bool isDiagnosticsMonitoringEnabled = false; - private static bool isTelemetryMonitoringEnabled = false; - /// /// Singleton to make sure only one instance of DiagnosticHandlerHelper is there. /// The system usage collection is disabled for internal builds so it is set to null to avoid /// compute for accidentally creating an instance or trying to use it. /// - public static readonly DiagnosticsHandlerHelper Instance = + private static DiagnosticsHandlerHelper Instance = #if INTERNAL null; #else new DiagnosticsHandlerHelper(); #endif + private static bool isDiagnosticsMonitoringEnabled; + private static bool isTelemetryMonitoringEnabled; + private readonly SystemUsageMonitor systemUsageMonitor = null; + public static DiagnosticsHandlerHelper GetInstance() + { + return DiagnosticsHandlerHelper.Instance; + } + + /// + /// Restart the monitor with client telemetry recorder if telemetry is enabled + /// + /// + public static void Refresh(bool isClientTelemetryEnabled) + { + if (isClientTelemetryEnabled != DiagnosticsHandlerHelper.isTelemetryMonitoringEnabled) + { + DiagnosticsHandlerHelper.Instance.StopSystemMonitor(); + + // Update telemetry flag + DiagnosticsHandlerHelper.isTelemetryMonitoringEnabled = isClientTelemetryEnabled; + + // Create new instance, it will start a new system monitor job + DiagnosticsHandlerHelper.Instance = new DiagnosticsHandlerHelper(); + } + } + + private void StopSystemMonitor() + { + try + { + this.systemUsageMonitor?.Dispose(); + } + catch (ObjectDisposedException ex) + { + DefaultTrace.TraceError($"Error while stopping system usage monitor. {0} ", ex); + } + } + /// /// Start System Usage Monitor with Diagnostic and Telemetry Recorder if Telemetry is enabled /// Otherwise Start System Usage Monitor with only Diagnostic Recorder @@ -61,16 +95,14 @@ private DiagnosticsHandlerHelper() // If the CPU monitor fails for some reason don't block the application try { - DiagnosticsHandlerHelper.isTelemetryMonitoringEnabled = ClientTelemetryOptions.IsClientTelemetryEnabled(); - List recorders = new List() { - this.diagnosticSystemUsageRecorder, + DiagnosticsHandlerHelper.DiagnosticSystemUsageRecorder, }; if (DiagnosticsHandlerHelper.isTelemetryMonitoringEnabled) { - recorders.Add(this.telemetrySystemUsageRecorder); + recorders.Add(DiagnosticsHandlerHelper.TelemetrySystemUsageRecorder); } this.systemUsageMonitor = SystemUsageMonitor.CreateAndStart(recorders); @@ -82,7 +114,6 @@ private DiagnosticsHandlerHelper() DefaultTrace.TraceError(ex.Message); DiagnosticsHandlerHelper.isDiagnosticsMonitoringEnabled = false; - DiagnosticsHandlerHelper.isTelemetryMonitoringEnabled = false; } } @@ -99,7 +130,7 @@ public SystemUsageHistory GetDiagnosticsSystemHistory() try { - return this.diagnosticSystemUsageRecorder.Data; + return DiagnosticsHandlerHelper.DiagnosticSystemUsageRecorder.Data; } catch (Exception ex) { @@ -123,7 +154,7 @@ public SystemUsageHistory GetClientTelemetrySystemHistory() try { - return this.telemetrySystemUsageRecorder.Data; + return DiagnosticsHandlerHelper.TelemetrySystemUsageRecorder.Data; } catch (Exception ex) { diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/AccountClientConfiguration.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/AccountClientConfiguration.cs new file mode 100644 index 0000000000..fd7d125dac --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/AccountClientConfiguration.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos +{ + using System.Collections.Generic; + using Microsoft.Azure.Documents; + using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + + internal class AccountClientConfiguration + { + [JsonProperty(PropertyName = Constants.Properties.ClientTelemetryConfiguration)] + public ClientTelemetryConfiguration ClientTelemetryConfiguration { get; set; } + + /// + /// This contains additional values for scenarios where the SDK is not aware of new fields. + /// This ensures that if resource is read and updated none of the fields will be lost in the process. + /// + [JsonExtensionData] + internal IDictionary AdditionalProperties { get; private set; } + + internal bool IsClientTelemetryEnabled() + { + return this.ClientTelemetryConfiguration.IsEnabled && this.ClientTelemetryConfiguration.Endpoint != null; + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/ClientTelemetryConfiguration.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/ClientTelemetryConfiguration.cs new file mode 100644 index 0000000000..3229b69fa2 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/ClientTelemetryConfiguration.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos +{ + using System.Collections.Generic; + using Microsoft.Azure.Documents; + using Newtonsoft.Json; + using Newtonsoft.Json.Linq; + + internal class ClientTelemetryConfiguration + { + [JsonProperty(PropertyName = Constants.Properties.ClientTelemetryEnabled)] + public bool IsEnabled { get; set; } + + [JsonProperty(PropertyName = Constants.Properties.ClientTelemetryEndpoint)] + public string Endpoint { get; set; } + + /// + /// This contains additional values for scenarios where the SDK is not aware of new fields. + /// This ensures that if resource is read and updated none of the fields will be lost in the process. + /// + [JsonExtensionData] + internal IDictionary AdditionalProperties { get; private set; } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs index 2dfcbab496..8460998711 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetry.cs @@ -26,11 +26,12 @@ namespace Microsoft.Azure.Cosmos.Telemetry /// internal class ClientTelemetry : IDisposable { - private static readonly TimeSpan observingWindow = ClientTelemetryOptions.GetScheduledTimeSpan(); + private static readonly TimeSpan observingWindow = ClientTelemetryOptions.DefaultIntervalForTelemetryJob; private readonly ClientTelemetryProperties clientTelemetryInfo; private readonly ClientTelemetryProcessor processor; private readonly DiagnosticsHandlerHelper diagnosticsHelper; + private readonly string endpointUrl; private readonly NetworkDataRecorder networkDataRecorder; private readonly CancellationTokenSource cancellationTokenSource; @@ -63,6 +64,7 @@ internal ClientTelemetry() /// /// /// + /// /// ClientTelemetry public static ClientTelemetry CreateAndStartBackgroundTelemetry( string clientId, @@ -72,7 +74,8 @@ public static ClientTelemetry CreateAndStartBackgroundTelemetry( AuthorizationTokenProvider authorizationTokenProvider, DiagnosticsHandlerHelper diagnosticsHelper, IReadOnlyList preferredRegions, - GlobalEndpointManager globalEndpointManager) + GlobalEndpointManager globalEndpointManager, + string endpointUrl ) { DefaultTrace.TraceInformation("Initiating telemetry with background task."); @@ -84,7 +87,8 @@ public static ClientTelemetry CreateAndStartBackgroundTelemetry( authorizationTokenProvider, diagnosticsHelper, preferredRegions, - globalEndpointManager); + globalEndpointManager, + endpointUrl); clientTelemetry.StartObserverTask(); @@ -99,9 +103,12 @@ internal ClientTelemetry( AuthorizationTokenProvider authorizationTokenProvider, DiagnosticsHandlerHelper diagnosticsHelper, IReadOnlyList preferredRegions, - GlobalEndpointManager globalEndpointManager) + GlobalEndpointManager globalEndpointManager, + string endpointUrl) { this.diagnosticsHelper = diagnosticsHelper ?? throw new ArgumentNullException(nameof(diagnosticsHelper)); + this.endpointUrl = endpointUrl ?? throw new ArgumentNullException(nameof(endpointUrl)); + this.globalEndpointManager = globalEndpointManager; this.processor = new ClientTelemetryProcessor(httpClient, authorizationTokenProvider); @@ -177,6 +184,7 @@ ConcurrentDictionary cacheRefreshInfo operationInfoSnapshot: operationInfoSnapshot, cacheRefreshInfoSnapshot: cacheRefreshInfoSnapshot, requestInfoSnapshot: requestInfoSnapshot, + endpointUrl: this.endpointUrl, cancellationToken: cancellationToken.Token), cancellationToken.Token); // Initiating Telemetry Data Processor task which will serialize and send telemetry information to Client Telemetry Service diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs index 2aeaadca63..84a47e1081 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryOptions.cs @@ -72,17 +72,13 @@ internal static class ClientTelemetryOptions internal const string IsThreadStarvingName = "SystemPool_IsThreadStarving_True"; internal const string IsThreadStarvingUnit = "Count"; - internal const double DefaultTimeStampInSeconds = 600; internal const double Percentile50 = 50.0; internal const double Percentile90 = 90.0; internal const double Percentile95 = 95.0; internal const double Percentile99 = 99.0; internal const double Percentile999 = 99.9; internal const string DateFormat = "yyyy-MM-ddTHH:mm:ssZ"; - internal const string EnvPropsClientTelemetrySchedulingInSeconds = "COSMOS.CLIENT_TELEMETRY_SCHEDULING_IN_SECONDS"; - internal const string EnvPropsClientTelemetryEnabled = "COSMOS.CLIENT_TELEMETRY_ENABLED"; - internal const string EnvPropsClientTelemetryVmMetadataUrl = "COSMOS.VM_METADATA_URL"; - internal const string EnvPropsClientTelemetryEndpoint = "COSMOS.CLIENT_TELEMETRY_ENDPOINT"; + internal const string EnvPropsClientTelemetryEnvironmentName = "COSMOS.ENVIRONMENT_NAME"; internal static readonly ResourceType AllowedResourceTypes = ResourceType.Document; @@ -99,53 +95,11 @@ internal static class ClientTelemetryOptions internal static readonly List ExcludedStatusCodes = new List { 404, 409, 412 }; internal static readonly int NetworkTelemetrySampleSize = 200; + internal static TimeSpan DefaultIntervalForTelemetryJob = TimeSpan.FromMinutes(10); internal static int PayloadSizeThreshold = 1024 * 1024 * 2; // 2MB internal static TimeSpan ClientTelemetryProcessorTimeOut = TimeSpan.FromMinutes(5); - private static Uri clientTelemetryEndpoint; private static string environmentName; - private static TimeSpan scheduledTimeSpan = TimeSpan.Zero; - - internal static bool IsClientTelemetryEnabled() - { - bool isTelemetryEnabled = ConfigurationManager - .GetEnvironmentVariable(ClientTelemetryOptions - .EnvPropsClientTelemetryEnabled, false); - - DefaultTrace.TraceInformation($"Telemetry Flag is set to {isTelemetryEnabled}"); - - return isTelemetryEnabled; - } - - internal static TimeSpan GetScheduledTimeSpan() - { - if (scheduledTimeSpan.Equals(TimeSpan.Zero)) - { - double scheduledTimeInSeconds = ClientTelemetryOptions.DefaultTimeStampInSeconds; - try - { - scheduledTimeInSeconds = ConfigurationManager - .GetEnvironmentVariable( - ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, - ClientTelemetryOptions.DefaultTimeStampInSeconds); - - if (scheduledTimeInSeconds <= 0) - { - throw new ArgumentException("Telemetry Scheduled time can not be less than or equal to 0."); - } - } - catch (Exception ex) - { - DefaultTrace.TraceError($"Error while getting telemetry scheduling configuration : {ex.Message}. Falling back to default configuration i.e. {scheduledTimeInSeconds}" ); - } - - scheduledTimeSpan = TimeSpan.FromSeconds(scheduledTimeInSeconds); - - DefaultTrace.TraceInformation($"Telemetry Scheduled in Seconds {scheduledTimeSpan.TotalSeconds}"); - - } - return scheduledTimeSpan; - } internal static string GetHostInformation(Compute vmInformation) { @@ -155,23 +109,6 @@ internal static string GetHostInformation(Compute vmInformation) vmInformation?.AzEnvironment); } - internal static Uri GetClientTelemetryEndpoint() - { - if (clientTelemetryEndpoint == null) - { - string uriProp = ConfigurationManager - .GetEnvironmentVariable( - ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, null); - if (!String.IsNullOrEmpty(uriProp)) - { - clientTelemetryEndpoint = new Uri(uriProp); - } - - DefaultTrace.TraceInformation($"Telemetry Endpoint URL is {uriProp}"); - } - return clientTelemetryEndpoint; - } - internal static string GetEnvironmentName() { if (String.IsNullOrEmpty(environmentName)) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryProcessor.cs b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryProcessor.cs index c9511cb4e4..ffa74c2466 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryProcessor.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/ClientTelemetryProcessor.cs @@ -19,8 +19,6 @@ namespace Microsoft.Azure.Cosmos.Telemetry internal class ClientTelemetryProcessor { - private static readonly Uri endpointUrl = ClientTelemetryOptions.GetClientTelemetryEndpoint(); - private readonly AuthorizationTokenProvider tokenProvider; private readonly CosmosHttpClient httpClient; @@ -39,6 +37,7 @@ internal async Task ProcessAndSendAsync( ConcurrentDictionary operationInfoSnapshot, ConcurrentDictionary cacheRefreshInfoSnapshot, IReadOnlyList requestInfoSnapshot, + string endpointUrl, CancellationToken cancellationToken) { try @@ -48,7 +47,7 @@ await ClientTelemetryPayloadWriter.SerializedPayloadChunksAsync( operationInfoSnapshot: operationInfoSnapshot, cacheRefreshInfoSnapshot: cacheRefreshInfoSnapshot, sampledRequestInfo: requestInfoSnapshot, - callback: async (payload) => await this.SendAsync(clientTelemetryInfo.GlobalDatabaseAccountName, payload, cancellationToken)); + callback: async (payload) => await this.SendAsync(clientTelemetryInfo.GlobalDatabaseAccountName, payload, endpointUrl, cancellationToken)); } catch (Exception ex) { @@ -67,6 +66,7 @@ await ClientTelemetryPayloadWriter.SerializedPayloadChunksAsync( private async Task SendAsync( string globalDatabaseAccountName, string jsonPayload, + string endpointUrl, CancellationToken cancellationToken) { if (endpointUrl == null) @@ -77,12 +77,12 @@ private async Task SendAsync( try { - DefaultTrace.TraceInformation("Sending Telemetry Data to {0}", endpointUrl.AbsoluteUri); + DefaultTrace.TraceInformation("Sending Telemetry Data to {0}", endpointUrl); using HttpRequestMessage request = new HttpRequestMessage { Method = HttpMethod.Post, - RequestUri = endpointUrl, + RequestUri = new Uri(endpointUrl), Content = new StringContent(jsonPayload, Encoding.UTF8, "application/json") }; @@ -91,7 +91,7 @@ async ValueTask CreateRequestMessage() INameValueCollection headersCollection = new StoreResponseNameValueCollection(); await this.tokenProvider.AddAuthorizationHeaderAsync( headersCollection, - endpointUrl, + new Uri(endpointUrl), "POST", AuthorizationTokenType.PrimaryMasterKey); diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/TelemetryToServiceHelper.cs b/Microsoft.Azure.Cosmos/src/Telemetry/TelemetryToServiceHelper.cs index 2f78df0913..9212457951 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/TelemetryToServiceHelper.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/TelemetryToServiceHelper.cs @@ -5,12 +5,17 @@ namespace Microsoft.Azure.Cosmos.Telemetry { using System; + using System.Net.Http; using System.Threading; using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Core.Trace; using Microsoft.Azure.Cosmos.Handler; + using Microsoft.Azure.Cosmos.Query.Core.Monads; using Microsoft.Azure.Cosmos.Routing; using Microsoft.Azure.Cosmos.Telemetry.Collector; + using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Documents; + using Microsoft.Azure.Documents.Collections; internal class TelemetryToServiceHelper : IDisposable { @@ -70,12 +75,69 @@ public static TelemetryToServiceHelper CreateAndInitializeClientConfigAndTelemet TelemetryToServiceHelper helper = new TelemetryToServiceHelper( clientId, connectionPolicy, cosmosAuthorization, httpClient, serviceEndpoint, globalEndpointManager, cancellationTokenSource); - helper.InitializeClientTelemetry(); + _ = helper.RetrieveConfigAndInitiateTelemetryAsync(); // Let it run in backgroud return helper; #endif } + private async Task RetrieveConfigAndInitiateTelemetryAsync() + { + try + { + Uri serviceEndpointWithPath = new Uri(this.serviceEnpoint + Paths.ClientConfigPathSegment); + + TryCatch databaseAccountClientConfigs = await this.GetDatabaseAccountClientConfigAsync(this.cosmosAuthorization, this.httpClient, serviceEndpointWithPath); + if (databaseAccountClientConfigs.Succeeded) + { + this.InitializeClientTelemetry(databaseAccountClientConfigs.Result); + } + else if (!this.cancellationTokenSource.IsCancellationRequested) + { + DefaultTrace.TraceWarning($"Exception while calling client config " + databaseAccountClientConfigs.Exception.ToString()); + } + } + catch (Exception ex) + { + DefaultTrace.TraceWarning($"Exception while running client config job " + ex.ToString()); + } + } + + private async Task> GetDatabaseAccountClientConfigAsync(AuthorizationTokenProvider cosmosAuthorization, + CosmosHttpClient httpClient, + Uri clientConfigEndpoint) + { + INameValueCollection headers = new RequestNameValueCollection(); + await cosmosAuthorization.AddAuthorizationHeaderAsync( + headersCollection: headers, + clientConfigEndpoint, + HttpConstants.HttpMethods.Get, + AuthorizationTokenType.PrimaryMasterKey); + + using (ITrace trace = Trace.GetRootTrace("Account Client Config Read", TraceComponent.Transport, TraceLevel.Info)) + { + try + { + using (HttpResponseMessage responseMessage = await httpClient.GetAsync( + uri: clientConfigEndpoint, + additionalHeaders: headers, + resourceType: ResourceType.DatabaseAccount, + timeoutPolicy: HttpTimeoutPolicyControlPlaneRead.Instance, + clientSideRequestStatistics: null, + cancellationToken: default)) + using (DocumentServiceResponse documentServiceResponse = await ClientExtensions.ParseResponseAsync(responseMessage)) + { + return TryCatch.FromResult(CosmosResource.FromStream(documentServiceResponse)); + } + } + catch (Exception ex) + { + DefaultTrace.TraceWarning($"Exception while calling client config " + ex.StackTrace); + return TryCatch.FromException(ex); + } + } + } + public ITelemetryCollector GetCollector() { return this.collector; @@ -89,28 +151,34 @@ public bool IsClientTelemetryJobRunning() /// /// Trigger Client Telemetry job when it is enabled and not already running. /// - private void InitializeClientTelemetry() + private void InitializeClientTelemetry(AccountClientConfiguration clientConfig) { - try - { - this.clientTelemetry = ClientTelemetry.CreateAndStartBackgroundTelemetry( - clientId: this.clientId, - httpClient: this.httpClient, - userAgent: this.connectionPolicy.UserAgentContainer.BaseUserAgent, - connectionMode: this.connectionPolicy.ConnectionMode, - authorizationTokenProvider: this.cosmosAuthorization, - diagnosticsHelper: DiagnosticsHandlerHelper.Instance, - preferredRegions: this.connectionPolicy.PreferredLocations, - globalEndpointManager: this.globalEndpointManager); - - this.collector = new TelemetryCollector(this.clientTelemetry, this.connectionPolicy); - - DefaultTrace.TraceVerbose("Client Telemetry Enabled."); - } - catch (Exception ex) + DiagnosticsHandlerHelper.Refresh(clientConfig.IsClientTelemetryEnabled()); + + if (clientConfig.IsClientTelemetryEnabled()) { - DefaultTrace.TraceWarning($"Error While starting Telemetry Job : {0}. Hence disabling Client Telemetry", ex.Message); - this.connectionPolicy.EnableClientTelemetry = false; + try + { + this.clientTelemetry = ClientTelemetry.CreateAndStartBackgroundTelemetry( + clientId: this.clientId, + httpClient: this.httpClient, + userAgent: this.connectionPolicy.UserAgentContainer.BaseUserAgent, + connectionMode: this.connectionPolicy.ConnectionMode, + authorizationTokenProvider: this.cosmosAuthorization, + diagnosticsHelper: DiagnosticsHandlerHelper.GetInstance(), + preferredRegions: this.connectionPolicy.PreferredLocations, + globalEndpointManager: this.globalEndpointManager, + endpointUrl: clientConfig.ClientTelemetryConfiguration.Endpoint); + + this.collector = new TelemetryCollector(this.clientTelemetry, this.connectionPolicy); + + DefaultTrace.TraceVerbose("Client Telemetry Enabled."); + } + catch (Exception ex) + { + DefaultTrace.TraceWarning($"Error While starting Telemetry Job : {0}. Hence disabling Client Telemetry", ex); + this.connectionPolicy.EnableClientTelemetry = false; + } } } diff --git a/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs b/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs index def12c8262..829899c4b1 100644 --- a/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs +++ b/Microsoft.Azure.Cosmos/src/Tracing/TraceData/ClientSideRequestStatisticsTraceDatum.cs @@ -419,7 +419,7 @@ public void UpdateSystemUsage() this.systemUsageHistory.Values.Count == 0 || this.systemUsageHistory.LastTimestamp + DiagnosticsHandlerHelper.DiagnosticsRefreshInterval < DateTime.UtcNow) { - this.systemUsageHistory = DiagnosticsHandlerHelper.Instance.GetDiagnosticsSystemHistory(); + this.systemUsageHistory = DiagnosticsHandlerHelper.GetInstance().GetDiagnosticsSystemHistory(); } #endif } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryReleaseTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryReleaseTests.cs index d31c95bfe8..7a54f490c0 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryReleaseTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryReleaseTests.cs @@ -36,20 +36,15 @@ public override Task HttpHandlerRequestCallbackChecks(HttpR } [ClassInitialize] - public static new void ClassInitialize(TestContext context) + public static void ClassInit(TestContext context) { ClientTelemetryTestsBase.ClassInitialize(context); - - // It will go away in next PR - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, "true"); - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, "1"); - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, "https://tools.cosmos.azure.com/api/clienttelemetry/trace"); } [ClassCleanup] - public static new void FinalCleanup() + public static void ClassCleanUp() { - ClientTelemetryTestsBase.FinalCleanup(); + ClientTelemetryTestsBase.ClassCleanup(); } [TestInitialize] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs index 2ffc60f5f4..ffa3e6eda1 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTests.cs @@ -5,11 +5,13 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests { using Microsoft.Azure.Cosmos.Fluent; - using Microsoft.Azure.Cosmos.Telemetry; using System.Net.Http; using System.Net; using System.Threading.Tasks; using Microsoft.VisualStudio.TestTools.UnitTesting; + using Newtonsoft.Json; + using System.Text; + using Microsoft.Azure.Documents; /// /// In Emulator Mode, Run test against emulator and mock client telemetry service calls. @@ -21,10 +23,25 @@ public class ClientTelemetryTests : ClientTelemetryTestsBase { public override Task HttpHandlerRequestCallbackChecks(HttpRequestMessage request) { - if (request.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) + if (request.RequestUri.AbsoluteUri.Equals(telemetryServiceEndpoint.AbsoluteUri)) { return Task.FromResult(new HttpResponseMessage(HttpStatusCode.NoContent)); // In Emulator test, send hardcoded response status code as there is no real communication happens with client telemetry service } + else if (request.RequestUri.AbsoluteUri.Contains(Paths.ClientConfigPathSegment)) + { + HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK); + AccountClientConfiguration clientConfigProperties = new AccountClientConfiguration + { + ClientTelemetryConfiguration = new ClientTelemetryConfiguration + { + IsEnabled = true, + Endpoint = telemetryServiceEndpoint.AbsoluteUri + } + }; + string payload = JsonConvert.SerializeObject(clientConfigProperties); + result.Content = new StringContent(payload, Encoding.UTF8, "application/json"); + return Task.FromResult(result); + } return null; } @@ -35,15 +52,15 @@ public override CosmosClientBuilder GetBuilder() } [ClassInitialize] - public static new void ClassInitialize(TestContext context) + public static void ClassInit(TestContext context) { ClientTelemetryTestsBase.ClassInitialize(context); } [ClassCleanup] - public static new void FinalCleanup() + public static void ClassCleanUp() { - ClientTelemetryTestsBase.FinalCleanup(); + ClientTelemetryTestsBase.ClassCleanup(); } [TestInitialize] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs index da4b131cdb..30c239a036 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryTestsBase.cs @@ -27,7 +27,8 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests public abstract class ClientTelemetryTestsBase : BaseCosmosClientHelper { - private static SystemUsageMonitor systemUsageMonitor; + protected static readonly Uri telemetryServiceEndpoint = new Uri("http://dummy.telemetry.service/api/url"); + private static readonly List preferredRegionList = new List { Regions.EastUS, @@ -53,13 +54,13 @@ public abstract class ClientTelemetryTestsBase : BaseCosmosClientHelper public static void ClassInitialize(TestContext _) { - Util.EnableClientTelemetryEnvironmentVariables(); - - SystemUsageMonitor oldSystemUsageMonitor = (SystemUsageMonitor)typeof(DiagnosticsHandlerHelper) - .GetField("systemUsageMonitor", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(DiagnosticsHandlerHelper.Instance); - oldSystemUsageMonitor.Stop(); + ClientTelemetryOptions.DefaultIntervalForTelemetryJob = TimeSpan.FromSeconds(1); + } - ClientTelemetryTestsBase.ResetSystemUsageMonitor(true); + public static void ClassCleanup() + { + //undone the changes done in ClassInitialize + ClientTelemetryOptions.DefaultIntervalForTelemetryJob = TimeSpan.FromMinutes(10); } public virtual void TestInitialize() @@ -70,7 +71,7 @@ public virtual void TestInitialize() { RequestCallBack = (request, cancellation) => { - if (request.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) + if (request.RequestUri.AbsoluteUri.Equals(telemetryServiceEndpoint.AbsoluteUri)) { string jsonObject = request.Content.ReadAsStringAsync().GetAwaiter().GetResult(); @@ -83,7 +84,7 @@ public virtual void TestInitialize() }, ResponseIntercepter = (response) => { - if (response.RequestMessage.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) + if (response.RequestMessage != null && response.RequestMessage.RequestUri.AbsoluteUri.Equals(telemetryServiceEndpoint.AbsoluteUri)) { Assert.AreEqual(HttpStatusCode.NoContent, response.StatusCode); } @@ -92,7 +93,7 @@ public virtual void TestInitialize() }, ExceptionIntercepter = (request, exception) => { - if (request.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) + if (request.RequestUri.AbsoluteUri.Equals(telemetryServiceEndpoint.AbsoluteUri)) { this.isClientTelemetryAPICallFailed = true; } @@ -109,7 +110,7 @@ public virtual void TestInitialize() return Task.FromResult(result); } - if (request.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) + if (request.RequestUri.AbsoluteUri.Equals(telemetryServiceEndpoint.AbsoluteUri)) { string jsonObject = request.Content.ReadAsStringAsync().GetAwaiter().GetResult(); @@ -123,7 +124,7 @@ public virtual void TestInitialize() }, ResponseIntercepter = (response) => { - if (response.RequestMessage.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) + if (response.RequestMessage != null && response.RequestMessage.RequestUri.AbsoluteUri.Equals(telemetryServiceEndpoint.AbsoluteUri)) { Assert.AreEqual(HttpStatusCode.NoContent, response.StatusCode); } @@ -131,7 +132,7 @@ public virtual void TestInitialize() }, ExceptionIntercepter = (request, exception) => { - if (request.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) + if (request.RequestUri.AbsoluteUri.Equals(telemetryServiceEndpoint.AbsoluteUri)) { this.isClientTelemetryAPICallFailed = true; } @@ -139,6 +140,7 @@ public virtual void TestInitialize() }; this.cosmosClientBuilder = this.GetBuilder() + .WithTelemetryEnabled() .WithApplicationPreferredRegions(ClientTelemetryTestsBase.preferredRegionList); } @@ -146,34 +148,6 @@ public virtual void TestInitialize() public abstract CosmosClientBuilder GetBuilder(); - private static void ResetSystemUsageMonitor(bool isTelemetryEnabled) - { - ClientTelemetryTestsBase.systemUsageMonitor?.Stop(); - - FieldInfo diagnosticsHandlerHelperInstance = typeof(DiagnosticsHandlerHelper) - .GetField("isTelemetryMonitoringEnabled", BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic); - diagnosticsHandlerHelperInstance.SetValue(null, isTelemetryEnabled); - - List recorders = new List() - { - (SystemUsageRecorder)typeof(DiagnosticsHandlerHelper) - .GetField("diagnosticSystemUsageRecorder", - BindingFlags.Instance | BindingFlags.NonPublic) - .GetValue(DiagnosticsHandlerHelper.Instance) - }; - - if (isTelemetryEnabled) - { - recorders.Add( - (SystemUsageRecorder)typeof(DiagnosticsHandlerHelper) - .GetField("telemetrySystemUsageRecorder", - BindingFlags.Instance | BindingFlags.NonPublic) - .GetValue(DiagnosticsHandlerHelper.Instance)); - } - - ClientTelemetryTestsBase.systemUsageMonitor = SystemUsageMonitor.CreateAndStart(recorders); - } - public virtual async Task Cleanup() { FieldInfo isInitializedField = typeof(VmMetadataApiHandler).GetField("isInitialized", @@ -185,16 +159,12 @@ public virtual async Task Cleanup() BindingFlags.Static | BindingFlags.NonPublic); azMetadataField.SetValue(null, null); + await base.TestCleanup(); - Assert.IsFalse(this.isClientTelemetryAPICallFailed, $"Call to client telemetry service endpoint (i.e. {ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri}) failed"); + Assert.IsFalse(this.isClientTelemetryAPICallFailed, $"Call to client telemetry service endpoint (i.e. {telemetryServiceEndpoint}) failed"); } - public static void FinalCleanup() - { - ClientTelemetryTestsBase.ResetSystemUsageMonitor(false); - } - public virtual async Task PointSuccessOperationsTest(ConnectionMode mode, bool isAzureInstance) { Container container = await this.CreateClientAndContainer( @@ -414,8 +384,6 @@ await this.WaitAndAssert( public virtual async Task QueryOperationSinglePartitionTest(ConnectionMode mode) { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, "20"); - Container container = await this.CreateClientAndContainer(mode); ToDoActivity testItem = ToDoActivity.CreateRandomToDoActivity("MyTestPkValue", "MyTestItemId"); @@ -471,7 +439,6 @@ await this.WaitAndAssert(expectedOperationCount: 4, public virtual async Task QueryMultiPageSinglePartitionOperationTest(ConnectionMode mode) { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, "20"); Container container = await this.CreateClientAndContainer(mode: mode); ItemRequestOptions requestOptions = new ItemRequestOptions() @@ -532,8 +499,6 @@ await this.WaitAndAssert( public virtual async Task QueryOperationCrossPartitionTest(ConnectionMode mode) { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, "20"); - ContainerInternal itemsCore = (ContainerInternal)await this.CreateClientAndContainer( mode: mode, isLargeContainer: true); @@ -674,7 +639,7 @@ public virtual async Task CreateItemWithSubStatusCodeTest(ConnectionMode mode) httpHandler.RequestCallBack = (request, cancellation) => { - if (request.RequestUri.AbsoluteUri.Equals(ClientTelemetryOptions.GetClientTelemetryEndpoint().AbsoluteUri)) + if (request.RequestUri.AbsoluteUri.Equals(telemetryServiceEndpoint.AbsoluteUri)) { string jsonObject = request.Content.ReadAsStringAsync().GetAwaiter().GetResult(); @@ -696,11 +661,12 @@ public virtual async Task CreateItemWithSubStatusCodeTest(ConnectionMode mode) return Task.FromResult(result); } - return null; + return this.HttpHandlerRequestCallbackChecks(request); }; // Replacing originally initialized cosmos Builder with this one with new handler this.cosmosClientBuilder = this.cosmosClientBuilder + .WithTelemetryEnabled() .WithHttpClientFactory(() => new HttpClient(httpHandler)); Container container = await this.CreateClientAndContainer( diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SynchronizationContextTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SynchronizationContextTests.cs index a8ae6ce1a4..1c5676a46a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SynchronizationContextTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/SynchronizationContextTests.cs @@ -6,9 +6,15 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests { using System; using System.Linq; + using System.Net; + using System.Net.Http; + using System.Text; using System.Threading; + using System.Threading.Tasks; using Microsoft.Azure.Cosmos.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; + using Newtonsoft.Json; + using Microsoft.Azure.Documents; [TestClass] public class SynchronizationContextTests @@ -19,10 +25,29 @@ public class SynchronizationContextTests [Timeout(30000)] public void VerifySynchronizationContextDoesNotLock(bool withClientTelemetry) { - if (withClientTelemetry) + HttpClientHandlerHelper httpHandler = new HttpClientHandlerHelper { - Util.EnableClientTelemetryEnvironmentVariables(); - } + RequestCallBack = (request, cancellation) => + { + if (request.RequestUri.AbsoluteUri.Contains(Paths.ClientConfigPathSegment)) + { + HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK); + AccountClientConfiguration clientConfigProperties = new AccountClientConfiguration + { + ClientTelemetryConfiguration = new ClientTelemetryConfiguration + { + IsEnabled = withClientTelemetry, + Endpoint = withClientTelemetry? "http://dummy.telemetry.endpoint/" : null + } + }; + string payload = JsonConvert.SerializeObject(clientConfigProperties); + result.Content = new StringContent(payload, Encoding.UTF8, "application/json"); + return Task.FromResult(result); + } + + return null; + } + }; string databaseId = Guid.NewGuid().ToString(); SynchronizationContext prevContext = SynchronizationContext.Current; @@ -32,7 +57,10 @@ public void VerifySynchronizationContextDoesNotLock(bool withClientTelemetry) SynchronizationContext.SetSynchronizationContext(syncContext); syncContext.Post(_ => { - using (CosmosClient client = TestCommon.CreateCosmosClient()) + using (CosmosClient client = TestCommon.CreateCosmosClient( + customizeClientBuilder: (builder) => builder + .WithTelemetryEnabled() + .WithHttpClientFactory(() => new HttpClient(httpHandler)))) { Cosmos.Database database = client.CreateDatabaseAsync(databaseId).GetAwaiter().GetResult(); database = client.CreateDatabaseIfNotExistsAsync(databaseId).GetAwaiter().GetResult(); @@ -124,7 +152,7 @@ public void VerifySynchronizationContextDoesNotLock(bool withClientTelemetry) double cost = container.GetItemLinqQueryable( allowSynchronousQueryExecution: true).Select(x => x.cost).Sum(); - + ItemResponse deleteResponse = container.DeleteItemAsync(partitionKey: new Cosmos.PartitionKey(testItem.pk), id: testItem.id).ConfigureAwait(false).GetAwaiter().GetResult(); Assert.IsNotNull(deleteResponse); } @@ -138,11 +166,6 @@ public void VerifySynchronizationContextDoesNotLock(bool withClientTelemetry) { client.GetDatabase(databaseId).DeleteAsync().GetAwaiter().GetResult(); } - - if (withClientTelemetry) - { - Util.DisableClientTelemetryEnvironmentVariables(); - } } } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/HttpHandlerHelper.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/HttpHandlerHelper.cs index 9b78eb573c..aead33feef 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/HttpHandlerHelper.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/HttpHandlerHelper.cs @@ -52,6 +52,8 @@ protected override async Task SendAsync(HttpRequestMessage throw; } this.ExceptionIntercepter.Invoke(request, ex); + + throw; // Anyway throw this exception } if (this.ResponseIntercepter != null) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs index 366cc68811..ea360ea285 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/Util.cs @@ -522,20 +522,6 @@ internal static void LogRequestOptions(RequestOptions options, bool shouldLogOff options.OfferThroughput); } - internal static void EnableClientTelemetryEnvironmentVariables() - { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, "true"); - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, "1"); - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, "http://dummy.telemetry.endpoint/"); - } - - internal static void DisableClientTelemetryEnvironmentVariables() - { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, null); - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetrySchedulingInSeconds, null); - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, null); - } - private static TracerProvider OTelTracerProvider; private static CustomListener TestListener; diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/HttpHandlerHelper.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/HttpHandlerHelper.cs new file mode 100644 index 0000000000..65fb15e012 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/HttpHandlerHelper.cs @@ -0,0 +1,67 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Performance.Tests +{ + using System; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + public class HttpClientHandlerHelper : DelegatingHandler + { + public HttpClientHandlerHelper() : base(new HttpClientHandler()) + { + } + + public Func> RequestCallBack { get; set; } + + public Func> ResponseIntercepter { get; set; } + + public Action ExceptionIntercepter { get; set; } + + protected override async Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) + { + HttpResponseMessage httpResponse = null; + if (this.RequestCallBack != null) + { + Task response = this.RequestCallBack(request, cancellationToken); + if(response != null) + { + httpResponse = await response; + if (httpResponse != null) + { + if (this.ResponseIntercepter != null) + { + httpResponse = await this.ResponseIntercepter(httpResponse); + } + return httpResponse; + } + } + } + + try + { + httpResponse = await base.SendAsync(request, cancellationToken); + } + catch (Exception ex) { + + if (this.ExceptionIntercepter == null) + { + throw; + } + this.ExceptionIntercepter.Invoke(request, ex); + + throw; // Anyway throw this exception + } + + if (this.ResponseIntercepter != null) + { + httpResponse = await this.ResponseIntercepter(httpResponse); + } + + return httpResponse; + } + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/MockDocumentClient.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/MockDocumentClient.cs index 3403269950..3484abb3ae 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/MockDocumentClient.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Mocks/MockDocumentClient.cs @@ -22,6 +22,9 @@ namespace Microsoft.Azure.Cosmos.Performance.Tests using Microsoft.Azure.Cosmos.Query.Core.QueryPlan; using Newtonsoft.Json; using Microsoft.Azure.Cosmos.Telemetry; + using System.Net.Http; + using System.Net; + using System.Text; internal class MockDocumentClient : DocumentClient, ICosmosAuthorizationTokenProvider { @@ -51,7 +54,7 @@ public static CosmosClient CreateMockCosmosClient( { policy = new ConnectionPolicy { - EnableClientTelemetry = isClientTelemetryEnabled.Value + EnableClientTelemetry = true // feature flag is always true }; } @@ -59,6 +62,43 @@ public static CosmosClient CreateMockCosmosClient( MockDocumentClient documentClient = new MockDocumentClient(policy); CosmosClientBuilder cosmosClientBuilder = new CosmosClientBuilder("http://localhost", Convert.ToBase64String(Guid.NewGuid().ToByteArray())); cosmosClientBuilder.WithConnectionModeDirect(); + + Uri telemetryServiceEndpoint = new Uri("https://dummy.endpoint.com/"); + + if (isClientTelemetryEnabled.HasValue) + { + // mock external calls + HttpClientHandlerHelper httpHandler = new HttpClientHandlerHelper + { + RequestCallBack = (request, cancellation) => + { + if (request.RequestUri.AbsoluteUri.Equals(telemetryServiceEndpoint.AbsoluteUri)) + { + return Task.FromResult(new HttpResponseMessage(HttpStatusCode.NoContent)); // In Emulator test, send hardcoded response status code as there is no real communication happens with client telemetry service + } + else if (request.RequestUri.AbsoluteUri.Contains(Paths.ClientConfigPathSegment)) + { + HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK); + AccountClientConfiguration clientConfigProperties = new AccountClientConfiguration + { + ClientTelemetryConfiguration = new ClientTelemetryConfiguration + { + IsEnabled = isClientTelemetryEnabled.Value, + Endpoint = isClientTelemetryEnabled.Value?telemetryServiceEndpoint.AbsoluteUri: null + } + }; + string payload = JsonConvert.SerializeObject(clientConfigProperties); + result.Content = new StringContent(payload, Encoding.UTF8, "application/json"); + return Task.FromResult(result); + } + + return null; + } + }; + + cosmosClientBuilder.WithHttpClientFactory(() => new HttpClient(httpHandler)); + } + customizeClientBuilder?.Invoke(cosmosClientBuilder); if (useCustomSerializer) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Diagnostics/DiagnosticHandlerHelperTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Diagnostics/DiagnosticHandlerHelperTests.cs new file mode 100644 index 0000000000..23c813d826 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Diagnostics/DiagnosticHandlerHelperTests.cs @@ -0,0 +1,75 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace Microsoft.Azure.Cosmos.Diagnostics +{ + using System; + using System.Reflection; + using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Handler; + using Microsoft.VisualStudio.TestTools.UnitTesting; + + [TestClass] + public class DiagnosticHandlerHelperTests + { + [ClassInitialize] + public static void Initialize(TestContext _) + { + DiagnosticHandlerHelperTests.ResetDiagnosticsHandlerHelper(); + } + + private static void ResetDiagnosticsHandlerHelper() + { + //Stop the job + DiagnosticsHandlerHelper helper = DiagnosticsHandlerHelper.GetInstance(); + MethodInfo iMethod = helper.GetType().GetMethod("StopSystemMonitor", BindingFlags.NonPublic | BindingFlags.Instance); + iMethod.Invoke(helper, new object[] { }); + + //Reset the instance woth original value + FieldInfo field = typeof(DiagnosticsHandlerHelper).GetField("Instance", + BindingFlags.Static | + BindingFlags.NonPublic); + field.SetValue(null, Activator.CreateInstance(typeof(DiagnosticsHandlerHelper), true)); + } + + [TestMethod] + public void SingletonTest() + { + DiagnosticsHandlerHelper diagnosticHandlerHelper1 = DiagnosticsHandlerHelper.GetInstance(); + DiagnosticsHandlerHelper diagnosticHandlerHelper2 = DiagnosticsHandlerHelper.GetInstance(); + + Assert.IsNotNull(diagnosticHandlerHelper1); + Assert.IsNotNull(diagnosticHandlerHelper2); + Assert.AreEqual(diagnosticHandlerHelper1, diagnosticHandlerHelper2, "Not Singleton"); + } + + [TestMethod] + public async Task RefreshTestAsync() + { + // Get default instance of DiagnosticsHandlerHelper with client telemetry disabled (default) + DiagnosticsHandlerHelper diagnosticHandlerHelper1 = DiagnosticsHandlerHelper.GetInstance(); + await Task.Delay(10000); // warm up + Assert.IsNotNull(diagnosticHandlerHelper1.GetDiagnosticsSystemHistory()); + int countBeforeRefresh = diagnosticHandlerHelper1.GetDiagnosticsSystemHistory().Values.Count; + + // Refresh instance of DiagnosticsHandlerHelper with client telemetry enabled + DiagnosticsHandlerHelper.Refresh(true); + DiagnosticsHandlerHelper diagnosticHandlerHelper2 = DiagnosticsHandlerHelper.GetInstance(); + int countAfterRefresh = diagnosticHandlerHelper1.GetDiagnosticsSystemHistory().Values.Count; + + Console.WriteLine(countBeforeRefresh + " " + countAfterRefresh); + Assert.IsTrue(countBeforeRefresh <= countAfterRefresh, "After Refresh count should be greater than or equal to before refresh count"); + + Assert.AreNotEqual(diagnosticHandlerHelper1, diagnosticHandlerHelper2); + + Assert.IsNotNull(diagnosticHandlerHelper2.GetDiagnosticsSystemHistory()); + Assert.IsNotNull(diagnosticHandlerHelper2.GetClientTelemetrySystemHistory()); + + // Refresh instance of DiagnosticsHandlerHelper with client telemetry disabled + DiagnosticsHandlerHelper.Refresh(false); + DiagnosticsHandlerHelper diagnosticHandlerHelper3 = DiagnosticsHandlerHelper.GetInstance(); + Assert.IsNotNull(diagnosticHandlerHelper3.GetDiagnosticsSystemHistory()); + Assert.IsNull(diagnosticHandlerHelper3.GetClientTelemetrySystemHistory()); + } + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryTests.cs index 9308d22806..6005ec3045 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Telemetry/ClientTelemetryTests.cs @@ -26,13 +26,6 @@ namespace Microsoft.Azure.Cosmos.Tests.Telemetry [TestClass] public class ClientTelemetryTests { - [TestCleanup] - public void Cleanup() - { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, null); - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, null); - } - [TestMethod] public void CheckMetricsAggregationLogic() { @@ -126,7 +119,6 @@ public void CheckJsonSerializerContractWithPreferredRegions() [DataRow(150, 0, 0)] // When only operation info is there in payload public async Task CheckIfPayloadIsDividedCorrectlyAsync(int expectedOperationInfoSize, int expectedCacheRefreshInfoSize, int expectedRequestInfoSize) { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, "http://dummy.telemetry.endpoint/"); ClientTelemetryOptions.PayloadSizeThreshold = 1024 * 15; //15 Kb string data = File.ReadAllText("Telemetry/ClientTelemetryPayloadWithoutMetrics.json", Encoding.UTF8); @@ -245,7 +237,8 @@ await processor.ProcessAndSendAsync( clientTelemetryProperties, operationInfoSnapshot, cacheRefreshInfoSnapshot, - requestInfoList, + requestInfoList, + "http://dummy.telemetry.endpoint/", new CancellationTokenSource(ClientTelemetryOptions.ClientTelemetryProcessorTimeOut).Token); Assert.AreEqual(expectedOperationInfoSize, actualOperationInfoSize, "Operation Info is not correct"); @@ -256,8 +249,6 @@ await processor.ProcessAndSendAsync( [TestMethod] public async Task ClientTelmetryProcessor_should_timeout() { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEndpoint, "http://dummy.telemetry.endpoint/"); - string data = File.ReadAllText("Telemetry/ClientTelemetryPayloadWithoutMetrics.json", Encoding.UTF8); ClientTelemetryProperties clientTelemetryProperties = JsonConvert.DeserializeObject(data); @@ -344,6 +335,7 @@ await processor.ProcessAndSendAsync(clientTelemetryProperties, operationInfoSnapshot, cacheRefreshInfoSnapshot, default, + "http://dummy.telemetry.endpoint/", cts.Token); }); @@ -352,13 +344,5 @@ await Assert.ThrowsExceptionAsync(() => ClientTeleme processingTask: processorTask, timeout: TimeSpan.FromTicks(1))); } - - [TestMethod] - [ExpectedException(typeof(FormatException))] - public void CheckMisconfiguredTelemetry_should_fail() - { - Environment.SetEnvironmentVariable(ClientTelemetryOptions.EnvPropsClientTelemetryEnabled, "non-boolean"); - using CosmosClient client = MockCosmosUtil.CreateMockCosmosClient(); - } } } From 7c3f5e1decc47a5888feaee2f79c8f4b2ad4bf63 Mon Sep 17 00:00:00 2001 From: David Chaava Date: Tue, 5 Sep 2023 21:55:18 +0200 Subject: [PATCH 184/240] [Internal] Benchmark tool: Fixes benchmark run command using OSSProjectRef parameter (#4066) * fix benchmark run command using OSSProjectRef parameter * remove ShouldUnsetParentConfigurationAndPlatform=false --------- Co-authored-by: David Chaava --- .../Tools/Benchmark/AzureVmBenchmark/scripts/custom-script.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/custom-script.sh b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/custom-script.sh index 2b41d4d0e4..8ae5662144 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/custom-script.sh +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/scripts/custom-script.sh @@ -14,10 +14,10 @@ git checkout ${BENCHMARKING_TOOLS_BRANCH_NAME} cd 'Microsoft.Azure.Cosmos.Samples/Tools/Benchmark' echo "########## Build benckmark tool ##########" -dotnet build --configuration Release -p:"OSSProjectRef=true;ShouldUnsetParentConfigurationAndPlatform=false" +dotnet build --configuration Release -p:"OSSProjectRef=true" echo "########## Run benchmark ##########" -nohup dotnet run -c Release -e ${COSMOS_URI} -k ${COSMOS_KEY} -t ${THROUGHPUT} -n ${DOCUMENTS} --pl ${PARALLELISM} \ +nohup dotnet run -c Release -p:"OSSProjectRef=true" -e ${COSMOS_URI} -k ${COSMOS_KEY} -t ${THROUGHPUT} -n ${DOCUMENTS} --pl ${PARALLELISM} \ --enablelatencypercentiles true --resultscontainer ${RESULTS_CONTAINER} --resultspartitionkeyvalue "pk" \ --DiagnosticsStorageConnectionString ${DIAGNOSTICS_STORAGE_CONNECTION_STRING} \ --DiagnosticLatencyThresholdInMs ${DIAGNOSTICS_LATENCY_THRESHOLD_IN_MS} \ From b7b1064ab7e8bb0d90825c95125c5e1e2d74cb50 Mon Sep 17 00:00:00 2001 From: Maya-Painter <130110800+Maya-Painter@users.noreply.github.com> Date: Fri, 8 Sep 2023 12:39:48 -0700 Subject: [PATCH 185/240] [Query] Adds public backend metrics property to Diagnostics (#4001) * initial commit * some pr comments, WIP * Refactor * more * Public constructors and modify accumulators * accumulator updates and undo test changes * add test * PR comments * bug fix * ToString() refactor * contract updates * test updates * small fixes * text fix * Update accumulators * fix * PR comments * small fix * Rename BE -> ServerSide * more renaming * Update API and tests * separate public and internal classes * API update * change namespace * Pr comments * public constructors and bug fix * API updates * renaming and test updates * PR comments * more PR comments * PR comments, test additions * API updates and more tests * tests and pkrangeid update * PR comments * more PR comments * smol test fix * PR comments - renaming properties and constructor rehash * contract update * seal classes and private fields. * update indexHitRatio calc * mocking refactor to abstract classes * contract updates * PR comments - Update documentation --- .../src/Diagnostics/CosmosDiagnostics.cs | 13 + .../src/Diagnostics/CosmosTraceDiagnostics.cs | 24 +- .../src/Query/Core/Metrics/BackendMetrics.cs | 237 ------------------ .../Query/Core/Metrics/ClientSideMetrics.cs | 38 --- .../Metrics/ClientSideMetricsAccumulator.cs | 47 ++++ .../Core/Metrics/IndexUtilizationInfo.cs | 38 --- .../IndexUtilizationInfoAccumulator.cs | 51 ++++ .../src/Query/Core/Metrics/QueryMetrics.cs | 70 ++---- .../Core/Metrics/QueryMetricsAccumulator.cs | 48 ++++ .../Core/Metrics/QueryMetricsTextWriter.cs | 4 +- .../Query/Core/Metrics/QueryMetricsWriter.cs | 28 +-- .../Core/Metrics/QueryPreparationTimes.cs | 104 -------- .../QueryPreparationTimesAccumulator.cs | 51 ++++ .../Metrics/QueryPreparationTimesInternal.cs | 65 +++++ .../Core/Metrics/RuntimeExecutionTimes.cs | 91 ------- .../RuntimeExecutionTimesAccumulator.cs | 48 ++++ .../Metrics/RuntimeExecutionTimesInternal.cs | 56 +++++ .../Metrics/ServerSideCumulativeMetrics.cs | 23 ++ .../ServerSideCumulativeMetricsInternal.cs | 29 +++ .../Query/Core/Metrics/ServerSideMetrics.cs | 74 ++++++ .../Core/Metrics/ServerSideMetricsInternal.cs | 153 +++++++++++ .../ServerSideMetricsInternalAccumulator.cs | 146 +++++++++++ ...csParser.cs => ServerSideMetricsParser.cs} | 164 ++++++------ ...nizer.cs => ServerSideMetricsTokenizer.cs} | 4 +- .../Core/Metrics/ServerSideMetricsUtils.cs | 13 + .../Metrics/ServerSidePartitionedMetrics.cs | 27 ++ .../ServerSidePartitionedMetricsInternal.cs | 40 +++ .../CosmosItemTests.cs | 134 +++++++++- .../QueryStatisticsDatumVisitor.cs | 14 +- .../QueryTests.cs | 26 +- .../Query/Metrics/Performance.cs | 2 +- .../TraceWriterBaselineTests.TraceData.xml | 2 +- .../Contracts/DotNetSDKAPI.json | 193 ++++++++++++++ .../Query/Metrics/ClientSideMetricsTests.cs | 8 +- .../Metrics/IndexUtilizationInfoTests.cs | 9 +- .../Query/Metrics/QueryMetricsTests.cs | 16 +- ...ricsTests.cs => ServerSideMetricsTests.cs} | 68 ++--- .../Tracing/TraceWriterBaselineTests.cs | 4 +- 38 files changed, 1420 insertions(+), 742 deletions(-) delete mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/BackendMetrics.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ClientSideMetricsAccumulator.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexUtilizationInfoAccumulator.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryMetricsAccumulator.cs delete mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryPreparationTimes.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryPreparationTimesAccumulator.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryPreparationTimesInternal.cs delete mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/RuntimeExecutionTimes.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/RuntimeExecutionTimesAccumulator.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/RuntimeExecutionTimesInternal.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideCumulativeMetrics.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideCumulativeMetricsInternal.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetrics.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsInternal.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsInternalAccumulator.cs rename Microsoft.Azure.Cosmos/src/Query/Core/Metrics/{BackendMetricsParser.cs => ServerSideMetricsParser.cs} (53%) rename Microsoft.Azure.Cosmos/src/Query/Core/Metrics/{BackendMetricsTokenizer.cs => ServerSideMetricsTokenizer.cs} (98%) create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsUtils.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSidePartitionedMetrics.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSidePartitionedMetricsInternal.cs rename Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/{BackendMetricsTests.cs => ServerSideMetricsTests.cs} (78%) diff --git a/Microsoft.Azure.Cosmos/src/Diagnostics/CosmosDiagnostics.cs b/Microsoft.Azure.Cosmos/src/Diagnostics/CosmosDiagnostics.cs index a82ef2ecc2..b88eaa8efe 100644 --- a/Microsoft.Azure.Cosmos/src/Diagnostics/CosmosDiagnostics.cs +++ b/Microsoft.Azure.Cosmos/src/Diagnostics/CosmosDiagnostics.cs @@ -43,6 +43,19 @@ public virtual int GetFailedRequestCount() throw new NotImplementedException($"{nameof(CosmosDiagnostics)}.{nameof(GetFailedRequestCount)}"); } + /// + /// This represents the backend query metrics for the request. + /// + /// + /// This is only applicable for query operations. For all other operations this will return null. + /// + /// The accumulated backend metrics for the request. + public virtual ServerSideCumulativeMetrics GetQueryMetrics() + { + // Default implementation avoids breaking change for users upgrading. + throw new NotImplementedException($"{nameof(CosmosDiagnostics)}.{nameof(GetQueryMetrics)}"); + } + /// /// Gets the string field instance in the Azure Cosmos DB database service. /// diff --git a/Microsoft.Azure.Cosmos/src/Diagnostics/CosmosTraceDiagnostics.cs b/Microsoft.Azure.Cosmos/src/Diagnostics/CosmosTraceDiagnostics.cs index 07e340f0ac..2d92a2cfb7 100644 --- a/Microsoft.Azure.Cosmos/src/Diagnostics/CosmosTraceDiagnostics.cs +++ b/Microsoft.Azure.Cosmos/src/Diagnostics/CosmosTraceDiagnostics.cs @@ -9,12 +9,15 @@ namespace Microsoft.Azure.Cosmos.Diagnostics using System.Linq; using System.Text; using Microsoft.Azure.Cosmos.Json; + using Microsoft.Azure.Cosmos.Query.Core.Metrics; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Cosmos.Tracing.TraceData; using static Microsoft.Azure.Cosmos.Tracing.TraceData.ClientSideRequestStatisticsTraceDatum; internal sealed class CosmosTraceDiagnostics : CosmosDiagnostics { + private readonly Lazy accumulatedMetrics; + public CosmosTraceDiagnostics(ITrace trace) { if (trace == null) @@ -30,6 +33,7 @@ public CosmosTraceDiagnostics(ITrace trace) } this.Value = rootTrace; + this.accumulatedMetrics = new Lazy(() => PopulateServerSideCumulativeMetrics(this.Value)); } public ITrace Value { get; } @@ -49,6 +53,11 @@ public override TimeSpan GetClientElapsedTime() return this.Value?.Summary?.RegionsContacted; } + public override ServerSideCumulativeMetrics GetQueryMetrics() + { + return this.accumulatedMetrics.Value; + } + internal bool IsGoneExceptionHit() { return this.WalkTraceTreeForGoneException(this.Value); @@ -61,9 +70,9 @@ private bool WalkTraceTreeForGoneException(ITrace currentTrace) return false; } - foreach (object datums in currentTrace.Data.Values) + foreach (object datum in currentTrace.Data.Values) { - if (datums is ClientSideRequestStatisticsTraceDatum clientSideRequestStatisticsTraceDatum) + if (datum is ClientSideRequestStatisticsTraceDatum clientSideRequestStatisticsTraceDatum) { foreach (StoreResponseStatistics responseStatistics in clientSideRequestStatisticsTraceDatum.StoreResponseStatisticsList) { @@ -99,6 +108,17 @@ private ReadOnlyMemory WriteTraceToJsonWriter(JsonSerializationFormat json return jsonTextWriter.GetResult(); } + private static ServerSideCumulativeMetrics PopulateServerSideCumulativeMetrics(ITrace trace) + { + ServerSideMetricsInternalAccumulator accumulator = new ServerSideMetricsInternalAccumulator(); + ServerSideMetricsInternalAccumulator.WalkTraceTreeForQueryMetrics(trace, accumulator); + + IReadOnlyList serverSideMetricsList = accumulator.GetPartitionedServerSideMetrics().Select(metrics => new ServerSidePartitionedMetricsInternal(metrics)).ToList(); + + ServerSideCumulativeMetrics accumulatedMetrics = new ServerSideCumulativeMetricsInternal(serverSideMetricsList); + return accumulatedMetrics.PartitionedMetrics.Count != 0 ? accumulatedMetrics : null; + } + public override DateTime? GetStartTimeUtc() { if (this.Value == null || this.Value.StartTime == null) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/BackendMetrics.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/BackendMetrics.cs deleted file mode 100644 index e958aee949..0000000000 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/BackendMetrics.cs +++ /dev/null @@ -1,237 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ - -namespace Microsoft.Azure.Cosmos.Query.Core.Metrics -{ - using System; - using System.Collections.Generic; - - /// - /// Metrics received for queries from the backend. - /// -#if INTERNAL -#pragma warning disable SA1600 -#pragma warning disable CS1591 - public -#else - internal -#endif - sealed class BackendMetrics - { - /// - /// QueryMetrics that with all members having default (but not null) members. - /// - public static readonly BackendMetrics Empty = new BackendMetrics( - retrievedDocumentCount: default, - retrievedDocumentSize: default, - outputDocumentCount: default, - outputDocumentSize: default, - indexHitRatio: default, - totalQueryExecutionTime: default, - queryPreparationTimes: QueryPreparationTimes.Zero, - indexLookupTime: default, - documentLoadTime: default, - vmExecutionTime: default, - runtimeExecutionTimes: RuntimeExecutionTimes.Empty, - documentWriteTime: default); - - public BackendMetrics( - long retrievedDocumentCount, - long retrievedDocumentSize, - long outputDocumentCount, - long outputDocumentSize, - double indexHitRatio, - TimeSpan totalQueryExecutionTime, - QueryPreparationTimes queryPreparationTimes, - TimeSpan indexLookupTime, - TimeSpan documentLoadTime, - TimeSpan vmExecutionTime, - RuntimeExecutionTimes runtimeExecutionTimes, - TimeSpan documentWriteTime) - { - this.RetrievedDocumentCount = retrievedDocumentCount; - this.RetrievedDocumentSize = retrievedDocumentSize; - this.OutputDocumentCount = outputDocumentCount; - this.OutputDocumentSize = outputDocumentSize; - this.IndexHitRatio = indexHitRatio; - this.TotalTime = totalQueryExecutionTime; - this.QueryPreparationTimes = queryPreparationTimes ?? throw new ArgumentNullException($"{nameof(queryPreparationTimes)} can not be null."); - this.IndexLookupTime = indexLookupTime; - this.DocumentLoadTime = documentLoadTime; - this.VMExecutionTime = vmExecutionTime; - this.RuntimeExecutionTimes = runtimeExecutionTimes ?? throw new ArgumentNullException($"{nameof(runtimeExecutionTimes)} can not be null."); - this.DocumentWriteTime = documentWriteTime; - } - - /// - /// Gets the total query time in the Azure Cosmos database service. - /// - public TimeSpan TotalTime { get; } - - /// - /// Gets the number of documents retrieved during query in the Azure Cosmos database service. - /// - public long RetrievedDocumentCount { get; } - - /// - /// Gets the size of documents retrieved in bytes during query in the Azure Cosmos DB service. - /// - public long RetrievedDocumentSize { get; } - - /// - /// Gets the number of documents returned by query in the Azure Cosmos DB service. - /// - public long OutputDocumentCount { get; } - - /// - /// Gets the size of documents outputted in bytes during query in the Azure Cosmos database service. - /// - public long OutputDocumentSize { get; } - - /// - /// Gets the query QueryPreparationTimes in the Azure Cosmos database service. - /// - public QueryPreparationTimes QueryPreparationTimes { get; } - - /// - /// Gets the query index lookup time in the Azure Cosmos database service. - /// - public TimeSpan IndexLookupTime { get; } - - /// - /// Gets the document loading time during query in the Azure Cosmos database service. - /// - public TimeSpan DocumentLoadTime { get; } - - /// - /// Gets the query runtime execution times during query in the Azure Cosmos database service. - /// - public RuntimeExecutionTimes RuntimeExecutionTimes { get; } - - /// - /// Gets the output writing/serializing time during query in the Azure Cosmos database service. - /// - public TimeSpan DocumentWriteTime { get; } - - /// - /// Gets the index hit ratio by query in the Azure Cosmos database service. - /// - public double IndexHitRatio { get; } - - /// - /// Gets the VMExecution Time. - /// - public TimeSpan VMExecutionTime { get; } - - public override string ToString() - { - return $"totalExecutionTimeInMs={this.TotalTime.TotalMilliseconds};queryCompileTimeInMs={this.QueryPreparationTimes.QueryCompilationTime.TotalMilliseconds};queryLogicalPlanBuildTimeInMs={this.QueryPreparationTimes.LogicalPlanBuildTime.TotalMilliseconds};queryPhysicalPlanBuildTimeInMs={this.QueryPreparationTimes.PhysicalPlanBuildTime.TotalMilliseconds};queryOptimizationTimeInMs={this.QueryPreparationTimes.QueryOptimizationTime.TotalMilliseconds};indexLookupTimeInMs={this.IndexLookupTime.TotalMilliseconds};documentLoadTimeInMs={this.DocumentLoadTime.TotalMilliseconds};systemFunctionExecuteTimeInMs={this.RuntimeExecutionTimes.SystemFunctionExecutionTime.TotalMilliseconds};userFunctionExecuteTimeInMs={this.RuntimeExecutionTimes.UserDefinedFunctionExecutionTime.TotalMilliseconds};retrievedDocumentCount={this.RetrievedDocumentCount};retrievedDocumentSize={this.RetrievedDocumentSize};outputDocumentCount={this.OutputDocumentCount};outputDocumentSize={this.OutputDocumentSize};writeOutputTimeInMs={this.DocumentWriteTime.TotalMilliseconds};indexUtilizationRatio={this.IndexHitRatio}"; - } - - public static BackendMetrics CreateFromIEnumerable(IEnumerable backendMetricsEnumerable) - { - BackendMetrics.Accumulator accumulator = default; - foreach (BackendMetrics backendMetrics in backendMetricsEnumerable) - { - accumulator = accumulator.Accumulate(backendMetrics); - } - - return BackendMetrics.Accumulator.ToBackendMetrics(accumulator); - } - - public static bool TryParseFromDelimitedString(string delimitedString, out BackendMetrics backendMetrics) - { - return BackendMetricsParser.TryParse(delimitedString, out backendMetrics); - } - - public static BackendMetrics ParseFromDelimitedString(string delimitedString) - { - if (!BackendMetricsParser.TryParse(delimitedString, out BackendMetrics backendMetrics)) - { - throw new FormatException(); - } - - return backendMetrics; - } - - public ref struct Accumulator - { - public Accumulator( - TimeSpan totalTime, - long retrievedDocumentCount, - long retrievedDocumentSize, - long outputDocumentCount, - long outputDocumentSize, - double indexHitRatio, - QueryPreparationTimes.Accumulator queryPreparationTimesAccumulator, - TimeSpan indexLookupTime, - TimeSpan documentLoadTime, - RuntimeExecutionTimes.Accumulator runtimeExecutionTimesAccumulator, - TimeSpan documentWriteTime, - TimeSpan vmExecutionTime) - { - this.TotalTime = totalTime; - this.RetrievedDocumentCount = retrievedDocumentCount; - this.RetrievedDocumentSize = retrievedDocumentSize; - this.OutputDocumentCount = outputDocumentCount; - this.OutputDocumentSize = outputDocumentSize; - this.IndexHitRatio = indexHitRatio; - this.QueryPreparationTimesAccumulator = queryPreparationTimesAccumulator; - this.IndexLookupTime = indexLookupTime; - this.DocumentLoadTime = documentLoadTime; - this.RuntimeExecutionTimesAccumulator = runtimeExecutionTimesAccumulator; - this.DocumentWriteTime = documentWriteTime; - this.VMExecutionTime = vmExecutionTime; - } - - public TimeSpan TotalTime { get; } - public long RetrievedDocumentCount { get; } - public long RetrievedDocumentSize { get; } - public long OutputDocumentCount { get; } - public long OutputDocumentSize { get; } - public double IndexHitRatio { get; } - public QueryPreparationTimes.Accumulator QueryPreparationTimesAccumulator { get; } - public TimeSpan IndexLookupTime { get; } - public TimeSpan DocumentLoadTime { get; } - public RuntimeExecutionTimes.Accumulator RuntimeExecutionTimesAccumulator { get; } - public TimeSpan DocumentWriteTime { get; } - public TimeSpan VMExecutionTime { get; } - - public Accumulator Accumulate(BackendMetrics backendMetrics) - { - return new Accumulator( - totalTime: this.TotalTime + backendMetrics.TotalTime, - retrievedDocumentCount: this.RetrievedDocumentCount + backendMetrics.RetrievedDocumentCount, - retrievedDocumentSize: this.RetrievedDocumentSize + backendMetrics.RetrievedDocumentSize, - outputDocumentCount: this.OutputDocumentCount + backendMetrics.OutputDocumentCount, - outputDocumentSize: this.OutputDocumentSize + backendMetrics.OutputDocumentSize, - indexHitRatio: ((this.OutputDocumentCount * this.IndexHitRatio) + (backendMetrics.OutputDocumentCount * backendMetrics.IndexHitRatio)) / (this.RetrievedDocumentCount + backendMetrics.RetrievedDocumentCount), - queryPreparationTimesAccumulator: this.QueryPreparationTimesAccumulator.Accumulate(backendMetrics.QueryPreparationTimes), - indexLookupTime: this.IndexLookupTime + backendMetrics.IndexLookupTime, - documentLoadTime: this.DocumentLoadTime + backendMetrics.DocumentLoadTime, - runtimeExecutionTimesAccumulator: this.RuntimeExecutionTimesAccumulator.Accumulate(backendMetrics.RuntimeExecutionTimes), - documentWriteTime: this.DocumentWriteTime + backendMetrics.DocumentWriteTime, - vmExecutionTime: this.VMExecutionTime + backendMetrics.VMExecutionTime); - - } - - public static BackendMetrics ToBackendMetrics(BackendMetrics.Accumulator accumulator) - { - return new BackendMetrics( - retrievedDocumentCount: accumulator.RetrievedDocumentCount, - retrievedDocumentSize: accumulator.RetrievedDocumentSize, - outputDocumentCount: accumulator.OutputDocumentCount, - outputDocumentSize: accumulator.OutputDocumentSize, - indexHitRatio: accumulator.IndexHitRatio, - totalQueryExecutionTime: accumulator.TotalTime, - queryPreparationTimes: QueryPreparationTimes.Accumulator.ToQueryPreparationTimes(accumulator.QueryPreparationTimesAccumulator), - indexLookupTime: accumulator.IndexLookupTime, - documentLoadTime: accumulator.DocumentLoadTime, - vmExecutionTime: accumulator.VMExecutionTime, - runtimeExecutionTimes: RuntimeExecutionTimes.Accumulator.ToRuntimeExecutionTimes(accumulator.RuntimeExecutionTimesAccumulator), - documentWriteTime: accumulator.DocumentWriteTime); - } - } - } -} diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ClientSideMetrics.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ClientSideMetrics.cs index e69f4c5808..ff68271a69 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ClientSideMetrics.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ClientSideMetrics.cs @@ -5,7 +5,6 @@ namespace Microsoft.Azure.Cosmos.Query.Core.Metrics { using System; using System.Collections.Generic; - using System.Linq; /// /// Stores client side QueryMetrics. @@ -54,42 +53,5 @@ public ClientSideMetrics( /// Gets the Fetch Execution Ranges for this continuation of the query. /// public IEnumerable FetchExecutionRanges { get; } - - public ref struct Accumulator - { - public Accumulator(long retries, double requestCharge, IEnumerable fetchExecutionRanges) - { - this.Retries = retries; - this.RequestCharge = requestCharge; - this.FetchExecutionRanges = fetchExecutionRanges; - } - - public long Retries { get; } - - public double RequestCharge { get; } - - public IEnumerable FetchExecutionRanges { get; } - - public Accumulator Accumulate(ClientSideMetrics clientSideMetrics) - { - if (clientSideMetrics == null) - { - throw new ArgumentNullException(nameof(clientSideMetrics)); - } - - return new Accumulator( - retries: this.Retries + clientSideMetrics.Retries, - requestCharge: this.RequestCharge + clientSideMetrics.RequestCharge, - fetchExecutionRanges: (this.FetchExecutionRanges ?? Enumerable.Empty()).Concat(clientSideMetrics.FetchExecutionRanges)); - } - - public static ClientSideMetrics ToClientSideMetrics(Accumulator accumulator) - { - return new ClientSideMetrics( - retries: accumulator.Retries, - requestCharge: accumulator.RequestCharge, - fetchExecutionRanges: accumulator.FetchExecutionRanges); - } - } } } diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ClientSideMetricsAccumulator.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ClientSideMetricsAccumulator.cs new file mode 100644 index 0000000000..57816580b6 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ClientSideMetricsAccumulator.cs @@ -0,0 +1,47 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace Microsoft.Azure.Cosmos.Query.Core.Metrics +{ + using System; + using System.Collections.Generic; + + internal sealed class ClientSideMetricsAccumulator + { + private readonly List clientSideMetricsList; + + public ClientSideMetricsAccumulator() + { + this.clientSideMetricsList = new List(); + } + + public void Accumulate(ClientSideMetrics clientSideMetrics) + { + if (clientSideMetrics == null) + { + throw new ArgumentNullException(nameof(clientSideMetrics)); + } + + this.clientSideMetricsList.Add(clientSideMetrics); + } + + public ClientSideMetrics GetClientSideMetrics() + { + long retries = 0; + double requestCharge = 0; + List fetchExecutionRanges = new List(); + + foreach (ClientSideMetrics clientSideMetrics in this.clientSideMetricsList) + { + retries += clientSideMetrics.Retries; + requestCharge += clientSideMetrics.RequestCharge; + fetchExecutionRanges.AddRange(clientSideMetrics.FetchExecutionRanges); + } + + return new ClientSideMetrics( + retries: retries, + requestCharge: requestCharge, + fetchExecutionRanges: fetchExecutionRanges); + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexUtilizationInfo.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexUtilizationInfo.cs index 2dba73132e..e34a7902ad 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexUtilizationInfo.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexUtilizationInfo.cs @@ -125,43 +125,5 @@ public static IndexUtilizationInfo CreateFromString(string delimitedString, bool return indexUtilizationInfo; } - - public ref struct Accumulator - { - public Accumulator( - IEnumerable utilizedSingleIndexes, - IEnumerable potentialSingleIndexes, - IEnumerable utilizedCompositeIndexes, - IEnumerable potentialCompositeIndexes) - { - this.UtilizedSingleIndexes = utilizedSingleIndexes; - this.PotentialSingleIndexes = potentialSingleIndexes; - this.UtilizedCompositeIndexes = utilizedCompositeIndexes; - this.PotentialCompositeIndexes = potentialCompositeIndexes; - } - - public IEnumerable UtilizedSingleIndexes { get; } - public IEnumerable PotentialSingleIndexes { get; } - public IEnumerable UtilizedCompositeIndexes { get; } - public IEnumerable PotentialCompositeIndexes { get; } - - public Accumulator Accumulate(IndexUtilizationInfo indexUtilizationInfo) - { - return new Accumulator( - utilizedSingleIndexes: (this.UtilizedSingleIndexes ?? Enumerable.Empty()).Concat(indexUtilizationInfo.UtilizedSingleIndexes), - potentialSingleIndexes: (this.PotentialSingleIndexes ?? Enumerable.Empty()).Concat(indexUtilizationInfo.PotentialSingleIndexes), - utilizedCompositeIndexes: (this.UtilizedCompositeIndexes ?? Enumerable.Empty()).Concat(indexUtilizationInfo.UtilizedCompositeIndexes), - potentialCompositeIndexes: (this.PotentialCompositeIndexes ?? Enumerable.Empty()).Concat(indexUtilizationInfo.PotentialCompositeIndexes)); - } - - public static IndexUtilizationInfo ToIndexUtilizationInfo(Accumulator accumulator) - { - return new IndexUtilizationInfo( - utilizedSingleIndexes: accumulator.UtilizedSingleIndexes.ToList(), - potentialSingleIndexes: accumulator.PotentialSingleIndexes.ToList(), - utilizedCompositeIndexes: accumulator.UtilizedCompositeIndexes.ToList(), - potentialCompositeIndexes: accumulator.PotentialCompositeIndexes.ToList()); - } - } } } diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexUtilizationInfoAccumulator.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexUtilizationInfoAccumulator.cs new file mode 100644 index 0000000000..978abba77a --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexUtilizationInfoAccumulator.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.Metrics +{ + using System; + using System.Collections.Generic; + + internal sealed class IndexUtilizationInfoAccumulator + { + private readonly List indexUtilizationInfoList; + + public IndexUtilizationInfoAccumulator() + { + this.indexUtilizationInfoList = new List(); + } + + public void Accumulate(IndexUtilizationInfo indexUtilizationInfo) + { + if (indexUtilizationInfo == null) + { + throw new ArgumentNullException(nameof(indexUtilizationInfo)); + } + + this.indexUtilizationInfoList.Add(indexUtilizationInfo); + } + + public IndexUtilizationInfo GetIndexUtilizationInfo() + { + List utilizedSingleIndexes = new List(); + List potentialSingleIndexes = new List(); + List utilizedCompositeIndexes = new List(); + List potentialCompositeIndexes = new List(); + + foreach (IndexUtilizationInfo indexUtilizationInfo in this.indexUtilizationInfoList) + { + utilizedSingleIndexes.AddRange(indexUtilizationInfo.UtilizedSingleIndexes); + potentialSingleIndexes.AddRange(indexUtilizationInfo.PotentialSingleIndexes); + utilizedCompositeIndexes.AddRange(indexUtilizationInfo.UtilizedCompositeIndexes); + potentialCompositeIndexes.AddRange(indexUtilizationInfo.PotentialCompositeIndexes); + } + + return new IndexUtilizationInfo( + utilizedSingleIndexes: utilizedSingleIndexes, + potentialSingleIndexes: potentialSingleIndexes, + utilizedCompositeIndexes: utilizedCompositeIndexes, + potentialCompositeIndexes: potentialCompositeIndexes); + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryMetrics.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryMetrics.cs index 5a7e9377ed..ed3993d47e 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryMetrics.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryMetrics.cs @@ -29,11 +29,11 @@ sealed class QueryMetrics clientSideMetrics: ClientSideMetrics.Empty); public QueryMetrics( - BackendMetrics backendMetrics, - IndexUtilizationInfo indexUtilizationInfo, - ClientSideMetrics clientSideMetrics) + ServerSideMetricsInternal serverSideMetrics, + IndexUtilizationInfo indexUtilizationInfo, + ClientSideMetrics clientSideMetrics) { - this.BackendMetrics = backendMetrics ?? throw new ArgumentNullException(nameof(backendMetrics)); + this.ServerSideMetrics = serverSideMetrics ?? throw new ArgumentNullException(nameof(serverSideMetrics)); this.IndexUtilizationInfo = indexUtilizationInfo ?? throw new ArgumentNullException(nameof(indexUtilizationInfo)); this.ClientSideMetrics = clientSideMetrics ?? throw new ArgumentNullException(nameof(clientSideMetrics)); } @@ -43,13 +43,13 @@ public QueryMetrics( IndexUtilizationInfo indexUtilizationInfo, ClientSideMetrics clientSideMetrics) : this(!String.IsNullOrWhiteSpace(deliminatedString) && - BackendMetricsParser.TryParse(deliminatedString, out BackendMetrics backendMetrics) - ? backendMetrics - : BackendMetrics.Empty, indexUtilizationInfo, clientSideMetrics) + ServerSideMetricsParser.TryParse(deliminatedString, out ServerSideMetricsInternal serverSideMetrics) + ? serverSideMetrics + : ServerSideMetricsInternal.Empty, indexUtilizationInfo, clientSideMetrics) { } - public BackendMetrics BackendMetrics { get; } + public ServerSideMetricsInternal ServerSideMetrics { get; } public IndexUtilizationInfo IndexUtilizationInfo { get; } @@ -63,11 +63,11 @@ public QueryMetrics( /// A new instance that is the sum of two instances public static QueryMetrics operator +(QueryMetrics queryMetrics1, QueryMetrics queryMetrics2) { - QueryMetrics.Accumulator queryMetricsAccumulator = new QueryMetrics.Accumulator(); - queryMetricsAccumulator = queryMetricsAccumulator.Accumulate(queryMetrics1); - queryMetricsAccumulator = queryMetricsAccumulator.Accumulate(queryMetrics2); + QueryMetricsAccumulator queryMetricsAccumulator = new QueryMetricsAccumulator(); + queryMetricsAccumulator.Accumulate(queryMetrics1); + queryMetricsAccumulator.Accumulate(queryMetrics2); - return QueryMetrics.Accumulator.ToQueryMetrics(queryMetricsAccumulator); + return queryMetricsAccumulator.GetQueryMetrics(); } /// @@ -94,53 +94,13 @@ public static QueryMetrics CreateFromIEnumerable(IEnumerable query throw new ArgumentNullException(nameof(queryMetricsList)); } - QueryMetrics.Accumulator queryMetricsAccumulator = new QueryMetrics.Accumulator(); + QueryMetricsAccumulator queryMetricsAccumulator = new QueryMetricsAccumulator(); foreach (QueryMetrics queryMetrics in queryMetricsList) { - queryMetricsAccumulator = queryMetricsAccumulator.Accumulate(queryMetrics); + queryMetricsAccumulator.Accumulate(queryMetrics); } - return QueryMetrics.Accumulator.ToQueryMetrics(queryMetricsAccumulator); - } - - public ref struct Accumulator - { - public Accumulator( - BackendMetrics.Accumulator backendMetricsAccumulator, - IndexUtilizationInfo.Accumulator indexUtilizationInfoAccumulator, - ClientSideMetrics.Accumulator clientSideMetricsAccumulator) - { - this.BackendMetricsAccumulator = backendMetricsAccumulator; - this.IndexUtilizationInfoAccumulator = indexUtilizationInfoAccumulator; - this.ClientSideMetricsAccumulator = clientSideMetricsAccumulator; - } - - public BackendMetrics.Accumulator BackendMetricsAccumulator { get; } - - public IndexUtilizationInfo.Accumulator IndexUtilizationInfoAccumulator { get; } - - public ClientSideMetrics.Accumulator ClientSideMetricsAccumulator { get; } - - public Accumulator Accumulate(QueryMetrics queryMetrics) - { - if (queryMetrics == null) - { - throw new ArgumentNullException(nameof(queryMetrics)); - } - - return new Accumulator( - backendMetricsAccumulator: this.BackendMetricsAccumulator.Accumulate(queryMetrics.BackendMetrics), - indexUtilizationInfoAccumulator: this.IndexUtilizationInfoAccumulator.Accumulate(queryMetrics.IndexUtilizationInfo), - clientSideMetricsAccumulator: this.ClientSideMetricsAccumulator.Accumulate(queryMetrics.ClientSideMetrics)); - } - - public static QueryMetrics ToQueryMetrics(Accumulator accumulator) - { - return new QueryMetrics( - BackendMetrics.Accumulator.ToBackendMetrics(accumulator.BackendMetricsAccumulator), - IndexUtilizationInfo.Accumulator.ToIndexUtilizationInfo(accumulator.IndexUtilizationInfoAccumulator), - ClientSideMetrics.Accumulator.ToClientSideMetrics(accumulator.ClientSideMetricsAccumulator)); - } + return queryMetricsAccumulator.GetQueryMetrics(); } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryMetricsAccumulator.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryMetricsAccumulator.cs new file mode 100644 index 0000000000..b6b817e95d --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryMetricsAccumulator.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.Metrics +{ + using System; + using System.Collections.Generic; + + internal sealed class QueryMetricsAccumulator + { + private readonly List queryMetricsList; + + public QueryMetricsAccumulator() + { + this.queryMetricsList = new List(); + } + + public void Accumulate(QueryMetrics queryMetrics) + { + if (queryMetrics == null) + { + throw new ArgumentNullException(nameof(queryMetrics)); + } + + this.queryMetricsList.Add(queryMetrics); + } + + public QueryMetrics GetQueryMetrics() + { + ServerSideMetricsInternalAccumulator serverSideMetricsAccumulator = new ServerSideMetricsInternalAccumulator(); + IndexUtilizationInfoAccumulator indexUtilizationInfoAccumulator = new IndexUtilizationInfoAccumulator(); + ClientSideMetricsAccumulator clientSideMetricsAccumulator = new ClientSideMetricsAccumulator(); + + foreach (QueryMetrics queryMetrics in this.queryMetricsList) + { + serverSideMetricsAccumulator.Accumulate(queryMetrics.ServerSideMetrics); + indexUtilizationInfoAccumulator.Accumulate(queryMetrics.IndexUtilizationInfo); + clientSideMetricsAccumulator.Accumulate(queryMetrics.ClientSideMetrics); + } + + return new QueryMetrics( + serverSideMetricsAccumulator.GetServerSideMetrics(), + indexUtilizationInfoAccumulator.GetIndexUtilizationInfo(), + clientSideMetricsAccumulator.GetClientSideMetrics()); + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryMetricsTextWriter.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryMetricsTextWriter.cs index bd634815e9..1802e60e28 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryMetricsTextWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryMetricsTextWriter.cs @@ -215,7 +215,7 @@ protected override void WriteTotalQueryExecutionTime(TimeSpan totalQueryExecutio indentLevel: 0); } - protected override void WriteQueryPreparationTime(QueryPreparationTimes queryPreparationTimes) + protected override void WriteQueryPreparationTime(QueryPreparationTimesInternal queryPreparationTimes) { QueryMetricsTextWriter.AppendTimeSpanToStringBuilder( this.stringBuilder, @@ -250,7 +250,7 @@ protected override void WriteVMExecutionTime(TimeSpan vmExecutionTime) // Do Nothing } - protected override void WriteRuntimeExecutionTime(RuntimeExecutionTimes runtimeExecutionTimes) + protected override void WriteRuntimeExecutionTime(RuntimeExecutionTimesInternal runtimeExecutionTimes) { QueryMetricsTextWriter.AppendTimeSpanToStringBuilder( this.stringBuilder, diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryMetricsWriter.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryMetricsWriter.cs index 2fbb455152..f0d6f7b0fa 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryMetricsWriter.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryMetricsWriter.cs @@ -23,25 +23,25 @@ public void WriteQueryMetrics(QueryMetrics queryMetrics) this.WriteBeforeQueryMetrics(); // Top Level Properties - this.WriteRetrievedDocumentCount(queryMetrics.BackendMetrics.RetrievedDocumentCount); - this.WriteRetrievedDocumentSize(queryMetrics.BackendMetrics.RetrievedDocumentSize); - this.WriteOutputDocumentCount(queryMetrics.BackendMetrics.OutputDocumentCount); - this.WriteOutputDocumentSize(queryMetrics.BackendMetrics.OutputDocumentSize); - this.WriteIndexHitRatio(queryMetrics.BackendMetrics.IndexHitRatio); + this.WriteRetrievedDocumentCount(queryMetrics.ServerSideMetrics.RetrievedDocumentCount); + this.WriteRetrievedDocumentSize(queryMetrics.ServerSideMetrics.RetrievedDocumentSize); + this.WriteOutputDocumentCount(queryMetrics.ServerSideMetrics.OutputDocumentCount); + this.WriteOutputDocumentSize(queryMetrics.ServerSideMetrics.OutputDocumentSize); + this.WriteIndexHitRatio(queryMetrics.ServerSideMetrics.IndexHitRatio); - this.WriteTotalQueryExecutionTime(queryMetrics.BackendMetrics.TotalTime); + this.WriteTotalQueryExecutionTime(queryMetrics.ServerSideMetrics.TotalTime); // QueryPreparationTimes - this.WriteQueryPreparationTime(queryMetrics.BackendMetrics.QueryPreparationTimes); + this.WriteQueryPreparationTime(queryMetrics.ServerSideMetrics.QueryPreparationTimes); - this.WriteIndexLookupTime(queryMetrics.BackendMetrics.IndexLookupTime); - this.WriteDocumentLoadTime(queryMetrics.BackendMetrics.DocumentLoadTime); - this.WriteVMExecutionTime(queryMetrics.BackendMetrics.VMExecutionTime); + this.WriteIndexLookupTime(queryMetrics.ServerSideMetrics.IndexLookupTime); + this.WriteDocumentLoadTime(queryMetrics.ServerSideMetrics.DocumentLoadTime); + this.WriteVMExecutionTime(queryMetrics.ServerSideMetrics.VMExecutionTime); // RuntimesExecutionTimes - this.WriteRuntimeExecutionTime(queryMetrics.BackendMetrics.RuntimeExecutionTimes); + this.WriteRuntimeExecutionTime(queryMetrics.ServerSideMetrics.RuntimeExecutionTimes); - this.WriteDocumentWriteTime(queryMetrics.BackendMetrics.DocumentWriteTime); + this.WriteDocumentWriteTime(queryMetrics.ServerSideMetrics.DocumentWriteTime); #if false // ClientSideMetrics this.WriteClientSideMetrics(queryMetrics.ClientSideMetrics); @@ -70,7 +70,7 @@ public void WriteQueryMetrics(QueryMetrics queryMetrics) protected abstract void WriteTotalQueryExecutionTime(TimeSpan totalQueryExecutionTime); - protected abstract void WriteQueryPreparationTime(QueryPreparationTimes queryPreparationTimes); + protected abstract void WriteQueryPreparationTime(QueryPreparationTimesInternal queryPreparationTimes); protected abstract void WriteIndexLookupTime(TimeSpan indexLookupTime); @@ -78,7 +78,7 @@ public void WriteQueryMetrics(QueryMetrics queryMetrics) protected abstract void WriteVMExecutionTime(TimeSpan vMExecutionTime); - protected abstract void WriteRuntimeExecutionTime(RuntimeExecutionTimes runtimeExecutionTimes); + protected abstract void WriteRuntimeExecutionTime(RuntimeExecutionTimesInternal runtimeExecutionTimes); protected abstract void WriteDocumentWriteTime(TimeSpan documentWriteTime); diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryPreparationTimes.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryPreparationTimes.cs deleted file mode 100644 index 4b2d3b1b20..0000000000 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryPreparationTimes.cs +++ /dev/null @@ -1,104 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ -namespace Microsoft.Azure.Cosmos.Query.Core.Metrics -{ - using System; - - /// - /// Query preparation metrics in the Azure DocumentDB database service. - /// -#if INTERNAL -#pragma warning disable SA1600 -#pragma warning disable CS1591 - public -#else - internal -#endif - sealed class QueryPreparationTimes - { - public static readonly QueryPreparationTimes Zero = new QueryPreparationTimes( - queryCompilationTime: default, - logicalPlanBuildTime: default, - physicalPlanBuildTime: default, - queryOptimizationTime: default); - - /// - /// Initializes a new instance of the QueryPreparationTimes class. - /// - /// Query compile and optimization time - /// Query logical plan build time - /// Query physical plan build time - /// Query optimization time - public QueryPreparationTimes( - TimeSpan queryCompilationTime, - TimeSpan logicalPlanBuildTime, - TimeSpan physicalPlanBuildTime, - TimeSpan queryOptimizationTime) - { - this.QueryCompilationTime = queryCompilationTime; - this.LogicalPlanBuildTime = logicalPlanBuildTime; - this.PhysicalPlanBuildTime = physicalPlanBuildTime; - this.QueryOptimizationTime = queryOptimizationTime; - } - - /// - /// Gets the query compile time in the Azure DocumentDB database service. - /// - public TimeSpan QueryCompilationTime { get; } - - /// - /// Gets the query logical plan build time in the Azure DocumentDB database service. - /// - public TimeSpan LogicalPlanBuildTime { get; } - - /// - /// Gets the query physical plan build time in the Azure DocumentDB database service. - /// - public TimeSpan PhysicalPlanBuildTime { get; } - - /// - /// Gets the query optimization time in the Azure DocumentDB database service. - /// - public TimeSpan QueryOptimizationTime { get; } - - public ref struct Accumulator - { - public Accumulator(TimeSpan queryCompliationTime, TimeSpan logicalPlanBuildTime, TimeSpan physicalPlanBuildTime, TimeSpan queryOptimizationTime) - { - this.QueryCompilationTime = queryCompliationTime; - this.LogicalPlanBuildTime = logicalPlanBuildTime; - this.PhysicalPlanBuildTime = physicalPlanBuildTime; - this.QueryOptimizationTime = queryOptimizationTime; - } - - public TimeSpan QueryCompilationTime { get; } - public TimeSpan LogicalPlanBuildTime { get; } - public TimeSpan PhysicalPlanBuildTime { get; } - public TimeSpan QueryOptimizationTime { get; } - - public Accumulator Accumulate(QueryPreparationTimes queryPreparationTimes) - { - if (queryPreparationTimes == null) - { - throw new ArgumentNullException(nameof(queryPreparationTimes)); - } - - return new Accumulator( - queryCompliationTime: this.QueryCompilationTime + queryPreparationTimes.QueryCompilationTime, - logicalPlanBuildTime: this.LogicalPlanBuildTime + queryPreparationTimes.LogicalPlanBuildTime, - physicalPlanBuildTime: this.PhysicalPlanBuildTime + queryPreparationTimes.PhysicalPlanBuildTime, - queryOptimizationTime: this.QueryOptimizationTime + queryPreparationTimes.QueryOptimizationTime); - } - - public static QueryPreparationTimes ToQueryPreparationTimes(QueryPreparationTimes.Accumulator accumulator) - { - return new QueryPreparationTimes( - queryCompilationTime: accumulator.QueryCompilationTime, - logicalPlanBuildTime: accumulator.LogicalPlanBuildTime, - physicalPlanBuildTime: accumulator.PhysicalPlanBuildTime, - queryOptimizationTime: accumulator.QueryOptimizationTime); - } - } - } -} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryPreparationTimesAccumulator.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryPreparationTimesAccumulator.cs new file mode 100644 index 0000000000..6b79e8c1f8 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryPreparationTimesAccumulator.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.Metrics +{ + using System; + using System.Collections.Generic; + + internal sealed class QueryPreparationTimesAccumulator + { + private readonly List queryPreparationTimesList; + + public QueryPreparationTimesAccumulator() + { + this.queryPreparationTimesList = new List(); + } + + public void Accumulate(QueryPreparationTimesInternal queryPreparationTimes) + { + if (queryPreparationTimes == null) + { + throw new ArgumentNullException(nameof(queryPreparationTimes)); + } + + this.queryPreparationTimesList.Add(queryPreparationTimes); + } + + public QueryPreparationTimesInternal GetQueryPreparationTimes() + { + TimeSpan queryCompilationTime = TimeSpan.Zero; + TimeSpan logicalPlanBuildTime = TimeSpan.Zero; + TimeSpan physicalPlanBuildTime = TimeSpan.Zero; + TimeSpan queryOptimizationTime = TimeSpan.Zero; + + foreach (QueryPreparationTimesInternal queryPreparationTimes in this.queryPreparationTimesList) + { + queryCompilationTime += queryPreparationTimes.QueryCompilationTime; + logicalPlanBuildTime += queryPreparationTimes.LogicalPlanBuildTime; + physicalPlanBuildTime += queryPreparationTimes.PhysicalPlanBuildTime; + queryOptimizationTime += queryPreparationTimes.QueryOptimizationTime; + } + + return new QueryPreparationTimesInternal( + queryCompilationTime: queryCompilationTime, + logicalPlanBuildTime: logicalPlanBuildTime, + physicalPlanBuildTime: physicalPlanBuildTime, + queryOptimizationTime: queryOptimizationTime); + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryPreparationTimesInternal.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryPreparationTimesInternal.cs new file mode 100644 index 0000000000..4e8ee38276 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/QueryPreparationTimesInternal.cs @@ -0,0 +1,65 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace Microsoft.Azure.Cosmos.Query.Core.Metrics +{ + using System; + + /// + /// Query preparation metrics in the Azure DocumentDB database service. + /// +#if INTERNAL +#pragma warning disable SA1600 +#pragma warning disable CS1591 + public +#else + internal +#endif + sealed class QueryPreparationTimesInternal + { + public static readonly QueryPreparationTimesInternal Zero = new QueryPreparationTimesInternal( + queryCompilationTime: TimeSpan.Zero, + logicalPlanBuildTime: TimeSpan.Zero, + physicalPlanBuildTime: TimeSpan.Zero, + queryOptimizationTime: TimeSpan.Zero); + + /// + /// Initializes a new instance of the QueryPreparationTimes class. + /// + /// Query compile and optimization time + /// Query logical plan build time + /// Query physical plan build time + /// Query optimization time + public QueryPreparationTimesInternal( + TimeSpan queryCompilationTime, + TimeSpan logicalPlanBuildTime, + TimeSpan physicalPlanBuildTime, + TimeSpan queryOptimizationTime) + { + this.QueryCompilationTime = queryCompilationTime; + this.LogicalPlanBuildTime = logicalPlanBuildTime; + this.PhysicalPlanBuildTime = physicalPlanBuildTime; + this.QueryOptimizationTime = queryOptimizationTime; + } + + /// + /// Gets the query compile time in the Azure DocumentDB database service. + /// + public TimeSpan QueryCompilationTime { get; } + + /// + /// Gets the query logical plan build time in the Azure DocumentDB database service. + /// + public TimeSpan LogicalPlanBuildTime { get; } + + /// + /// Gets the query physical plan build time in the Azure DocumentDB database service. + /// + public TimeSpan PhysicalPlanBuildTime { get; } + + /// + /// Gets the query optimization time in the Azure DocumentDB database service. + /// + public TimeSpan QueryOptimizationTime { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/RuntimeExecutionTimes.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/RuntimeExecutionTimes.cs deleted file mode 100644 index 0fd8dc22f0..0000000000 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/RuntimeExecutionTimes.cs +++ /dev/null @@ -1,91 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ -namespace Microsoft.Azure.Cosmos.Query.Core.Metrics -{ - using System; - - /// - /// Query runtime execution times in the Azure Cosmos DB service. - /// -#if INTERNAL -#pragma warning disable SA1600 -#pragma warning disable CS1591 - public -#else - internal -#endif - sealed class RuntimeExecutionTimes - { - public static readonly RuntimeExecutionTimes Empty = new RuntimeExecutionTimes( - queryEngineExecutionTime: default, - systemFunctionExecutionTime: default, - userDefinedFunctionExecutionTime: default); - - /// - /// Initializes a new instance of the RuntimeExecutionTimes class. - /// - /// Query end - to - end execution time - /// Total time spent executing system functions - /// Total time spent executing user - defined functions - public RuntimeExecutionTimes( - TimeSpan queryEngineExecutionTime, - TimeSpan systemFunctionExecutionTime, - TimeSpan userDefinedFunctionExecutionTime) - { - this.QueryEngineExecutionTime = queryEngineExecutionTime; - this.SystemFunctionExecutionTime = systemFunctionExecutionTime; - this.UserDefinedFunctionExecutionTime = userDefinedFunctionExecutionTime; - } - - /// - /// Gets the total query runtime execution time in the Azure Cosmos DB service. - /// - public TimeSpan QueryEngineExecutionTime { get; } - - /// - /// Gets the query system function execution time in the Azure Cosmos DB service. - /// - public TimeSpan SystemFunctionExecutionTime { get; } - - /// - /// Gets the query user defined function execution time in the Azure Cosmos DB service. - /// - public TimeSpan UserDefinedFunctionExecutionTime { get; } - - public ref struct Accumulator - { - public Accumulator(TimeSpan queryEngineExecutionTime, TimeSpan systemFunctionExecutionTime, TimeSpan userDefinedFunctionExecutionTimes) - { - this.QueryEngineExecutionTime = queryEngineExecutionTime; - this.SystemFunctionExecutionTime = systemFunctionExecutionTime; - this.UserDefinedFunctionExecutionTime = userDefinedFunctionExecutionTimes; - } - - public TimeSpan QueryEngineExecutionTime { get; set; } - public TimeSpan SystemFunctionExecutionTime { get; set; } - public TimeSpan UserDefinedFunctionExecutionTime { get; set; } - - public Accumulator Accumulate(RuntimeExecutionTimes runtimeExecutionTimes) - { - if (runtimeExecutionTimes == null) - { - throw new ArgumentNullException(nameof(runtimeExecutionTimes)); - } - - return new Accumulator( - queryEngineExecutionTime: this.QueryEngineExecutionTime + runtimeExecutionTimes.QueryEngineExecutionTime, - systemFunctionExecutionTime: this.SystemFunctionExecutionTime + runtimeExecutionTimes.SystemFunctionExecutionTime, - userDefinedFunctionExecutionTimes: this.UserDefinedFunctionExecutionTime + runtimeExecutionTimes.UserDefinedFunctionExecutionTime); - } - - public static RuntimeExecutionTimes ToRuntimeExecutionTimes(Accumulator accumulator) - { - return new RuntimeExecutionTimes( - queryEngineExecutionTime: accumulator.QueryEngineExecutionTime, - systemFunctionExecutionTime: accumulator.SystemFunctionExecutionTime, - userDefinedFunctionExecutionTime: accumulator.UserDefinedFunctionExecutionTime); - } - } - } -} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/RuntimeExecutionTimesAccumulator.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/RuntimeExecutionTimesAccumulator.cs new file mode 100644 index 0000000000..60f5e37573 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/RuntimeExecutionTimesAccumulator.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.Metrics +{ + using System; + using System.Collections.Generic; + + internal sealed class RuntimeExecutionTimesAccumulator + { + private readonly List runtimeExecutionTimesList; + + public RuntimeExecutionTimesAccumulator() + { + this.runtimeExecutionTimesList = new List(); + } + + public void Accumulate(RuntimeExecutionTimesInternal runtimeExecutionTimes) + { + if (runtimeExecutionTimes == null) + { + throw new ArgumentNullException(nameof(runtimeExecutionTimes)); + } + + this.runtimeExecutionTimesList.Add(runtimeExecutionTimes); + } + + public RuntimeExecutionTimesInternal GetRuntimeExecutionTimes() + { + TimeSpan queryEngineExecutionTime = TimeSpan.Zero; + TimeSpan systemFunctionExecutionTime = TimeSpan.Zero; + TimeSpan userDefinedFunctionExecutionTime = TimeSpan.Zero; + + foreach (RuntimeExecutionTimesInternal runtimeExecutionTimes in this.runtimeExecutionTimesList) + { + queryEngineExecutionTime += runtimeExecutionTimes.QueryEngineExecutionTime; + systemFunctionExecutionTime += runtimeExecutionTimes.SystemFunctionExecutionTime; + userDefinedFunctionExecutionTime += runtimeExecutionTimes.UserDefinedFunctionExecutionTime; + } + + return new RuntimeExecutionTimesInternal( + queryEngineExecutionTime: queryEngineExecutionTime, + systemFunctionExecutionTime: systemFunctionExecutionTime, + userDefinedFunctionExecutionTime: userDefinedFunctionExecutionTime); + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/RuntimeExecutionTimesInternal.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/RuntimeExecutionTimesInternal.cs new file mode 100644 index 0000000000..bbd97ca45d --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/RuntimeExecutionTimesInternal.cs @@ -0,0 +1,56 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace Microsoft.Azure.Cosmos.Query.Core.Metrics +{ + using System; + + /// + /// Query runtime execution times in the Azure Cosmos DB service. + /// +#if INTERNAL +#pragma warning disable SA1600 +#pragma warning disable CS1591 + public +#else + internal +#endif + sealed class RuntimeExecutionTimesInternal + { + public static readonly RuntimeExecutionTimesInternal Empty = new RuntimeExecutionTimesInternal( + queryEngineExecutionTime: TimeSpan.Zero, + systemFunctionExecutionTime: TimeSpan.Zero, + userDefinedFunctionExecutionTime: TimeSpan.Zero); + + /// + /// Initializes a new instance of the RuntimeExecutionTimes class. + /// + /// Query end - to - end execution time + /// Total time spent executing system functions + /// Total time spent executing user - defined functions + public RuntimeExecutionTimesInternal( + TimeSpan queryEngineExecutionTime, + TimeSpan systemFunctionExecutionTime, + TimeSpan userDefinedFunctionExecutionTime) + { + this.QueryEngineExecutionTime = queryEngineExecutionTime; + this.SystemFunctionExecutionTime = systemFunctionExecutionTime; + this.UserDefinedFunctionExecutionTime = userDefinedFunctionExecutionTime; + } + + /// + /// Gets the total query runtime execution time in the Azure Cosmos DB service. + /// + public TimeSpan QueryEngineExecutionTime { get; } + + /// + /// Gets the query system function execution time in the Azure Cosmos DB service. + /// + public TimeSpan SystemFunctionExecutionTime { get; } + + /// + /// Gets the query user defined function execution time in the Azure Cosmos DB service. + /// + public TimeSpan UserDefinedFunctionExecutionTime { get; } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideCumulativeMetrics.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideCumulativeMetrics.cs new file mode 100644 index 0000000000..3e7364f957 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideCumulativeMetrics.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace Microsoft.Azure.Cosmos +{ + using System.Collections.Generic; + + /// + /// Metrics received for queries from the backend. + /// + public abstract class ServerSideCumulativeMetrics + { + /// + /// Gets the ServerSideMetrics accumulated for a single round trip. + /// + public abstract ServerSideMetrics CumulativeMetrics { get; } + + /// + /// Gets the list of ServerSideMetrics, one for for each partition. + /// + public abstract IReadOnlyList PartitionedMetrics { get; } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideCumulativeMetricsInternal.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideCumulativeMetricsInternal.cs new file mode 100644 index 0000000000..5405482bb5 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideCumulativeMetricsInternal.cs @@ -0,0 +1,29 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace Microsoft.Azure.Cosmos +{ + using System.Collections.Generic; + using System.Linq; + using Microsoft.Azure.Cosmos.Query.Core.Metrics; + + /// + /// Internal implementation of metrics received for queries from the backend. + /// + internal class ServerSideCumulativeMetricsInternal : ServerSideCumulativeMetrics + { + /// + /// Initializes a new instance of the class. + /// + /// + internal ServerSideCumulativeMetricsInternal(IEnumerable serverSideMetricsList) + { + this.PartitionedMetrics = serverSideMetricsList.ToList(); + this.CumulativeMetrics = ServerSideMetricsInternal.Create(serverSideMetricsList.Select(partitionedMetrics => partitionedMetrics.ServerSideMetricsInternal)); + } + + public override ServerSideMetrics CumulativeMetrics { get; } + + public override IReadOnlyList PartitionedMetrics { get; } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetrics.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetrics.cs new file mode 100644 index 0000000000..ff215a582e --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetrics.cs @@ -0,0 +1,74 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos +{ + using System; + + /// + /// Metrics received for queries from the backend. + /// + public abstract class ServerSideMetrics + { + /// + /// Gets the total query time in the Azure Cosmos database service. + /// + public abstract TimeSpan TotalTime { get; } + + /// + /// Gets the number of documents retrieved during query in the Azure Cosmos database service. + /// + public abstract long RetrievedDocumentCount { get; } + + /// + /// Gets the size of documents retrieved in bytes during query in the Azure Cosmos DB service. + /// + public abstract long RetrievedDocumentSize { get; } + + /// + /// Gets the number of documents returned by query in the Azure Cosmos DB service. + /// + public abstract long OutputDocumentCount { get; } + + /// + /// Gets the size of documents outputted in bytes during query in the Azure Cosmos database service. + /// + public abstract long OutputDocumentSize { get; } + + /// + /// Gets the query preparation time in the Azure Cosmos database service. + /// + public abstract TimeSpan QueryPreparationTime { get; } + + /// + /// Gets the query index lookup time in the Azure Cosmos database service. + /// + public abstract TimeSpan IndexLookupTime { get; } + + /// + /// Gets the document loading time during query in the Azure Cosmos database service. + /// + public abstract TimeSpan DocumentLoadTime { get; } + + /// + /// Gets the query runtime execution time during query in the Azure Cosmos database service. + /// + public abstract TimeSpan RuntimeExecutionTime { get; } + + /// + /// Gets the output writing/serializing time during query in the Azure Cosmos database service. + /// + public abstract TimeSpan DocumentWriteTime { get; } + + /// + /// Gets the index hit ratio by query in the Azure Cosmos database service. Value is within the range [0,1]. + /// + public abstract double IndexHitRatio { get; } + + /// + /// Gets the VMExecution Time. + /// + public abstract TimeSpan VMExecutionTime { get; } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsInternal.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsInternal.cs new file mode 100644 index 0000000000..6e80de06a5 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsInternal.cs @@ -0,0 +1,153 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.Metrics +{ + using System; + using System.Collections.Generic; + + /// + /// internal implementation of metrics received for queries from the backend. + /// +#if INTERNAL +#pragma warning disable SA1600 +#pragma warning disable CS1591 + public +#else + internal +#endif + sealed class ServerSideMetricsInternal : ServerSideMetrics + { + /// + /// QueryMetrics with all members having default (but not null) members. + /// + public static readonly ServerSideMetricsInternal Empty = new ServerSideMetricsInternal( + retrievedDocumentCount: 0, + retrievedDocumentSize: 0, + outputDocumentCount: 0, + outputDocumentSize: 0, + indexHitRatio: 0, + totalQueryExecutionTime: TimeSpan.Zero, + queryPreparationTimes: QueryPreparationTimesInternal.Zero, + indexLookupTime: TimeSpan.Zero, + documentLoadTime: TimeSpan.Zero, + vmExecutionTime: TimeSpan.Zero, + runtimeExecutionTimes: RuntimeExecutionTimesInternal.Empty, + documentWriteTime: TimeSpan.Zero); + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public ServerSideMetricsInternal( + long retrievedDocumentCount, + long retrievedDocumentSize, + long outputDocumentCount, + long outputDocumentSize, + double indexHitRatio, + TimeSpan totalQueryExecutionTime, + QueryPreparationTimesInternal queryPreparationTimes, + TimeSpan indexLookupTime, + TimeSpan documentLoadTime, + TimeSpan vmExecutionTime, + RuntimeExecutionTimesInternal runtimeExecutionTimes, + TimeSpan documentWriteTime, + string feedRange = null, + int? partitionKeyRangeId = null) + { + this.RetrievedDocumentCount = retrievedDocumentCount; + this.RetrievedDocumentSize = retrievedDocumentSize; + this.OutputDocumentCount = outputDocumentCount; + this.OutputDocumentSize = outputDocumentSize; + this.IndexHitRatio = indexHitRatio; + this.TotalTime = totalQueryExecutionTime; + this.QueryPreparationTimes = queryPreparationTimes ?? throw new ArgumentNullException($"{nameof(queryPreparationTimes)} can not be null."); + this.IndexLookupTime = indexLookupTime; + this.DocumentLoadTime = documentLoadTime; + this.VMExecutionTime = vmExecutionTime; + this.RuntimeExecutionTimes = runtimeExecutionTimes ?? throw new ArgumentNullException($"{nameof(runtimeExecutionTimes)} can not be null."); + this.DocumentWriteTime = documentWriteTime; + this.FeedRange = feedRange; + this.PartitionKeyRangeId = partitionKeyRangeId; + } + + public override TimeSpan TotalTime { get; } + + public override long RetrievedDocumentCount { get; } + + public override long RetrievedDocumentSize { get; } + + public override long OutputDocumentCount { get; } + + public override long OutputDocumentSize { get; } + + public QueryPreparationTimesInternal QueryPreparationTimes { get; } + + public override TimeSpan QueryPreparationTime => + this.QueryPreparationTimes.LogicalPlanBuildTime + + this.QueryPreparationTimes.PhysicalPlanBuildTime + + this.QueryPreparationTimes.QueryCompilationTime + + this.QueryPreparationTimes.QueryOptimizationTime; + + public override TimeSpan IndexLookupTime { get; } + + public override TimeSpan DocumentLoadTime { get; } + + public RuntimeExecutionTimesInternal RuntimeExecutionTimes { get; } + + public override TimeSpan RuntimeExecutionTime => + this.RuntimeExecutionTimes.QueryEngineExecutionTime + + this.RuntimeExecutionTimes.SystemFunctionExecutionTime + + this.RuntimeExecutionTimes.UserDefinedFunctionExecutionTime; + + public override TimeSpan DocumentWriteTime { get; } + + public override double IndexHitRatio { get; } + + public override TimeSpan VMExecutionTime { get; } + + public string FeedRange { get; set; } + + public int? PartitionKeyRangeId { get; set; } + + public static ServerSideMetricsInternal Create(IEnumerable serverSideMetricsEnumerable) + { + ServerSideMetricsInternalAccumulator accumulator = new ServerSideMetricsInternalAccumulator(); + foreach (ServerSideMetricsInternal serverSideMetrics in serverSideMetricsEnumerable) + { + accumulator.Accumulate(serverSideMetrics); + } + + return accumulator.GetServerSideMetrics(); + } + + public static bool TryParseFromDelimitedString(string delimitedString, out ServerSideMetricsInternal serverSideMetrics) + { + return ServerSideMetricsParser.TryParse(delimitedString, out serverSideMetrics); + } + + public static ServerSideMetricsInternal ParseFromDelimitedString(string delimitedString) + { + if (!ServerSideMetricsParser.TryParse(delimitedString, out ServerSideMetricsInternal serverSideMetrics)) + { + throw new FormatException(); + } + + return serverSideMetrics; + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsInternalAccumulator.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsInternalAccumulator.cs new file mode 100644 index 0000000000..64be05e6b8 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsInternalAccumulator.cs @@ -0,0 +1,146 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.Query.Core.Metrics +{ + using System; + using System.Collections.Generic; + using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Cosmos.Tracing.TraceData; + + internal sealed class ServerSideMetricsInternalAccumulator + { + private readonly List serverSideMetricsList; + + public ServerSideMetricsInternalAccumulator() + { + this.serverSideMetricsList = new List(); + } + + public void Accumulate(ServerSideMetricsInternal serverSideMetrics) + { + if (serverSideMetrics == null) + { + throw new ArgumentNullException(nameof(serverSideMetrics)); + } + + this.serverSideMetricsList.Add(serverSideMetrics); + } + + public ServerSideMetricsInternal GetServerSideMetrics() + { + TimeSpan totalTime = TimeSpan.Zero; + long retrievedDocumentCount = 0; + long retrievedDocumentSize = 0; + long outputDocumentCount = 0; + long outputDocumentSize = 0; + double indexHitRatio = 0; + QueryPreparationTimesAccumulator queryPreparationTimesAccumulator = new QueryPreparationTimesAccumulator(); + TimeSpan indexLookupTime = TimeSpan.Zero; + TimeSpan documentLoadTime = TimeSpan.Zero; + RuntimeExecutionTimesAccumulator runtimeExecutionTimesAccumulator = new RuntimeExecutionTimesAccumulator(); + TimeSpan documentWriteTime = TimeSpan.Zero; + TimeSpan vMExecutionTime = TimeSpan.Zero; + + foreach (ServerSideMetricsInternal serverSideMetrics in this.serverSideMetricsList) + { + indexHitRatio = (retrievedDocumentCount + serverSideMetrics.RetrievedDocumentCount) != 0 ? + ((retrievedDocumentCount * indexHitRatio) + (serverSideMetrics.RetrievedDocumentCount * serverSideMetrics.IndexHitRatio)) / (retrievedDocumentCount + serverSideMetrics.RetrievedDocumentCount) : + 0; + totalTime += serverSideMetrics.TotalTime; + retrievedDocumentCount += serverSideMetrics.RetrievedDocumentCount; + retrievedDocumentSize += serverSideMetrics.RetrievedDocumentSize; + outputDocumentCount += serverSideMetrics.OutputDocumentCount; + outputDocumentSize += serverSideMetrics.OutputDocumentSize; + queryPreparationTimesAccumulator.Accumulate(serverSideMetrics.QueryPreparationTimes); + indexLookupTime += serverSideMetrics.IndexLookupTime; + documentLoadTime += serverSideMetrics.DocumentLoadTime; + runtimeExecutionTimesAccumulator.Accumulate(serverSideMetrics.RuntimeExecutionTimes); + documentWriteTime += serverSideMetrics.DocumentWriteTime; + vMExecutionTime += serverSideMetrics.VMExecutionTime; + } + + return new ServerSideMetricsInternal( + retrievedDocumentCount: retrievedDocumentCount, + retrievedDocumentSize: retrievedDocumentSize, + outputDocumentCount: outputDocumentCount, + outputDocumentSize: outputDocumentSize, + indexHitRatio: indexHitRatio, + totalQueryExecutionTime: totalTime, + queryPreparationTimes: queryPreparationTimesAccumulator.GetQueryPreparationTimes(), + indexLookupTime: indexLookupTime, + documentLoadTime: documentLoadTime, + vmExecutionTime: vMExecutionTime, + runtimeExecutionTimes: runtimeExecutionTimesAccumulator.GetRuntimeExecutionTimes(), + documentWriteTime: documentWriteTime); + } + + public List GetPartitionedServerSideMetrics() + { + return this.serverSideMetricsList; + } + + public static void WalkTraceTreeForQueryMetrics(ITrace currentTrace, ServerSideMetricsInternalAccumulator accumulator) + { + if (currentTrace == null) + { + return; + } + + foreach (object datum in currentTrace.Data.Values) + { + if (datum is QueryMetricsTraceDatum queryMetricsTraceDatum) + { + queryMetricsTraceDatum.QueryMetrics.ServerSideMetrics.FeedRange = currentTrace.Name; + queryMetricsTraceDatum.QueryMetrics.ServerSideMetrics.PartitionKeyRangeId = WalkTraceTreeForPartitionKeyRangeId(currentTrace); + accumulator.Accumulate(queryMetricsTraceDatum.QueryMetrics.ServerSideMetrics); + return; + } + } + + foreach (ITrace childTrace in currentTrace.Children) + { + WalkTraceTreeForQueryMetrics(childTrace, accumulator); + } + + return; + } + + private static int? WalkTraceTreeForPartitionKeyRangeId(ITrace currentTrace) + { + if (currentTrace == null) + { + return null; + } + + foreach (Object datum in currentTrace.Data.Values) + { + if (datum is ClientSideRequestStatisticsTraceDatum clientSideRequestStatisticsTraceDatum) + { + if (clientSideRequestStatisticsTraceDatum.StoreResponseStatisticsList.Count > 0) + { + return int.TryParse(clientSideRequestStatisticsTraceDatum.StoreResponseStatisticsList[0].StoreResult.PartitionKeyRangeId, out int pKRangeId) + ? pKRangeId + : null; + } + else + { + return null; + } + } + } + + foreach (ITrace childTrace in currentTrace.Children) + { + int? partitionKeyRangeId = WalkTraceTreeForPartitionKeyRangeId(childTrace); + if (partitionKeyRangeId != null) + { + return partitionKeyRangeId; + } + } + + return null; + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/BackendMetricsParser.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsParser.cs similarity index 53% rename from Microsoft.Azure.Cosmos/src/Query/Core/Metrics/BackendMetricsParser.cs rename to Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsParser.cs index ecd5becdd4..eeba3c6c85 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/BackendMetricsParser.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsParser.cs @@ -8,7 +8,7 @@ namespace Microsoft.Azure.Cosmos.Query.Core.Metrics using System.Text; /// - /// Parser for . + /// Parser for . /// #if INTERNAL #pragma warning disable SA1600 @@ -17,9 +17,9 @@ namespace Microsoft.Azure.Cosmos.Query.Core.Metrics #else internal #endif - static class BackendMetricsParser + static class ServerSideMetricsParser { - public static unsafe bool TryParse(string deliminatedString, out BackendMetrics backendMetrics) + public static unsafe bool TryParse(string deliminatedString, out ServerSideMetricsInternal serverSideMetrics) { if (deliminatedString == null) { @@ -30,7 +30,7 @@ public static unsafe bool TryParse(string deliminatedString, out BackendMetrics { // Stack allocating a zero length buffer returns a null pointer // so we special case the zero length string. - backendMetrics = BackendMetrics.Empty; + serverSideMetrics = ServerSideMetricsInternal.Empty; return true; } @@ -72,7 +72,7 @@ public static unsafe bool TryParse(string deliminatedString, out BackendMetrics while (!corpus.IsEmpty) { - (BackendMetricsTokenizer.TokenType? tokenType, ReadOnlyMemory buffer) = BackendMetricsTokenizer.Read(corpus); + (ServerSideMetricsTokenizer.TokenType? tokenType, ReadOnlyMemory buffer) = ServerSideMetricsTokenizer.Read(corpus); int bytesConsumed; if (!tokenType.HasValue) @@ -95,162 +95,162 @@ public static unsafe bool TryParse(string deliminatedString, out BackendMetrics { switch (tokenType.Value) { - case BackendMetricsTokenizer.TokenType.DocumentLoadTimeInMs: - corpus = corpus.Slice(BackendMetricsTokenizer.TokenBuffers.DocumentLoadTimeInMs.Length); - if (!BackendMetricsParser.TryParseTimeSpanField(corpus, out documentLoadTime, out bytesConsumed)) + case ServerSideMetricsTokenizer.TokenType.DocumentLoadTimeInMs: + corpus = corpus.Slice(ServerSideMetricsTokenizer.TokenBuffers.DocumentLoadTimeInMs.Length); + if (!ServerSideMetricsParser.TryParseTimeSpanField(corpus, out documentLoadTime, out bytesConsumed)) { - backendMetrics = default; + serverSideMetrics = default; return false; } break; - case BackendMetricsTokenizer.TokenType.WriteOutputTimeInMs: - corpus = corpus.Slice(BackendMetricsTokenizer.TokenBuffers.WriteOutputTimeInMs.Length); - if (!BackendMetricsParser.TryParseTimeSpanField(corpus, out documentWriteTime, out bytesConsumed)) + case ServerSideMetricsTokenizer.TokenType.WriteOutputTimeInMs: + corpus = corpus.Slice(ServerSideMetricsTokenizer.TokenBuffers.WriteOutputTimeInMs.Length); + if (!ServerSideMetricsParser.TryParseTimeSpanField(corpus, out documentWriteTime, out bytesConsumed)) { - backendMetrics = default; + serverSideMetrics = default; return false; } break; - case BackendMetricsTokenizer.TokenType.IndexLookupTimeInMs: - corpus = corpus.Slice(BackendMetricsTokenizer.TokenBuffers.IndexLookupTimeInMs.Length); - if (!BackendMetricsParser.TryParseTimeSpanField(corpus, out indexLookupTime, out bytesConsumed)) + case ServerSideMetricsTokenizer.TokenType.IndexLookupTimeInMs: + corpus = corpus.Slice(ServerSideMetricsTokenizer.TokenBuffers.IndexLookupTimeInMs.Length); + if (!ServerSideMetricsParser.TryParseTimeSpanField(corpus, out indexLookupTime, out bytesConsumed)) { - backendMetrics = default; + serverSideMetrics = default; return false; } break; - case BackendMetricsTokenizer.TokenType.IndexUtilizationRatio: - corpus = corpus.Slice(BackendMetricsTokenizer.TokenBuffers.IndexUtilizationRatio.Length); - if (!BackendMetricsParser.TryParseDoubleField(corpus, out indexHitRatio, out bytesConsumed)) + case ServerSideMetricsTokenizer.TokenType.IndexUtilizationRatio: + corpus = corpus.Slice(ServerSideMetricsTokenizer.TokenBuffers.IndexUtilizationRatio.Length); + if (!ServerSideMetricsParser.TryParseDoubleField(corpus, out indexHitRatio, out bytesConsumed)) { - backendMetrics = default; + serverSideMetrics = default; return false; } break; - case BackendMetricsTokenizer.TokenType.QueryLogicalPlanBuildTimeInMs: - corpus = corpus.Slice(BackendMetricsTokenizer.TokenBuffers.QueryLogicalPlanBuildTimeInMs.Length); - if (!BackendMetricsParser.TryParseTimeSpanField(corpus, out logicalPlanBuildTime, out bytesConsumed)) + case ServerSideMetricsTokenizer.TokenType.QueryLogicalPlanBuildTimeInMs: + corpus = corpus.Slice(ServerSideMetricsTokenizer.TokenBuffers.QueryLogicalPlanBuildTimeInMs.Length); + if (!ServerSideMetricsParser.TryParseTimeSpanField(corpus, out logicalPlanBuildTime, out bytesConsumed)) { - backendMetrics = default; + serverSideMetrics = default; return false; } break; - case BackendMetricsTokenizer.TokenType.OutputDocumentCount: - corpus = corpus.Slice(BackendMetricsTokenizer.TokenBuffers.OutputDocumentCount.Length); - if (!BackendMetricsParser.TryParseLongField(corpus, out outputDocumentCount, out bytesConsumed)) + case ServerSideMetricsTokenizer.TokenType.OutputDocumentCount: + corpus = corpus.Slice(ServerSideMetricsTokenizer.TokenBuffers.OutputDocumentCount.Length); + if (!ServerSideMetricsParser.TryParseLongField(corpus, out outputDocumentCount, out bytesConsumed)) { - backendMetrics = default; + serverSideMetrics = default; return false; } break; - case BackendMetricsTokenizer.TokenType.OutputDocumentSize: - corpus = corpus.Slice(BackendMetricsTokenizer.TokenBuffers.OutputDocumentSize.Length); - if (!BackendMetricsParser.TryParseLongField(corpus, out outputDocumentSize, out bytesConsumed)) + case ServerSideMetricsTokenizer.TokenType.OutputDocumentSize: + corpus = corpus.Slice(ServerSideMetricsTokenizer.TokenBuffers.OutputDocumentSize.Length); + if (!ServerSideMetricsParser.TryParseLongField(corpus, out outputDocumentSize, out bytesConsumed)) { - backendMetrics = default; + serverSideMetrics = default; return false; } break; - case BackendMetricsTokenizer.TokenType.QueryPhysicalPlanBuildTimeInMs: - corpus = corpus.Slice(BackendMetricsTokenizer.TokenBuffers.QueryPhysicalPlanBuildTimeInMs.Length); - if (!BackendMetricsParser.TryParseTimeSpanField(corpus, out physicalPlanBuildTime, out bytesConsumed)) + case ServerSideMetricsTokenizer.TokenType.QueryPhysicalPlanBuildTimeInMs: + corpus = corpus.Slice(ServerSideMetricsTokenizer.TokenBuffers.QueryPhysicalPlanBuildTimeInMs.Length); + if (!ServerSideMetricsParser.TryParseTimeSpanField(corpus, out physicalPlanBuildTime, out bytesConsumed)) { - backendMetrics = default; + serverSideMetrics = default; return false; } break; - case BackendMetricsTokenizer.TokenType.QueryCompileTimeInMs: - corpus = corpus.Slice(BackendMetricsTokenizer.TokenBuffers.QueryCompileTimeInMs.Length); - if (!BackendMetricsParser.TryParseTimeSpanField(corpus, out queryCompilationTime, out bytesConsumed)) + case ServerSideMetricsTokenizer.TokenType.QueryCompileTimeInMs: + corpus = corpus.Slice(ServerSideMetricsTokenizer.TokenBuffers.QueryCompileTimeInMs.Length); + if (!ServerSideMetricsParser.TryParseTimeSpanField(corpus, out queryCompilationTime, out bytesConsumed)) { - backendMetrics = default; + serverSideMetrics = default; return false; } break; - case BackendMetricsTokenizer.TokenType.QueryOptimizationTimeInMs: - corpus = corpus.Slice(BackendMetricsTokenizer.TokenBuffers.QueryOptimizationTimeInMs.Length); - if (!BackendMetricsParser.TryParseTimeSpanField(corpus, out queryOptimizationTime, out bytesConsumed)) + case ServerSideMetricsTokenizer.TokenType.QueryOptimizationTimeInMs: + corpus = corpus.Slice(ServerSideMetricsTokenizer.TokenBuffers.QueryOptimizationTimeInMs.Length); + if (!ServerSideMetricsParser.TryParseTimeSpanField(corpus, out queryOptimizationTime, out bytesConsumed)) { - backendMetrics = default; + serverSideMetrics = default; return false; } break; - case BackendMetricsTokenizer.TokenType.RetrievedDocumentCount: - corpus = corpus.Slice(BackendMetricsTokenizer.TokenBuffers.RetrievedDocumentCount.Length); - if (!BackendMetricsParser.TryParseLongField(corpus, out retrievedDocumentCount, out bytesConsumed)) + case ServerSideMetricsTokenizer.TokenType.RetrievedDocumentCount: + corpus = corpus.Slice(ServerSideMetricsTokenizer.TokenBuffers.RetrievedDocumentCount.Length); + if (!ServerSideMetricsParser.TryParseLongField(corpus, out retrievedDocumentCount, out bytesConsumed)) { - backendMetrics = default; + serverSideMetrics = default; return false; } break; - case BackendMetricsTokenizer.TokenType.RetrievedDocumentSize: - corpus = corpus.Slice(BackendMetricsTokenizer.TokenBuffers.RetrievedDocumentSize.Length); - if (!BackendMetricsParser.TryParseLongField(corpus, out retrievedDocumentSize, out bytesConsumed)) + case ServerSideMetricsTokenizer.TokenType.RetrievedDocumentSize: + corpus = corpus.Slice(ServerSideMetricsTokenizer.TokenBuffers.RetrievedDocumentSize.Length); + if (!ServerSideMetricsParser.TryParseLongField(corpus, out retrievedDocumentSize, out bytesConsumed)) { - backendMetrics = default; + serverSideMetrics = default; return false; } break; - case BackendMetricsTokenizer.TokenType.SystemFunctionExecuteTimeInMs: - corpus = corpus.Slice(BackendMetricsTokenizer.TokenBuffers.SystemFunctionExecuteTimeInMs.Length); - if (!BackendMetricsParser.TryParseTimeSpanField(corpus, out systemFunctionExecutionTime, out bytesConsumed)) + case ServerSideMetricsTokenizer.TokenType.SystemFunctionExecuteTimeInMs: + corpus = corpus.Slice(ServerSideMetricsTokenizer.TokenBuffers.SystemFunctionExecuteTimeInMs.Length); + if (!ServerSideMetricsParser.TryParseTimeSpanField(corpus, out systemFunctionExecutionTime, out bytesConsumed)) { - backendMetrics = default; + serverSideMetrics = default; return false; } break; - case BackendMetricsTokenizer.TokenType.TotalExecutionTimeInMs: - corpus = corpus.Slice(BackendMetricsTokenizer.TokenBuffers.TotalExecutionTimeInMs.Length); - if (!BackendMetricsParser.TryParseTimeSpanField(corpus, out totalQueryExecutionTime, out bytesConsumed)) + case ServerSideMetricsTokenizer.TokenType.TotalExecutionTimeInMs: + corpus = corpus.Slice(ServerSideMetricsTokenizer.TokenBuffers.TotalExecutionTimeInMs.Length); + if (!ServerSideMetricsParser.TryParseTimeSpanField(corpus, out totalQueryExecutionTime, out bytesConsumed)) { - backendMetrics = default; + serverSideMetrics = default; return false; } break; - case BackendMetricsTokenizer.TokenType.UserFunctionExecuteTimeInMs: - corpus = corpus.Slice(BackendMetricsTokenizer.TokenBuffers.UserFunctionExecuteTimeInMs.Length); - if (!BackendMetricsParser.TryParseTimeSpanField(corpus, out userDefinedFunctionExecutionTime, out bytesConsumed)) + case ServerSideMetricsTokenizer.TokenType.UserFunctionExecuteTimeInMs: + corpus = corpus.Slice(ServerSideMetricsTokenizer.TokenBuffers.UserFunctionExecuteTimeInMs.Length); + if (!ServerSideMetricsParser.TryParseTimeSpanField(corpus, out userDefinedFunctionExecutionTime, out bytesConsumed)) { - backendMetrics = default; + serverSideMetrics = default; return false; } break; - case BackendMetricsTokenizer.TokenType.VMExecutionTimeInMs: - corpus = corpus.Slice(BackendMetricsTokenizer.TokenBuffers.VMExecutionTimeInMs.Length); - if (!BackendMetricsParser.TryParseTimeSpanField(corpus, out vmExecutionTime, out bytesConsumed)) + case ServerSideMetricsTokenizer.TokenType.VMExecutionTimeInMs: + corpus = corpus.Slice(ServerSideMetricsTokenizer.TokenBuffers.VMExecutionTimeInMs.Length); + if (!ServerSideMetricsParser.TryParseTimeSpanField(corpus, out vmExecutionTime, out bytesConsumed)) { - backendMetrics = default; + serverSideMetrics = default; return false; } break; default: - backendMetrics = default; + serverSideMetrics = default; return false; } } corpus = corpus.Slice(bytesConsumed); if (!corpus.IsEmpty) { - (BackendMetricsTokenizer.TokenType? semicolonToken, ReadOnlyMemory semicolonBuffer) = BackendMetricsTokenizer.Read(corpus); - if (!semicolonToken.HasValue || (semicolonToken != BackendMetricsTokenizer.TokenType.SemiColonDelimiter)) + (ServerSideMetricsTokenizer.TokenType? semicolonToken, ReadOnlyMemory semicolonBuffer) = ServerSideMetricsTokenizer.Read(corpus); + if (!semicolonToken.HasValue || (semicolonToken != ServerSideMetricsTokenizer.TokenType.SemiColonDelimiter)) { - backendMetrics = default; + serverSideMetrics = default; return false; } @@ -258,14 +258,14 @@ public static unsafe bool TryParse(string deliminatedString, out BackendMetrics } } - backendMetrics = new BackendMetrics( + serverSideMetrics = new ServerSideMetricsInternal( retrievedDocumentCount: retrievedDocumentCount, retrievedDocumentSize: retrievedDocumentSize, outputDocumentCount: outputDocumentCount, outputDocumentSize: outputDocumentSize, indexHitRatio: indexHitRatio, totalQueryExecutionTime: totalQueryExecutionTime, - queryPreparationTimes: new QueryPreparationTimes( + queryPreparationTimes: new QueryPreparationTimesInternal( queryCompilationTime: queryCompilationTime, logicalPlanBuildTime: logicalPlanBuildTime, physicalPlanBuildTime: physicalPlanBuildTime, @@ -273,7 +273,7 @@ public static unsafe bool TryParse(string deliminatedString, out BackendMetrics indexLookupTime: indexLookupTime, documentLoadTime: documentLoadTime, vmExecutionTime: vmExecutionTime, - runtimeExecutionTimes: new RuntimeExecutionTimes( + runtimeExecutionTimes: new RuntimeExecutionTimesInternal( queryEngineExecutionTime: vmExecutionTime - indexLookupTime - documentLoadTime - documentWriteTime, systemFunctionExecutionTime: systemFunctionExecutionTime, userDefinedFunctionExecutionTime: userDefinedFunctionExecutionTime), @@ -283,8 +283,8 @@ public static unsafe bool TryParse(string deliminatedString, out BackendMetrics private static bool TryParseTimeSpanField(ReadOnlySpan corpus, out TimeSpan timeSpan, out int bytesConsumed) { - (BackendMetricsTokenizer.TokenType? tokenType, ReadOnlyMemory buffer) = BackendMetricsTokenizer.Read(corpus); - if (!tokenType.HasValue || (tokenType.Value != BackendMetricsTokenizer.TokenType.EqualsDelimiter)) + (ServerSideMetricsTokenizer.TokenType? tokenType, ReadOnlyMemory buffer) = ServerSideMetricsTokenizer.Read(corpus); + if (!tokenType.HasValue || (tokenType.Value != ServerSideMetricsTokenizer.TokenType.EqualsDelimiter)) { timeSpan = default; bytesConsumed = default; @@ -306,8 +306,8 @@ private static bool TryParseTimeSpanField(ReadOnlySpan corpus, out TimeSpa private static bool TryParseLongField(ReadOnlySpan corpus, out long value, out int bytesConsumed) { - (BackendMetricsTokenizer.TokenType? tokenType, ReadOnlyMemory buffer) = BackendMetricsTokenizer.Read(corpus); - if (!tokenType.HasValue || (tokenType.Value != BackendMetricsTokenizer.TokenType.EqualsDelimiter)) + (ServerSideMetricsTokenizer.TokenType? tokenType, ReadOnlyMemory buffer) = ServerSideMetricsTokenizer.Read(corpus); + if (!tokenType.HasValue || (tokenType.Value != ServerSideMetricsTokenizer.TokenType.EqualsDelimiter)) { value = default; bytesConsumed = default; @@ -327,8 +327,8 @@ private static bool TryParseLongField(ReadOnlySpan corpus, out long value, private static bool TryParseDoubleField(ReadOnlySpan corpus, out double value, out int bytesConsumed) { - (BackendMetricsTokenizer.TokenType? tokenType, ReadOnlyMemory buffer) = BackendMetricsTokenizer.Read(corpus); - if (!tokenType.HasValue || (tokenType.Value != BackendMetricsTokenizer.TokenType.EqualsDelimiter)) + (ServerSideMetricsTokenizer.TokenType? tokenType, ReadOnlyMemory buffer) = ServerSideMetricsTokenizer.Read(corpus); + if (!tokenType.HasValue || (tokenType.Value != ServerSideMetricsTokenizer.TokenType.EqualsDelimiter)) { value = default; bytesConsumed = default; diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/BackendMetricsTokenizer.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsTokenizer.cs similarity index 98% rename from Microsoft.Azure.Cosmos/src/Query/Core/Metrics/BackendMetricsTokenizer.cs rename to Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsTokenizer.cs index f17e6afbf4..431f3add64 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/BackendMetricsTokenizer.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsTokenizer.cs @@ -8,7 +8,7 @@ namespace Microsoft.Azure.Cosmos.Query.Core.Metrics using System.Text; /// - /// Tokenizer for + /// Tokenizer for /// #if INTERNAL #pragma warning disable SA1600 @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Cosmos.Query.Core.Metrics #else internal #endif - static class BackendMetricsTokenizer + static class ServerSideMetricsTokenizer { public enum TokenType { diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsUtils.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsUtils.cs new file mode 100644 index 0000000000..a439bdfd57 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSideMetricsUtils.cs @@ -0,0 +1,13 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ +namespace Microsoft.Azure.Cosmos.Query.Core.Metrics +{ + internal static class ServerSideMetricsUtils + { + public static string FormatTrace(this ServerSideMetricsInternal serverSideMetrics) + { + return $"totalExecutionTimeInMs={serverSideMetrics.TotalTime.TotalMilliseconds};queryCompileTimeInMs={serverSideMetrics.QueryPreparationTimes.QueryCompilationTime.TotalMilliseconds};queryLogicalPlanBuildTimeInMs={serverSideMetrics.QueryPreparationTimes.LogicalPlanBuildTime.TotalMilliseconds};queryPhysicalPlanBuildTimeInMs={serverSideMetrics.QueryPreparationTimes.PhysicalPlanBuildTime.TotalMilliseconds};queryOptimizationTimeInMs={serverSideMetrics.QueryPreparationTimes.QueryOptimizationTime.TotalMilliseconds};indexLookupTimeInMs={serverSideMetrics.IndexLookupTime.TotalMilliseconds};documentLoadTimeInMs={serverSideMetrics.DocumentLoadTime.TotalMilliseconds};systemFunctionExecuteTimeInMs={serverSideMetrics.RuntimeExecutionTimes.SystemFunctionExecutionTime.TotalMilliseconds};userFunctionExecuteTimeInMs={serverSideMetrics.RuntimeExecutionTimes.UserDefinedFunctionExecutionTime.TotalMilliseconds};retrievedDocumentCount={serverSideMetrics.RetrievedDocumentCount};retrievedDocumentSize={serverSideMetrics.RetrievedDocumentSize};outputDocumentCount={serverSideMetrics.OutputDocumentCount};outputDocumentSize={serverSideMetrics.OutputDocumentSize};writeOutputTimeInMs={serverSideMetrics.DocumentWriteTime.TotalMilliseconds};indexUtilizationRatio={serverSideMetrics.IndexHitRatio}"; + } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSidePartitionedMetrics.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSidePartitionedMetrics.cs new file mode 100644 index 0000000000..3fd1f47094 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSidePartitionedMetrics.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos +{ + /// + /// Represents server side metrics specific for a single partition. + /// + public abstract class ServerSidePartitionedMetrics + { + /// + /// Gets the backend metrics for the request. + /// + public abstract ServerSideMetrics ServerSideMetrics { get; } + + /// + /// Gets the FeedRange for the partition. + /// + public abstract string FeedRange { get; } + + /// + /// Gets the partition key range id for the partition. + /// + public abstract int? PartitionKeyRangeId { get; } + } +} diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSidePartitionedMetricsInternal.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSidePartitionedMetricsInternal.cs new file mode 100644 index 0000000000..9ed30963a6 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Metrics/ServerSidePartitionedMetricsInternal.cs @@ -0,0 +1,40 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos +{ + using Microsoft.Azure.Cosmos.Query.Core.Metrics; + + /// + /// The internal implementation for server side metrics specific for a single partition. + /// + internal class ServerSidePartitionedMetricsInternal : ServerSidePartitionedMetrics + { + internal ServerSidePartitionedMetricsInternal(ServerSideMetricsInternal serverSideMetricsInternal) + : this(serverSideMetricsInternal, serverSideMetricsInternal.FeedRange, serverSideMetricsInternal.PartitionKeyRangeId) + { + } + + /// + /// Initializes a new instance of the class. + /// + /// + /// + /// + internal ServerSidePartitionedMetricsInternal(ServerSideMetricsInternal serverSideMetricsInternal, string feedRange, int? partitionKeyRangeId) + { + this.ServerSideMetricsInternal = serverSideMetricsInternal; + this.FeedRange = feedRange; + this.PartitionKeyRangeId = partitionKeyRangeId; + } + + public ServerSideMetricsInternal ServerSideMetricsInternal { get; } + + public override ServerSideMetrics ServerSideMetrics => this.ServerSideMetricsInternal; + + public override string FeedRange { get; } + + public override int? PartitionKeyRangeId { get; } + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs index b237c68c2a..dd09fde938 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs @@ -33,6 +33,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Reflection; using System.Text.RegularExpressions; using Microsoft.Azure.Cosmos.Diagnostics; + using Microsoft.Azure.Cosmos.Query.Core.Metrics; [TestClass] public class CosmosItemTests : BaseCosmosClientHelper @@ -141,6 +142,7 @@ public async Task CreateDropItemTest() Assert.IsFalse(string.IsNullOrEmpty(diagnostics.ToString())); Assert.IsTrue(diagnostics.GetClientElapsedTime() > TimeSpan.Zero); Assert.AreEqual(0, response.Diagnostics.GetFailedRequestCount()); + Assert.IsNull(response.Diagnostics.GetQueryMetrics()); response = await this.Container.ReadItemAsync(testItem.id, new Cosmos.PartitionKey(testItem.pk)); Assert.IsNotNull(response); @@ -158,6 +160,7 @@ public async Task CreateDropItemTest() Assert.IsNotNull(response.Diagnostics); Assert.IsFalse(string.IsNullOrEmpty(response.Diagnostics.ToString())); Assert.IsTrue(response.Diagnostics.GetClientElapsedTime() > TimeSpan.Zero); + Assert.IsNull(response.Diagnostics.GetQueryMetrics()); } [TestMethod] @@ -386,6 +389,7 @@ public async Task CreateDropItemMultiPartPartitionKeyTest() ItemResponse response = await multiPartPkContainer.CreateItemAsync(item: testItem); Assert.IsNotNull(response); Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); + Assert.IsNull(response.Diagnostics.GetQueryMetrics()); ItemResponse readResponse = await multiPartPkContainer.ReadItemAsync(id: testItem.id, partitionKey: new Cosmos.PartitionKey("pk1")); Assert.IsNotNull(readResponse); @@ -603,6 +607,7 @@ public async Task UpsertItemTest() Assert.IsNotNull(response); Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); Assert.IsNotNull(response.Headers.Session); + Assert.IsNull(response.Diagnostics.GetQueryMetrics()); } { @@ -613,6 +618,7 @@ public async Task UpsertItemTest() Assert.IsNotNull(response); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); Assert.IsNotNull(response.Headers.Session); + Assert.IsNull(response.Diagnostics.GetQueryMetrics()); } } @@ -703,6 +709,7 @@ await feedIterator.ReadNextAsync(this.cancellationToken)) } } + Assert.IsNull(responseMessage.Diagnostics.GetQueryMetrics()); } } @@ -842,7 +849,7 @@ public async Task PartitionKeyDeleteTestForSubpartitionedContainer() } [TestMethod] - public async Task ItemCustomSerialzierTest() + public async Task ItemCustomSerializerTest() { DateTime createDateTime = DateTime.UtcNow; Dictionary keyValuePairs = new Dictionary() @@ -1278,6 +1285,22 @@ public async Task QuerySinglePartitionItemStreamTest(int perPKItemCount, int max System.Diagnostics.Trace.TraceInformation($"ContinuationToken: {lastContinuationToken}"); Newtonsoft.Json.JsonSerializer serializer = new Newtonsoft.Json.JsonSerializer(); + ServerSideCumulativeMetrics metrics = response.Diagnostics.GetQueryMetrics(); + Assert.IsTrue(metrics.PartitionedMetrics.Count == 1); + Assert.IsTrue(metrics.CumulativeMetrics.TotalTime > TimeSpan.Zero); + Assert.IsTrue(metrics.CumulativeMetrics.QueryPreparationTime > TimeSpan.Zero); + + if (metrics.CumulativeMetrics.RetrievedDocumentCount >= 1) + { + Assert.IsTrue(metrics.CumulativeMetrics.RetrievedDocumentSize > 0); + Assert.IsTrue(metrics.CumulativeMetrics.DocumentLoadTime > TimeSpan.Zero); + Assert.IsTrue(metrics.CumulativeMetrics.RuntimeExecutionTime > TimeSpan.Zero); + } + else + { + Assert.AreEqual(0, metrics.CumulativeMetrics.RetrievedDocumentSize); + } + using (StreamReader sr = new StreamReader(response.Content)) using (JsonTextReader jtr = new JsonTextReader(sr)) { @@ -1317,9 +1340,9 @@ public async Task QuerySinglePartitionItemStreamTest(int perPKItemCount, int max [TestMethod] public async Task ItemMultiplePartitionQuery() { - IList deleteList = await ToDoActivity.CreateRandomItems(this.Container, 3, randomPartitionKey: true); + IList itemList = await ToDoActivity.CreateRandomItems(this.Container, 3, randomPartitionKey: true); - ToDoActivity find = deleteList.First(); + ToDoActivity find = itemList.First(); QueryDefinition sql = new QueryDefinition("select * from toDoActivity t where t.id = '" + find.id + "'"); QueryRequestOptions requestOptions = new QueryRequestOptions() @@ -1345,6 +1368,111 @@ public async Task ItemMultiplePartitionQuery() ToDoActivity response = iter.First(); Assert.AreEqual(find.id, response.id); } + + ServerSideCumulativeMetrics metrics = iter.Diagnostics.GetQueryMetrics(); + + if (metrics != null) + { + Assert.IsTrue(metrics.PartitionedMetrics.Count == 3); + Assert.IsTrue(metrics.CumulativeMetrics.TotalTime > TimeSpan.Zero); + Assert.IsTrue(metrics.CumulativeMetrics.QueryPreparationTime > TimeSpan.Zero); + + foreach (ServerSidePartitionedMetrics partitionedMetrics in metrics.PartitionedMetrics) + { + Assert.IsNotNull(partitionedMetrics); + Assert.IsNotNull(partitionedMetrics.PartitionKeyRangeId); + } + + if (metrics.CumulativeMetrics.RetrievedDocumentCount >= 1) + { + Assert.IsTrue(metrics.CumulativeMetrics.RetrievedDocumentSize > 0); + Assert.IsTrue(metrics.CumulativeMetrics.DocumentLoadTime > TimeSpan.Zero); + Assert.IsTrue(metrics.CumulativeMetrics.RuntimeExecutionTime > TimeSpan.Zero); + } + else + { + Assert.AreEqual(0, metrics.CumulativeMetrics.RetrievedDocumentSize); + } + } + else + { + string diag = iter.Diagnostics.ToString(); + Assert.IsNotNull(diag); + } + } + + Assert.IsTrue(found); + } + + /// + /// Validate single partition query using gateway mode. + /// + [TestMethod] + public async Task ItemSinglePartitionQueryGateway() + { + ContainerResponse containerResponse = await this.database.CreateContainerAsync( + new ContainerProperties(id: Guid.NewGuid().ToString(), partitionKeyPath: "/pk")); + + Container createdContainer = (ContainerInlineCore)containerResponse; + CosmosClient client1 = TestCommon.CreateCosmosClient(useGateway: true); + + Container container = client1.GetContainer(this.database.Id, createdContainer.Id); + + string findId = "id2002"; + ToDoActivity item = ToDoActivity.CreateRandomToDoActivity("pk2002", findId); + await container.CreateItemAsync(item); + + QueryDefinition sql = new QueryDefinition("select * from toDoActivity t where t.id = '" + findId + "'"); + + QueryRequestOptions requestOptions = new QueryRequestOptions() + { + MaxBufferedItemCount = 10, + ResponseContinuationTokenLimitInKb = 500, + MaxItemCount = 1, + MaxConcurrency = 1, + }; + + FeedIterator feedIterator = container.GetItemQueryIterator( + sql, + requestOptions: requestOptions); + + bool found = false; + while (feedIterator.HasMoreResults) + { + FeedResponse iter = await feedIterator.ReadNextAsync(); + Assert.IsTrue(iter.Count() <= 1); + if (iter.Count() == 1) + { + found = true; + ToDoActivity response = iter.First(); + Assert.AreEqual(findId, response.id); + } + + ServerSideCumulativeMetrics metrics = iter.Diagnostics.GetQueryMetrics(); + + if (metrics != null) + { + Assert.IsTrue(metrics.PartitionedMetrics.Count == 1); + Assert.IsTrue(metrics.CumulativeMetrics.TotalTime > TimeSpan.Zero); + Assert.IsTrue(metrics.CumulativeMetrics.QueryPreparationTime > TimeSpan.Zero); + + foreach (ServerSidePartitionedMetrics partitionedMetrics in metrics.PartitionedMetrics) + { + Assert.IsNotNull(partitionedMetrics); + Assert.IsNull(partitionedMetrics.PartitionKeyRangeId); + } + + if (metrics.CumulativeMetrics.RetrievedDocumentCount >= 1) + { + Assert.IsTrue(metrics.CumulativeMetrics.RetrievedDocumentSize > 0); + Assert.IsTrue(metrics.CumulativeMetrics.DocumentLoadTime > TimeSpan.Zero); + Assert.IsTrue(metrics.CumulativeMetrics.RuntimeExecutionTime > TimeSpan.Zero); + } + else + { + Assert.AreEqual(0, metrics.CumulativeMetrics.RetrievedDocumentSize); + } + } } Assert.IsTrue(found); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/QueryStatisticsDatumVisitor.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/QueryStatisticsDatumVisitor.cs index 200150875b..c100146bdb 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/QueryStatisticsDatumVisitor.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryPerfTest/QueryStatisticsDatumVisitor.cs @@ -41,13 +41,13 @@ public void AddGetCosmosElementResponseTime(double time) public void Visit(QueryMetricsTraceDatum queryMetricsTraceDatum) { - this.queryMetrics.RetrievedDocumentCount = queryMetricsTraceDatum.QueryMetrics.BackendMetrics.RetrievedDocumentCount; - this.queryMetrics.RetrievedDocumentSize = queryMetricsTraceDatum.QueryMetrics.BackendMetrics.RetrievedDocumentSize; - this.queryMetrics.OutputDocumentCount = queryMetricsTraceDatum.QueryMetrics.BackendMetrics.OutputDocumentCount; - this.queryMetrics.OutputDocumentSize = queryMetricsTraceDatum.QueryMetrics.BackendMetrics.OutputDocumentSize; - this.queryMetrics.TotalQueryExecutionTime = queryMetricsTraceDatum.QueryMetrics.BackendMetrics.TotalTime.TotalMilliseconds; - this.queryMetrics.DocumentLoadTime = queryMetricsTraceDatum.QueryMetrics.BackendMetrics.DocumentLoadTime.TotalMilliseconds; - this.queryMetrics.DocumentWriteTime = queryMetricsTraceDatum.QueryMetrics.BackendMetrics.DocumentWriteTime.TotalMilliseconds; + this.queryMetrics.RetrievedDocumentCount = queryMetricsTraceDatum.QueryMetrics.ServerSideMetrics.RetrievedDocumentCount; + this.queryMetrics.RetrievedDocumentSize = queryMetricsTraceDatum.QueryMetrics.ServerSideMetrics.RetrievedDocumentSize; + this.queryMetrics.OutputDocumentCount = queryMetricsTraceDatum.QueryMetrics.ServerSideMetrics.OutputDocumentCount; + this.queryMetrics.OutputDocumentSize = queryMetricsTraceDatum.QueryMetrics.ServerSideMetrics.OutputDocumentSize; + this.queryMetrics.TotalQueryExecutionTime = queryMetricsTraceDatum.QueryMetrics.ServerSideMetrics.TotalTime.TotalMilliseconds; + this.queryMetrics.DocumentLoadTime = queryMetricsTraceDatum.QueryMetrics.ServerSideMetrics.DocumentLoadTime.TotalMilliseconds; + this.queryMetrics.DocumentWriteTime = queryMetricsTraceDatum.QueryMetrics.ServerSideMetrics.DocumentWriteTime.TotalMilliseconds; } public void Visit(ClientSideRequestStatisticsTraceDatum clientSideRequestStatisticsTraceDatum) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs index afc25ec771..d971223f09 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/QueryTests.cs @@ -1870,11 +1870,11 @@ public async Task TestQueryMetricsNonZero() QueryMetrics queryMetrics = QueryMetrics.CreateFromIEnumerable(feedResonse.QueryMetrics.Values); - Assert.IsTrue(queryMetrics.BackendMetrics.RetrievedDocumentCount > 0); - Assert.IsTrue(queryMetrics.BackendMetrics.RetrievedDocumentSize > 0); - Assert.IsTrue(queryMetrics.BackendMetrics.OutputDocumentCount > 0); - Assert.IsTrue(queryMetrics.BackendMetrics.OutputDocumentSize > 0); - Assert.IsTrue(queryMetrics.BackendMetrics.IndexHitRatio > 0); + Assert.IsTrue(queryMetrics.ServerSideMetrics.RetrievedDocumentCount > 0); + Assert.IsTrue(queryMetrics.ServerSideMetrics.RetrievedDocumentSize > 0); + Assert.IsTrue(queryMetrics.ServerSideMetrics.OutputDocumentCount > 0); + Assert.IsTrue(queryMetrics.ServerSideMetrics.OutputDocumentSize > 0); + Assert.IsTrue(queryMetrics.ServerSideMetrics.IndexHitRatio > 0); await client.DeleteDatabaseAsync(database); } @@ -1960,7 +1960,7 @@ private void TestForceQueryScanHeaders(Database database, bool partitionedCollec query, feedOptions).AsDocumentQuery().ExecuteNextAsync().Result; queryMetrics = result.QueryMetrics.Values.Aggregate((curr, acc) => curr + acc); - Assert.AreEqual(TimeSpan.Zero, queryMetrics.BackendMetrics.IndexLookupTime); + Assert.AreEqual(TimeSpan.Zero, queryMetrics.ServerSideMetrics.IndexLookupTime); // Without ForceQueryScan feedOptions = new FeedOptions() @@ -1976,7 +1976,7 @@ private void TestForceQueryScanHeaders(Database database, bool partitionedCollec query, feedOptions).AsDocumentQuery().ExecuteNextAsync().Result; queryMetrics = result.QueryMetrics.Values.Aggregate((curr, acc) => curr + acc); - Assert.AreNotEqual(TimeSpan.Zero, queryMetrics.BackendMetrics.IndexLookupTime); + Assert.AreNotEqual(TimeSpan.Zero, queryMetrics.ServerSideMetrics.IndexLookupTime); } private void TestFeedOptionInput( @@ -2315,19 +2315,19 @@ private void ValidateQueryMetrics(QueryMetrics metrics) Assert.AreEqual(0, metrics.ClientSideMetrics.Retries); //We are not checking VMExecutionTime, since that is not a public property //Assert.IsTrue(metrics.QueryEngineTimes.VMExecutionTime.TotalMilliseconds > 0, "Expected VMExecutionTimeInMs to be > 0, metrics = {0}", metrics); - Assert.IsTrue(metrics.BackendMetrics.QueryPreparationTimes.QueryCompilationTime.TotalMilliseconds > 0, "Expected CompileTimeInMs to be > 0, metrics = {0}", metrics); + Assert.IsTrue(metrics.ServerSideMetrics.QueryPreparationTimes.QueryCompilationTime.TotalMilliseconds > 0, "Expected CompileTimeInMs to be > 0, metrics = {0}", metrics); //We are not checking DocumentLoadTime and RetrievedDocumentCount, since some queries don't return any documents (especially in the last continuation). //Assert.IsTrue(metrics.QueryEngineTimes.DocumentLoadTime.TotalMilliseconds > 0, "Expected DocumentLoadTimeInMs to be > 0, metrics = {0}", metrics); //Assert.IsTrue(metrics.RetrievedDocumentCount > 0, "Expected RetrievedDocumentCount to be > 0, metrics = {0}", metrics); - Assert.IsTrue(metrics.BackendMetrics.TotalTime.TotalMilliseconds > 0, "Expected TotalExecutionTimeInMs to be > 0, metrics = {0}", metrics); + Assert.IsTrue(metrics.ServerSideMetrics.TotalTime.TotalMilliseconds > 0, "Expected TotalExecutionTimeInMs to be > 0, metrics = {0}", metrics); //Assert.IsTrue(metrics.QueryEngineTimes.WriteOutputTime.TotalMilliseconds > 0, "Expected WriteOutputTimeInMs to be > 0, metrics = {0}", metrics); //Assert.IsTrue(metrics.RetrievedDocumentSize > 0, "Expected RetrievedDocumentSize to be > 0, metrics = {0}", metrics); - Assert.IsTrue(metrics.BackendMetrics.IndexLookupTime.TotalMilliseconds > 0, "Expected IndexLookupTimeInMs to be > 0, metrics = {0}", metrics); - Assert.IsTrue(metrics.BackendMetrics.QueryPreparationTimes.LogicalPlanBuildTime.TotalMilliseconds > 0, "Expected LogicalPlanBuildTimeInMs to be > 0, metrics = {0}", metrics); + Assert.IsTrue(metrics.ServerSideMetrics.IndexLookupTime.TotalMilliseconds > 0, "Expected IndexLookupTimeInMs to be > 0, metrics = {0}", metrics); + Assert.IsTrue(metrics.ServerSideMetrics.QueryPreparationTimes.LogicalPlanBuildTime.TotalMilliseconds > 0, "Expected LogicalPlanBuildTimeInMs to be > 0, metrics = {0}", metrics); //Assert.AreEqual(metrics.QueryEngineTimes.VMExecutionTime - metrics.QueryEngineTimes.IndexLookupTime - metrics.QueryEngineTimes.DocumentLoadTime - metrics.QueryEngineTimes.WriteOutputTime, // metrics.QueryEngineTimes.RuntimeExecutionTimes.TotalTime); - Assert.IsTrue(metrics.BackendMetrics.RuntimeExecutionTimes.QueryEngineExecutionTime >= metrics.BackendMetrics.RuntimeExecutionTimes.SystemFunctionExecutionTime + metrics.BackendMetrics.RuntimeExecutionTimes.UserDefinedFunctionExecutionTime, - "Expected Query VM Execution Time to be > {0}, metrics = {1}", metrics.BackendMetrics.RuntimeExecutionTimes.SystemFunctionExecutionTime + metrics.BackendMetrics.RuntimeExecutionTimes.UserDefinedFunctionExecutionTime, metrics); + Assert.IsTrue(metrics.ServerSideMetrics.RuntimeExecutionTimes.QueryEngineExecutionTime >= metrics.ServerSideMetrics.RuntimeExecutionTimes.SystemFunctionExecutionTime + metrics.ServerSideMetrics.RuntimeExecutionTimes.UserDefinedFunctionExecutionTime, + "Expected Query VM Execution Time to be > {0}, metrics = {1}", metrics.ServerSideMetrics.RuntimeExecutionTimes.SystemFunctionExecutionTime + metrics.ServerSideMetrics.RuntimeExecutionTimes.UserDefinedFunctionExecutionTime, metrics); //Assert.IsTrue(metrics.QueryEngineTimes.VMExecutionTime >= metrics.QueryEngineTimes.RuntimeExecutionTimes.TotalTime, // "Expected Query VM Execution Time to be > {0}, metrics = {1}", metrics.QueryEngineTimes.RuntimeExecutionTimes.TotalTime, metrics); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Query/Metrics/Performance.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Query/Metrics/Performance.cs index 6d5db62d6d..40484e792c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Query/Metrics/Performance.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Performance.Tests/Query/Metrics/Performance.cs @@ -37,7 +37,7 @@ public void TestParse() ValueStopwatch stopwatch = ValueStopwatch.StartNew(); for (int i = 0; i < 100000; i++) { - BackendMetricsParser.TryParse(delimitedString, out BackendMetrics backendMetrics); + ServerSideMetricsParser.TryParse(delimitedString, out ServerSideMetricsInternal serverSideMetrics); } stopwatch.Stop(); Console.WriteLine(stopwatch.ElapsedMilliseconds); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml index d1dee72a0f..75cd9894de 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/TraceWriterBaselineTests.TraceData.xml @@ -126,7 +126,7 @@ { QueryMetricsTraceDatum datum = new QueryMetricsTraceDatum( new Lazy(() => new QueryMetrics( - BackendMetricsTests.MockBackendMetrics, + ServerSideMetricsTests.ServerSideMetrics, IndexUtilizationInfoTests.MockIndexUtilizationInfo, ClientSideMetricsTests.MockClientSideMetrics))); rootTrace.AddDatum("Query Metrics", datum); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 7fde376d49..759762f21f 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -3124,6 +3124,11 @@ "Attributes": [], "MethodInfo": "Int32 GetFailedRequestCount();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Microsoft.Azure.Cosmos.ServerSideCumulativeMetrics GetQueryMetrics()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.ServerSideCumulativeMetrics GetQueryMetrics();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "System.Collections.Generic.IReadOnlyList`1[System.ValueTuple`2[System.String,System.Uri]] GetContactedRegions()": { "Type": "Method", "Attributes": [], @@ -9029,6 +9034,194 @@ }, "NestedTypes": {} }, + "Microsoft.Azure.Cosmos.ServerSideCumulativeMetrics;System.Object;IsAbstract:True;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "Microsoft.Azure.Cosmos.ServerSideMetrics CumulativeMetrics": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.ServerSideMetrics CumulativeMetrics;CanRead:True;CanWrite:False;Microsoft.Azure.Cosmos.ServerSideMetrics get_CumulativeMetrics();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.ServerSideMetrics get_CumulativeMetrics()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.ServerSideMetrics get_CumulativeMetrics();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Collections.Generic.IReadOnlyList`1[Microsoft.Azure.Cosmos.ServerSidePartitionedMetrics] get_PartitionedMetrics()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.Collections.Generic.IReadOnlyList`1[Microsoft.Azure.Cosmos.ServerSidePartitionedMetrics] get_PartitionedMetrics();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Collections.Generic.IReadOnlyList`1[Microsoft.Azure.Cosmos.ServerSidePartitionedMetrics] PartitionedMetrics": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.Collections.Generic.IReadOnlyList`1[Microsoft.Azure.Cosmos.ServerSidePartitionedMetrics] PartitionedMetrics;CanRead:True;CanWrite:False;System.Collections.Generic.IReadOnlyList`1[Microsoft.Azure.Cosmos.ServerSidePartitionedMetrics] get_PartitionedMetrics();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, + "Microsoft.Azure.Cosmos.ServerSideMetrics;System.Object;IsAbstract:True;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "Double get_IndexHitRatio()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Double get_IndexHitRatio();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Double IndexHitRatio": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Double IndexHitRatio;CanRead:True;CanWrite:False;Double get_IndexHitRatio();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int64 get_OutputDocumentCount()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Int64 get_OutputDocumentCount();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int64 get_OutputDocumentSize()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Int64 get_OutputDocumentSize();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int64 get_RetrievedDocumentCount()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Int64 get_RetrievedDocumentCount();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int64 get_RetrievedDocumentSize()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Int64 get_RetrievedDocumentSize();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int64 OutputDocumentCount": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Int64 OutputDocumentCount;CanRead:True;CanWrite:False;Int64 get_OutputDocumentCount();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int64 OutputDocumentSize": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Int64 OutputDocumentSize;CanRead:True;CanWrite:False;Int64 get_OutputDocumentSize();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int64 RetrievedDocumentCount": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Int64 RetrievedDocumentCount;CanRead:True;CanWrite:False;Int64 get_RetrievedDocumentCount();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Int64 RetrievedDocumentSize": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Int64 RetrievedDocumentSize;CanRead:True;CanWrite:False;Int64 get_RetrievedDocumentSize();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan DocumentLoadTime": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.TimeSpan DocumentLoadTime;CanRead:True;CanWrite:False;System.TimeSpan get_DocumentLoadTime();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan DocumentWriteTime": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.TimeSpan DocumentWriteTime;CanRead:True;CanWrite:False;System.TimeSpan get_DocumentWriteTime();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan get_DocumentLoadTime()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.TimeSpan get_DocumentLoadTime();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan get_DocumentWriteTime()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.TimeSpan get_DocumentWriteTime();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan get_IndexLookupTime()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.TimeSpan get_IndexLookupTime();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan get_QueryPreparationTime()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.TimeSpan get_QueryPreparationTime();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan get_RuntimeExecutionTime()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.TimeSpan get_RuntimeExecutionTime();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan get_TotalTime()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.TimeSpan get_TotalTime();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan get_VMExecutionTime()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.TimeSpan get_VMExecutionTime();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan IndexLookupTime": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.TimeSpan IndexLookupTime;CanRead:True;CanWrite:False;System.TimeSpan get_IndexLookupTime();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan QueryPreparationTime": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.TimeSpan QueryPreparationTime;CanRead:True;CanWrite:False;System.TimeSpan get_QueryPreparationTime();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan RuntimeExecutionTime": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.TimeSpan RuntimeExecutionTime;CanRead:True;CanWrite:False;System.TimeSpan get_RuntimeExecutionTime();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan TotalTime": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.TimeSpan TotalTime;CanRead:True;CanWrite:False;System.TimeSpan get_TotalTime();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.TimeSpan VMExecutionTime": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.TimeSpan VMExecutionTime;CanRead:True;CanWrite:False;System.TimeSpan get_VMExecutionTime();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, + "Microsoft.Azure.Cosmos.ServerSidePartitionedMetrics;System.Object;IsAbstract:True;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "Microsoft.Azure.Cosmos.ServerSideMetrics get_ServerSideMetrics()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.ServerSideMetrics get_ServerSideMetrics();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.ServerSideMetrics ServerSideMetrics": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.ServerSideMetrics ServerSideMetrics;CanRead:True;CanWrite:False;Microsoft.Azure.Cosmos.ServerSideMetrics get_ServerSideMetrics();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Nullable`1[System.Int32] get_PartitionKeyRangeId()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.Nullable`1[System.Int32] get_PartitionKeyRangeId();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Nullable`1[System.Int32] PartitionKeyRangeId": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.Nullable`1[System.Int32] PartitionKeyRangeId;CanRead:True;CanWrite:False;System.Nullable`1[System.Int32] get_PartitionKeyRangeId();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String FeedRange": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "System.String FeedRange;CanRead:True;CanWrite:False;System.String get_FeedRange();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.String get_FeedRange()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.String get_FeedRange();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.Spatial.BoundingBox;System.Object;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { "Subclasses": {}, "Members": { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/ClientSideMetricsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/ClientSideMetricsTests.cs index 4a446bb933..90f9fec8ad 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/ClientSideMetricsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/ClientSideMetricsTests.cs @@ -21,11 +21,11 @@ public class ClientSideMetricsTests [TestMethod] public void TestAccumulator() { - ClientSideMetrics.Accumulator accumulator = new ClientSideMetrics.Accumulator(); - accumulator = accumulator.Accumulate(MockClientSideMetrics); - accumulator = accumulator.Accumulate(MockClientSideMetrics); + ClientSideMetricsAccumulator accumulator = new ClientSideMetricsAccumulator(); + accumulator.Accumulate(MockClientSideMetrics); + accumulator.Accumulate(MockClientSideMetrics); - ClientSideMetrics doubleMetrics = ClientSideMetrics.Accumulator.ToClientSideMetrics(accumulator); + ClientSideMetrics doubleMetrics = accumulator.GetClientSideMetrics(); Assert.AreEqual(2 * MockClientSideMetrics.Retries, doubleMetrics.Retries); Assert.AreEqual(2 * MockClientSideMetrics.RequestCharge, doubleMetrics.RequestCharge); Assert.AreEqual(2 * MockClientSideMetrics.FetchExecutionRanges.Count(), doubleMetrics.FetchExecutionRanges.Count()); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/IndexUtilizationInfoTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/IndexUtilizationInfoTests.cs index 13702de3b5..9fe272a6bd 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/IndexUtilizationInfoTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/IndexUtilizationInfoTests.cs @@ -8,7 +8,6 @@ namespace Microsoft.Azure.Cosmos.Tests.Query.Metrics using VisualStudio.TestTools.UnitTesting; using Microsoft.Azure.Cosmos.Query.Core.Metrics; using System.Collections.Generic; - using System.Text; [TestClass] public class IndexUtilizationInfoTests @@ -35,11 +34,11 @@ public class IndexUtilizationInfoTests [TestMethod] public void TestAccumulator() { - IndexUtilizationInfo.Accumulator accumulator = new IndexUtilizationInfo.Accumulator(); - accumulator = accumulator.Accumulate(MockIndexUtilizationInfo); - accumulator = accumulator.Accumulate(MockIndexUtilizationInfo); + IndexUtilizationInfoAccumulator accumulator = new IndexUtilizationInfoAccumulator(); + accumulator.Accumulate(MockIndexUtilizationInfo); + accumulator.Accumulate(MockIndexUtilizationInfo); - IndexUtilizationInfo doubleInfo = IndexUtilizationInfo.Accumulator.ToIndexUtilizationInfo(accumulator); + IndexUtilizationInfo doubleInfo = accumulator.GetIndexUtilizationInfo(); Assert.AreEqual(2 * MockIndexUtilizationInfo.PotentialSingleIndexes.Count, doubleInfo.PotentialSingleIndexes.Count); Assert.AreEqual(2 * MockIndexUtilizationInfo.UtilizedSingleIndexes.Count, doubleInfo.UtilizedSingleIndexes.Count); Assert.AreEqual(2 * MockIndexUtilizationInfo.PotentialCompositeIndexes.Count, doubleInfo.PotentialCompositeIndexes.Count); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/QueryMetricsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/QueryMetricsTests.cs index d655de097a..17f73616c2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/QueryMetricsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/QueryMetricsTests.cs @@ -12,21 +12,21 @@ namespace Microsoft.Azure.Cosmos.Tests.Query.Metrics public class QueryMetricsTests { private static readonly QueryMetrics MockQueryMetrics = new QueryMetrics( - BackendMetricsTests.MockBackendMetrics, + ServerSideMetricsTests.ServerSideMetrics, IndexUtilizationInfoTests.MockIndexUtilizationInfo, ClientSideMetricsTests.MockClientSideMetrics); [TestMethod] public void TestAccumulator() { - QueryMetrics.Accumulator accumulator = new QueryMetrics.Accumulator(); - accumulator = accumulator.Accumulate(MockQueryMetrics); - accumulator = accumulator.Accumulate(MockQueryMetrics); + QueryMetricsAccumulator accumulator = new QueryMetricsAccumulator(); + accumulator.Accumulate(MockQueryMetrics); + accumulator.Accumulate(MockQueryMetrics); - QueryMetrics doubleQueryMetrics = QueryMetrics.Accumulator.ToQueryMetrics(accumulator); + QueryMetrics doubleQueryMetrics = accumulator.GetQueryMetrics(); // Spot check - Assert.AreEqual(2 * BackendMetricsTests.MockBackendMetrics.IndexLookupTime, doubleQueryMetrics.BackendMetrics.IndexLookupTime); + Assert.AreEqual(2 * ServerSideMetricsTests.ServerSideMetrics.IndexLookupTime, doubleQueryMetrics.ServerSideMetrics.IndexLookupTime); Assert.AreEqual(2 * IndexUtilizationInfoTests.MockIndexUtilizationInfo.PotentialSingleIndexes.Count, doubleQueryMetrics.IndexUtilizationInfo.PotentialSingleIndexes.Count); Assert.AreEqual(2 * ClientSideMetricsTests.MockClientSideMetrics.RequestCharge, doubleQueryMetrics.ClientSideMetrics.RequestCharge); } @@ -37,7 +37,7 @@ public void TestAddition() QueryMetrics doubleQueryMetrics = MockQueryMetrics + MockQueryMetrics; // Spot check - Assert.AreEqual(2 * BackendMetricsTests.MockBackendMetrics.IndexLookupTime, doubleQueryMetrics.BackendMetrics.IndexLookupTime); + Assert.AreEqual(2 * ServerSideMetricsTests.ServerSideMetrics.IndexLookupTime, doubleQueryMetrics.ServerSideMetrics.IndexLookupTime); Assert.AreEqual(2 * IndexUtilizationInfoTests.MockIndexUtilizationInfo.PotentialSingleIndexes.Count, doubleQueryMetrics.IndexUtilizationInfo.PotentialSingleIndexes.Count); Assert.AreEqual(2 * ClientSideMetricsTests.MockClientSideMetrics.RequestCharge, doubleQueryMetrics.ClientSideMetrics.RequestCharge); } @@ -48,7 +48,7 @@ public void TestCreateFromEnumerable() QueryMetrics tripleQueryMetrics = QueryMetrics.CreateFromIEnumerable(new List() { MockQueryMetrics, MockQueryMetrics, MockQueryMetrics }); // Spot check - Assert.AreEqual(3 * BackendMetricsTests.MockBackendMetrics.IndexLookupTime, tripleQueryMetrics.BackendMetrics.IndexLookupTime); + Assert.AreEqual(3 * ServerSideMetricsTests.ServerSideMetrics.IndexLookupTime, tripleQueryMetrics.ServerSideMetrics.IndexLookupTime); Assert.AreEqual(3 * IndexUtilizationInfoTests.MockIndexUtilizationInfo.PotentialSingleIndexes.Count, tripleQueryMetrics.IndexUtilizationInfo.PotentialSingleIndexes.Count); Assert.AreEqual(3 * ClientSideMetricsTests.MockClientSideMetrics.RequestCharge, tripleQueryMetrics.ClientSideMetrics.RequestCharge); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/BackendMetricsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/ServerSideMetricsTests.cs similarity index 78% rename from Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/BackendMetricsTests.cs rename to Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/ServerSideMetricsTests.cs index 221057790d..4c6e382ebf 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/BackendMetricsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Metrics/ServerSideMetricsTests.cs @@ -7,11 +7,10 @@ namespace Microsoft.Azure.Cosmos.Tests.Query.Metrics using System; using VisualStudio.TestTools.UnitTesting; using Microsoft.Azure.Cosmos.Query.Core.Metrics; - using System.Diagnostics; using System.Collections.Generic; [TestClass] - public class BackendMetricsTests + public class ServerSideMetricsTests { private static readonly TimeSpan totalExecutionTime = TimeSpan.FromTicks((long)(TimeSpan.TicksPerMillisecond * 33.67)); private static readonly TimeSpan queryCompileTime = TimeSpan.FromTicks((long)(TimeSpan.TicksPerMillisecond * 0.06)); @@ -32,14 +31,14 @@ public class BackendMetricsTests private static readonly string delimitedString = $"totalExecutionTimeInMs={totalExecutionTime.TotalMilliseconds};queryCompileTimeInMs={queryCompileTime.TotalMilliseconds};queryLogicalPlanBuildTimeInMs={logicalPlanBuildTime.TotalMilliseconds};queryPhysicalPlanBuildTimeInMs={physicalPlanBuildTime.TotalMilliseconds};queryOptimizationTimeInMs={queryOptimizationTime.TotalMilliseconds};VMExecutionTimeInMs={vmExecutionTime.TotalMilliseconds};indexLookupTimeInMs={indexLookupTime.TotalMilliseconds};documentLoadTimeInMs={documentLoadTime.TotalMilliseconds};systemFunctionExecuteTimeInMs={systemFunctionExecuteTime.TotalMilliseconds};userFunctionExecuteTimeInMs={userFunctionExecuteTime.TotalMilliseconds};retrievedDocumentCount={retrievedDocumentCount};retrievedDocumentSize={retrievedDocumentSize};outputDocumentCount={outputDocumentCount};outputDocumentSize={outputDocumentSize};writeOutputTimeInMs={documentWriteTime.TotalMilliseconds};indexUtilizationRatio={indexHitRatio}"; - internal static readonly BackendMetrics MockBackendMetrics = new BackendMetrics( + internal static readonly ServerSideMetricsInternal ServerSideMetrics = new ServerSideMetricsInternal( retrievedDocumentCount, retrievedDocumentSize, outputDocumentCount, outputDocumentSize, indexHitRatio, totalExecutionTime, - new QueryPreparationTimes( + new QueryPreparationTimesInternal( queryCompileTime, logicalPlanBuildTime, physicalPlanBuildTime, @@ -47,7 +46,7 @@ public class BackendMetricsTests indexLookupTime, documentLoadTime, vmExecutionTime, - new RuntimeExecutionTimes( + new RuntimeExecutionTimesInternal( totalExecutionTime - systemFunctionExecuteTime - userFunctionExecuteTime, systemFunctionExecuteTime, userFunctionExecuteTime), @@ -57,13 +56,13 @@ public class BackendMetricsTests [TestMethod] public void TestParse() { - BackendMetricsTests.ValidateParse(delimitedString, MockBackendMetrics); + ServerSideMetricsTests.ValidateParse(delimitedString, ServerSideMetrics); } [TestMethod] public void TestParseEmptyString() { - BackendMetricsTests.ValidateParse(string.Empty, BackendMetrics.Empty); + ServerSideMetricsTests.ValidateParse(string.Empty, ServerSideMetricsInternal.Empty); } [TestMethod] @@ -72,14 +71,14 @@ public void TestParseStringWithMissingFields() TimeSpan totalExecutionTime = TimeSpan.FromTicks((long)(TimeSpan.TicksPerMillisecond * 33.67)); string delimitedString = $"totalExecutionTimeInMs={totalExecutionTime.TotalMilliseconds}"; - BackendMetrics expected = new BackendMetrics( + ServerSideMetricsInternal expected = new ServerSideMetricsInternal( default(long), default(long), default(long), default(long), default(double), totalExecutionTime, - new QueryPreparationTimes( + new QueryPreparationTimesInternal( default(TimeSpan), default(TimeSpan), default(TimeSpan), @@ -87,27 +86,27 @@ public void TestParseStringWithMissingFields() default(TimeSpan), default(TimeSpan), default(TimeSpan), - new RuntimeExecutionTimes( + new RuntimeExecutionTimesInternal( default(TimeSpan), default(TimeSpan), default(TimeSpan)), default(TimeSpan)); - BackendMetricsTests.ValidateParse(delimitedString, expected); + ServerSideMetricsTests.ValidateParse(delimitedString, expected); } [TestMethod] public void TestParseStringWithTrailingUnknownField() { string delimitedString = $"thisIsNotAKnownField=asdf"; - BackendMetrics expected = new BackendMetrics( + ServerSideMetricsInternal expected = new ServerSideMetricsInternal( default(long), default(long), default(long), default(long), default(double), default(TimeSpan), - new QueryPreparationTimes( + new QueryPreparationTimesInternal( default(TimeSpan), default(TimeSpan), default(TimeSpan), @@ -115,13 +114,13 @@ public void TestParseStringWithTrailingUnknownField() default(TimeSpan), default(TimeSpan), default(TimeSpan), - new RuntimeExecutionTimes( + new RuntimeExecutionTimesInternal( default(TimeSpan), default(TimeSpan), default(TimeSpan)), default(TimeSpan)); - BackendMetricsTests.ValidateParse(delimitedString, expected); + ServerSideMetricsTests.ValidateParse(delimitedString, expected); } [TestMethod] @@ -129,7 +128,7 @@ public void TestParseStringWithTrailingUnknownField() [DataRow("totalExecutionTimeInMs=33.6+totalExecutionTimeInMs=33.6", DisplayName = "Wrong Delimiter")] public void TestNegativeCases(string delimitedString) { - Assert.IsFalse(BackendMetricsParser.TryParse(delimitedString, out BackendMetrics backendMetrics)); + Assert.IsFalse(ServerSideMetricsParser.TryParse(delimitedString, out ServerSideMetricsInternal serverSideMetrics)); } [TestMethod] @@ -137,14 +136,14 @@ public void TestParseStringWithUnknownField() { TimeSpan totalExecutionTime = TimeSpan.FromTicks((long)(TimeSpan.TicksPerMillisecond * 33.67)); string delimitedString = $"totalExecutionTimeInMs={totalExecutionTime.TotalMilliseconds};thisIsNotAKnownField={totalExecutionTime.TotalMilliseconds};totalExecutionTimeInMs={totalExecutionTime.TotalMilliseconds}"; - BackendMetrics expected = new BackendMetrics( + ServerSideMetricsInternal expected = new ServerSideMetricsInternal( default(long), default(long), default(long), default(long), default(double), totalExecutionTime, - new QueryPreparationTimes( + new QueryPreparationTimesInternal( default(TimeSpan), default(TimeSpan), default(TimeSpan), @@ -152,31 +151,34 @@ public void TestParseStringWithUnknownField() default(TimeSpan), default(TimeSpan), default(TimeSpan), - new RuntimeExecutionTimes( + new RuntimeExecutionTimesInternal( default(TimeSpan), default(TimeSpan), default(TimeSpan)), default(TimeSpan)); - BackendMetricsTests.ValidateParse(delimitedString, expected); + ServerSideMetricsTests.ValidateParse(delimitedString, expected); } [TestMethod] public void TestAccumulator() { - BackendMetrics.Accumulator accumulator = new BackendMetrics.Accumulator(); - accumulator = accumulator.Accumulate(MockBackendMetrics); - accumulator = accumulator.Accumulate(MockBackendMetrics); + ServerSideMetricsInternalAccumulator accumulator = new ServerSideMetricsInternalAccumulator(); + accumulator.Accumulate(ServerSideMetrics); + accumulator.Accumulate(ServerSideMetrics); + ServerSideMetricsInternal serverSideMetricsFromAddition = accumulator.GetServerSideMetrics(); - BackendMetrics backendMetricsFromAddition = BackendMetrics.Accumulator.ToBackendMetrics(accumulator); - BackendMetrics expected = new BackendMetrics( + List metricsList = new List { ServerSideMetrics, ServerSideMetrics }; + ServerSideMetricsInternal serverSideMetricsFromCreate = ServerSideMetricsInternal.Create(metricsList); + + ServerSideMetricsInternal expected = new ServerSideMetricsInternal( retrievedDocumentCount * 2, retrievedDocumentSize * 2, outputDocumentCount * 2, outputDocumentSize * 2, indexHitRatio, totalExecutionTime * 2, - new QueryPreparationTimes( + new QueryPreparationTimesInternal( queryCompileTime * 2, logicalPlanBuildTime * 2, physicalPlanBuildTime * 2, @@ -184,22 +186,22 @@ public void TestAccumulator() indexLookupTime * 2, documentLoadTime * 2, vmExecutionTime * 2, - new RuntimeExecutionTimes( + new RuntimeExecutionTimesInternal( (totalExecutionTime - systemFunctionExecuteTime - userFunctionExecuteTime) * 2, systemFunctionExecuteTime * 2, userFunctionExecuteTime * 2), documentWriteTime * 2); - BackendMetricsTests.ValidateBackendMetricsEquals(expected, backendMetricsFromAddition); + ServerSideMetricsTests.ValidateServerSideMetricsEquals(expected, serverSideMetricsFromAddition); + ServerSideMetricsTests.ValidateServerSideMetricsEquals(expected, serverSideMetricsFromCreate); } - - private static void ValidateParse(string delimitedString, BackendMetrics expected) + private static void ValidateParse(string delimitedString, ServerSideMetricsInternal expected) { - Assert.IsTrue(BackendMetricsParser.TryParse(delimitedString, out BackendMetrics actual)); - BackendMetricsTests.ValidateBackendMetricsEquals(expected, actual); + Assert.IsTrue(ServerSideMetricsParser.TryParse(delimitedString, out ServerSideMetricsInternal actual)); + ServerSideMetricsTests.ValidateServerSideMetricsEquals(expected, actual); } - private static void ValidateBackendMetricsEquals(BackendMetrics expected, BackendMetrics actual) + private static void ValidateServerSideMetricsEquals(ServerSideMetricsInternal expected, ServerSideMetricsInternal actual) { Assert.AreEqual(expected.DocumentLoadTime, actual.DocumentLoadTime); Assert.AreEqual(expected.DocumentWriteTime, actual.DocumentWriteTime); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs index fe3dc7054f..2d69341182 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Tracing/TraceWriterBaselineTests.cs @@ -41,7 +41,7 @@ namespace Microsoft.Azure.Cosmos.Tests.Tracing public sealed class TraceWriterBaselineTests : BaselineTests { private static readonly Lazy MockQueryMetrics = new Lazy(() => new QueryMetrics( - BackendMetricsTests.MockBackendMetrics, + ServerSideMetricsTests.ServerSideMetrics, IndexUtilizationInfoTests.MockIndexUtilizationInfo, ClientSideMetricsTests.MockClientSideMetrics)); @@ -316,7 +316,7 @@ public void TraceData() { QueryMetricsTraceDatum datum = new QueryMetricsTraceDatum( new Lazy(() => new QueryMetrics( - BackendMetricsTests.MockBackendMetrics, + ServerSideMetricsTests.ServerSideMetrics, IndexUtilizationInfoTests.MockIndexUtilizationInfo, ClientSideMetricsTests.MockClientSideMetrics))); rootTrace.AddDatum("Query Metrics", datum); From 4111caed99a5d00acd466bfc6dc2141c3bb106f8 Mon Sep 17 00:00:00 2001 From: Maya-Painter <130110800+Maya-Painter@users.noreply.github.com> Date: Mon, 11 Sep 2023 08:29:16 -0700 Subject: [PATCH 186/240] [Query][Internal] Adds tests for aggregate queries with invalid continuation tokens (#4052) * partial test * Tests and error handling update * update error message * typo * update original err msg * combine tests * test cleanup * undo error message update --- .../CosmosItemLinqTests.cs | 59 ++++++++++++++++++- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemLinqTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemLinqTests.cs index b3dc7afa41..efffeae1cb 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemLinqTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemLinqTests.cs @@ -878,9 +878,65 @@ async Task TestSearch(Expression> expression, string ex await TestSearch(x => x.description.Contains("todo"), "CONTAINS", false, 0); await TestSearch(x => x.description.Contains("tOdO", StringComparison.OrdinalIgnoreCase), "CONTAINS", true, 200); - } + [TestMethod] + public async Task LinqAggregatesWithContinuationTokenTest() + { + await ToDoActivity.CreateRandomItems(container: this.Container, pkCount: 1, perPKItemCount: 2, randomPartitionKey: true); + + QueryRequestOptions requestOptions = new QueryRequestOptions() + { + MaxItemCount = 1 + }; + + IOrderedQueryable firstQuery = this.Container.GetItemLinqQueryable(allowSynchronousQueryExecution: true, requestOptions: requestOptions); + + int count = await firstQuery.CountAsync(); + double average = firstQuery.Average(x => x.taskNum); + + string continuationToken = null; + + FeedIterator firstFeedIterator = firstQuery.ToFeedIterator(); + + // if instead of while loop in order to retrieve continuation token + if (firstFeedIterator.HasMoreResults) + { + FeedResponse firstFeedResponse = await firstFeedIterator.ReadNextAsync(); + + continuationToken = firstFeedResponse.ContinuationToken; + } + + Assert.AreEqual(2, count); + Assert.IsNotNull(continuationToken); + + IOrderedQueryable secondQuery = this.Container.GetItemLinqQueryable(allowSynchronousQueryExecution: true, continuationToken: continuationToken, requestOptions: requestOptions); + + try + { + count = await secondQuery.CountAsync(); + Assert.Fail("Expected Count query to return exception"); + } + catch (CosmosException exception) + { + Assert.IsTrue(exception.StatusCode == System.Net.HttpStatusCode.BadRequest); + Assert.IsTrue(exception.SubStatusCode == (int)Documents.SubStatusCodes.MalformedContinuationToken); + Assert.IsTrue(exception.Message.Contains("ParallelCrossPartitionQueryPipelineStage")); + } + + try + { + average = secondQuery.Average(x => x.taskNum); + Assert.Fail("Expected Average query to return exception"); + } + catch (CosmosException exception) + { + Assert.IsTrue(exception.StatusCode == System.Net.HttpStatusCode.BadRequest); + Assert.IsTrue(exception.SubStatusCode == (int)Documents.SubStatusCodes.MalformedContinuationToken); + Assert.IsTrue(exception.Message.Contains("ParallelCrossPartitionQueryPipelineStage")); + } + } + [TestMethod] public async Task LinqSelectEverythingWithoutQueryableTest() { @@ -911,7 +967,6 @@ private class NumberLinqItem public decimal decimaleValue; public bool booleanValue; public NumberLinqItem[] children; - } private async Task> FetchResults(QueryDefinition queryDefinition) From b909bd7ee4b00ee4d6a28f744ab300138aa37ad3 Mon Sep 17 00:00:00 2001 From: Kiran Kumar Kolli Date: Mon, 11 Sep 2023 12:48:13 -0700 Subject: [PATCH 187/240] [Internal] Benchmark tool: Fixes code refractoring to model the metrics as EventSource (#4040) * Adding metrics for Benchmark tool. * Adding OpenTelemetry. * Revert "Adding OpenTelemetry." This reverts commit c7da0884697064103145099e284892365f4ebb68. * Telemetry for windowed percentiles. * OpenTelemetry, AppInsights and Dashboard. * Removing DiagnosticDataListener. * Code styling, comments and clean-up. * Fixing issues with dashboard. * Fixing positions of charts on the dashboard. * Fixing the dashboard. * Updating titles and subtitles. * Removing ILogger and other not required references. * Fixing code review points. * Fixing issues after rebase. * Removing unnecessary changes. * Fixing code review points. * Adding metrics for Benchmark tool. * Adding OpenTelemetry. * Revert "Adding OpenTelemetry." This reverts commit c7da0884697064103145099e284892365f4ebb68. * Telemetry for windowed percentiles. * OpenTelemetry, AppInsights and Dashboard. * Removing DiagnosticDataListener. * Code styling, comments and clean-up. * Fixing issues with dashboard. * Fixing positions of charts on the dashboard. * Fixing the dashboard. * Updating titles and subtitles. * Removing ILogger and other not required references. * Fixing code review points. * Fixing issues after rebase. * Removing unnecessary changes. * Fixing code review points. * Fixing code review points. * make MetrcisCollectorProvider non static and remove locks * fix * fixes * use static class name TelemetrySpan.IncludePercentile * use app insights connection string * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs * modified: Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs * rename AppInsightsConnectionString * fix * fix comments * fix if AppInsights c string is not set * summary * fix * remove unnecessary collector types * remove unnecesary metere provicer * add event source * remove folder * fix * split success and failed latencies * Code refractor to use EvenSource design pattern for metrics * Fixing build breaks * Removing BenchmarkExecutionEventSource * Fixign misc things * Some extra cleanup * use TimeSpan except milliseconds * fix metrics publication * fix metrics publication * move tests to benchmark folder * move back benchmark test * use background task for flushing metrics * remove sync metrics flushing * split failed and success operations * fix latenclies charts * fix benchmark run command * remove ShouldUnsetParentConfigurationAndPlatform=false --------- Co-authored-by: Mikhail Lipin Co-authored-by: David Chaava Co-authored-by: David Chaava --- .../AzureVmBenchmark/system/cloud-init.txt | 3 - .../Benchmark/BenchmarkLatencyEventSource.cs | 12 +++ .../Benchmark/CosmosBenchmarkEventListener.cs | 92 ++++++++++++++++++ .../Benchmark/Fx/DiagnosticDataListener.cs | 15 +-- .../Tools/Benchmark/Fx/IExecutionStrategy.cs | 3 +- .../Tools/Benchmark/Fx/IExecutor.cs | 3 +- .../Tools/Benchmark/Fx/IMetricsCollector.cs | 20 +--- .../Tools/Benchmark/Fx/MetricsCollector.cs | 59 +++++++----- .../Benchmark/Fx/MetricsCollectorProvider.cs | 96 ------------------- .../Tools/Benchmark/Fx/OperationResult.cs | 1 + .../Benchmark/Fx/ParallelExecutionStrategy.cs | 11 +-- .../Benchmark/Fx/SerialOperationExecutor.cs | 21 +--- .../Tools/Benchmark/Fx/TelemetrySpan.cs | 52 +++++----- .../Tools/Benchmark/MetricCollectionWindow.cs | 25 +++-- .../Tools/Benchmark/Program.cs | 48 +++++----- .../v2/InsertV2BenchmarkOperation.cs | 1 + ...QueryStreamSinglePkV2BenchmarkOperation.cs | 1 + .../v2/QueryTSinglePkV2BenchmarkOperation.cs | 1 + .../v2/ReadFeedStreamV2BenchmarkOperation.cs | 1 + .../v2/ReadNotExistsV2BenchmarkOperation.cs | 1 + .../ReadStreamExistsV2BenchmarkOperation.cs | 1 + .../v2/ReadTExistsV2BenchmarkOperation.cs | 1 + .../v3/InsertV3BenchmarkOperation.cs | 1 + .../v3/QueryTV3BenchmarkOperation.cs | 1 + .../v3/ReadFeedStreamV3BenchmarkOperation.cs | 1 + .../v3/ReadNotExistsV3BenchmarkOperation.cs | 1 + .../ReadStreamExistsV3BenchmarkOperation.cs | 1 + ...istsWithDiagnosticsV3BenchmarkOperation.cs | 1 + .../v3/ReadTExistsV3BenchmarkOperation.cs | 1 + 29 files changed, 238 insertions(+), 237 deletions(-) create mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmarkEventListener.cs delete mode 100644 Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollectorProvider.cs diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/system/cloud-init.txt b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/system/cloud-init.txt index 6821dcaa15..b6a0419fd5 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/system/cloud-init.txt +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/AzureVmBenchmark/system/cloud-init.txt @@ -4,9 +4,6 @@ packages: - azure-cli runcmd: - - wget https://aka.ms/downloadazcopy-v10-linux - - tar -xvf downloadazcopy-v10-linux - - sudo cp ./azcopy_linux_amd64_*/azcopy /usr/bin/ - wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb - sudo dpkg -i packages-microsoft-prod.deb - sudo apt update diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkLatencyEventSource.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkLatencyEventSource.cs index 5a945d21da..6b1b6d03d7 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkLatencyEventSource.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkLatencyEventSource.cs @@ -45,5 +45,17 @@ public void LatencyDiagnostics( this.WriteEvent(1, dbName, containerName, durationInMs, lazyDiagnostics()); } } + + [Event(2, Level = EventLevel.Informational)] + public void OnOperationSuccess(int operationType, double durationInMs) + { + this.WriteEvent(2, operationType, durationInMs); + } + + [Event(3, Level = EventLevel.Informational)] + public void OnOperationFailure(int operationType, double durationInMs) + { + this.WriteEvent(3, operationType, durationInMs); + } } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmarkEventListener.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmarkEventListener.cs new file mode 100644 index 0000000000..d12cb6c476 --- /dev/null +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/CosmosBenchmarkEventListener.cs @@ -0,0 +1,92 @@ +namespace CosmosBenchmark +{ + using System; + using System.Diagnostics.Tracing; + using System.Threading; + using System.Threading.Tasks; + using OpenTelemetry.Metrics; + + internal class CosmosBenchmarkEventListener : EventListener + { + static readonly string CosmosBenchmarkEventSourceName = "Azure.Cosmos.Benchmark"; + + private readonly MeterProvider meterProvider; + private readonly MetricsCollector[] metricsCollectors; + private readonly MetricCollectionWindow metricCollectionWindow; + private const int WindowCheckInterval = 10; + + public CosmosBenchmarkEventListener(MeterProvider meterProvider, BenchmarkConfig config) + { + this.meterProvider = meterProvider; + this.metricCollectionWindow ??= new MetricCollectionWindow(config.MetricsReportingIntervalInSec); + + this.metricsCollectors = new MetricsCollector[Enum.GetValues().Length]; + foreach (BenchmarkOperationType entry in Enum.GetValues()) + { + this.metricsCollectors[(int)entry] = new MetricsCollector(entry); + } + + /// + /// Flush metrics every + /// + ThreadPool.QueueUserWorkItem(async state => + { + while (true) + { + // Reset metricCollectionWindow and flush. + if (this.metricCollectionWindow.IsInvalid()) + { + this.meterProvider.ForceFlush(); + this.metricCollectionWindow.Reset(); + } + await Task.Delay(TimeSpan.FromMilliseconds(CosmosBenchmarkEventListener.WindowCheckInterval)); + } + }); + } + + + + /// + /// Override this method to get a list of all the eventSources that exist. + /// + protected override void OnEventSourceCreated(EventSource eventSource) + { + // Because we want to turn on every EventSource, we subscribe to a callback that triggers + // when new EventSources are created. It is also fired when the EventListener is created + // for all pre-existing EventSources. Thus this callback get called once for every + // EventSource regardless of the order of EventSource and EventListener creation. + + // For any EventSource we learn about, turn it on. + if (eventSource.Name == CosmosBenchmarkEventSourceName) + { + this.EnableEvents(eventSource, EventLevel.Informational, EventKeywords.All); + } + } + + /// + /// We override this method to get a callback on every event we subscribed to with EnableEvents + /// + /// + protected override void OnEventWritten(EventWrittenEventArgs eventData) + { + if (eventData.EventId == 2 // Successful + || eventData.EventId == 3) // Failure + { + int operationTypeIndex = (int)eventData.Payload[0]; + double durationInMs = (double)eventData.Payload[1]; + + switch (eventData.EventId) + { + case 2: + this.metricsCollectors[operationTypeIndex].OnOperationSuccess(durationInMs); + break; + case 3: + this.metricsCollectors[operationTypeIndex].OnOperationFailure(durationInMs); + break; + default: + break; + } + } + } + } +} diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/DiagnosticDataListener.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/DiagnosticDataListener.cs index 1171a05faa..fe7da4a2e2 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/DiagnosticDataListener.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/DiagnosticDataListener.cs @@ -131,13 +131,16 @@ public DiagnosticDataListener(BenchmarkConfig config) /// An instance of containing the request latency and diagnostics. protected override void OnEventWritten(EventWrittenEventArgs eventData) { - try + if (eventData.EventId == 1) { - this.Writer.WriteLine($"{eventData.Payload[2]} ; {eventData.Payload[3]}"); - } - catch (Exception ex) - { - Utility.TraceError("An exception ocured while writing diagnostic data to the file", ex); + try + { + this.Writer.WriteLine($"{eventData.Payload[2]} ; {eventData.Payload[3]}"); + } + catch (Exception ex) + { + Utility.TraceError("An exception ocured while writing diagnostic data to the file", ex); + } } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IExecutionStrategy.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IExecutionStrategy.cs index ed1400026b..e517439419 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IExecutionStrategy.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IExecutionStrategy.cs @@ -20,7 +20,6 @@ public Task ExecuteAsync( BenchmarkConfig benchmarkConfig, int serialExecutorConcurrency, int serialExecutorIterationCount, - double warmupFraction, - MetricsCollectorProvider metricsCollectorProvider); + double warmupFraction); } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IExecutor.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IExecutor.cs index 235a54199b..c4d1c765e7 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IExecutor.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IExecutor.cs @@ -18,7 +18,6 @@ public Task ExecuteAsync( bool isWarmup, bool traceFailures, Action completionCallback, - BenchmarkConfig benchmarkConfig, - MetricsCollectorProvider metricsCollectorProvider); + BenchmarkConfig benchmarkConfig); } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IMetricsCollector.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IMetricsCollector.cs index 58af9d0b19..fa5558c31b 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IMetricsCollector.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/IMetricsCollector.cs @@ -12,25 +12,13 @@ namespace CosmosBenchmark public interface IMetricsCollector { /// - /// Collects the number of successful operations. + /// Successful operation with latency /// - void CollectMetricsOnSuccess(); + void OnOperationSuccess(double operationLatencyInMs); /// - /// Collects the number of failed operations. + /// Failed operation with latency /// - void CollectMetricsOnFailure(); - - /// - /// Records latency for success operations in milliseconda. - /// - /// The number of milliseconds to record. - void RecordSuccessOpLatencyAndRps(TimeSpan timeSpan); - - /// - /// Records latency for failed operations in milliseconda. - /// - /// The number of milliseconds to record. - void RecordFailedOpLatencyAndRps(TimeSpan timeSpan); + void OnOperationFailure(double operationLatencyInMs); } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollector.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollector.cs index 1676dd0052..4f1fc68257 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollector.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollector.cs @@ -5,6 +5,7 @@ namespace CosmosBenchmark { using System; + using System.Collections.Generic; using System.Diagnostics.Metrics; /// @@ -96,45 +97,55 @@ internal class MetricsCollector : IMetricsCollector /// Initialize new instance of . /// /// OpenTelemetry meter. - public MetricsCollector(Meter meter, string prefix) + public MetricsCollector(BenchmarkOperationType operationType) { - this.meter = meter; - this.rpsMetricNameHistogram = meter.CreateHistogram($"{prefix}OperationRpsHistogram"); - this.operationLatencyHistogram = meter.CreateHistogram($"{prefix}OperationLatencyInMsHistogram"); + this.meter = new Meter($"CosmosBenchmark{operationType}OperationMeter"); + this.rpsMetricNameHistogram = this.meter.CreateHistogram($"{operationType}OperationRpsHistogram"); + this.operationLatencyHistogram = this.meter.CreateHistogram($"{operationType}OperationLatencyInMsHistogram"); - this.rpsFailedMetricNameHistogram = meter.CreateHistogram($"{prefix}FailedOperationRpsHistogram"); - this.operationFailedLatencyHistogram = meter.CreateHistogram($"{prefix}FailedOperationLatencyInMsHistogram"); + this.rpsFailedMetricNameHistogram = this.meter.CreateHistogram($"{operationType}FailedOperationRpsHistogram"); + this.operationFailedLatencyHistogram = this.meter.CreateHistogram($"{operationType}FailedOperationLatencyInMsHistogram"); - this.successOperationCounter = meter.CreateCounter($"{prefix}OperationSuccess"); - this.failureOperationCounter = meter.CreateCounter($"{prefix}OperationFailure"); + this.successOperationCounter = this.meter.CreateCounter($"{operationType}OperationSuccess"); + this.failureOperationCounter = this.meter.CreateCounter($"{operationType}OperationFailure"); - this.latencyInMsMetricNameGauge = this.meter.CreateObservableGauge($"{prefix}OperationLatencyInMs", + this.latencyInMsMetricNameGauge = this.meter.CreateObservableGauge($"{operationType}OperationLatencyInMs", () => new Measurement(this.latencyInMs)); - this.rpsNameGauge = this.meter.CreateObservableGauge($"{prefix}OperationRps", + this.rpsNameGauge = this.meter.CreateObservableGauge($"{operationType}OperationRps", () => new Measurement(this.rps)); - this.latencyInMsFailedMetricNameGauge = this.meter.CreateObservableGauge($"{prefix}FailedOperationLatencyInMs", - () => new Measurement(this.latencyInMs)); + this.latencyInMsFailedMetricNameGauge = this.meter.CreateObservableGauge($"{operationType}FailedOperationLatencyInMs", + () => new Measurement(this.latencyFailedInMs)); - this.rpsFailedNameGauge = this.meter.CreateObservableGauge($"{prefix}FailedOperationRps", - () => new Measurement(this.rps)); + this.rpsFailedNameGauge = this.meter.CreateObservableGauge($"{operationType}FailedOperationRps", + () => new Measurement(this.rpsFailed)); + } + + internal static IEnumerable GetBenchmarkMeterNames() + { + foreach (BenchmarkOperationType entry in Enum.GetValues()) + { + yield return $"CosmosBenchmark{entry}OperationMeter"; + } } /// - /// Collects the number of successful operations. + /// Successful operation with latency /// - public void CollectMetricsOnSuccess() + public void OnOperationSuccess(double operationLatencyInMs) { this.successOperationCounter.Add(1); + this.RecordSuccessOpLatencyAndRps(operationLatencyInMs); } /// - /// Collects the number of failed operations. + /// Failed operation with latency /// - public void CollectMetricsOnFailure() + public void OnOperationFailure(double operationLatencyInMs) { this.failureOperationCounter.Add(1); + this.RecordFailedOpLatencyAndRps(operationLatencyInMs); } /// @@ -142,10 +153,10 @@ public void CollectMetricsOnFailure() /// /// The number of milliseconds to record. public void RecordSuccessOpLatencyAndRps( - TimeSpan timeSpan) + double operationLatencyInMs) { - this.rps = timeSpan.TotalMilliseconds != 0 ? 1000 / timeSpan.TotalMilliseconds : 0; - this.latencyInMs = timeSpan.TotalMilliseconds; + this.rps = operationLatencyInMs != 0 ? 1000 / operationLatencyInMs : 0; + this.latencyInMs = operationLatencyInMs; this.rpsMetricNameHistogram.Record(this.rps); this.operationLatencyHistogram.Record(this.latencyInMs); } @@ -155,10 +166,10 @@ public void RecordSuccessOpLatencyAndRps( /// /// The number of milliseconds to record. public void RecordFailedOpLatencyAndRps( - TimeSpan timeSpan) + double operationLatencyInMs) { - this.rpsFailed = timeSpan.TotalMilliseconds != 0 ? 1000 / timeSpan.TotalMilliseconds : 0; - this.latencyFailedInMs = timeSpan.TotalMilliseconds; + this.rpsFailed = operationLatencyInMs != 0 ? 1000 / operationLatencyInMs : 0; + this.latencyFailedInMs = operationLatencyInMs; this.rpsFailedMetricNameHistogram.Record(this.rpsFailed); this.operationFailedLatencyHistogram.Record(this.latencyFailedInMs); } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollectorProvider.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollectorProvider.cs deleted file mode 100644 index f49d9ec571..0000000000 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/MetricsCollectorProvider.cs +++ /dev/null @@ -1,96 +0,0 @@ -//------------------------------------------------------------ -// Copyright (c) Microsoft Corporation. All rights reserved. -//------------------------------------------------------------ - -namespace CosmosBenchmark -{ - using System; - using System.Diagnostics.Metrics; - using System.Threading; - using System.Threading.Tasks; - using OpenTelemetry.Metrics; - - /// - /// Represents the metrics collector provider. - /// - internal class MetricsCollectorProvider - { - private const int WindowCheckInterval = 10; - private MetricCollectionWindow metricCollectionWindow; - - private static readonly object metricCollectionWindowLock = new object(); - - private readonly MetricsCollector insertOperationMetricsCollector; - - private readonly MetricsCollector queryOperationMetricsCollector; - - private readonly MetricsCollector readOperationMetricsCollector; - - private readonly Meter insertOperationMeter = new("CosmosBenchmarkInsertOperationMeter"); - - private readonly Meter queryOperationMeter = new("CosmosBenchmarkQueryOperationMeter"); - - private readonly Meter readOperationMeter = new("CosmosBenchmarkReadOperationMeter"); - - private readonly MeterProvider meterProvider; - - public MetricsCollectorProvider(BenchmarkConfig config, MeterProvider meterProvider) - { - this.meterProvider = meterProvider; - this.insertOperationMetricsCollector ??= new MetricsCollector(this.insertOperationMeter, "Insert"); - this.queryOperationMetricsCollector ??= new MetricsCollector(this.queryOperationMeter, "Query"); - this.readOperationMetricsCollector ??= new MetricsCollector(this.readOperationMeter, "Read"); - this.metricCollectionWindow ??= new MetricCollectionWindow(config); - - /// - /// Flush metrics every - /// - ThreadPool.QueueUserWorkItem(async state => - { - while (true) - { - MetricCollectionWindow metricCollectionWindow = this.GetCurrentMetricCollectionWindow(config); - - // Reset metricCollectionWindow and flush. - if (!metricCollectionWindow.IsValid) - { - this.meterProvider.ForceFlush(); - this.metricCollectionWindow.Reset(config); - } - await Task.Delay(TimeSpan.FromMilliseconds(MetricsCollectorProvider.WindowCheckInterval)); - } - }); - } - - private MetricCollectionWindow GetCurrentMetricCollectionWindow(BenchmarkConfig config) - { - if (this.metricCollectionWindow is null || !this.metricCollectionWindow.IsValid) - { - lock (metricCollectionWindowLock) - { - this.metricCollectionWindow ??= new MetricCollectionWindow(config); - } - } - - return this.metricCollectionWindow; - } - - /// - /// Gets the metric collector. - /// - /// Benchmark operation. - /// Benchmark configuration. - /// Metrics collector. - /// Thrown if provided benchmark operation is not covered supported to collect metrics. - public IMetricsCollector GetMetricsCollector(IBenchmarkOperation benchmarkOperation) - { - return benchmarkOperation.OperationType switch - { - BenchmarkOperationType.Insert => this.insertOperationMetricsCollector, - BenchmarkOperationType.Query => this.queryOperationMetricsCollector, - BenchmarkOperationType.Read => this.readOperationMetricsCollector, - _ => throw new NotSupportedException($"The type of {nameof(benchmarkOperation)} is not supported for collecting metrics."), - }; - } - } -} diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/OperationResult.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/OperationResult.cs index 0e87c33b35..a7f34b8bb0 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/OperationResult.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/OperationResult.cs @@ -7,6 +7,7 @@ internal struct OperationResult { public string DatabseName { get; set; } public string ContainerName { get; set; } + public BenchmarkOperationType OperationType { get; set; } public double RuCharges { get; set; } public Func LazyDiagnostics { get; set; } public CosmosDiagnostics CosmosDiagnostics { get; set; } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/ParallelExecutionStrategy.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/ParallelExecutionStrategy.cs index d32052e3fe..018f7f1615 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/ParallelExecutionStrategy.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/ParallelExecutionStrategy.cs @@ -29,8 +29,7 @@ public async Task ExecuteAsync( BenchmarkConfig benchmarkConfig, int serialExecutorConcurrency, int serialExecutorIterationCount, - double warmupFraction, - MetricsCollectorProvider metricsCollectorProvider) + double warmupFraction) { IExecutor warmupExecutor = new SerialOperationExecutor( executorId: "Warmup", @@ -39,9 +38,8 @@ await warmupExecutor.ExecuteAsync( (int)(serialExecutorIterationCount * warmupFraction), isWarmup: true, traceFailures: benchmarkConfig.TraceFailures, - completionCallback: () => { }, - benchmarkConfig, - metricsCollectorProvider); + completionCallback: () => { }, + benchmarkConfig); Utility.TeePrint("Starting execution {0} tasks", serialExecutorConcurrency); IExecutor[] executors = new IExecutor[serialExecutorConcurrency]; @@ -60,8 +58,7 @@ await warmupExecutor.ExecuteAsync( isWarmup: false, traceFailures: benchmarkConfig.TraceFailures, completionCallback: () => Interlocked.Decrement(ref this.pendingExecutorCount), - benchmarkConfig, - metricsCollectorProvider); + benchmarkConfig); } return await this.LogOutputStats( diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/SerialOperationExecutor.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/SerialOperationExecutor.cs index 3bb84e26fa..200a647e77 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/SerialOperationExecutor.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/SerialOperationExecutor.cs @@ -13,7 +13,6 @@ namespace CosmosBenchmark internal class SerialOperationExecutor : IExecutor { private readonly IBenchmarkOperation operation; - private readonly string executorId; public SerialOperationExecutor( @@ -28,7 +27,6 @@ public SerialOperationExecutor( } public int SuccessOperationCount { get; private set; } - public int FailedOperationCount { get; private set; } public double TotalRuCharges { get; private set; } @@ -38,19 +36,15 @@ public async Task ExecuteAsync( bool isWarmup, bool traceFailures, Action completionCallback, - BenchmarkConfig benchmarkConfig, - MetricsCollectorProvider metricsCollectorProvider) + BenchmarkConfig benchmarkConfig) { Trace.TraceInformation($"Executor {this.executorId} started"); - Trace.TraceInformation("Initializing counters and metrics."); - try { int currentIterationCount = 0; do { - IMetricsCollector metricsCollector = metricsCollectorProvider.GetMetricsCollector(this.operation); OperationResult? operationResult = null; await this.operation.PrepareAsync(); @@ -58,15 +52,12 @@ public async Task ExecuteAsync( using (ITelemetrySpan telemetrySpan = TelemetrySpan.StartNew( benchmarkConfig, () => operationResult.Value, - disableTelemetry: isWarmup, - metricsCollector.RecordSuccessOpLatencyAndRps, - metricsCollector.RecordFailedOpLatencyAndRps)) + disableTelemetry: isWarmup)) { try { operationResult = await this.operation.ExecuteOnceAsync(); - - metricsCollector.CollectMetricsOnSuccess(); + telemetrySpan.MarkSuccess(); // Success case this.SuccessOperationCount++; @@ -79,13 +70,11 @@ public async Task ExecuteAsync( } catch (Exception ex) { + telemetrySpan.MarkFailed(); if (traceFailures) { Trace.TraceInformation(ex.ToString()); } - telemetrySpan.MarkFailed(); - - metricsCollector.CollectMetricsOnFailure(); // failure case this.FailedOperationCount++; @@ -123,4 +112,4 @@ public async Task ExecuteAsync( } } } -} \ No newline at end of file +} diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/TelemetrySpan.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/TelemetrySpan.cs index 4f8785860d..ae03edcfa3 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/TelemetrySpan.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Fx/TelemetrySpan.cs @@ -19,8 +19,6 @@ internal class TelemetrySpan : ITelemetrySpan private Stopwatch stopwatch; private Func lazyOperationResult; - private Action recordFailedOpLatencyAction; - private Action recordSuccessOpLatencyAction; private bool disableTelemetry; private bool isFailed = false; private BenchmarkConfig benchmarkConfig; @@ -28,9 +26,7 @@ internal class TelemetrySpan : ITelemetrySpan public static ITelemetrySpan StartNew( BenchmarkConfig benchmarkConfig, Func lazyOperationResult, - bool disableTelemetry, - Action recordSuccessOpLatencyAction, - Action recordFailedOpLatencyAction) + bool disableTelemetry) { if (disableTelemetry || !TelemetrySpan.IncludePercentile) { @@ -42,17 +38,25 @@ public static ITelemetrySpan StartNew( benchmarkConfig = benchmarkConfig, stopwatch = Stopwatch.StartNew(), lazyOperationResult = lazyOperationResult, - recordSuccessOpLatencyAction = recordSuccessOpLatencyAction, - recordFailedOpLatencyAction = recordFailedOpLatencyAction, disableTelemetry = disableTelemetry }; } - public void MarkFailed() { this.isFailed = true; } + public void MarkFailed() + { + this.isFailed = true; + this.stopwatch.Stop(); + } - public void Dispose() + public void MarkSuccess() { + this.isFailed = false; this.stopwatch.Stop(); + } + + public void Dispose() + { + this.stopwatch.Stop(); // No-op in-case of MarkFailed or MarkSuccess prior call if (!this.disableTelemetry) { OperationResult operationResult = this.lazyOperationResult(); @@ -61,14 +65,13 @@ public void Dispose() { RecordLatency(this.stopwatch.Elapsed.TotalMilliseconds); - if(this.isFailed) + if (this.isFailed) { - this.recordSuccessOpLatencyAction?.Invoke(this.stopwatch.Elapsed); + BenchmarkLatencyEventSource.Instance.OnOperationFailure((int)operationResult.OperationType, this.stopwatch.Elapsed.TotalMilliseconds); } else { - this.recordSuccessOpLatencyAction?.Invoke(this.stopwatch.Elapsed); - + BenchmarkLatencyEventSource.Instance.OnOperationSuccess((int)operationResult.OperationType, this.stopwatch.Elapsed.TotalMilliseconds); } } @@ -76,9 +79,8 @@ public void Dispose() operationResult.DatabseName, operationResult.ContainerName, (int)this.stopwatch.ElapsedMilliseconds, - operationResult.LazyDiagnostics, + operationResult.LazyDiagnostics, this.benchmarkConfig.DiagnosticLatencyThresholdInMs); - } } @@ -104,16 +106,6 @@ internal static void ResetLatencyHistogram(int totalNumberOfIterations) return MathNet.Numerics.Statistics.Statistics.Percentile(latencyHistogram.Take(latencyIndex + 1), percentile); } - internal static double? GetLatencyQuantile(double quantile) - { - if (TelemetrySpan.latencyHistogram == null) - { - return null; - } - - return MathNet.Numerics.Statistics.Statistics.Quantile(latencyHistogram.Take(latencyIndex + 1), quantile); - } - private class NoOpDisposable : ITelemetrySpan { public static readonly NoOpDisposable Instance = new NoOpDisposable(); @@ -122,13 +114,19 @@ public void Dispose() { } + public void MarkSuccess() + { + } + public void MarkFailed() { } } - public interface ITelemetrySpan : IDisposable { + public interface ITelemetrySpan : IDisposable + { + void MarkSuccess(); void MarkFailed(); } } -} +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/MetricCollectionWindow.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/MetricCollectionWindow.cs index 948ade075e..fabdcfc75d 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/MetricCollectionWindow.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/MetricCollectionWindow.cs @@ -11,38 +11,35 @@ namespace CosmosBenchmark /// internal class MetricCollectionWindow { - /// - /// The timestamp when window span is started. - /// - public DateTime Started { get; private set; } + private DateTime ValidTill { get; set; } - /// - /// The timestamp until which the current window span is not elapsed. - /// - public DateTime ValidTill { get; private set; } + private int MetricsReportingIntervalInSec { get; set; } /// /// Creates the instance of . /// /// Cosmos Benchmark configuration. - public MetricCollectionWindow(BenchmarkConfig config) + public MetricCollectionWindow(int metricsReportingIntervalInSec) { - this.Reset(config); + this.MetricsReportingIntervalInSec = metricsReportingIntervalInSec; + this.Reset(); } /// /// Indicates whether the current window is valid. /// - public bool IsValid => DateTime.UtcNow > this.ValidTill; + public bool IsInvalid() + { + return DateTime.UtcNow > this.ValidTill; + } /// /// Resets the started timestamp and valid till timespan. /// /// - public void Reset(BenchmarkConfig config) + public void Reset() { - this.Started = DateTime.UtcNow; - this.ValidTill = this.Started.AddSeconds(config.MetricsReportingIntervalInSec); + this.ValidTill = DateTime.UtcNow.AddSeconds(this.MetricsReportingIntervalInSec); } } } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs index 744d53f2af..d1f8677cc6 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs @@ -41,8 +41,7 @@ public static async Task Main(string[] args) await AddAzureInfoToRunSummary(); MeterProvider meterProvider = BuildMeterProvider(config); - - MetricsCollectorProvider metricsCollectorProvider = new MetricsCollectorProvider(config, meterProvider); + CosmosBenchmarkEventListener listener = new CosmosBenchmarkEventListener(meterProvider, config); ThreadPool.SetMinThreads(config.MinThreadPoolSize, config.MinThreadPoolSize); @@ -62,7 +61,7 @@ public static async Task Main(string[] args) Program program = new Program(); - RunSummary runSummary = await program.ExecuteAsync(config, metricsCollectorProvider); + RunSummary runSummary = await program.ExecuteAsync(config); if (!string.IsNullOrEmpty(config.DiagnosticsStorageConnectionString)) { @@ -90,25 +89,28 @@ public static async Task Main(string[] args) /// private static MeterProvider BuildMeterProvider(BenchmarkConfig config) { + MeterProviderBuilder meterProviderBuilder = Sdk.CreateMeterProviderBuilder(); if (string.IsNullOrWhiteSpace(config.AppInsightsConnectionString)) { - return Sdk.CreateMeterProviderBuilder() - .AddMeter("CosmosBenchmarkInsertOperationMeter") - .AddMeter("CosmosBenchmarkQueryOperationMeter") - .AddMeter("CosmosBenchmarkReadOperationMeter") - .Build(); + foreach(string benchmarkName in MetricsCollector.GetBenchmarkMeterNames()) + { + meterProviderBuilder = meterProviderBuilder.AddMeter(benchmarkName); + }; + + return meterProviderBuilder.Build(); } OpenTelemetry.Trace.TracerProviderBuilder tracerProviderBuilder = Sdk.CreateTracerProviderBuilder() .AddAzureMonitorTraceExporter(); - return Sdk.CreateMeterProviderBuilder() - .AddAzureMonitorMetricExporter(configure: new Action( - (options) => options.ConnectionString = config.AppInsightsConnectionString)) - .AddMeter("CosmosBenchmarkInsertOperationMeter") - .AddMeter("CosmosBenchmarkQueryOperationMeter") - .AddMeter("CosmosBenchmarkReadOperationMeter") - .Build(); + meterProviderBuilder = meterProviderBuilder.AddAzureMonitorMetricExporter(configure: new Action( + (options) => options.ConnectionString = config.AppInsightsConnectionString)); + foreach (string benchmarkName in MetricsCollector.GetBenchmarkMeterNames()) + { + meterProviderBuilder = meterProviderBuilder.AddMeter(benchmarkName); + }; + + return meterProviderBuilder.Build(); } /// @@ -138,13 +140,11 @@ private static async Task AddAzureInfoToRunSummary() } } - /// /// Executing benchmarks for V2/V3 cosmosdb SDK. /// /// a Task object. - private async Task ExecuteAsync(BenchmarkConfig config, - MetricsCollectorProvider metricsCollectorProvider) + private async Task ExecuteAsync(BenchmarkConfig config) { // V3 SDK client initialization using (CosmosClient cosmosClient = config.CreateCosmosClient(config.Key)) @@ -200,7 +200,7 @@ private async Task ExecuteAsync(BenchmarkConfig config, } IExecutionStrategy execution = IExecutionStrategy.StartNew(benchmarkOperationFactory); - runSummary = await execution.ExecuteAsync(config, taskCount, opsPerTask, 0.01, metricsCollectorProvider); + runSummary = await execution.ExecuteAsync(config, taskCount, opsPerTask, 0.01); } if (config.CleanupOnFinish) @@ -224,8 +224,8 @@ private async Task ExecuteAsync(BenchmarkConfig config, Utility.TeeTraceInformation("Publishing results"); runSummary.Diagnostics = CosmosDiagnosticsLogger.GetDiagnostics(); await this.PublishResults( - config, - runSummary, + config, + runSummary, cosmosClient); } @@ -234,8 +234,8 @@ await this.PublishResults( } private async Task PublishResults( - BenchmarkConfig config, - RunSummary runSummary, + BenchmarkConfig config, + RunSummary runSummary, CosmosClient benchmarkClient) { if (string.IsNullOrEmpty(config.ResultsEndpoint)) @@ -390,4 +390,4 @@ private static void ClearCoreSdkListeners() traceSource.Listeners.Clear(); } } -} \ No newline at end of file +} diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/InsertV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/InsertV2BenchmarkOperation.cs index 124c841085..aafe6d4d4e 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/InsertV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/InsertV2BenchmarkOperation.cs @@ -55,6 +55,7 @@ public async Task ExecuteOnceAsync() { DatabseName = databsaeName, ContainerName = containerName, + OperationType = this.OperationType, RuCharges = ruCharges, LazyDiagnostics = () => itemResponse.RequestDiagnosticsString, }; diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryStreamSinglePkV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryStreamSinglePkV2BenchmarkOperation.cs index b0f071f6de..222fa5fa3f 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryStreamSinglePkV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryStreamSinglePkV2BenchmarkOperation.cs @@ -82,6 +82,7 @@ public async Task ExecuteOnceAsync() { DatabseName = databsaeName, ContainerName = containerName, + OperationType = this.OperationType, RuCharges = totalCharge, LazyDiagnostics = lastDiagnostics, }; diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryTSinglePkV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryTSinglePkV2BenchmarkOperation.cs index cd50a789b8..7abb881ba1 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryTSinglePkV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/QueryTSinglePkV2BenchmarkOperation.cs @@ -90,6 +90,7 @@ public async Task ExecuteOnceAsync() { DatabseName = databsaeName, ContainerName = containerName, + OperationType = this.OperationType, RuCharges = totalCharge, LazyDiagnostics = lastDiagnostics, }; diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadFeedStreamV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadFeedStreamV2BenchmarkOperation.cs index 0a9b9e3d7f..49e92195ce 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadFeedStreamV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadFeedStreamV2BenchmarkOperation.cs @@ -54,6 +54,7 @@ public async Task ExecuteOnceAsync() { DatabseName = databsaeName, ContainerName = containerName, + OperationType = this.OperationType, RuCharges = ruCharges, LazyDiagnostics = () => feedResponse.QueryMetrics.ToString(), }; diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadNotExistsV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadNotExistsV2BenchmarkOperation.cs index 1d8b99449e..825d10ab60 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadNotExistsV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadNotExistsV2BenchmarkOperation.cs @@ -61,6 +61,7 @@ public async Task ExecuteOnceAsync() { DatabseName = databsaeName, ContainerName = containerName, + OperationType = this.OperationType, RuCharges = dce.RequestCharge, LazyDiagnostics = () => dce.ToString(), }; diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadStreamExistsV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadStreamExistsV2BenchmarkOperation.cs index c7419db811..041d9e4ffd 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadStreamExistsV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadStreamExistsV2BenchmarkOperation.cs @@ -58,6 +58,7 @@ public async Task ExecuteOnceAsync() { DatabseName = databsaeName, ContainerName = containerName, + OperationType = this.OperationType, RuCharges = ruCharges, LazyDiagnostics = () => itemResponse.RequestDiagnosticsString, }; diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadTExistsV2BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadTExistsV2BenchmarkOperation.cs index 7e161f8ffc..7058f07f66 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadTExistsV2BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v2/ReadTExistsV2BenchmarkOperation.cs @@ -59,6 +59,7 @@ public async Task ExecuteOnceAsync() { DatabseName = databsaeName, ContainerName = containerName, + OperationType = this.OperationType, RuCharges = ruCharges, LazyDiagnostics = () => itemResponse.RequestDiagnosticsString, }; diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/InsertV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/InsertV3BenchmarkOperation.cs index 504148bfda..cb3acc5d7b 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/InsertV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/InsertV3BenchmarkOperation.cs @@ -55,6 +55,7 @@ public async Task ExecuteOnceAsync() { DatabseName = databaseName, ContainerName = containerName, + OperationType = this.OperationType, RuCharges = ruCharges, CosmosDiagnostics = itemResponse.Diagnostics, LazyDiagnostics = () => itemResponse.Diagnostics.ToString(), diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/QueryTV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/QueryTV3BenchmarkOperation.cs index f78153034b..a40a8d0834 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/QueryTV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/QueryTV3BenchmarkOperation.cs @@ -108,6 +108,7 @@ private async Task ExecuteOnceAsyncDefault() { DatabseName = databaseName, ContainerName = containerName, + OperationType = this.OperationType, RuCharges = totalCharge, CosmosDiagnostics = lastDiagnostics, LazyDiagnostics = () => lastDiagnostics?.ToString(), diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadFeedStreamV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadFeedStreamV3BenchmarkOperation.cs index 3b9c5cd800..cc69305450 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadFeedStreamV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadFeedStreamV3BenchmarkOperation.cs @@ -59,6 +59,7 @@ public async Task ExecuteOnceAsync() { DatabseName = databsaeName, ContainerName = containerName, + OperationType = this.OperationType, RuCharges = feedResponse.Headers.RequestCharge, CosmosDiagnostics = feedResponse.Diagnostics, LazyDiagnostics = () => feedResponse.Diagnostics.ToString(), diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadNotExistsV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadNotExistsV3BenchmarkOperation.cs index 1804ea9852..c3a24f8dcd 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadNotExistsV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadNotExistsV3BenchmarkOperation.cs @@ -49,6 +49,7 @@ public async Task ExecuteOnceAsync() { DatabseName = databsaeName, ContainerName = containerName, + OperationType = this.OperationType, RuCharges = itemResponse.Headers.RequestCharge, CosmosDiagnostics = itemResponse.Diagnostics, LazyDiagnostics = () => itemResponse.Diagnostics.ToString(), diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsV3BenchmarkOperation.cs index fabe8f20bd..752a773bdc 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsV3BenchmarkOperation.cs @@ -56,6 +56,7 @@ public async Task ExecuteOnceAsync() { DatabseName = databsaeName, ContainerName = containerName, + OperationType = this.OperationType, RuCharges = itemResponse.Headers.RequestCharge, CosmosDiagnostics = itemResponse.Diagnostics, LazyDiagnostics = () => itemResponse.Diagnostics.ToString(), diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsWithDiagnosticsV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsWithDiagnosticsV3BenchmarkOperation.cs index 74f2ac67f7..5963f04c3a 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsWithDiagnosticsV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadStreamExistsWithDiagnosticsV3BenchmarkOperation.cs @@ -62,6 +62,7 @@ public async Task ExecuteOnceAsync() { DatabseName = databsaeName, ContainerName = containerName, + OperationType = this.OperationType, RuCharges = itemResponse.Headers.RequestCharge, CosmosDiagnostics = itemResponse.Diagnostics, LazyDiagnostics = () => itemResponse.Diagnostics.ToString(), diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadTExistsV3BenchmarkOperation.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadTExistsV3BenchmarkOperation.cs index bb6295356e..1a1feccb82 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadTExistsV3BenchmarkOperation.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/v3/ReadTExistsV3BenchmarkOperation.cs @@ -55,6 +55,7 @@ public async Task ExecuteOnceAsync() { DatabseName = databsaeName, ContainerName = containerName, + OperationType = this.OperationType, RuCharges = itemResponse.Headers.RequestCharge, CosmosDiagnostics = itemResponse.Diagnostics, LazyDiagnostics = () => itemResponse.Diagnostics.ToString(), From be0c0981b80c2ba18b73588520a80e9437b289de Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Tue, 12 Sep 2023 16:30:41 +0530 Subject: [PATCH 188/240] first draft (#4079) --- .../Filters/DiagnosticsFilterHelper.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs index 60fb86fa5c..a5ca0215cb 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/Filters/DiagnosticsFilterHelper.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos.Telemetry.Diagnostics { using System; using Documents; + using static Antlr4.Runtime.TokenStreamRewriter; internal static class DiagnosticsFilterHelper { @@ -26,7 +27,9 @@ public static bool IsLatencyThresholdCrossed( } else { - latencyThreshold = operationType == OperationType.Query ? DistributedTracingOptions.DefaultQueryTimeoutThreshold : DistributedTracingOptions.DefaultCrudLatencyThreshold; + latencyThreshold = DiagnosticsFilterHelper.IsPointOperation(operationType) ? + DistributedTracingOptions.DefaultCrudLatencyThreshold : + DistributedTracingOptions.DefaultQueryTimeoutThreshold; } return response.Diagnostics.GetClientElapsedTime() > latencyThreshold; @@ -44,5 +47,19 @@ public static bool IsSuccessfulResponse(OpenTelemetryAttributes response) || (response.StatusCode == System.Net.HttpStatusCode.Conflict && response.SubStatusCode == 0) || (response.StatusCode == System.Net.HttpStatusCode.PreconditionFailed && response.SubStatusCode == 0); } + + /// + /// Check if passed operation type is a point operation + /// + /// + public static bool IsPointOperation(OperationType operationType) + { + return operationType == OperationType.Create || + operationType == OperationType.Delete || + operationType == OperationType.Replace || + operationType == OperationType.Upsert || + operationType == OperationType.Patch || + operationType == OperationType.Read; + } } } From 391c3d9872aff6615c00dffaa313aaa7013b69a0 Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Thu, 14 Sep 2023 14:35:07 -0700 Subject: [PATCH 189/240] Subpartitioning: Fixes bug for queries on subpartitioned containers (#3934) * initial fix, needs testing on prod * test fix * clean up pr * query rework * refactors previous changes * requested changes and bug fixes * nits * requested changes * bug fixes * start of test * added test * nit: changed name of EffectivePartitionKeyRanges to EffectiveRangesForPartitionKey * Address code comments * Address code comments * saving work * addresses code comments * nit, spacing * PartitionKeyHash fixes * Fixes bugs in tests * Removed bad method, added additional test coverage * Removed EffectivePartitionKeyString use * test fix * requested changes * Requested changes * fixed test * Test fix * Added comment --------- Co-authored-by: SrinikhilReddy --- .../CosmosQueryExecutionContextFactory.cs | 94 +++++----- .../QueryClient/ContainerQueryProperties.cs | 11 +- .../Core/QueryClient/CosmosQueryClient.cs | 9 +- .../Query/v3Query/CosmosQueryClientCore.cs | 35 ++-- .../src/Routing/PartitionKeyHash.cs | 30 +++- .../src/Routing/PartitionKeyHashRange.cs | 2 +- .../src/Routing/PartitionKeyHashRanges.cs | 14 +- .../CosmosItemTests.cs | 4 +- .../CosmosQueryClientCoreTest.cs | 2 +- .../PartitionKeyHashBaselineTest.Lists.xml | 32 ++++ .../Microsoft.Azure.Cosmos.Tests.csproj | 3 + .../Pagination/InMemoryContainer.cs | 164 ++++++++++++++---- ...misticDirectExecutionQueryBaselineTests.cs | 23 ++- .../Query/SplitPartitionQueryTests.cs | 77 ++++++++ .../Routing/PartitionKeyHashBaselineTest.cs | 63 +++++++ .../PartitionKeyHashRangeSplitterAndMerger.cs | 49 +++++- 16 files changed, 471 insertions(+), 141 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/PartitionKeyHashBaselineTest.Lists.xml create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/SplitPartitionQueryTests.cs rename Microsoft.Azure.Cosmos/{src => tests/Microsoft.Azure.Cosmos.Tests}/Routing/PartitionKeyHashRangeSplitterAndMerger.cs (73%) diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs index 43ebf6a2d8..01ed10a627 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Pipeline/CosmosQueryExecutionContextFactory.cs @@ -9,6 +9,7 @@ namespace Microsoft.Azure.Cosmos.Query.Core.ExecutionContext using System.Linq; using System.Threading; using System.Threading.Tasks; + using global::Azure; using Microsoft.Azure.Cosmos; using Microsoft.Azure.Cosmos.CosmosElements; using Microsoft.Azure.Cosmos.Pagination; @@ -27,6 +28,7 @@ namespace Microsoft.Azure.Cosmos.Query.Core.ExecutionContext using Microsoft.Azure.Cosmos.SqlObjects; using Microsoft.Azure.Cosmos.SqlObjects.Visitors; using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Documents.Routing; internal static class CosmosQueryExecutionContextFactory { @@ -211,10 +213,10 @@ private static async Task> TryCreateCoreContextAsy // Only thing that matters is that we target the correct range. Documents.PartitionKeyDefinition partitionKeyDefinition = GetPartitionKeyDefinition(inputParameters, containerQueryProperties); - List targetRanges = await cosmosQueryContext.QueryClient.GetTargetPartitionKeyRangesByEpkStringAsync( + List targetRanges = await cosmosQueryContext.QueryClient.GetTargetPartitionKeyRangesAsync( cosmosQueryContext.ResourceLink, containerQueryProperties.ResourceId, - containerQueryProperties.EffectivePartitionKeyString, + containerQueryProperties.EffectiveRangesForPartitionKey, forceRefresh: false, createQueryPipelineTrace); @@ -635,67 +637,54 @@ private static async Task GetPartitionedQueryExec ITrace trace) { List targetRanges; - if (containerQueryProperties.EffectivePartitionKeyString != null) + if (containerQueryProperties.EffectiveRangesForPartitionKey != null) { - targetRanges = await queryClient.GetTargetPartitionKeyRangesByEpkStringAsync( + targetRanges = await queryClient.GetTargetPartitionKeyRangesAsync( resourceLink, containerQueryProperties.ResourceId, - containerQueryProperties.EffectivePartitionKeyString, + containerQueryProperties.EffectiveRangesForPartitionKey, forceRefresh: false, trace); } else if (TryGetEpkProperty(properties, out string effectivePartitionKeyString)) { - targetRanges = await queryClient.GetTargetPartitionKeyRangesByEpkStringAsync( + //Note that here we have no way to consume the EPK string as there is no way to convert + //the string to the partition key type to evaulate the number of components which needs to be done for the + //multihahs methods/classes. This is particually important for queries with prefix partition key. + //the EPK sting header is only for internal use but this needs to be fixed in the future. + List> effectiveRanges = new List> + { Range.GetPointRange(effectivePartitionKeyString) }; + + targetRanges = await queryClient.GetTargetPartitionKeyRangesAsync( resourceLink, containerQueryProperties.ResourceId, - effectivePartitionKeyString, + effectiveRanges, forceRefresh: false, trace); } else if (feedRangeInternal != null) { targetRanges = await queryClient.GetTargetPartitionKeyRangeByFeedRangeAsync( - resourceLink, - containerQueryProperties.ResourceId, - containerQueryProperties.PartitionKeyDefinition, - feedRangeInternal, - forceRefresh: false, - trace); + resourceLink, + containerQueryProperties.ResourceId, + containerQueryProperties.PartitionKeyDefinition, + feedRangeInternal, + forceRefresh: false, + trace); } else { - targetRanges = await queryClient.GetTargetPartitionKeyRangesAsync( - resourceLink, - containerQueryProperties.ResourceId, - partitionedQueryExecutionInfo.QueryRanges, - forceRefresh: false, - trace); + targetRanges = await queryClient.GetTargetPartitionKeyRangesAsync( + resourceLink, + containerQueryProperties.ResourceId, + partitionedQueryExecutionInfo.QueryRanges, + forceRefresh: false, + trace); } return targetRanges; } - private static void SetTestInjectionPipelineType(InputParameters inputParameters, string pipelineType) - { - TestInjections.ResponseStats responseStats = inputParameters?.TestInjections?.Stats; - if (responseStats != null) - { - if (pipelineType == OptimisticDirectExecution) - { - responseStats.PipelineType = TestInjections.PipelineType.OptimisticDirectExecution; - } - else if (pipelineType == Specialized) - { - responseStats.PipelineType = TestInjections.PipelineType.Specialized; - } - else - { - responseStats.PipelineType = TestInjections.PipelineType.Passthrough; - } - } - } - private static bool TryGetEpkProperty( IReadOnlyDictionary properties, out string effectivePartitionKeyString) @@ -718,6 +707,26 @@ private static bool TryGetEpkProperty( return false; } + private static void SetTestInjectionPipelineType(InputParameters inputParameters, string pipelineType) + { + TestInjections.ResponseStats responseStats = inputParameters?.TestInjections?.Stats; + if (responseStats != null) + { + if (pipelineType == OptimisticDirectExecution) + { + responseStats.PipelineType = TestInjections.PipelineType.OptimisticDirectExecution; + } + else if (pipelineType == Specialized) + { + responseStats.PipelineType = TestInjections.PipelineType.Specialized; + } + else + { + responseStats.PipelineType = TestInjections.PipelineType.Passthrough; + } + } + } + private static Documents.PartitionKeyDefinition GetPartitionKeyDefinition(InputParameters inputParameters, ContainerQueryProperties containerQueryProperties) { //todo:elasticcollections this may rely on information from collection cache which is outdated @@ -781,14 +790,13 @@ private static Documents.PartitionKeyDefinition GetPartitionKeyDefinition(InputP else { Documents.PartitionKeyDefinition partitionKeyDefinition = GetPartitionKeyDefinition(inputParameters, containerQueryProperties); - if (inputParameters.PartitionKey != null) + if (inputParameters.PartitionKey.HasValue) { Debug.Assert(partitionKeyDefinition != null, "CosmosQueryExecutionContextFactory Assert!", "PartitionKeyDefinition cannot be null if partitionKey is defined"); - - targetRanges = await cosmosQueryContext.QueryClient.GetTargetPartitionKeyRangesByEpkStringAsync( + targetRanges = await cosmosQueryContext.QueryClient.GetTargetPartitionKeyRangesAsync( cosmosQueryContext.ResourceLink, containerQueryProperties.ResourceId, - containerQueryProperties.EffectivePartitionKeyString, + containerQueryProperties.EffectiveRangesForPartitionKey, forceRefresh: false, trace); } diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/ContainerQueryProperties.cs b/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/ContainerQueryProperties.cs index 0baaceb9c6..279b7585b9 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/ContainerQueryProperties.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/ContainerQueryProperties.cs @@ -4,24 +4,29 @@ namespace Microsoft.Azure.Cosmos.Query.Core.QueryClient { + using System.Collections.Generic; using Microsoft.Azure.Documents; + using Microsoft.Azure.Documents.Routing; internal readonly struct ContainerQueryProperties { public ContainerQueryProperties( string resourceId, - string effectivePartitionKeyString, + IReadOnlyList> effectivePartitionKeyRanges, PartitionKeyDefinition partitionKeyDefinition, Cosmos.GeospatialType geospatialType) { this.ResourceId = resourceId; - this.EffectivePartitionKeyString = effectivePartitionKeyString; + this.EffectiveRangesForPartitionKey = effectivePartitionKeyRanges; this.PartitionKeyDefinition = partitionKeyDefinition; this.GeospatialType = geospatialType; } public string ResourceId { get; } - public string EffectivePartitionKeyString { get; } + + //A PartitionKey has one range when it is a full PartitionKey value. + //It can span many it is a prefix PartitionKey for a sub-partitioned container. + public IReadOnlyList> EffectiveRangesForPartitionKey { get; } public PartitionKeyDefinition PartitionKeyDefinition { get; } public Cosmos.GeospatialType GeospatialType { get; } } diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs b/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs index 3fa4cb90e7..d9dc0ac976 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/QueryClient/CosmosQueryClient.cs @@ -76,13 +76,6 @@ public abstract Task ExecuteQueryPlanRequestAsync public abstract void ClearSessionTokenCache(string collectionFullName); - public abstract Task> GetTargetPartitionKeyRangesByEpkStringAsync( - string resourceLink, - string collectionResourceId, - string effectivePartitionKeyString, - bool forceRefresh, - ITrace trace); - public abstract Task> GetTargetPartitionKeyRangeByFeedRangeAsync( string resourceLink, string collectionResourceId, @@ -94,7 +87,7 @@ public abstract Task ExecuteQueryPlanRequestAsync public abstract Task> GetTargetPartitionKeyRangesAsync( string resourceLink, string collectionResourceId, - List> providedRanges, + IReadOnlyList> providedRanges, bool forceRefresh, ITrace trace); diff --git a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs index cce1a5268a..a392632649 100644 --- a/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs +++ b/Microsoft.Azure.Cosmos/src/Query/v3Query/CosmosQueryClientCore.cs @@ -63,17 +63,26 @@ public override async Task GetCachedContainerQueryProp trace, cancellationToken); - string effectivePartitionKeyString = null; + List> effectivePartitionKeyRange = null; if (partitionKey != null) { // Dis-ambiguate the NonePK if used PartitionKeyInternal partitionKeyInternal = partitionKey.Value.IsNone ? containerProperties.GetNoneValue() : partitionKey.Value.InternalKey; - effectivePartitionKeyString = partitionKeyInternal.GetEffectivePartitionKeyString(containerProperties.PartitionKey); + effectivePartitionKeyRange = new List> + { + PartitionKeyInternal.GetEffectivePartitionKeyRange( + containerProperties.PartitionKey, + new Range( + min: partitionKeyInternal, + max: partitionKeyInternal, + isMinInclusive: true, + isMaxInclusive: true)) + }; } return new ContainerQueryProperties( containerProperties.ResourceId, - effectivePartitionKeyString, + effectivePartitionKeyRange, containerProperties.PartitionKey, containerProperties.GeospatialConfig.GeospatialType); } @@ -200,24 +209,6 @@ public override async Task ExecuteQueryPlanReques return partitionedQueryExecutionInfo; } - public override Task> GetTargetPartitionKeyRangesByEpkStringAsync( - string resourceLink, - string collectionResourceId, - string effectivePartitionKeyString, - bool forceRefresh, - ITrace trace) - { - return this.GetTargetPartitionKeyRangesAsync( - resourceLink, - collectionResourceId, - new List> - { - Range.GetPointRange(effectivePartitionKeyString) - }, - forceRefresh, - trace); - } - public override async Task> GetTargetPartitionKeyRangeByFeedRangeAsync( string resourceLink, string collectionResourceId, @@ -243,7 +234,7 @@ public override async Task> GetTargetPartitionKeyRangeBy public override async Task> GetTargetPartitionKeyRangesAsync( string resourceLink, string collectionResourceId, - List> providedRanges, + IReadOnlyList> providedRanges, bool forceRefresh, ITrace trace) { diff --git a/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyHash.cs b/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyHash.cs index 42ef970915..0d7189abb2 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyHash.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyHash.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.Cosmos.Routing { using System; - using System.Runtime.CompilerServices; + using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using Microsoft.Azure.Documents.Routing; @@ -35,12 +35,34 @@ namespace Microsoft.Azure.Cosmos.Routing /// internal readonly struct PartitionKeyHash : IComparable, IEquatable { + private readonly IReadOnlyList values; + public PartitionKeyHash(UInt128 value) + : this(new UInt128[] { value }) { - this.Value = value; } - public UInt128 Value { get; } + public PartitionKeyHash(UInt128[] values) + { + StringBuilder stringBuilder = new StringBuilder(); + foreach (UInt128 value in values) + { + if (stringBuilder.Length > 0) + { + stringBuilder.Append('-'); + } + stringBuilder.Append(value.ToString()); + } + + this.Value = stringBuilder.ToString(); + this.values = values; + } + + public readonly static PartitionKeyHash None = new PartitionKeyHash(0); + + public string Value { get; } + + internal readonly IReadOnlyList HashValues => this.values; public int CompareTo(PartitionKeyHash other) { @@ -66,7 +88,7 @@ public override bool Equals(object obj) public override int GetHashCode() => this.Value.GetHashCode(); - public override string ToString() => this.Value.ToString(); + public override string ToString() => this.Value; public static bool TryParse(string value, out PartitionKeyHash parsedValue) { diff --git a/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyHashRange.cs b/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyHashRange.cs index 21e257b49a..7e8265e470 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyHashRange.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyHashRange.cs @@ -181,4 +181,4 @@ public override string ToString() return stringBuilder.ToString(); } } -} +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyHashRanges.cs b/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyHashRanges.cs index a927fcba87..f15556a23d 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyHashRanges.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyHashRanges.cs @@ -132,9 +132,9 @@ public static CreateOutcome TryCreate( { if (partitionKeyHashRange.StartInclusive.HasValue) { - if (partitionKeyHashRange.StartInclusive.Value.Value < minStart) + if (partitionKeyHashRange.StartInclusive.Value.HashValues[0] < minStart) { - minStart = partitionKeyHashRange.StartInclusive.Value.Value; + minStart = partitionKeyHashRange.StartInclusive.Value.HashValues[0]; } } else @@ -144,9 +144,9 @@ public static CreateOutcome TryCreate( if (partitionKeyHashRange.EndExclusive.HasValue) { - if (partitionKeyHashRange.EndExclusive.Value.Value > maxEnd) + if (partitionKeyHashRange.EndExclusive.Value.HashValues[0] > maxEnd) { - maxEnd = partitionKeyHashRange.EndExclusive.Value.Value; + maxEnd = partitionKeyHashRange.EndExclusive.Value.HashValues[0]; } } else @@ -154,8 +154,8 @@ public static CreateOutcome TryCreate( maxEnd = UInt128.MaxValue; } - UInt128 width = partitionKeyHashRange.EndExclusive.GetValueOrDefault(new PartitionKeyHash(UInt128.MaxValue)).Value - - partitionKeyHashRange.StartInclusive.GetValueOrDefault(new PartitionKeyHash(UInt128.MinValue)).Value; + UInt128 width = partitionKeyHashRange.EndExclusive.GetValueOrDefault(new PartitionKeyHash(UInt128.MaxValue)).HashValues[0] + - partitionKeyHashRange.StartInclusive.GetValueOrDefault(new PartitionKeyHash(UInt128.MinValue)).HashValues[0]; sumOfWidth += width; if (sumOfWidth < width) { @@ -223,4 +223,4 @@ public enum CreateOutcome Success, } } -} +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs index dd09fde938..607b552b83 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosItemTests.cs @@ -1664,7 +1664,6 @@ public async Task EpkPointReadTest() epk = new PartitionKey("test") .InternalKey .GetEffectivePartitionKeyString(this.containerSettings.PartitionKey); - properties = new Dictionary() { { WFConstants.BackendHeaders.EffectivePartitionKeyString, epk }, @@ -1714,9 +1713,11 @@ public async Task ItemEpkQuerySingleKeyRangeValidation() // If this fails the RUs of the container needs to be increased to ensure at least 2 partitions. Assert.IsTrue(ranges.Count > 1, " RUs of the container needs to be increased to ensure at least 2 partitions."); + ContainerQueryProperties containerQueryProperties = new ContainerQueryProperties( containerResponse.Resource.ResourceId, null, + //new List> { new Documents.Routing.Range("AA", "AA", true, true) }, containerResponse.Resource.PartitionKey, containerResponse.Resource.GeospatialConfig.GeospatialType); @@ -1734,6 +1735,7 @@ public async Task ItemEpkQuerySingleKeyRangeValidation() trace: NoOpTrace.Singleton); Assert.IsTrue(partitionKeyRanges.Count == 1, "Only 1 partition key range should be selected since the EPK option is set."); + } finally { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosQueryClientCoreTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosQueryClientCoreTest.cs index 21a8b4ad59..3f325eef9a 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosQueryClientCoreTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosQueryClientCoreTest.cs @@ -51,7 +51,7 @@ public async Task TryGetOverlappingRangesAsyncTest() Assert.IsNotNull(containerProperties); Assert.IsNotNull(containerProperties.ResourceId); - Assert.IsNotNull(containerProperties.EffectivePartitionKeyString); + Assert.IsNotNull(containerProperties.EffectiveRangesForPartitionKey); IReadOnlyList pkRange = await this.queryClientCore.TryGetOverlappingRangesAsync( collectionResourceId: containerProperties.ResourceId, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/PartitionKeyHashBaselineTest.Lists.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/PartitionKeyHashBaselineTest.Lists.xml new file mode 100644 index 0000000000..3f7faa9f26 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/PartitionKeyHashBaselineTest.Lists.xml @@ -0,0 +1,32 @@ + + + + 1 Path List + ["/path1"] + + + 00-00-00-00-00-00-00-00-00-00-00-00-0A-A1-CC-05 + B6-3D-B6-C4-3A-4F-1B-01-4C-63-B0-C2-E6-28-E8-12 + + + + + 2 Path List + ["/path1","/path2"] + + + 00-00-00-00-00-00-00-00-00-00-00-00-0A-A1-CC-05-00-00-00-00-00-00-00-00-00-00-00-00-C9-1E-F0-78 + B6-3D-B6-C4-3A-4F-1B-01-4C-63-B0-C2-E6-28-E8-12-A6-0C-6C-BE-5A-2D-38-6E-5D-AE-1A-AC-94-21-6B-6C + + + + + 3 Path List + ["/path1","/path2","/path3"] + + + 00-00-00-00-00-00-00-00-00-00-00-00-0A-A1-CC-05-00-00-00-00-00-00-00-00-00-00-00-00-C9-1E-F0-78-00-00-00-00-00-00-00-00-00-00-00-00-9A-B4-68-CD + B6-3D-B6-C4-3A-4F-1B-01-4C-63-B0-C2-E6-28-E8-12-A6-0C-6C-BE-5A-2D-38-6E-5D-AE-1A-AC-94-21-6B-6C-88-A6-18-5D-2D-D5-1C-96-D0-47-75-B7-2E-FA-BE-08 + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj index 4d25f7e5a7..5b429468d8 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj @@ -115,6 +115,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Pagination/InMemoryContainer.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Pagination/InMemoryContainer.cs index f2201d3cc4..5c6e8961e7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Pagination/InMemoryContainer.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Pagination/InMemoryContainer.cs @@ -31,6 +31,7 @@ namespace Microsoft.Azure.Cosmos.Tests.Pagination using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; using ResourceIdentifier = Cosmos.Pagination.ResourceIdentifier; + using UInt128 = UInt128; // Collection useful for mocking requests and repartitioning (splits / merge). internal class InMemoryContainer : IMonadicDocumentContainer @@ -280,8 +281,8 @@ static Task> CreateNotFoundException(CosmosElement partitionKey requestCharge: 42))); } - PartitionKeyHash partitionKeyHash = GetHashFromPartitionKey( - partitionKey, + PartitionKeyHash partitionKeyHash = GetHashFromPartitionKeys( + new List { partitionKey }, this.partitionKeyDefinition); if (!this.partitionedRecords.TryGetValue(partitionKeyHash, out Records records)) @@ -797,9 +798,20 @@ public Task MonadicSplitAsync( } // Split the range space - PartitionKeyHashRanges partitionKeyHashRanges = PartitionKeyHashRangeSplitterAndMerger.SplitRange( - parentRange, - rangeCount: 2); + PartitionKeyHashRanges partitionKeyHashRanges; + if (this.partitionKeyDefinition.Kind == PartitionKind.MultiHash && + this.partitionKeyDefinition.Paths.Count > 1) + { + //For MultiHash, to help with testing we will split using the median partition key among documents. + PartitionKeyHash midPoint = this.ComputeMedianSplitPointAmongDocumentsInPKRange(parentRange); + partitionKeyHashRanges = PartitionKeyHashRangeSplitterAndMerger.SplitRange(parentRange, midPoint); + } + else + { + partitionKeyHashRanges = PartitionKeyHashRangeSplitterAndMerger.SplitRange( + parentRange, + rangeCount: 2); + } // Update the partition routing map int maxPartitionKeyRangeId = this.partitionKeyRangeIdToHashRange.Keys.Max(); @@ -1084,16 +1096,16 @@ private static PartitionKeyHash GetHashFromPayload( CosmosObject payload, PartitionKeyDefinition partitionKeyDefinition) { - CosmosElement partitionKey = GetPartitionKeyFromPayload(payload, partitionKeyDefinition); - return GetHashFromPartitionKey(partitionKey, partitionKeyDefinition); + IList partitionKey = GetPartitionKeysFromPayload(payload, partitionKeyDefinition); + return GetHashFromPartitionKeys(partitionKey, partitionKeyDefinition); } private static PartitionKeyHash GetHashFromObjectModel( Cosmos.PartitionKey payload, PartitionKeyDefinition partitionKeyDefinition) { - CosmosElement partitionKey = GetPartitionKeyFromObjectModel(payload); - return GetHashFromPartitionKey(partitionKey, partitionKeyDefinition); + IList partitionKeys = GetPartitionKeysFromObjectModel(payload); + return GetHashFromPartitionKeys(partitionKeys, partitionKeyDefinition); } private static CosmosElement GetPartitionKeyFromPayload(CosmosObject payload, PartitionKeyDefinition partitionKeyDefinition) @@ -1131,23 +1143,56 @@ private static CosmosElement GetPartitionKeyFromPayload(CosmosObject payload, Pa return partitionKey; } - private static CosmosElement GetPartitionKeyFromObjectModel(Cosmos.PartitionKey payload) + private static IList GetPartitionKeysFromPayload(CosmosObject payload, PartitionKeyDefinition partitionKeyDefinition) { - CosmosArray partitionKeyPayload = CosmosArray.Parse(payload.ToJsonString()); - if (partitionKeyPayload.Count != 1) + // Restrict the partition key definition for now to keep things simple + if (partitionKeyDefinition.Kind != PartitionKind.MultiHash && partitionKeyDefinition.Kind != PartitionKind.Hash) { - throw new ArgumentOutOfRangeException("Can only support a single partition key path."); + throw new ArgumentOutOfRangeException("Can only support Hash/MultiHash partitioning"); + } + + if (partitionKeyDefinition.Version != Documents.PartitionKeyDefinitionVersion.V2) + { + throw new ArgumentOutOfRangeException("Can only support hash v2"); + } + + IList cosmosElements = new List(); + foreach (string partitionKeyPath in partitionKeyDefinition.Paths) + { + IEnumerable tokens = partitionKeyPath.Split("/").Skip(1); + CosmosElement partitionKey = payload; + foreach (string token in tokens) + { + if (partitionKey != default) + { + if (!payload.TryGetValue(token, out partitionKey)) + { + partitionKey = default; + } + } + } + cosmosElements.Add(partitionKey); } + return cosmosElements; + } - return partitionKeyPayload[0]; + private static IList GetPartitionKeysFromObjectModel(Cosmos.PartitionKey payload) + { + CosmosArray partitionKeyPayload = CosmosArray.Parse(payload.ToJsonString()); + List cosmosElemementPayload = new List(); + foreach (CosmosElement element in partitionKeyPayload) + { + cosmosElemementPayload.Add(element); + } + return cosmosElemementPayload; } - private static PartitionKeyHash GetHashFromPartitionKey(CosmosElement partitionKey, PartitionKeyDefinition partitionKeyDefinition) + private static PartitionKeyHash GetHashFromPartitionKeys(IList partitionKeys, PartitionKeyDefinition partitionKeyDefinition) { // Restrict the partition key definition for now to keep things simple - if (partitionKeyDefinition.Kind != PartitionKind.Hash) + if (partitionKeyDefinition.Kind != PartitionKind.MultiHash && partitionKeyDefinition.Kind != PartitionKind.Hash) { - throw new ArgumentOutOfRangeException("Can only support hash partitioning"); + throw new ArgumentOutOfRangeException("Can only support Hash/MultiHash partitioning"); } if (partitionKeyDefinition.Version != Documents.PartitionKeyDefinitionVersion.V2) @@ -1155,21 +1200,41 @@ private static PartitionKeyHash GetHashFromPartitionKey(CosmosElement partitionK throw new ArgumentOutOfRangeException("Can only support hash v2"); } - if (partitionKeyDefinition.Paths.Count != 1) + IList partitionKeyHashValues = new List(); + + foreach (CosmosElement partitionKey in partitionKeys) { - throw new ArgumentOutOfRangeException("Can only support a single partition key path."); + if (partitionKey is CosmosArray cosmosArray) + { + foreach (CosmosElement element in cosmosArray) + { + PartitionKeyHash elementHash = element switch + { + null => PartitionKeyHash.V2.HashUndefined(), + CosmosString stringPartitionKey => PartitionKeyHash.V2.Hash(stringPartitionKey.Value), + CosmosNumber numberPartitionKey => PartitionKeyHash.V2.Hash(Number64.ToDouble(numberPartitionKey.Value)), + CosmosBoolean cosmosBoolean => PartitionKeyHash.V2.Hash(cosmosBoolean.Value), + CosmosNull _ => PartitionKeyHash.V2.HashNull(), + _ => throw new ArgumentOutOfRangeException(), + }; + partitionKeyHashValues.Add(elementHash.HashValues[0]); + } + continue; + } + + PartitionKeyHash partitionKeyHash = partitionKey switch + { + null => PartitionKeyHash.V2.HashUndefined(), + CosmosString stringPartitionKey => PartitionKeyHash.V2.Hash(stringPartitionKey.Value), + CosmosNumber numberPartitionKey => PartitionKeyHash.V2.Hash(Number64.ToDouble(numberPartitionKey.Value)), + CosmosBoolean cosmosBoolean => PartitionKeyHash.V2.Hash(cosmosBoolean.Value), + CosmosNull _ => PartitionKeyHash.V2.HashNull(), + _ => throw new ArgumentOutOfRangeException(), + }; + partitionKeyHashValues.Add(partitionKeyHash.HashValues[0]); } - PartitionKeyHash partitionKeyHash = partitionKey switch - { - null => PartitionKeyHash.V2.HashUndefined(), - CosmosString stringPartitionKey => PartitionKeyHash.V2.Hash(stringPartitionKey.Value), - CosmosNumber numberPartitionKey => PartitionKeyHash.V2.Hash(Number64.ToDouble(numberPartitionKey.Value)), - CosmosBoolean cosmosBoolean => PartitionKeyHash.V2.Hash(cosmosBoolean.Value), - CosmosNull _ => PartitionKeyHash.V2.HashNull(), - _ => throw new ArgumentOutOfRangeException(), - }; - return partitionKeyHash; + return new PartitionKeyHash(partitionKeyHashValues.ToArray()); } private static CosmosObject ConvertRecordToCosmosElement(Record record) @@ -1196,9 +1261,16 @@ private static bool IsRecordWithinFeedRange( { if (feedRange is FeedRangePartitionKey feedRangePartitionKey) { - CosmosElement partitionKey = GetPartitionKeyFromObjectModel(feedRangePartitionKey.PartitionKey); - CosmosElement partitionKeyFromRecord = GetPartitionKeyFromPayload(record.Payload, partitionKeyDefinition); - return partitionKey.Equals(partitionKeyFromRecord); + IList partitionKey = GetPartitionKeysFromObjectModel(feedRangePartitionKey.PartitionKey); + IList partitionKeyFromRecord = GetPartitionKeysFromPayload(record.Payload, partitionKeyDefinition); + if (partitionKeyDefinition.Kind == PartitionKind.MultiHash) + { + PartitionKeyHash partitionKeyHash = GetHashFromPartitionKeys(partitionKey, partitionKeyDefinition); + PartitionKeyHash partitionKeyFromRecordHash = GetHashFromPartitionKeys(partitionKeyFromRecord, partitionKeyDefinition); + + return partitionKeyHash.Equals(partitionKeyFromRecordHash) || partitionKeyFromRecordHash.Value.StartsWith(partitionKeyHash.Value); + } + return partitionKey.SequenceEqual(partitionKeyFromRecord); } else if (feedRange is FeedRangeEpk feedRangeEpk) { @@ -1301,6 +1373,32 @@ private static FeedRangeEpk HashRangeToFeedRangeEpk(PartitionKeyHashRange hashRa isMaxInclusive: false)); } + private PartitionKeyHash ComputeMedianSplitPointAmongDocumentsInPKRange(PartitionKeyHashRange hashRange) + { + if (!this.partitionedRecords.TryGetValue(hashRange, out Records parentRecords)) + { + throw new InvalidOperationException("failed to find the range."); + } + + List partitionKeyHashes = new List(); + foreach (Record record in parentRecords) + { + PartitionKeyHash partitionKeyHash = GetHashFromPayload(record.Payload, this.partitionKeyDefinition); + partitionKeyHashes.Add(partitionKeyHash); + } + + partitionKeyHashes.Sort(); + PartitionKeyHash medianPkHash = partitionKeyHashes[partitionKeyHashes.Count / 2]; + + // For MultiHash Collection, split at top level to ensure documents for top level key exist across partitions + // after split + if (medianPkHash.HashValues.Count > 1) + { + return new PartitionKeyHash(medianPkHash.HashValues[0]); + } + + return medianPkHash; + } public Task> MonadicGetResourceIdentifierAsync(ITrace trace, CancellationToken cancellationToken) { return Task.FromResult(TryCatch.FromResult("AYIMAMmFOw8YAAAAAAAAAA==")); @@ -1516,4 +1614,4 @@ public SqlScalarExpression Visit(CosmosUndefined cosmosUndefined) } } } -} +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs index 5c0e66f1a6..cc4a2c7718 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/OptimisticDirectExecutionQueryBaselineTests.cs @@ -1003,9 +1003,16 @@ public override Task ForceRefreshCollectionCacheAsync(string collectionLink, Can public override Task GetCachedContainerQueryPropertiesAsync(string containerLink, Cosmos.PartitionKey? partitionKey, ITrace trace, CancellationToken cancellationToken) { - return Task.FromResult(new ContainerQueryProperties( + return Task.FromResult(new ContainerQueryProperties( "test", - WFConstants.BackendHeaders.EffectivePartitionKeyString, + new List> + { + new Range( + PartitionKeyInternal.MinimumInclusiveEffectivePartitionKey, + PartitionKeyInternal.MaximumExclusiveEffectivePartitionKey, + true, + true) + }, new PartitionKeyDefinition(), Cosmos.GeospatialType.Geometry)); } @@ -1015,17 +1022,7 @@ public override Task> GetTargetPartitionKeyRangeByFeedRa throw new NotImplementedException(); } - public override Task> GetTargetPartitionKeyRangesAsync(string resourceLink, string collectionResourceId, List> providedRanges, bool forceRefresh, ITrace trace) - { - return Task.FromResult(new List{new PartitionKeyRange() - { - MinInclusive = PartitionKeyInternal.MinimumInclusiveEffectivePartitionKey, - MaxExclusive = PartitionKeyInternal.MaximumExclusiveEffectivePartitionKey - } - }); - } - - public override Task> GetTargetPartitionKeyRangesByEpkStringAsync(string resourceLink, string collectionResourceId, string effectivePartitionKeyString, bool forceRefresh, ITrace trace) + public override Task> GetTargetPartitionKeyRangesAsync(string resourceLink, string collectionResourceId, IReadOnlyList> providedRanges, bool forceRefresh, ITrace trace) { return Task.FromResult(new List{new PartitionKeyRange() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/SplitPartitionQueryTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/SplitPartitionQueryTests.cs new file mode 100644 index 0000000000..4dd4ed1bd8 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/SplitPartitionQueryTests.cs @@ -0,0 +1,77 @@ +namespace Microsoft.Azure.Cosmos.Tests.Query +{ + using System; + using System.Threading.Tasks; + using Microsoft.Azure.Cosmos.Pagination; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using Microsoft.Azure.Documents; + using Microsoft.Azure.Cosmos.Tests.Pagination; + using Microsoft.Azure.Cosmos.CosmosElements; + using Microsoft.Azure.Cosmos.Query.Core.Monads; + using Microsoft.Azure.Cosmos.Tracing; + using Microsoft.Azure.Cosmos.Query.Core.Pipeline.Pagination; + + [TestClass] + public class SplitPartitionQueryTests + { + [TestMethod] + public async Task PrefixPartitionKeyQueryOnSplitParitionTest() + { + int numItems = 500; + IDocumentContainer documentContainer = await CreateSplitDocumentContainerAsync(numItems); + + string query = "SELECT * FROM c"; + for(int i = 0; i < 5; i++) + { + Cosmos.PartitionKey partitionKey = new PartitionKeyBuilder() + .Add(i.ToString()) + .Build(); + + QueryPage queryPage = await documentContainer.QueryAsync( + sqlQuerySpec: new Cosmos.Query.Core.SqlQuerySpec(query), + feedRangeState: new FeedRangeState(new FeedRangePartitionKey(partitionKey), state: null), + queryPaginationOptions: new QueryPaginationOptions(pageSizeHint: int.MaxValue), + trace: NoOpTrace.Singleton, + cancellationToken: default); + + Assert.AreEqual(numItems / 5, queryPage.Documents.Count); + } + } + + private static async Task CreateSplitDocumentContainerAsync(int numItems) + { + PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition() + { + Paths = new System.Collections.ObjectModel.Collection() + { + "/id", + "/value1", + "/value2" + }, + Kind = PartitionKind.MultiHash, + Version = PartitionKeyDefinitionVersion.V2, + }; + + IMonadicDocumentContainer monadicDocumentContainer = new InMemoryContainer(partitionKeyDefinition); + DocumentContainer documentContainer = new DocumentContainer(monadicDocumentContainer); + + for (int i = 0; i < numItems; i++) + { + // Insert an item + CosmosObject item = CosmosObject.Parse($"{{\"id\" : \"{i%5}\", \"value1\" : \"{Guid.NewGuid()}\", \"value2\" : \"{i}\" }}"); + while (true) + { + TryCatch monadicCreateRecord = await documentContainer.MonadicCreateItemAsync(item, cancellationToken: default); + if (monadicCreateRecord.Succeeded) + { + break; + } + } + } + + await documentContainer.SplitAsync(FeedRangeEpk.FullRange, cancellationToken: default); + + return documentContainer; + } + } +} diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionKeyHashBaselineTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionKeyHashBaselineTest.cs index 4fb7b5b53f..f60d0849ca 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionKeyHashBaselineTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionKeyHashBaselineTest.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos.Tests.Routing { using System; using System.Collections.Generic; + using System.Linq; using System.Numerics; using System.Xml; using Microsoft.Azure.Cosmos.CosmosElements; @@ -126,6 +127,37 @@ public void Numbers() this.ExecuteTestSuite(inputs); } + [TestMethod] + public void Lists() + { + List inputs = new List() + { + new Input( + description: "1 Path List", + partitionKeyValue: CosmosArray.Create(new List() + { + CosmosString.Create("/path1") + })), + new Input( + description: "2 Path List", + partitionKeyValue: CosmosArray.Create(new List() + { + CosmosString.Create("/path1"), + CosmosString.Create("/path2") + })), + new Input( + description: "3 Path List", + partitionKeyValue: CosmosArray.Create(new List() + { + CosmosString.Create("/path1"), + CosmosString.Create("/path2"), + CosmosString.Create("/path3") + })), + }; + + this.ExecuteTestSuite(inputs); + } + public override Output ExecuteTest(Input input) { CosmosElement value = input.PartitionKeyValue; @@ -159,7 +191,38 @@ public override Output ExecuteTest(Input input) partitionKeyHashV1 = PartitionKeyHash.V1.Hash(Number64.ToDouble(cosmosNumber.Value)); partitionKeyHashV2 = PartitionKeyHash.V2.Hash(Number64.ToDouble(cosmosNumber.Value)); break; + case CosmosArray cosmosArray: + IList partitionKeyHashValuesV1 = new List(); + IList partitionKeyHashValuesV2 = new List(); + foreach (CosmosElement element in cosmosArray) + { + PartitionKeyHash elementHashV1 = element switch + { + null => PartitionKeyHash.V2.HashUndefined(), + CosmosString stringPartitionKey => PartitionKeyHash.V1.Hash(stringPartitionKey.Value), + CosmosNumber numberPartitionKey => PartitionKeyHash.V1.Hash(Number64.ToDouble(numberPartitionKey.Value)), + CosmosBoolean cosmosBoolean => PartitionKeyHash.V1.Hash(cosmosBoolean.Value), + CosmosNull _ => PartitionKeyHash.V1.HashNull(), + _ => throw new ArgumentOutOfRangeException(), + }; + partitionKeyHashValuesV1.Add(elementHashV1.HashValues[0]); + + PartitionKeyHash elementHashV2 = element switch + { + null => PartitionKeyHash.V2.HashUndefined(), + CosmosString stringPartitionKey => PartitionKeyHash.V2.Hash(stringPartitionKey.Value), + CosmosNumber numberPartitionKey => PartitionKeyHash.V2.Hash(Number64.ToDouble(numberPartitionKey.Value)), + CosmosBoolean cosmosBoolean => PartitionKeyHash.V2.Hash(cosmosBoolean.Value), + CosmosNull _ => PartitionKeyHash.V2.HashNull(), + _ => throw new ArgumentOutOfRangeException(), + }; + partitionKeyHashValuesV2.Add(elementHashV2.HashValues[0]); + } + + partitionKeyHashV1 = new PartitionKeyHash(partitionKeyHashValuesV1.ToArray()); + partitionKeyHashV2 = new PartitionKeyHash(partitionKeyHashValuesV2.ToArray()); + break; default: throw new ArgumentOutOfRangeException($"Unknown {nameof(CosmosElement)} type: {value.GetType()}."); } diff --git a/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyHashRangeSplitterAndMerger.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionKeyHashRangeSplitterAndMerger.cs similarity index 73% rename from Microsoft.Azure.Cosmos/src/Routing/PartitionKeyHashRangeSplitterAndMerger.cs rename to Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionKeyHashRangeSplitterAndMerger.cs index 54b72ae3a2..af005b1515 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/PartitionKeyHashRangeSplitterAndMerger.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Routing/PartitionKeyHashRangeSplitterAndMerger.cs @@ -39,8 +39,8 @@ public static SplitOutcome TrySplitRange(PartitionKeyHashRange partitionKeyHashR return SplitOutcome.NumRangesNeedsToBeGreaterThanZero; } - UInt128 actualEnd = partitionKeyHashRange.EndExclusive.HasValue ? partitionKeyHashRange.EndExclusive.Value.Value : UInt128.MaxValue; - UInt128 actualStart = partitionKeyHashRange.StartInclusive.HasValue ? partitionKeyHashRange.StartInclusive.Value.Value : UInt128.MinValue; + UInt128 actualEnd = partitionKeyHashRange.EndExclusive.HasValue ? partitionKeyHashRange.EndExclusive.Value.HashValues[0] : UInt128.MaxValue; + UInt128 actualStart = partitionKeyHashRange.StartInclusive.HasValue ? partitionKeyHashRange.StartInclusive.Value.HashValues[0] : UInt128.MinValue; UInt128 rangeLength = actualEnd - actualStart; if (rangeLength < rangeCount) { @@ -67,7 +67,7 @@ public static SplitOutcome TrySplitRange(PartitionKeyHashRange partitionKeyHashR for (int i = 1; i < rangeCount - 1; i++) { PartitionKeyHash start = new PartitionKeyHash(actualStart + (childRangeLength * i)); - PartitionKeyHash end = new PartitionKeyHash(start.Value + childRangeLength); + PartitionKeyHash end = new PartitionKeyHash(start.HashValues[0] + childRangeLength); childRanges.Add(new PartitionKeyHashRange(start, end)); } @@ -82,6 +82,39 @@ public static SplitOutcome TrySplitRange(PartitionKeyHashRange partitionKeyHashR return SplitOutcome.Success; } + public static PartitionKeyHashRanges SplitRange(PartitionKeyHashRange partitionKeyHashRange, PartitionKeyHash explicitSplitPoint) + { + SplitOutcome splitOutcome = PartitionKeyHashRangeSplitterAndMerger.TrySplitRange( + partitionKeyHashRange, + explicitSplitPoint, + out PartitionKeyHashRanges splitRanges); + + return splitOutcome switch + { + SplitOutcome.Success => splitRanges, + _ => throw new RangeSplitException($"Splitting range failed because {splitOutcome}"), + }; + } + + public static SplitOutcome TrySplitRange(PartitionKeyHashRange partitionKeyHashRange, PartitionKeyHash explicitSplitPoint, out PartitionKeyHashRanges splitRanges) + { + if (explicitSplitPoint < (partitionKeyHashRange.StartInclusive != null ? partitionKeyHashRange.StartInclusive : PartitionKeyHash.None) || + explicitSplitPoint > partitionKeyHashRange.EndExclusive) + { + splitRanges = default; + return SplitOutcome.RangeNotWideEnough; + } + + IList childRanges = new List + { + new PartitionKeyHashRange(partitionKeyHashRange.StartInclusive, explicitSplitPoint), + new PartitionKeyHashRange(explicitSplitPoint, partitionKeyHashRange.EndExclusive) + }; + + splitRanges = PartitionKeyHashRanges.Create(childRanges); + return SplitOutcome.Success; + } + public static PartitionKeyHashRange MergeRanges(PartitionKeyHashRanges partitionedSortedEffectiveRanges) { if (partitionedSortedEffectiveRanges == null) @@ -111,7 +144,13 @@ private sealed class V2 : PartitionKeyHashRangeSplitterAndMerger public override PartitionKeyHashRange FullRange => PartitionKeyHashRangeSplitterAndMerger.V2.fullRange; } - + private sealed class RangeSplitException : Exception + { + public RangeSplitException(string message) + : base(message) + { + } + } public enum SplitOutcome { Success, @@ -119,4 +158,4 @@ public enum SplitOutcome RangeNotWideEnough, } } -} +} \ No newline at end of file From 0a0e5ae69dc942d1625d3454a8d51467493d9e96 Mon Sep 17 00:00:00 2001 From: leminh98 Date: Thu, 14 Sep 2023 23:51:18 -0700 Subject: [PATCH 190/240] [Internal] Query: Fixes LINQ Test Organization (#4076) * preliminary change * Add some more boiler plate code * move all linq test to the same folder; add some groupBy test * fix references error in test refactoring add code for group by substitution. Still need to adjust binding post groupby * preliminary for the groupby functions with key and value selector * trying to change collection inputs for group by * Undo the LINQ GROUP BY part * fix accidental changes --------- Co-authored-by: Minh Le --- .../LinqAggregateFunctionsBaselineTests.cs | 8 +- .../LinqAttributeContractBaselineTests.cs | 0 .../LinqConstantFoldingBaselineTests.cs | 0 .../{ => Linq}/LinqGeneralBaselineTests.cs | 85 ++++++++++--------- .../LinqSQLTranslationBaselineTests.cs | 20 +++-- .../{ => Linq}/LinqTestData.cs | 2 +- .../{ => Linq}/LinqTestsCommon.cs | 0 .../LinqTranslationBaselineTests.cs | 9 +- 8 files changed, 63 insertions(+), 61 deletions(-) rename Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/{ => Linq}/LinqAggregateFunctionsBaselineTests.cs (98%) rename Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/{ => Linq}/LinqAttributeContractBaselineTests.cs (100%) rename Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/{ => Linq}/LinqConstantFoldingBaselineTests.cs (100%) rename Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/{ => Linq}/LinqGeneralBaselineTests.cs (98%) rename Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/{ => Linq}/LinqSQLTranslationBaselineTests.cs (96%) rename Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/{ => Linq}/LinqTestData.cs (98%) rename Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/{ => Linq}/LinqTestsCommon.cs (100%) rename Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/{ => Linq}/LinqTranslationBaselineTests.cs (99%) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqAggregateFunctionsBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqAggregateFunctionsBaselineTests.cs similarity index 98% rename from Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqAggregateFunctionsBaselineTests.cs rename to Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqAggregateFunctionsBaselineTests.cs index 0734f4dfad..b957b0a740 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqAggregateFunctionsBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqAggregateFunctionsBaselineTests.cs @@ -38,7 +38,7 @@ public async static Task Initialize(TestContext textContext) // Set a callback to get the handle of the last executed query to do the verification // This is neede because aggregate queries return type is a scalar so it can't be used // to verify the translated LINQ directly as other queries type. - client.DocumentClient.OnExecuteScalarQueryCallback = q => LinqAggregateFunctionBaselineTests.lastExecutedScalarQuery = q; + client.DocumentClient.OnExecuteScalarQueryCallback = q => lastExecutedScalarQuery = q; string dbName = $"{nameof(LinqAggregateFunctionBaselineTests)}-{Guid.NewGuid().ToString("N")}"; testDb = await client.CreateDatabaseAsync(dbName); @@ -501,7 +501,7 @@ public void TestAggregateAvg() public override LinqAggregateOutput ExecuteTest(LinqAggregateInput input) { - LinqAggregateFunctionBaselineTests.lastExecutedScalarQuery = null; + lastExecutedScalarQuery = null; Func compiledQuery = input.expression.Compile(); string errorMessage = null; @@ -515,10 +515,10 @@ public override LinqAggregateOutput ExecuteTest(LinqAggregateInput input) } finally { - Assert.IsNotNull(LinqAggregateFunctionBaselineTests.lastExecutedScalarQuery, "lastExecutedScalarQuery is not set"); + Assert.IsNotNull(lastExecutedScalarQuery, "lastExecutedScalarQuery is not set"); query = JObject - .Parse(LinqAggregateFunctionBaselineTests.lastExecutedScalarQuery.ToString()) + .Parse(lastExecutedScalarQuery.ToString()) .GetValue("query", StringComparison.Ordinal) .ToString(); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqAttributeContractBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqAttributeContractBaselineTests.cs similarity index 100% rename from Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqAttributeContractBaselineTests.cs rename to Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqAttributeContractBaselineTests.cs diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqConstantFoldingBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqConstantFoldingBaselineTests.cs similarity index 100% rename from Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqConstantFoldingBaselineTests.cs rename to Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqConstantFoldingBaselineTests.cs diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqGeneralBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqGeneralBaselineTests.cs similarity index 98% rename from Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqGeneralBaselineTests.cs rename to Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqGeneralBaselineTests.cs index 3fc3aff900..e76b2827be 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqGeneralBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqGeneralBaselineTests.cs @@ -18,6 +18,7 @@ namespace Microsoft.Azure.Cosmos.Services.Management.Tests.LinqProviderTests using BaselineTest; using Microsoft.Azure.Documents; using Microsoft.Azure.Cosmos.Scripts; + using static Microsoft.Azure.Cosmos.Services.Management.Tests.LinqProviderTests.LinqGeneralBaselineTests; [Microsoft.Azure.Cosmos.SDK.EmulatorTests.TestClass] public class LinqGeneralBaselineTests : BaselineTests @@ -242,19 +243,19 @@ public void TestSubquery() inputs.Add(new LinqTestInput( "Select(OrderBy)", b => getQuery(b) .Select(f => f.Children.OrderBy(c => c.Pets.Count())))); - + inputs.Add(new LinqTestInput( "Select(Take)", b => getQuery(b) .Select(f => f.Children.Take(2)))); - + inputs.Add(new LinqTestInput( "Select(Where)", b => getQuery(b) .Select(f => f.Children.Where(c => c.Pets.Count() > 0)))); - + inputs.Add(new LinqTestInput( "Select(Distinct)", b => getQuery(b) .Select(f => f.Children.Distinct()))); - + inputs.Add(new LinqTestInput( "Select(Count)", b => getQuery(b) .Select(f => f.Children.Count(c => c.Grade > 80)))); @@ -378,7 +379,7 @@ public void TestSubquery() inputs.Add(new LinqTestInput( "Select(binary with Count)", b => getQuery(b) .Select(f => 5 + f.Children.Count(c => c.Pets.Count() > 0)))); - + inputs.Add(new LinqTestInput( "Select(constant + Where -> Count)", b => getQuery(b) .Select(f => 5 + f.Children.Where(c => c.Pets.Count() > 0).Count()))); @@ -473,7 +474,7 @@ public void TestSubquery() inputs.Add(new LinqTestInput( "Select(Select) -> Where", b => getQuery(b).Select(f => f.Children.Select(c => c.Pets.Count())).Where(x => x.Count() > 0))); - + // Customer requested scenario inputs.Add(new LinqTestInput( "Select(new w/ Where) -> Where -> OrderBy -> Take", b => getQuery(b) @@ -631,7 +632,7 @@ public void TestSubquery() inputs.Add(new LinqTestInput( "Take -> Select(Select)", b => getQuery(b) .Take(10).Select(f => f.Children.Select(c => c.Pets.Count())))); - + // ------------------ // Any in lambda // ------------------ @@ -639,23 +640,23 @@ public void TestSubquery() inputs.Add(new LinqTestInput( "Select(Any w const array)", b => getQuery(b) .Select(f => new int[] { 1, 2, 3 }.Any()))); - + inputs.Add(new LinqTestInput( "Select(Any)", b => getQuery(b) .Select(f => f.Children.Any()))); - + inputs.Add(new LinqTestInput( "Select(Any w lambda)", b => getQuery(b) .Select(f => f.Children.Any(c => c.Grade > 80)))); - + inputs.Add(new LinqTestInput( "Select(new Any)", b => getQuery(b) .Select(f => new { f.FamilyId, HasGoodChildren = f.Children.Any(c => c.Grade > 80) }))); - + inputs.Add(new LinqTestInput( "Select(new 2 Any)", b => getQuery(b) .Select(f => new { HasChildrenWithPets = f.Children.Any(c => c.Pets.Count() > 0), HasGoodChildren = f.Children.Any(c => c.Grade > 80) }))); - + inputs.Add(new LinqTestInput( "Select(Nested Any)", b => getQuery(b) .Select(f => f.Children.Any(c => c.Pets.Any(p => p.GivenName.Count() > 10))))); @@ -672,7 +673,7 @@ public void TestSubquery() inputs.Add(new LinqTestInput( "OrderBy(Any)", b => getQuery(b) .OrderBy(f => f.Children.Any(c => c.Pets.Count() > 3)))); - + // ------------------------------------------------ // SelectMany with Take and OrderBy in lambda // ------------------------------------------------ @@ -700,7 +701,7 @@ public void TestSubquery() [Ignore] public void DebuggingTest() { - + } [TestMethod] @@ -1929,7 +1930,7 @@ public void ValidateDynamicLinq() [TestMethod] public async Task ValidateLinqQueries() { - Container container = await testDb.CreateContainerAsync(new ContainerProperties (id : Guid.NewGuid().ToString("N"), partitionKeyPath : "/id" )); + Container container = await testDb.CreateContainerAsync(new ContainerProperties(id: Guid.NewGuid().ToString("N"), partitionKeyPath: "/id")); Parent mother = new Parent { FamilyName = "Wakefield", GivenName = "Robin" }; Parent father = new Parent { FamilyName = "Miller", GivenName = "Ben" }; @@ -1945,13 +1946,13 @@ public async Task ValidateLinqQueries() }; Address address = new Address { State = "NY", County = "Manhattan", City = "NY" }; - Family family = new Family { FamilyId = "WakefieldFamily", Parents = new Parent[] { mother, father }, Children = new Child[] { child }, IsRegistered = false, Int = 3, NullableInt = 5 , Id = "WakefieldFamily"}; + Family family = new Family { FamilyId = "WakefieldFamily", Parents = new Parent[] { mother, father }, Children = new Child[] { child }, IsRegistered = false, Int = 3, NullableInt = 5, Id = "WakefieldFamily" }; List fList = new List(); fList.Add(family); container.CreateItemAsync(family).Wait(); - IOrderedQueryable query = container.GetItemLinqQueryable(allowSynchronousQueryExecution : true); + IOrderedQueryable query = container.GetItemLinqQueryable(allowSynchronousQueryExecution: true); IEnumerable q1 = query.Select(f => f.Parents[0].FamilyName); Assert.AreEqual(q1.FirstOrDefault(), family.Parents[0].FamilyName); @@ -2009,7 +2010,7 @@ public async Task ValidateLinqQueries() ListArrayClass arrayObject = new ListArrayClass() { Id = "arrayObject", ArrayField = new int[] { 1, 2, 3 } }; container.CreateItemAsync(arrayObject).Wait(); - IOrderedQueryable listArrayQuery = container.GetItemLinqQueryable(allowSynchronousQueryExecution : true); + IOrderedQueryable listArrayQuery = container.GetItemLinqQueryable(allowSynchronousQueryExecution: true); IEnumerable q13 = listArrayQuery.Where(a => a.ArrayField == arrayObject.ArrayField); Assert.AreEqual(q13.FirstOrDefault().Id, arrayObject.Id); @@ -2061,9 +2062,9 @@ public async Task ValidateLinqQueries() Document doubleQoutesDocument = new Document() { Id = doc1Id }; container.CreateItemAsync(doubleQoutesDocument).Wait(); - IQueryable docQuery = from book in container.GetItemLinqQueryable(allowSynchronousQueryExecution : true) - where book.Id == doc1Id - select book; + IQueryable docQuery = from book in container.GetItemLinqQueryable(allowSynchronousQueryExecution: true) + where book.Id == doc1Id + select book; Assert.AreEqual(docQuery.AsEnumerable().Single().Id, doc1Id); @@ -2072,7 +2073,7 @@ public async Task ValidateLinqQueries() container.CreateItemAsync(greatGreatFamily).Wait(); List greatGreatFamilyData = new List() { greatGreatFamily }; - IOrderedQueryable queryable = container.GetItemLinqQueryable(allowSynchronousQueryExecution : true); + IOrderedQueryable queryable = container.GetItemLinqQueryable(allowSynchronousQueryExecution: true); IEnumerable q16 = queryable.SelectMany(gf => gf.GreatFamily.Family.Children.Where(c => c.GivenName == "Jesse").Select(c => gf)); @@ -2082,7 +2083,7 @@ public async Task ValidateLinqQueries() container.CreateItemAsync(sport).Wait(); List sportData = new List() { sport }; - IOrderedQueryable sportQuery = container.GetItemLinqQueryable(allowSynchronousQueryExecution : true); + IOrderedQueryable sportQuery = container.GetItemLinqQueryable(allowSynchronousQueryExecution: true); IEnumerable q17 = sportQuery.Where(s => s.SportName == "Tennis"); @@ -2178,8 +2179,8 @@ private async Task ValidateBasicQueryAsync() List queryResults = new List(); //Simple Equality IQueryable dbQuery = from db in client.CreateDatabaseQuery() - where db.Id == databaseName - select db; + where db.Id == databaseName + select db; IDocumentQuery documentQuery = dbQuery.AsDocumentQuery(); while (documentQuery.HasMoreResults) @@ -2288,32 +2289,32 @@ public void ValidateDynamicDocumentQuery() //Ensure query on custom property of }; //Unfiltered execution. - IOrderedQueryable bookDocQuery = testContainer.GetItemLinqQueryable(allowSynchronousQueryExecution : true); + IOrderedQueryable bookDocQuery = testContainer.GetItemLinqQueryable(allowSynchronousQueryExecution: true); Func> getBookQuery = useQuery => useQuery ? bookDocQuery : new List().AsQueryable(); List inputs = new List(); inputs.Add(new LinqTestInput("Simple Equality on custom property", b => from book in getBookQuery(b) - where book.Title == "My Book" - select book)); + where book.Title == "My Book" + select book)); inputs.Add(new LinqTestInput("Nested Property access", b => from book in getBookQuery(b) - where book.Author.Name == "Don" - select book)); + where book.Author.Name == "Don" + select book)); inputs.Add(new LinqTestInput("Array references & Project Author out..", b => from book in getBookQuery(b) - where book.Languages[0].Name == "English" - select book.Author)); + where book.Languages[0].Name == "English" + select book.Author)); inputs.Add(new LinqTestInput("SelectMany", b => getBookQuery(b).SelectMany(book => book.Languages).Where(lang => lang.Name == "French").Select(lang => lang.Copyright))); inputs.Add(new LinqTestInput("NumericRange query", b => from book in getBookQuery(b) - where book.Price < 10 - select book.Author)); + where book.Price < 10 + select book.Author)); inputs.Add(new LinqTestInput("Or query", b => from book in getBookQuery(b) - where book.Title == "My Book" || book.Author.Name == "Don" - select book)); + where book.Title == "My Book" || book.Author.Name == "Don" + select book)); inputs.Add(new LinqTestInput("SelectMany query on a List type.", b => getBookQuery(b).SelectMany(book => book.Editions).Select(ed => ed.Name))); // Below samples are strictly speaking not Any equivalent. But they join and filter "all" @@ -2334,7 +2335,7 @@ where book.Price < 10 [TestMethod] public void ValidateDynamicAttachmentQuery() //Ensure query on custom property of attachment. { - IOrderedQueryable attachmentQuery = testContainer.GetItemLinqQueryable(allowSynchronousQueryExecution : true); + IOrderedQueryable attachmentQuery = testContainer.GetItemLinqQueryable(allowSynchronousQueryExecution: true); Document myDocument = new Document(); Func> getAttachmentQuery = useQuery => useQuery ? attachmentQuery : new List().AsQueryable(); @@ -2401,7 +2402,7 @@ public QueryHelper(Container container) public IQueryable Query() where T : BaseDocument { - IQueryable query = this.container.GetItemLinqQueryable(allowSynchronousQueryExecution : true) + IQueryable query = this.container.GetItemLinqQueryable(allowSynchronousQueryExecution: true) .Where(d => d.TypeName == "Hello"); string queryString = query.ToString(); return query; @@ -2411,7 +2412,7 @@ public IQueryable Query() where T : BaseDocument [TestMethod] public async Task ValidateLinqOnDataDocumentType() { - Container container = await testDb.CreateContainerAsync(new ContainerProperties(id : nameof(ValidateLinqOnDataDocumentType), partitionKeyPath : "/id")); + Container container = await testDb.CreateContainerAsync(new ContainerProperties(id: nameof(ValidateLinqOnDataDocumentType), partitionKeyPath: "/id")); DataDocument doc = new DataDocument() { Id = Guid.NewGuid().ToString("N"), Number = 0, TypeName = "Hello" }; container.CreateItemAsync(doc).Wait(); @@ -2424,10 +2425,10 @@ public async Task ValidateLinqOnDataDocumentType() Assert.AreEqual(doc.Id, baseDocument.Id); BaseDocument iDocument = doc; - IOrderedQueryable q = container.GetItemLinqQueryable(allowSynchronousQueryExecution : true); + IOrderedQueryable q = container.GetItemLinqQueryable(allowSynchronousQueryExecution: true); IEnumerable iresult = from f in q - where f.Id == iDocument.Id + where f.Id == iDocument.Id select f; DataDocument id = iresult.FirstOrDefault(); Assert.AreEqual(doc.Id, id.Id); @@ -2504,7 +2505,7 @@ function callback(err, docCreated) { StoredProcedureExecuteResponse scriptResponse = null; int totalNumberOfDocuments = GatewayTests.CreateExecuteAndDeleteCosmosProcedure(collection, script, out scriptResponse, "My Book"); - IOrderedQueryable linqQueryable = collection.GetItemLinqQueryable(allowSynchronousQueryExecution : true); + IOrderedQueryable linqQueryable = collection.GetItemLinqQueryable(allowSynchronousQueryExecution: true); int totalHit = linqQueryable.Where(book => book.Title == "My Book").Count(); Assert.AreEqual(totalHit, totalNumberOfDocuments, "Didnt get all the documents"); diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqSQLTranslationBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqSQLTranslationBaselineTests.cs similarity index 96% rename from Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqSQLTranslationBaselineTests.cs rename to Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqSQLTranslationBaselineTests.cs index 230e2599a3..d38cede2b3 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqSQLTranslationBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqSQLTranslationBaselineTests.cs @@ -16,6 +16,7 @@ namespace Microsoft.Azure.Cosmos.Services.Management.Tests using System.Threading.Tasks; using System.Net; using Microsoft.Azure.Cosmos.Query.Core; + using Microsoft.Azure.Cosmos.Services.Management.Tests.LinqProviderTests; [Microsoft.Azure.Cosmos.SDK.EmulatorTests.TestClass] public class LinqSQLTranslationBaselineTest : BaselineTests @@ -32,7 +33,8 @@ static Expression Lambda(Expression> func) [ClassInitialize] public async static Task Initialize(TestContext textContext) { - cosmosClient = TestCommon.CreateCosmosClient((cosmosClientBuilder) => { + cosmosClient = TestCommon.CreateCosmosClient((cosmosClientBuilder) => + { cosmosClientBuilder.WithCustomSerializer(new CustomJsonSerializer(new JsonSerializerSettings() { ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, @@ -76,7 +78,7 @@ struct simple public string pk; public simple(int x, int y) - { this.x = x; this.y = y; this.id = Guid.NewGuid().ToString(); this.pk = "Test"; } + { this.x = x; this.y = y; this.id = Guid.NewGuid().ToString(); this.pk = "Test"; } } struct nested @@ -246,13 +248,13 @@ public void ValidateSQLTranslation() inputs.Add(new LinqTestInput("Select identity", b => dataQuery(b).Select(x => x))); inputs.Add(new LinqTestInput("Select simple property", b => dataQuery(b).Select(x => x.x))); inputs.Add(new LinqTestInput("Select extension data", b => dataQuery(b).Select(x => new complex() { - NewtonsoftExtensionData = new() { + NewtonsoftExtensionData = new() { { "test", 1.5 } }, - NetExtensionData = new() { + NetExtensionData = new() { { "OtherTest", 1.5 } } - } ))); + }))); this.ExecuteTestSuite(inputs); } @@ -280,9 +282,9 @@ public void ValidateSQLTranslationComplexData() obj.str = random.NextDouble() < 0.1 ? "5" : LinqTestsCommon.RandomString(random, random.Next(MaxStringLength)); obj.id = Guid.NewGuid().ToString(); obj.pk = "Test"; - obj.NewtonsoftExtensionData = new Dictionary() { + obj.NewtonsoftExtensionData = new Dictionary() { ["age"] = 32, - ["tags"] = new [] { "item-1", "item-2" } + ["tags"] = new[] { "item-1", "item-2" } }; return obj; }; @@ -307,11 +309,11 @@ public void ValidateSQLTranslationComplexData() inputs.Add(new LinqTestInput("SelectMany array", b => getQuery(b).SelectMany(x => x.dblArray))); inputs.Add(new LinqTestInput("Select where extensiondata", b => getQuery(b).Where(p => (int)p.NewtonsoftExtensionData["age"] > 18).Select(x => new { Age = (int)x.NewtonsoftExtensionData["age"] }))); - inputs.Add(new LinqTestInput("Select where extensiondata contains", b => getQuery(b).Where(p => ((string[])p.NewtonsoftExtensionData["tags"]).Contains("item-1")).Select(x => (string[])x.NewtonsoftExtensionData["tags"] ))); + inputs.Add(new LinqTestInput("Select where extensiondata contains", b => getQuery(b).Where(p => ((string[])p.NewtonsoftExtensionData["tags"]).Contains("item-1")).Select(x => (string[])x.NewtonsoftExtensionData["tags"]))); // TODO: SelectMany does not currently work with Dictionary objects, the snapshot represents // the current (broken) behavior - inputs.Add(new LinqTestInput("SelectMany where extensiondata contains", b => getQuery(b).Where(p => ((string[])p.NewtonsoftExtensionData["tags"]).Contains("item-1")).SelectMany(x => (object[])x.NewtonsoftExtensionData["tags"] ))); + inputs.Add(new LinqTestInput("SelectMany where extensiondata contains", b => getQuery(b).Where(p => ((string[])p.NewtonsoftExtensionData["tags"]).Contains("item-1")).SelectMany(x => (object[])x.NewtonsoftExtensionData["tags"]))); this.ExecuteTestSuite(inputs); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestData.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTestData.cs similarity index 98% rename from Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestData.cs rename to Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTestData.cs index f302655613..a543a00418 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestData.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTestData.cs @@ -71,7 +71,7 @@ public class Transaction : LinqTestObject { public DateTime Date; public long Amount; - public TransactionType Type; + public TransactionType Type; } public enum TransactionType diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestsCommon.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTestsCommon.cs similarity index 100% rename from Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTestsCommon.cs rename to Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTestsCommon.cs diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTranslationBaselineTests.cs similarity index 99% rename from Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs rename to Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTranslationBaselineTests.cs index 4c8d6c423f..d6e4ee4767 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/LinqTranslationBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Linq/LinqTranslationBaselineTests.cs @@ -17,7 +17,6 @@ namespace Microsoft.Azure.Cosmos.Services.Management.Tests.LinqProviderTests using BaselineTest; using System.Linq.Dynamic; using System.Text; - using Microsoft.Azure.Documents; using Microsoft.Azure.Cosmos.SDK.EmulatorTests; using System.Threading.Tasks; @@ -622,7 +621,7 @@ public void TestMemberAccess() List testData = new List(); IOrderedQueryable constantQuery = testContainer.GetItemLinqQueryable(allowSynchronousQueryExecution: true); Func> getQuery = useQuery => useQuery ? constantQuery : testData.AsQueryable(); - + List inputs = new List { // This test case will use the legacy delegate compilation expression evaluator @@ -683,7 +682,7 @@ private Func> CreateDataTestStringFunctions() StringField = sb.ToString(), Id = Guid.NewGuid().ToString(), Pk = "Test", - + // For ToString tests ArrayField = new int[] {}, Point = new Point(0, 0) @@ -805,9 +804,9 @@ public void TestStringFunctions() new LinqTestInput("ToUpper", b => getQuery(b).Select(doc => doc.StringField.ToUpper())) }; this.ExecuteTestSuite(inputs); - } + } - [TestMethod] + [TestMethod] public void TestArrayFunctions() { const int Records = 100; From 52d04361049a41e9d66d811bba5a3206792fb4cf Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Fri, 15 Sep 2023 21:07:47 +0530 Subject: [PATCH 191/240] ClientTelemetry : Adds logic to call client config in every 10 minutes (#4071) * first draft * fix tests * fixes * fix tests * remove consoles * added exception * remove comment * fix tests * fix test * rev comments * rev comments * refactor code * remove log from api exception --- .../src/Handler/DiagnosticsHandlerHelper.cs | 35 ++- .../src/Telemetry/TelemetryToServiceHelper.cs | 90 ++++-- .../ClientTelemetryConfigurationTest.cs | 265 ++++++++++++++++++ .../DiagnosticHandlerHelperTests.cs | 29 +- 4 files changed, 385 insertions(+), 34 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryConfigurationTest.cs diff --git a/Microsoft.Azure.Cosmos/src/Handler/DiagnosticsHandlerHelper.cs b/Microsoft.Azure.Cosmos/src/Handler/DiagnosticsHandlerHelper.cs index cdc3c2bac3..266524e38b 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/DiagnosticsHandlerHelper.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/DiagnosticsHandlerHelper.cs @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos.Handler { using System; using System.Collections.Generic; + using System.Threading.Tasks; using Documents.Rntbd; using Microsoft.Azure.Cosmos.Core.Trace; @@ -21,16 +22,14 @@ internal class DiagnosticsHandlerHelper private const string Telemetrykey = "telemetry"; public static readonly TimeSpan DiagnosticsRefreshInterval = TimeSpan.FromSeconds(10); - private static readonly SystemUsageRecorder DiagnosticSystemUsageRecorder = new SystemUsageRecorder( + private static readonly TimeSpan ClientTelemetryRefreshInterval = TimeSpan.FromSeconds(5); + + // Need to reset it in Tests hence kept it non-readonly. + private static SystemUsageRecorder DiagnosticSystemUsageRecorder = new SystemUsageRecorder( identifier: Diagnostickey, historyLength: 6, refreshInterval: DiagnosticsHandlerHelper.DiagnosticsRefreshInterval); - - private static readonly TimeSpan ClientTelemetryRefreshInterval = TimeSpan.FromSeconds(5); - private static readonly SystemUsageRecorder TelemetrySystemUsageRecorder = new SystemUsageRecorder( - identifier: Telemetrykey, - historyLength: 120, - refreshInterval: DiagnosticsHandlerHelper.ClientTelemetryRefreshInterval); + private static SystemUsageRecorder TelemetrySystemUsageRecorder = null; /// /// Singleton to make sure only one instance of DiagnosticHandlerHelper is there. @@ -62,13 +61,13 @@ public static void Refresh(bool isClientTelemetryEnabled) { if (isClientTelemetryEnabled != DiagnosticsHandlerHelper.isTelemetryMonitoringEnabled) { - DiagnosticsHandlerHelper.Instance.StopSystemMonitor(); + DiagnosticsHandlerHelper tempInstance = DiagnosticsHandlerHelper.Instance; - // Update telemetry flag DiagnosticsHandlerHelper.isTelemetryMonitoringEnabled = isClientTelemetryEnabled; - - // Create new instance, it will start a new system monitor job DiagnosticsHandlerHelper.Instance = new DiagnosticsHandlerHelper(); + + // Stopping the monitor is a blocking call so we do it in a separate thread + _ = Task.Run(() => tempInstance.StopSystemMonitor()); } } @@ -80,7 +79,7 @@ private void StopSystemMonitor() } catch (ObjectDisposedException ex) { - DefaultTrace.TraceError($"Error while stopping system usage monitor. {0} ", ex); + DefaultTrace.TraceError("Error while stopping system usage monitor. {0} ", ex); } } @@ -102,8 +101,18 @@ private DiagnosticsHandlerHelper() if (DiagnosticsHandlerHelper.isTelemetryMonitoringEnabled) { + // re-initialize a fresh telemetry recorder when feature is switched on + DiagnosticsHandlerHelper.TelemetrySystemUsageRecorder = new SystemUsageRecorder( + identifier: Telemetrykey, + historyLength: 120, + refreshInterval: DiagnosticsHandlerHelper.ClientTelemetryRefreshInterval); + recorders.Add(DiagnosticsHandlerHelper.TelemetrySystemUsageRecorder); } + else + { + DiagnosticsHandlerHelper.TelemetrySystemUsageRecorder = null; + } this.systemUsageMonitor = SystemUsageMonitor.CreateAndStart(recorders); @@ -154,7 +163,7 @@ public SystemUsageHistory GetClientTelemetrySystemHistory() try { - return DiagnosticsHandlerHelper.TelemetrySystemUsageRecorder.Data; + return DiagnosticsHandlerHelper.TelemetrySystemUsageRecorder?.Data; } catch (Exception ex) { diff --git a/Microsoft.Azure.Cosmos/src/Telemetry/TelemetryToServiceHelper.cs b/Microsoft.Azure.Cosmos/src/Telemetry/TelemetryToServiceHelper.cs index 9212457951..f358076b25 100644 --- a/Microsoft.Azure.Cosmos/src/Telemetry/TelemetryToServiceHelper.cs +++ b/Microsoft.Azure.Cosmos/src/Telemetry/TelemetryToServiceHelper.cs @@ -21,7 +21,8 @@ internal class TelemetryToServiceHelper : IDisposable { private ITelemetryCollector collector = new TelemetryCollectorNoOp(); - internal static int DefaultBackgroundRefreshClientConfigTimeIntervalInMS = (int)TimeSpan.FromMinutes(10).TotalMilliseconds; + internal static TimeSpan DefaultBackgroundRefreshClientConfigTimeInterval + = TimeSpan.FromMinutes(10); private readonly AuthorizationTokenProvider cosmosAuthorization; private readonly CosmosHttpClient httpClient; @@ -73,7 +74,13 @@ public static TelemetryToServiceHelper CreateAndInitializeClientConfigAndTelemet } TelemetryToServiceHelper helper = new TelemetryToServiceHelper( - clientId, connectionPolicy, cosmosAuthorization, httpClient, serviceEndpoint, globalEndpointManager, cancellationTokenSource); + clientId: clientId, + connectionPolicy: connectionPolicy, + cosmosAuthorization: cosmosAuthorization, + httpClient: httpClient, + serviceEndpoint: serviceEndpoint, + globalEndpointManager: globalEndpointManager, + cancellationTokenSource: cancellationTokenSource); _ = helper.RetrieveConfigAndInitiateTelemetryAsync(); // Let it run in backgroud @@ -86,20 +93,36 @@ private async Task RetrieveConfigAndInitiateTelemetryAsync() try { Uri serviceEndpointWithPath = new Uri(this.serviceEnpoint + Paths.ClientConfigPathSegment); - - TryCatch databaseAccountClientConfigs = await this.GetDatabaseAccountClientConfigAsync(this.cosmosAuthorization, this.httpClient, serviceEndpointWithPath); - if (databaseAccountClientConfigs.Succeeded) - { - this.InitializeClientTelemetry(databaseAccountClientConfigs.Result); - } - else if (!this.cancellationTokenSource.IsCancellationRequested) + while (!this.cancellationTokenSource.IsCancellationRequested) { - DefaultTrace.TraceWarning($"Exception while calling client config " + databaseAccountClientConfigs.Exception.ToString()); + TryCatch databaseAccountClientConfigs = await this.GetDatabaseAccountClientConfigAsync( + cosmosAuthorization: this.cosmosAuthorization, + httpClient: this.httpClient, + clientConfigEndpoint: serviceEndpointWithPath); + + if (databaseAccountClientConfigs.Succeeded) + { + this.InitializeClientTelemetry( + clientConfig: databaseAccountClientConfigs.Result); + } + else if (databaseAccountClientConfigs.Exception is ObjectDisposedException) + { + DefaultTrace.TraceWarning("Client is being disposed for {0} at {1}", serviceEndpointWithPath, DateTime.UtcNow); + break; + } + else if (!this.cancellationTokenSource.IsCancellationRequested) + { + DefaultTrace.TraceWarning("Exception while calling client config {0} ", databaseAccountClientConfigs.Exception); + } + + await Task.Delay( + delay: TelemetryToServiceHelper.DefaultBackgroundRefreshClientConfigTimeInterval, + cancellationToken: this.cancellationTokenSource.Token); } } catch (Exception ex) { - DefaultTrace.TraceWarning($"Exception while running client config job " + ex.ToString()); + DefaultTrace.TraceWarning("Exception while running client config job: {0}", ex); } } @@ -125,14 +148,25 @@ await cosmosAuthorization.AddAuthorizationHeaderAsync( timeoutPolicy: HttpTimeoutPolicyControlPlaneRead.Instance, clientSideRequestStatistics: null, cancellationToken: default)) - using (DocumentServiceResponse documentServiceResponse = await ClientExtensions.ParseResponseAsync(responseMessage)) { - return TryCatch.FromResult(CosmosResource.FromStream(documentServiceResponse)); + // It means feature flag is off at gateway, then log the exception and retry after defined interval. + // If feature flag is OFF at gateway, SDK won't refresh the latest state of the flag. + if (responseMessage.StatusCode == System.Net.HttpStatusCode.BadRequest) + { + string responseFromGateway = await responseMessage.Content.ReadAsStringAsync(); + return TryCatch.FromException( + new InvalidOperationException($"Client Config API is not enabled at compute gateway. Response is {responseFromGateway}")); + } + + using (DocumentServiceResponse documentServiceResponse = await ClientExtensions.ParseResponseAsync(responseMessage)) + { + return TryCatch.FromResult( + CosmosResource.FromStream(documentServiceResponse)); + } } } catch (Exception ex) { - DefaultTrace.TraceWarning($"Exception while calling client config " + ex.StackTrace); return TryCatch.FromException(ex); } } @@ -153,10 +187,16 @@ public bool IsClientTelemetryJobRunning() /// private void InitializeClientTelemetry(AccountClientConfiguration clientConfig) { + // If state of the job is same as state of the flag, then no need to do anything. + if (clientConfig.IsClientTelemetryEnabled() == this.IsClientTelemetryJobRunning()) + { + return; + } + DiagnosticsHandlerHelper.Refresh(clientConfig.IsClientTelemetryEnabled()); if (clientConfig.IsClientTelemetryEnabled()) - { + { try { this.clientTelemetry = ClientTelemetry.CreateAndStartBackgroundTelemetry( @@ -180,6 +220,11 @@ private void InitializeClientTelemetry(AccountClientConfiguration clientConfig) this.connectionPolicy.EnableClientTelemetry = false; } } + else + { + this.StopClientTelemetry(); + DefaultTrace.TraceVerbose("Client Telemetry Disabled."); + } } public void Dispose() @@ -193,10 +238,19 @@ public void Dispose() /// private void StopClientTelemetry() { - this.collector = new TelemetryCollectorNoOp(); + try + { + this.collector = new TelemetryCollectorNoOp(); + + this.clientTelemetry?.Dispose(); + this.clientTelemetry = null; - this.clientTelemetry?.Dispose(); - this.clientTelemetry = null; + DiagnosticsHandlerHelper.Refresh(isClientTelemetryEnabled: false); + } + catch (Exception ex) + { + DefaultTrace.TraceWarning($"Error While stopping Telemetry Job : {0}", ex); + } } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryConfigurationTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryConfigurationTest.cs new file mode 100644 index 0000000000..57b5357055 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/ClientTelemetryConfigurationTest.cs @@ -0,0 +1,265 @@ +//------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +//------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests +{ + using System.Net.Http; + using System.Net; + using System.Text; + using System.Threading.Tasks; + using Microsoft.VisualStudio.TestTools.UnitTesting; + using Newtonsoft.Json; + using Microsoft.Azure.Cosmos.Fluent; + using System; + using Microsoft.Azure.Cosmos.Routing; + using System.Reflection; + using System.Threading; + using Microsoft.Azure.Cosmos.Telemetry; + + [TestClass] + public class ClientTelemetryConfigurationTest : BaseCosmosClientHelper + { + private const string EndpointUrl = "http://dummy.test.com/"; + private CosmosClientBuilder cosmosClientBuilder; + + private readonly TimeSpan OriginalDefaultBackgroundRefreshClientConfigTimeInterval = TelemetryToServiceHelper.DefaultBackgroundRefreshClientConfigTimeInterval; + + [TestInitialize] + public void TestInitialize() + { + TelemetryToServiceHelper.DefaultBackgroundRefreshClientConfigTimeInterval + = TimeSpan.FromMilliseconds(100); + + this.cosmosClientBuilder = TestCommon.GetDefaultConfiguration(); + } + + [TestCleanup] + public async Task Cleanup() + { + await base.TestCleanup(); + + // Resetting time intervals + TelemetryToServiceHelper.DefaultBackgroundRefreshClientConfigTimeInterval + = this.OriginalDefaultBackgroundRefreshClientConfigTimeInterval; + } + + [TestMethod] + public async Task Validate_ClientTelemetryJob_Status_if_Disabled_At_Instance_LevelAsync() + { + HttpClientHandlerHelper httpHandler = new HttpClientHandlerHelper + { + RequestCallBack = (request, cancellation) => + { + if (request.RequestUri.AbsoluteUri.Equals(EndpointUrl)) + { + HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK); + return Task.FromResult(result); + } + else if (request.RequestUri.AbsoluteUri.Contains(Documents.Paths.ClientConfigPathSegment)) + { + HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK); + + AccountClientConfiguration clientConfigProperties = new AccountClientConfiguration + { + ClientTelemetryConfiguration = new ClientTelemetryConfiguration + { + IsEnabled = true, + Endpoint = EndpointUrl + } + }; + + string payload = JsonConvert.SerializeObject(clientConfigProperties); + result.Content = new StringContent(payload, Encoding.UTF8, "application/json"); + + return Task.FromResult(result); + } + return null; + } + }; + + this.cosmosClientBuilder + .WithHttpClientFactory(() => new HttpClient(httpHandler)) + .WithTelemetryDisabled(); + + this.SetClient(this.cosmosClientBuilder.Build()); + + this.database = await this.GetClient().CreateDatabaseAsync(Guid.NewGuid().ToString()); + + DocumentClient documentClient = this.GetClient().DocumentClient; + + Assert.IsNotNull(documentClient.telemetryToServiceHelper); + Assert.IsFalse(documentClient.telemetryToServiceHelper.IsClientTelemetryJobRunning()); + + ClientCollectionCache collCache = (ClientCollectionCache)documentClient + .GetType() + .GetField("collectionCache", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static) + .GetValue(documentClient); + + TelemetryToServiceHelper telemetryToServiceHelper = (TelemetryToServiceHelper)collCache + .GetType() + .GetField("telemetryToServiceHelper", BindingFlags.Instance | BindingFlags.NonPublic) + .GetValue(collCache); + + Assert.IsNotNull(telemetryToServiceHelper); + Assert.IsFalse(telemetryToServiceHelper.IsClientTelemetryJobRunning()); + } + + [TestMethod] + [DataRow(true, HttpStatusCode.OK)] + [DataRow(false, HttpStatusCode.OK)] + [DataRow(false, HttpStatusCode.BadRequest)] // Errored Client Config API + public async Task Validate_ClientTelemetryJob_Status_with_Client_Config_Api_States_Async(bool clientTelemetryFlagEnabled, HttpStatusCode clientConfigApiStatus) + { + HttpClientHandlerHelper httpHandler = new HttpClientHandlerHelper + { + RequestCallBack = (request, cancellation) => + { + if (request.RequestUri.AbsoluteUri.Equals(EndpointUrl)) + { + HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK); + return Task.FromResult(result); + } + else if (request.RequestUri.AbsoluteUri.Contains(Documents.Paths.ClientConfigPathSegment)) + { + HttpResponseMessage result = new HttpResponseMessage(clientConfigApiStatus); + + AccountClientConfiguration clientConfigProperties = new AccountClientConfiguration + { + ClientTelemetryConfiguration = new ClientTelemetryConfiguration + { + IsEnabled = clientTelemetryFlagEnabled, + Endpoint = clientTelemetryFlagEnabled ? EndpointUrl : null + } + }; + + string payload = JsonConvert.SerializeObject(clientConfigProperties); + result.Content = new StringContent(payload, Encoding.UTF8, "application/json"); + + return Task.FromResult(result); + } + return null; + } + }; + + this.cosmosClientBuilder + .WithHttpClientFactory(() => new HttpClient(httpHandler)) + .WithTelemetryEnabled(); + + this.SetClient(this.cosmosClientBuilder.Build()); + + this.database = await this.GetClient().CreateDatabaseAsync(Guid.NewGuid().ToString()); + + DocumentClient documentClient = this.GetClient().DocumentClient; + + ClientCollectionCache collCache = (ClientCollectionCache)documentClient + .GetType() + .GetField("collectionCache", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static) + .GetValue(documentClient); + + TelemetryToServiceHelper telemetryToServiceHelperFromCollectionCache = (TelemetryToServiceHelper)collCache + .GetType() + .GetField("telemetryToServiceHelper", BindingFlags.Instance | BindingFlags.NonPublic) + .GetValue(collCache); + + Assert.AreEqual(clientTelemetryFlagEnabled, documentClient.telemetryToServiceHelper.IsClientTelemetryJobRunning()); + Assert.AreEqual(clientTelemetryFlagEnabled, telemetryToServiceHelperFromCollectionCache.IsClientTelemetryJobRunning()); + } + + [TestMethod] + [DataRow(true, false, HttpStatusCode.OK)] + [DataRow(false, true, HttpStatusCode.OK)] + [DataRow(true, false, HttpStatusCode.BadRequest)] + [DataRow(false, true, HttpStatusCode.BadRequest)] + public async Task Validate_ClientTelemetryJob_When_Flag_Is_Switched(bool flagState1, bool flagState2, HttpStatusCode clientConfigApiStatusAfterSwitch) + { + using ManualResetEvent manualResetEvent = new ManualResetEvent(false); + + int counter = 0; + HttpClientHandlerHelper httpHandler = new HttpClientHandlerHelper + { + RequestCallBack = (request, cancellation) => + { + if (request.RequestUri.AbsoluteUri.Contains(Documents.Paths.ClientConfigPathSegment)) + { + if (counter == 10) + { + manualResetEvent.Set(); + } + + counter++; + + bool isEnabled = counter < 5 ? flagState1 : flagState2; + HttpStatusCode apiStatusCode = counter < 5 ? HttpStatusCode.OK : clientConfigApiStatusAfterSwitch; + + HttpResponseMessage result = new HttpResponseMessage(apiStatusCode); + string payload = JsonConvert.SerializeObject(new AccountClientConfiguration + { + ClientTelemetryConfiguration = new ClientTelemetryConfiguration + { + IsEnabled = isEnabled, + Endpoint = isEnabled ? EndpointUrl : null + } + }); + result.Content = new StringContent(payload, Encoding.UTF8, "application/json"); + + return Task.FromResult(result); + } + + return null; + } + }; + + this.cosmosClientBuilder + .WithHttpClientFactory(() => new HttpClient(httpHandler)) + .WithTelemetryEnabled(); + + this.SetClient(this.cosmosClientBuilder.Build()); + + this.database = await this.GetClient() + .CreateDatabaseAsync(Guid.NewGuid().ToString()); + + DocumentClient documentClient = this.GetClient().DocumentClient; + + ClientCollectionCache collCache = (ClientCollectionCache)documentClient + .GetType() + .GetField("collectionCache", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static) + .GetValue(documentClient); + + TelemetryToServiceHelper telemetryToServiceHelperFromCollectionCache + = (TelemetryToServiceHelper)collCache + .GetType() + .GetField("telemetryToServiceHelper", BindingFlags.Instance | BindingFlags.NonPublic) + .GetValue(collCache); + + Assert.AreEqual(flagState1, documentClient.telemetryToServiceHelper.IsClientTelemetryJobRunning()); + Assert.AreEqual(flagState1, telemetryToServiceHelperFromCollectionCache.IsClientTelemetryJobRunning()); + + manualResetEvent.WaitOne(TimeSpan.FromSeconds(1)); + + collCache = (ClientCollectionCache)documentClient + .GetType() + .GetField("collectionCache", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static) + .GetValue(documentClient); + + telemetryToServiceHelperFromCollectionCache = (TelemetryToServiceHelper)collCache + .GetType() + .GetField("telemetryToServiceHelper", BindingFlags.Instance | BindingFlags.NonPublic) + .GetValue(collCache); + + if (clientConfigApiStatusAfterSwitch == HttpStatusCode.OK) + { + Assert.AreEqual(flagState2, documentClient.telemetryToServiceHelper.IsClientTelemetryJobRunning()); + Assert.AreEqual(flagState2, telemetryToServiceHelperFromCollectionCache.IsClientTelemetryJobRunning()); + } + else + { + // If the client config api errored out, the flag should not be changed + Assert.AreEqual(flagState1, documentClient.telemetryToServiceHelper.IsClientTelemetryJobRunning()); + Assert.AreEqual(flagState1, telemetryToServiceHelperFromCollectionCache.IsClientTelemetryJobRunning()); + } + + + } + } +} \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Diagnostics/DiagnosticHandlerHelperTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Diagnostics/DiagnosticHandlerHelperTests.cs index 23c813d826..c620b726e7 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Diagnostics/DiagnosticHandlerHelperTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Diagnostics/DiagnosticHandlerHelperTests.cs @@ -25,11 +25,21 @@ private static void ResetDiagnosticsHandlerHelper() MethodInfo iMethod = helper.GetType().GetMethod("StopSystemMonitor", BindingFlags.NonPublic | BindingFlags.Instance); iMethod.Invoke(helper, new object[] { }); - //Reset the instance woth original value + //Reset the DiagnosticSystemUsageRecorder with original value + FieldInfo DiagnosticSystemUsageRecorderField = typeof(DiagnosticsHandlerHelper).GetField("DiagnosticSystemUsageRecorder", + BindingFlags.Static | + BindingFlags.NonPublic); + DiagnosticSystemUsageRecorderField.SetValue(null, new Documents.Rntbd.SystemUsageRecorder( + identifier: "diagnostic", + historyLength: 6, + refreshInterval: DiagnosticsHandlerHelper.DiagnosticsRefreshInterval)); + + //Reset the instance with original value FieldInfo field = typeof(DiagnosticsHandlerHelper).GetField("Instance", BindingFlags.Static | BindingFlags.NonPublic); field.SetValue(null, Activator.CreateInstance(typeof(DiagnosticsHandlerHelper), true)); + } [TestMethod] @@ -50,14 +60,20 @@ public async Task RefreshTestAsync() DiagnosticsHandlerHelper diagnosticHandlerHelper1 = DiagnosticsHandlerHelper.GetInstance(); await Task.Delay(10000); // warm up Assert.IsNotNull(diagnosticHandlerHelper1.GetDiagnosticsSystemHistory()); + Assert.IsTrue(diagnosticHandlerHelper1.GetDiagnosticsSystemHistory().Values.Count > 0); int countBeforeRefresh = diagnosticHandlerHelper1.GetDiagnosticsSystemHistory().Values.Count; + FieldInfo TelemetrySystemUsageRecorderField1 = typeof(DiagnosticsHandlerHelper).GetField("TelemetrySystemUsageRecorder", + BindingFlags.Static | + BindingFlags.NonPublic); + Assert.IsNull(TelemetrySystemUsageRecorderField1.GetValue(null)); + // Refresh instance of DiagnosticsHandlerHelper with client telemetry enabled DiagnosticsHandlerHelper.Refresh(true); + await Task.Delay(5000); // warm up again to populate telemetry data DiagnosticsHandlerHelper diagnosticHandlerHelper2 = DiagnosticsHandlerHelper.GetInstance(); int countAfterRefresh = diagnosticHandlerHelper1.GetDiagnosticsSystemHistory().Values.Count; - - Console.WriteLine(countBeforeRefresh + " " + countAfterRefresh); + Assert.IsTrue(countBeforeRefresh <= countAfterRefresh, "After Refresh count should be greater than or equal to before refresh count"); Assert.AreNotEqual(diagnosticHandlerHelper1, diagnosticHandlerHelper2); @@ -65,11 +81,18 @@ public async Task RefreshTestAsync() Assert.IsNotNull(diagnosticHandlerHelper2.GetDiagnosticsSystemHistory()); Assert.IsNotNull(diagnosticHandlerHelper2.GetClientTelemetrySystemHistory()); + Assert.IsTrue(diagnosticHandlerHelper2.GetClientTelemetrySystemHistory().Values.Count > 0); + // Refresh instance of DiagnosticsHandlerHelper with client telemetry disabled DiagnosticsHandlerHelper.Refresh(false); DiagnosticsHandlerHelper diagnosticHandlerHelper3 = DiagnosticsHandlerHelper.GetInstance(); Assert.IsNotNull(diagnosticHandlerHelper3.GetDiagnosticsSystemHistory()); Assert.IsNull(diagnosticHandlerHelper3.GetClientTelemetrySystemHistory()); + + FieldInfo TelemetrySystemUsageRecorderField3 = typeof(DiagnosticsHandlerHelper).GetField("TelemetrySystemUsageRecorder", + BindingFlags.Static | + BindingFlags.NonPublic); + Assert.IsNull(TelemetrySystemUsageRecorderField3.GetValue(null)); } } } From 83509cc173f01fc7cbf20a0eb8d06da53f5f3b94 Mon Sep 17 00:00:00 2001 From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com> Date: Fri, 15 Sep 2023 13:35:33 -0700 Subject: [PATCH 192/240] SDK 3.35.4: Adds version bump and changelog (#4087) * bump version and changelog * added apis * Update changelog.md --- Directory.Build.props | 4 +- .../contracts/API_3.35.4-preview.txt | 1563 +++++++++++++++++ .../contracts/API_3.35.4.txt | 1502 ++++++++++++++++ changelog.md | 8 +- 4 files changed, 3074 insertions(+), 3 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.35.4-preview.txt create mode 100644 Microsoft.Azure.Cosmos/contracts/API_3.35.4.txt diff --git a/Directory.Build.props b/Directory.Build.props index 044a7ec7d9..404becc428 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,7 @@ - 3.35.3 - 3.35.3 + 3.35.4 + 3.35.4 preview 3.31.4 2.0.3 diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.35.4-preview.txt b/Microsoft.Azure.Cosmos/contracts/API_3.35.4-preview.txt new file mode 100644 index 0000000000..6c989053fd --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.35.4-preview.txt @@ -0,0 +1,1563 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public class ChangeFeedItemChange + { + public ChangeFeedItemChange(); + public T Current { get; set; } + public ChangeFeedMetadata Metadata { get; set; } + public T Previous { get; set; } + } + public class ChangeFeedMetadata + { + public ChangeFeedMetadata(DateTime conflictResolutionTimestamp, long lsn, ChangeFeedOperationType operationType, long previousLsn); + public DateTime ConflictResolutionTimestamp { get; } + public bool IsTimeToLiveExpired { get; } + public long Lsn { get; } + public ChangeFeedOperationType OperationType { get; } + public long PreviousLsn { get; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode AllVersionsAndDeletes { get; } + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public enum ChangeFeedOperationType + { + Create = 0, + Delete = 2, + Replace = 1, + } + public sealed class ChangeFeedPolicy + { + public ChangeFeedPolicy(); + public static TimeSpan FullFidelityNoRetention { get; } + public TimeSpan FullFidelityRetention { get; set; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public sealed class ComputedProperty + { + public ComputedProperty(); + public string Name { get; set; } + public string Query { get; set; } + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteAllItemsByPartitionKeyStreamAsync(PartitionKey partitionKey, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> GetPartitionKeyRangesAsync(FeedRange feedRange, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ChangeFeedPolicy ChangeFeedPolicy { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public Collection ComputedProperties { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool IsDistributedTracingEnabled { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable BypassIntegratedCache { get; set; } + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public enum PriorityLevel + { + High = 1, + Low = 2, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public bool EnableOptimisticDirectExecution { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public Nullable PriorityLevel { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public class ChangeFeedPolicyDefinition + { + public ContainerBuilder Attach(); + } + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ComputedPropertiesDefinition + { + public T Attach(); + public ComputedPropertiesDefinition WithComputedProperty(string name, string query); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ChangeFeedPolicyDefinition WithChangeFeedPolicy(TimeSpan retention); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public ComputedPropertiesDefinition WithComputedProperties(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithDistributedTracing(bool isEnabled=true); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query, IDictionary namedParameters); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/Microsoft.Azure.Cosmos/contracts/API_3.35.4.txt b/Microsoft.Azure.Cosmos/contracts/API_3.35.4.txt new file mode 100644 index 0000000000..c0dc3e280f --- /dev/null +++ b/Microsoft.Azure.Cosmos/contracts/API_3.35.4.txt @@ -0,0 +1,1502 @@ +namespace Microsoft.Azure.Cosmos +{ + public class AccountConsistency + { + public AccountConsistency(); + public ConsistencyLevel DefaultConsistencyLevel { get; } + public int MaxStalenessIntervalInSeconds { get; } + public int MaxStalenessPrefix { get; } + } + public class AccountProperties + { + public AccountConsistency Consistency { get; } + public string ETag { get; } + public string Id { get; } + public IEnumerable ReadableRegions { get; } + public IEnumerable WritableRegions { get; } + } + public class AccountRegion + { + public AccountRegion(); + public string Endpoint { get; } + public string Name { get; } + } + public sealed class BoundingBoxProperties + { + public BoundingBoxProperties(); + public double Xmax { get; set; } + public double Xmin { get; set; } + public double Ymax { get; set; } + public double Ymin { get; set; } + } + public abstract class ChangeFeedEstimator + { + protected ChangeFeedEstimator(); + public abstract FeedIterator GetCurrentStateIterator(ChangeFeedEstimatorRequestOptions changeFeedEstimatorRequestOptions=null); + } + public sealed class ChangeFeedEstimatorRequestOptions + { + public ChangeFeedEstimatorRequestOptions(); + public Nullable MaxItemCount { get; set; } + } + public abstract class ChangeFeedMode + { + public static ChangeFeedMode Incremental { get; } + public static ChangeFeedMode LatestVersion { get; } + } + public abstract class ChangeFeedProcessor + { + protected ChangeFeedProcessor(); + public abstract Task StartAsync(); + public abstract Task StopAsync(); + } + public class ChangeFeedProcessorBuilder + { + public ChangeFeedProcessor Build(); + public ChangeFeedProcessorBuilder WithErrorNotification(Container.ChangeFeedMonitorErrorDelegate errorDelegate); + public ChangeFeedProcessorBuilder WithInstanceName(string instanceName); + public ChangeFeedProcessorBuilder WithLeaseAcquireNotification(Container.ChangeFeedMonitorLeaseAcquireDelegate acquireDelegate); + public ChangeFeedProcessorBuilder WithLeaseConfiguration(Nullable acquireInterval=default(Nullable), Nullable expirationInterval=default(Nullable), Nullable renewInterval=default(Nullable)); + public ChangeFeedProcessorBuilder WithLeaseContainer(Container leaseContainer); + public ChangeFeedProcessorBuilder WithLeaseReleaseNotification(Container.ChangeFeedMonitorLeaseReleaseDelegate releaseDelegate); + public ChangeFeedProcessorBuilder WithMaxItems(int maxItemCount); + public ChangeFeedProcessorBuilder WithPollInterval(TimeSpan pollInterval); + public ChangeFeedProcessorBuilder WithStartTime(DateTime startTime); + } + public abstract class ChangeFeedProcessorContext + { + protected ChangeFeedProcessorContext(); + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract Headers Headers { get; } + public abstract string LeaseToken { get; } + } + public sealed class ChangeFeedProcessorState + { + public ChangeFeedProcessorState(string leaseToken, long estimatedLag, string instanceName); + public long EstimatedLag { get; } + public string InstanceName { get; } + public string LeaseToken { get; } + } + public class ChangeFeedProcessorUserException : Exception + { + public ChangeFeedProcessorUserException(Exception originalException, ChangeFeedProcessorContext context); + protected ChangeFeedProcessorUserException(SerializationInfo info, StreamingContext context); + public ChangeFeedProcessorContext ChangeFeedProcessorContext { get; } + public override void GetObjectData(SerializationInfo info, StreamingContext context); + } + public sealed class ChangeFeedRequestOptions : RequestOptions + { + public ChangeFeedRequestOptions(); + public new string IfMatchEtag { get; set; } + public new string IfNoneMatchEtag { get; set; } + public Nullable PageSizeHint { get; set; } + } + public abstract class ChangeFeedStartFrom + { + public static ChangeFeedStartFrom Beginning(); + public static ChangeFeedStartFrom Beginning(FeedRange feedRange); + public static ChangeFeedStartFrom ContinuationToken(string continuationToken); + public static ChangeFeedStartFrom Now(); + public static ChangeFeedStartFrom Now(FeedRange feedRange); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc); + public static ChangeFeedStartFrom Time(DateTime dateTimeUtc, FeedRange feedRange); + } + public sealed class ClientEncryptionIncludedPath + { + public ClientEncryptionIncludedPath(); + public string ClientEncryptionKeyId { get; set; } + public string EncryptionAlgorithm { get; set; } + public string EncryptionType { get; set; } + public string Path { get; set; } + } + public abstract class ClientEncryptionKey + { + protected ClientEncryptionKey(); + public abstract string Id { get; } + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class ClientEncryptionKeyProperties : IEquatable + { + protected ClientEncryptionKeyProperties(); + public ClientEncryptionKeyProperties(string id, string encryptionAlgorithm, byte[] wrappedDataEncryptionKey, EncryptionKeyWrapMetadata encryptionKeyWrapMetadata); + public Nullable CreatedTime { get; } + public string EncryptionAlgorithm { get; } + public EncryptionKeyWrapMetadata EncryptionKeyWrapMetadata { get; } + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public virtual string SelfLink { get; } + public byte[] WrappedDataEncryptionKey { get; } + public bool Equals(ClientEncryptionKeyProperties other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public class ClientEncryptionKeyResponse : Response + { + protected ClientEncryptionKeyResponse(); + public override string ActivityId { get; } + public virtual ClientEncryptionKey ClientEncryptionKey { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ClientEncryptionKeyProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ClientEncryptionKey (ClientEncryptionKeyResponse response); + } + public sealed class ClientEncryptionPolicy + { + public ClientEncryptionPolicy(IEnumerable includedPaths); + public ClientEncryptionPolicy(IEnumerable includedPaths, int policyFormatVersion); + public IEnumerable IncludedPaths { get; } + public int PolicyFormatVersion { get; } + } + public sealed class CompositePath + { + public CompositePath(); + public CompositePathSortOrder Order { get; set; } + public string Path { get; set; } + } + public enum CompositePathSortOrder + { + Ascending = 0, + Descending = 1, + } + public class ConflictProperties + { + public ConflictProperties(); + public string Id { get; } + public OperationKind OperationKind { get; } + public string SelfLink { get; } + } + public enum ConflictResolutionMode + { + Custom = 1, + LastWriterWins = 0, + } + public class ConflictResolutionPolicy + { + public ConflictResolutionPolicy(); + public ConflictResolutionMode Mode { get; set; } + public string ResolutionPath { get; set; } + public string ResolutionProcedure { get; set; } + } + public abstract class Conflicts + { + protected Conflicts(); + public abstract Task DeleteAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetConflictQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetConflictQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract T ReadConflictContent(ConflictProperties conflict); + public abstract Task> ReadCurrentAsync(ConflictProperties conflict, PartitionKey partitionKey, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum ConnectionMode + { + Direct = 1, + Gateway = 0, + } + public enum ConsistencyLevel + { + BoundedStaleness = 1, + ConsistentPrefix = 4, + Eventual = 3, + Session = 2, + Strong = 0, + } + public abstract class Container + { + protected Container(); + public abstract Conflicts Conflicts { get; } + public abstract Database Database { get; } + public abstract string Id { get; } + public abstract Scripts Scripts { get; } + public abstract Task> CreateItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch CreateTransactionalBatch(PartitionKey partitionKey); + public abstract Task DeleteContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> DeleteItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ChangeFeedEstimator GetChangeFeedEstimator(string processorName, Container leaseContainer); + public abstract ChangeFeedProcessorBuilder GetChangeFeedEstimatorBuilder(string processorName, Container.ChangesEstimationHandler estimationDelegate, Nullable estimationPeriod=default(Nullable)); + public abstract FeedIterator GetChangeFeedIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedStreamHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(string processorName, Container.ChangeFeedHandlerWithManualCheckpoint onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangeFeedHandler onChangesDelegate); + public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(string processorName, Container.ChangesHandler onChangesDelegate); + public abstract FeedIterator GetChangeFeedStreamIterator(ChangeFeedStartFrom changeFeedStartFrom, ChangeFeedMode changeFeedMode, ChangeFeedRequestOptions changeFeedRequestOptions=null); + public abstract Task> GetFeedRangesAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract IOrderedQueryable GetItemLinqQueryable(bool allowSynchronousQueryExecution=false, string continuationToken=null, QueryRequestOptions requestOptions=null, CosmosLinqSerializerOptions linqSerializerOptions=null); + public abstract FeedIterator GetItemQueryIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(FeedRange feedRange, QueryDefinition queryDefinition, string continuationToken, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetItemQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task> PatchItemAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task PatchItemStreamAsync(string id, PartitionKey partitionKey, IReadOnlyList patchOperations, PatchItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadContainerStreamAsync(ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadItemAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadItemStreamAsync(string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadManyItemsAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadManyItemsStreamAsync(IReadOnlyList> items, ReadManyRequestOptions readManyRequestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceContainerStreamAsync(ContainerProperties containerProperties, ContainerRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReplaceItemAsync(T item, string id, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceItemStreamAsync(Stream streamPayload, string id, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> UpsertItemAsync(T item, Nullable partitionKey=default(Nullable), ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertItemStreamAsync(Stream streamPayload, PartitionKey partitionKey, ItemRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public delegate Task ChangeFeedHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, IReadOnlyCollection changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangeFeedHandler(ChangeFeedProcessorContext context, IReadOnlyCollection changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedMonitorErrorDelegate(string leaseToken, Exception exception); + public delegate Task ChangeFeedMonitorLeaseAcquireDelegate(string leaseToken); + public delegate Task ChangeFeedMonitorLeaseReleaseDelegate(string leaseToken); + public delegate Task ChangeFeedStreamHandler(ChangeFeedProcessorContext context, Stream changes, CancellationToken cancellationToken); + public delegate Task ChangeFeedStreamHandlerWithManualCheckpoint(ChangeFeedProcessorContext context, Stream changes, Func checkpointAsync, CancellationToken cancellationToken); + public delegate Task ChangesEstimationHandler(long estimatedPendingChanges, CancellationToken cancellationToken); + public delegate Task ChangesHandler(IReadOnlyCollection changes, CancellationToken cancellationToken); + } + public class ContainerProperties + { + public ContainerProperties(); + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths); + public ContainerProperties(string id, string partitionKeyPath); + public Nullable AnalyticalStoreTimeToLiveInSeconds { get; set; } + public ClientEncryptionPolicy ClientEncryptionPolicy { get; set; } + public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; } + public Nullable DefaultTimeToLive { get; set; } + public string ETag { get; } + public GeospatialConfig GeospatialConfig { get; set; } + public string Id { get; set; } + public IndexingPolicy IndexingPolicy { get; set; } + public Nullable LastModified { get; } + public Nullable PartitionKeyDefinitionVersion { get; set; } + public string PartitionKeyPath { get; set; } + public IReadOnlyList PartitionKeyPaths { get; set; } + public string SelfLink { get; } + public string TimeToLivePropertyPath { get; set; } + public UniqueKeyPolicy UniqueKeyPolicy { get; set; } + } + public class ContainerRequestOptions : RequestOptions + { + public ContainerRequestOptions(); + public bool PopulateQuotaInfo { get; set; } + } + public class ContainerResponse : Response + { + protected ContainerResponse(); + public override string ActivityId { get; } + public virtual Container Container { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override ContainerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Container (ContainerResponse response); + } + public class CosmosClient : IDisposable + { + protected CosmosClient(); + public CosmosClient(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, TokenCredential tokenCredential, CosmosClientOptions clientOptions=null); + public CosmosClient(string connectionString, CosmosClientOptions clientOptions=null); + public CosmosClient(string accountEndpoint, string authKeyOrResourceToken, CosmosClientOptions clientOptions=null); + public virtual CosmosClientOptions ClientOptions { get; } + public virtual Uri Endpoint { get; } + public virtual CosmosResponseFactory ResponseFactory { get; } + public static Task CreateAndInitializeAsync(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, TokenCredential tokenCredential, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string connectionString, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public static Task CreateAndInitializeAsync(string accountEndpoint, string authKeyOrResourceToken, IReadOnlyList> containers, CosmosClientOptions cosmosClientOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseIfNotExistsAsync(string id, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public virtual Task CreateDatabaseStreamAsync(DatabaseProperties databaseProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual Container GetContainer(string databaseId, string containerId); + public virtual Database GetDatabase(string id); + public virtual FeedIterator GetDatabaseQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual FeedIterator GetDatabaseQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public virtual Task ReadAccountAsync(); + } + public class CosmosClientOptions + { + public CosmosClientOptions(); + public bool AllowBulkExecution { get; set; } + public string ApplicationName { get; set; } + public IReadOnlyList ApplicationPreferredRegions { get; set; } + public string ApplicationRegion { get; set; } + public ConnectionMode ConnectionMode { get; set; } + public Nullable ConsistencyLevel { get; set; } + public Collection CustomHandlers { get; } + public Nullable EnableContentResponseOnWrite { get; set; } + public bool EnableTcpConnectionEndpointRediscovery { get; set; } + public int GatewayModeMaxConnectionLimit { get; set; } + public Func HttpClientFactory { get; set; } + public Nullable IdleTcpConnectionTimeout { get; set; } + public bool LimitToEndpoint { get; set; } + public Nullable MaxRequestsPerTcpConnection { get; set; } + public Nullable MaxRetryAttemptsOnRateLimitedRequests { get; set; } + public Nullable MaxRetryWaitTimeOnRateLimitedRequests { get; set; } + public Nullable MaxTcpConnectionsPerEndpoint { get; set; } + public Nullable OpenTcpConnectionTimeout { get; set; } + public Nullable PortReuseMode { get; set; } + public TimeSpan RequestTimeout { get; set; } + public CosmosSerializer Serializer { get; set; } + public CosmosSerializationOptions SerializerOptions { get; set; } + public Func ServerCertificateCustomValidationCallback { get; set; } + public Nullable TokenCredentialBackgroundRefreshInterval { get; set; } + public IWebProxy WebProxy { get; set; } + } + public abstract class CosmosDiagnostics + { + protected CosmosDiagnostics(); + public virtual TimeSpan GetClientElapsedTime(); + public abstract IReadOnlyList> GetContactedRegions(); + public virtual int GetFailedRequestCount(); + public virtual Nullable GetStartTimeUtc(); + public abstract override string ToString(); + } + public class CosmosException : Exception + { + public CosmosException(string message, HttpStatusCode statusCode, int subStatusCode, string activityId, double requestCharge); + public virtual string ActivityId { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual Headers Headers { get; } + public override string Message { get; } + public virtual double RequestCharge { get; } + public virtual string ResponseBody { get; } + public virtual Nullable RetryAfter { get; } + public override string StackTrace { get; } + public virtual HttpStatusCode StatusCode { get; } + public virtual int SubStatusCode { get; } + public override string ToString(); + public virtual bool TryGetHeader(string headerName, out string value); + } + public sealed class CosmosLinqSerializerOptions + { + public CosmosLinqSerializerOptions(); + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public class CosmosOperationCanceledException : OperationCanceledException + { + public CosmosOperationCanceledException(OperationCanceledException originalException, CosmosDiagnostics diagnostics); + protected CosmosOperationCanceledException(SerializationInfo info, StreamingContext context); + public override IDictionary Data { get; } + public CosmosDiagnostics Diagnostics { get; } + public override string HelpLink { get; set; } + public override string Message { get; } + public override string Source { get; set; } + public override string StackTrace { get; } + public override Exception GetBaseException(); + public override void GetObjectData(SerializationInfo info, StreamingContext context); + public override string ToString(); + } + public enum CosmosPropertyNamingPolicy + { + CamelCase = 1, + Default = 0, + } + public abstract class CosmosResponseFactory + { + protected CosmosResponseFactory(); + public abstract FeedResponse CreateItemFeedResponse(ResponseMessage responseMessage); + public abstract ItemResponse CreateItemResponse(ResponseMessage responseMessage); + public abstract StoredProcedureExecuteResponse CreateStoredProcedureExecuteResponse(ResponseMessage responseMessage); + } + public sealed class CosmosSerializationOptions + { + public CosmosSerializationOptions(); + public bool IgnoreNullValues { get; set; } + public bool Indented { get; set; } + public CosmosPropertyNamingPolicy PropertyNamingPolicy { get; set; } + } + public abstract class CosmosSerializer + { + protected CosmosSerializer(); + public abstract T FromStream(Stream stream); + public abstract Stream ToStream(T input); + } + public abstract class Database + { + protected Database(); + public abstract CosmosClient Client { get; } + public abstract string Id { get; } + public abstract Task CreateClientEncryptionKeyAsync(ClientEncryptionKeyProperties clientEncryptionKeyProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerIfNotExistsAsync(string id, string partitionKeyPath, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateContainerStreamAsync(ContainerProperties containerProperties, Nullable throughput=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ContainerBuilder DefineContainer(string name, string partitionKeyPath); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract ClientEncryptionKey GetClientEncryptionKey(string id); + public abstract FeedIterator GetClientEncryptionKeyQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Container GetContainer(string id); + public abstract FeedIterator GetContainerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetContainerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract User GetUser(string id); + public abstract FeedIterator GetUserQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadStreamAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadThroughputAsync(RequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ReadThroughputAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(ThroughputProperties throughputProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceThroughputAsync(int throughput, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertUserAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class DatabaseProperties + { + public DatabaseProperties(); + public DatabaseProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class DatabaseResponse : Response + { + protected DatabaseResponse(); + public override string ActivityId { get; } + public virtual Database Database { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override DatabaseProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Database (DatabaseResponse response); + } + public enum DataType + { + LineString = 3, + MultiPolygon = 5, + Number = 0, + Point = 2, + Polygon = 4, + String = 1, + } + public class DedicatedGatewayRequestOptions + { + public DedicatedGatewayRequestOptions(); + public Nullable MaxIntegratedCacheStaleness { get; set; } + } + public class EncryptionKeyWrapMetadata : IEquatable + { + public EncryptionKeyWrapMetadata(EncryptionKeyWrapMetadata source); + public EncryptionKeyWrapMetadata(string type, string name, string value, string algorithm); + public string Algorithm { get; } + public string Name { get; } + public string Type { get; } + public string Value { get; } + public bool Equals(EncryptionKeyWrapMetadata other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class ExcludedPath + { + public ExcludedPath(); + public string Path { get; set; } + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedIterator : IDisposable + { + protected FeedIterator(); + public abstract bool HasMoreResults { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public abstract Task> ReadNextAsync(CancellationToken cancellationToken=default(CancellationToken)); + } + public abstract class FeedRange + { + protected FeedRange(); + public static FeedRange FromJsonString(string toStringValue); + public static FeedRange FromPartitionKey(PartitionKey partitionKey); + public abstract string ToJsonString(); + } + public abstract class FeedResponse : IEnumerable, IEnumerable + { + protected FeedResponse(); + public override string ActivityId { get; } + public abstract string ContinuationToken { get; } + public abstract int Count { get; } + public override string ETag { get; } + public abstract string IndexMetrics { get; } + public override double RequestCharge { get; } + public abstract IEnumerator GetEnumerator(); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public sealed class GeospatialConfig + { + public GeospatialConfig(); + public GeospatialConfig(GeospatialType geospatialType); + public GeospatialType GeospatialType { get; set; } + } + public enum GeospatialType + { + Geography = 0, + Geometry = 1, + } + public class Headers : IEnumerable + { + public Headers(); + public virtual string ActivityId { get; } + public virtual string ContentLength { get; set; } + public virtual string ContentType { get; } + public virtual string ContinuationToken { get; } + public virtual string ETag { get; } + public virtual string this[string headerName] { get; set; } + public virtual string Location { get; } + public virtual double RequestCharge { get; } + public virtual string Session { get; } + public virtual void Add(string headerName, IEnumerable values); + public virtual void Add(string headerName, string value); + public virtual string[] AllKeys(); + public virtual string Get(string headerName); + public virtual IEnumerator GetEnumerator(); + public virtual T GetHeaderValue(string headerName); + public virtual string GetValueOrDefault(string headerName); + public virtual void Remove(string headerName); + public virtual void Set(string headerName, string value); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + public virtual bool TryGetValue(string headerName, out string value); + } + public sealed class IncludedPath + { + public IncludedPath(); + public string Path { get; set; } + } + public enum IndexingDirective + { + Default = 0, + Exclude = 2, + Include = 1, + } + public enum IndexingMode + { + Consistent = 0, + Lazy = 1, + None = 2, + } + public sealed class IndexingPolicy + { + public IndexingPolicy(); + public bool Automatic { get; set; } + public Collection> CompositeIndexes { get; } + public Collection ExcludedPaths { get; } + public Collection IncludedPaths { get; } + public IndexingMode IndexingMode { get; set; } + public Collection SpatialIndexes { get; } + } + public enum IndexKind + { + Hash = 0, + Range = 1, + Spatial = 2, + } + public class ItemRequestOptions : RequestOptions + { + public ItemRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + public IEnumerable PostTriggers { get; set; } + public IEnumerable PreTriggers { get; set; } + public string SessionToken { get; set; } + } + public class ItemResponse : Response + { + protected ItemResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public override HttpStatusCode StatusCode { get; } + } + public enum OperationKind + { + Create = 1, + Delete = 3, + Invalid = 0, + Read = 4, + Replace = 2, + } + public struct PartitionKey : IEquatable + { + public static readonly PartitionKey None; + public static readonly PartitionKey Null; + public static readonly string SystemKeyName; + public static readonly string SystemKeyPath; + public PartitionKey(bool partitionKeyValue); + public PartitionKey(double partitionKeyValue); + public PartitionKey(string partitionKeyValue); + public bool Equals(PartitionKey other); + public override bool Equals(object obj); + public override int GetHashCode(); + public static bool operator ==(PartitionKey left, PartitionKey right); + public static bool operator !=(PartitionKey left, PartitionKey right); + public override string ToString(); + } + public sealed class PartitionKeyBuilder + { + public PartitionKeyBuilder(); + public PartitionKeyBuilder Add(bool val); + public PartitionKeyBuilder Add(double val); + public PartitionKeyBuilder Add(string val); + public PartitionKeyBuilder AddNoneType(); + public PartitionKeyBuilder AddNullValue(); + public PartitionKey Build(); + } + public enum PartitionKeyDefinitionVersion + { + V1 = 1, + V2 = 2, + } + public sealed class PatchItemRequestOptions : ItemRequestOptions + { + public PatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public abstract class PatchOperation + { + protected PatchOperation(); + public virtual string From { get; set; } + public abstract PatchOperationType OperationType { get; } + public abstract string Path { get; } + public static PatchOperation Add(string path, T value); + public static PatchOperation Increment(string path, double value); + public static PatchOperation Increment(string path, long value); + public static PatchOperation Move(string from, string path); + public static PatchOperation Remove(string path); + public static PatchOperation Replace(string path, T value); + public static PatchOperation Set(string path, T value); + public virtual bool TrySerializeValueParameter(CosmosSerializer cosmosSerializer, out Stream valueParam); + } + public enum PatchOperationType + { + Add = 0, + Increment = 4, + Move = 5, + Remove = 1, + Replace = 2, + Set = 3, + } + public abstract class PatchOperation : PatchOperation + { + protected PatchOperation(); + public abstract T Value { get; } + } + public abstract class Permission + { + protected Permission(); + public abstract string Id { get; } + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadAsync(Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public enum PermissionMode : byte + { + All = (byte)2, + Read = (byte)1, + } + public class PermissionProperties + { + public PermissionProperties(string id, PermissionMode permissionMode, Container container, PartitionKey resourcePartitionKey, string itemId); + public PermissionProperties(string id, PermissionMode permissionMode, Container container, Nullable resourcePartitionKey=default(Nullable)); + public string ETag { get; } + public string Id { get; } + public Nullable LastModified { get; } + public PermissionMode PermissionMode { get; } + public Nullable ResourcePartitionKey { get; set; } + public string ResourceUri { get; } + public string SelfLink { get; } + public string Token { get; } + } + public class PermissionResponse : Response + { + protected PermissionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public virtual Permission Permission { get; } + public override double RequestCharge { get; } + public override PermissionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator Permission (PermissionResponse response); + } + public enum PortReuseMode + { + PrivatePortPool = 1, + ReuseUnicastPort = 0, + } + public class QueryDefinition + { + public QueryDefinition(string query); + public string QueryText { get; } + public IReadOnlyList> GetQueryParameters(); + public QueryDefinition WithParameter(string name, object value); + public QueryDefinition WithParameterStream(string name, Stream valueStream); + } + public class QueryRequestOptions : RequestOptions + { + public QueryRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public DedicatedGatewayRequestOptions DedicatedGatewayRequestOptions { get; set; } + public Nullable EnableLowPrecisionOrderBy { get; set; } + public Nullable EnableScanInQuery { get; set; } + public Nullable MaxBufferedItemCount { get; set; } + public Nullable MaxConcurrency { get; set; } + public Nullable MaxItemCount { get; set; } + public Nullable PartitionKey { get; set; } + public Nullable PopulateIndexMetrics { get; set; } + public Nullable ResponseContinuationTokenLimitInKb { get; set; } + public string SessionToken { get; set; } + } + public class ReadManyRequestOptions : RequestOptions + { + public ReadManyRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public static class Regions + { + public const string AustraliaCentral = "Australia Central"; + public const string AustraliaCentral2 = "Australia Central 2"; + public const string AustraliaEast = "Australia East"; + public const string AustraliaSoutheast = "Australia Southeast"; + public const string BrazilSouth = "Brazil South"; + public const string BrazilSoutheast = "Brazil Southeast"; + public const string CanadaCentral = "Canada Central"; + public const string CanadaEast = "Canada East"; + public const string CentralIndia = "Central India"; + public const string CentralUS = "Central US"; + public const string CentralUSEUAP = "Central US EUAP"; + public const string ChinaEast = "China East"; + public const string ChinaEast2 = "China East 2"; + public const string ChinaEast3 = "China East 3"; + public const string ChinaNorth = "China North"; + public const string ChinaNorth2 = "China North 2"; + public const string ChinaNorth3 = "China North 3"; + public const string EastAsia = "East Asia"; + public const string EastUS = "East US"; + public const string EastUS2 = "East US 2"; + public const string EastUS2EUAP = "East US 2 EUAP"; + public const string EastUSSLV = "East US SLV"; + public const string FranceCentral = "France Central"; + public const string FranceSouth = "France South"; + public const string GermanyCentral = "Germany Central"; + public const string GermanyNorth = "Germany North"; + public const string GermanyNortheast = "Germany Northeast"; + public const string GermanyWestCentral = "Germany West Central"; + public const string IsraelCentral = "Israel Central"; + public const string ItalyNorth = "Italy North"; + public const string JapanEast = "Japan East"; + public const string JapanWest = "Japan West"; + public const string JioIndiaCentral = "Jio India Central"; + public const string JioIndiaWest = "Jio India West"; + public const string KoreaCentral = "Korea Central"; + public const string KoreaSouth = "Korea South"; + public const string MalaysiaSouth = "Malaysia South"; + public const string NorthCentralUS = "North Central US"; + public const string NorthEurope = "North Europe"; + public const string NorwayEast = "Norway East"; + public const string NorwayWest = "Norway West"; + public const string PolandCentral = "Poland Central"; + public const string QatarCentral = "Qatar Central"; + public const string SouthAfricaNorth = "South Africa North"; + public const string SouthAfricaWest = "South Africa West"; + public const string SouthCentralUS = "South Central US"; + public const string SoutheastAsia = "Southeast Asia"; + public const string SouthIndia = "South India"; + public const string SwedenCentral = "Sweden Central"; + public const string SwedenSouth = "Sweden South"; + public const string SwitzerlandNorth = "Switzerland North"; + public const string SwitzerlandWest = "Switzerland West"; + public const string UAECentral = "UAE Central"; + public const string UAENorth = "UAE North"; + public const string UKSouth = "UK South"; + public const string UKWest = "UK West"; + public const string USDoDCentral = "USDoD Central"; + public const string USDoDEast = "USDoD East"; + public const string USGovArizona = "USGov Arizona"; + public const string USGovTexas = "USGov Texas"; + public const string USGovVirginia = "USGov Virginia"; + public const string USNatEast = "USNat East"; + public const string USNatWest = "USNat West"; + public const string USSecEast = "USSec East"; + public const string USSecWest = "USSec West"; + public const string WestCentralUS = "West Central US"; + public const string WestEurope = "West Europe"; + public const string WestIndia = "West India"; + public const string WestUS = "West US"; + public const string WestUS2 = "West US 2"; + public const string WestUS3 = "West US 3"; + } + public abstract class RequestHandler + { + protected RequestHandler(); + public RequestHandler InnerHandler { get; set; } + public virtual Task SendAsync(RequestMessage request, CancellationToken cancellationToken); + } + public class RequestMessage : IDisposable + { + public RequestMessage(); + public RequestMessage(HttpMethod method, Uri requestUri); + public virtual Stream Content { get; set; } + public virtual Headers Headers { get; } + public virtual HttpMethod Method { get; } + public virtual Dictionary Properties { get; } + public virtual Uri RequestUri { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + } + public class RequestOptions + { + public RequestOptions(); + public Action AddRequestHeaders { get; set; } + public string IfMatchEtag { get; set; } + public string IfNoneMatchEtag { get; set; } + public IReadOnlyDictionary Properties { get; set; } + public RequestOptions ShallowCopy(); + } + public class ResponseMessage : IDisposable + { + public ResponseMessage(); + public ResponseMessage(HttpStatusCode statusCode, RequestMessage requestMessage=null, string errorMessage=null); + public virtual Stream Content { get; set; } + public virtual string ContinuationToken { get; } + public virtual CosmosDiagnostics Diagnostics { get; set; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public string IndexMetrics { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual RequestMessage RequestMessage { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual ResponseMessage EnsureSuccessStatusCode(); + } + public abstract class Response + { + protected Response(); + public abstract string ActivityId { get; } + public abstract CosmosDiagnostics Diagnostics { get; } + public abstract string ETag { get; } + public abstract Headers Headers { get; } + public abstract double RequestCharge { get; } + public abstract T Resource { get; } + public abstract HttpStatusCode StatusCode { get; } + public static implicit operator T (Response response); + } + public sealed class SpatialPath + { + public SpatialPath(); + public BoundingBoxProperties BoundingBox { get; set; } + public string Path { get; set; } + public Collection SpatialTypes { get; } + } + public enum SpatialType + { + LineString = 1, + MultiPolygon = 3, + Point = 0, + Polygon = 2, + } + public class ThroughputProperties + { + public Nullable AutoscaleMaxThroughput { get; } + public string ETag { get; } + public Nullable LastModified { get; } + public string SelfLink { get; } + public Nullable Throughput { get; } + public static ThroughputProperties CreateAutoscaleThroughput(int autoscaleMaxThroughput); + public static ThroughputProperties CreateManualThroughput(int throughput); + } + public class ThroughputResponse : Response + { + protected ThroughputResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public Nullable IsReplacePending { get; } + public Nullable MinThroughput { get; } + public override double RequestCharge { get; } + public override ThroughputProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator ThroughputProperties (ThroughputResponse response); + } + public abstract class TransactionalBatch + { + protected TransactionalBatch(); + public abstract TransactionalBatch CreateItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch CreateItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch DeleteItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract Task ExecuteAsync(TransactionalBatchRequestOptions requestOptions, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteAsync(CancellationToken cancellationToken=default(CancellationToken)); + public abstract TransactionalBatch PatchItem(string id, IReadOnlyList patchOperations, TransactionalBatchPatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReadItem(string id, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItemStream(string id, Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch ReplaceItem(string id, T item, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItemStream(Stream streamPayload, TransactionalBatchItemRequestOptions requestOptions=null); + public abstract TransactionalBatch UpsertItem(T item, TransactionalBatchItemRequestOptions requestOptions=null); + } + public class TransactionalBatchItemRequestOptions : RequestOptions + { + public TransactionalBatchItemRequestOptions(); + public Nullable EnableContentResponseOnWrite { get; set; } + public Nullable IndexingDirective { get; set; } + } + public class TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual string ETag { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual Stream ResourceStream { get; } + public virtual TimeSpan RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + } + public class TransactionalBatchOperationResult : TransactionalBatchOperationResult + { + protected TransactionalBatchOperationResult(); + public virtual T Resource { get; set; } + } + public class TransactionalBatchPatchItemRequestOptions : TransactionalBatchItemRequestOptions + { + public TransactionalBatchPatchItemRequestOptions(); + public string FilterPredicate { get; set; } + } + public class TransactionalBatchRequestOptions : RequestOptions + { + public TransactionalBatchRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public string SessionToken { get; set; } + } + public class TransactionalBatchResponse : IDisposable, IEnumerable, IEnumerable, IReadOnlyCollection, IReadOnlyList + { + protected TransactionalBatchResponse(); + public virtual string ActivityId { get; } + public virtual int Count { get; } + public virtual CosmosDiagnostics Diagnostics { get; } + public virtual string ErrorMessage { get; } + public virtual Headers Headers { get; } + public virtual bool IsSuccessStatusCode { get; } + public virtual TransactionalBatchOperationResult this[int index] { get; } + public virtual double RequestCharge { get; } + public virtual Nullable RetryAfter { get; } + public virtual HttpStatusCode StatusCode { get; } + public void Dispose(); + protected virtual void Dispose(bool disposing); + public virtual IEnumerator GetEnumerator(); + public virtual TransactionalBatchOperationResult GetOperationResultAtIndex(int index); + IEnumerator System.Collections.IEnumerable.GetEnumerator(); + } + public class UniqueKey + { + public UniqueKey(); + public Collection Paths { get; } + } + public sealed class UniqueKeyPolicy + { + public UniqueKeyPolicy(); + public Collection UniqueKeys { get; } + } + public abstract class User + { + protected User(); + public abstract string Id { get; } + public abstract Task CreatePermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Permission GetPermission(string id); + public abstract FeedIterator GetPermissionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetPermissionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadAsync(RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceAsync(UserProperties userProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task UpsertPermissionAsync(PermissionProperties permissionProperties, Nullable tokenExpiryInSeconds=default(Nullable), RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class UserProperties + { + protected UserProperties(); + public UserProperties(string id); + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class UserResponse : Response + { + protected UserResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public virtual User User { get; } + public static implicit operator User (UserResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Fluent +{ + public sealed class ClientEncryptionPolicyDefinition + { + public ContainerBuilder Attach(); + public ClientEncryptionPolicyDefinition WithIncludedPath(ClientEncryptionIncludedPath path); + } + public class CompositeIndexDefinition + { + public T Attach(); + public CompositeIndexDefinition Path(string path); + public CompositeIndexDefinition Path(string path, CompositePathSortOrder sortOrder); + } + public class ConflictResolutionDefinition + { + public ContainerBuilder Attach(); + public ConflictResolutionDefinition WithCustomStoredProcedureResolution(string conflictResolutionProcedure); + public ConflictResolutionDefinition WithLastWriterWinsResolution(string conflictResolutionPath); + } + public class ContainerBuilder : ContainerDefinition + { + protected ContainerBuilder(); + public ContainerBuilder(Database database, string name, string partitionKeyPath); + public new ContainerProperties Build(); + public Task CreateAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(ThroughputProperties throughputProperties, CancellationToken cancellationToken=default(CancellationToken)); + public Task CreateIfNotExistsAsync(Nullable throughput=default(Nullable), CancellationToken cancellationToken=default(CancellationToken)); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(); + public ClientEncryptionPolicyDefinition WithClientEncryptionPolicy(int policyFormatVersion); + public ConflictResolutionDefinition WithConflictResolution(); + public UniqueKeyDefinition WithUniqueKey(); + } + public abstract class ContainerDefinition where T : ContainerDefinition + { + public ContainerDefinition(); + public ContainerProperties Build(); + public T WithDefaultTimeToLive(int defaultTtlInSeconds); + public T WithDefaultTimeToLive(TimeSpan defaultTtlTimeSpan); + public IndexingPolicyDefinition WithIndexingPolicy(); + public T WithPartitionKeyDefinitionVersion(PartitionKeyDefinitionVersion partitionKeyDefinitionVersion); + public T WithTimeToLivePropertyPath(string propertyPath); + } + public class CosmosClientBuilder + { + public CosmosClientBuilder(string connectionString); + public CosmosClientBuilder(string accountEndpoint, AzureKeyCredential authKeyOrResourceTokenCredential); + public CosmosClientBuilder(string accountEndpoint, TokenCredential tokenCredential); + public CosmosClientBuilder(string accountEndpoint, string authKeyOrResourceToken); + public CosmosClientBuilder AddCustomHandlers(params RequestHandler[] customHandlers); + public CosmosClient Build(); + public Task BuildAndInitializeAsync(IReadOnlyList> containers, CancellationToken cancellationToken=default(CancellationToken)); + public CosmosClientBuilder WithApplicationName(string applicationName); + public CosmosClientBuilder WithApplicationPreferredRegions(IReadOnlyList applicationPreferredRegions); + public CosmosClientBuilder WithApplicationRegion(string applicationRegion); + public CosmosClientBuilder WithBulkExecution(bool enabled); + public CosmosClientBuilder WithConnectionModeDirect(); + public CosmosClientBuilder WithConnectionModeDirect(Nullable idleTcpConnectionTimeout=default(Nullable), Nullable openTcpConnectionTimeout=default(Nullable), Nullable maxRequestsPerTcpConnection=default(Nullable), Nullable maxTcpConnectionsPerEndpoint=default(Nullable), Nullable portReuseMode=default(Nullable), Nullable enableTcpConnectionEndpointRediscovery=default(Nullable)); + public CosmosClientBuilder WithConnectionModeGateway(Nullable maxConnectionLimit=default(Nullable), IWebProxy webProxy=null); + public CosmosClientBuilder WithConsistencyLevel(ConsistencyLevel consistencyLevel); + public CosmosClientBuilder WithContentResponseOnWrite(bool contentResponseOnWrite); + public CosmosClientBuilder WithCustomSerializer(CosmosSerializer cosmosJsonSerializer); + public CosmosClientBuilder WithHttpClientFactory(Func httpClientFactory); + public CosmosClientBuilder WithLimitToEndpoint(bool limitToEndpoint); + public CosmosClientBuilder WithRequestTimeout(TimeSpan requestTimeout); + public CosmosClientBuilder WithSerializerOptions(CosmosSerializationOptions cosmosSerializerOptions); + public CosmosClientBuilder WithThrottlingRetryOptions(TimeSpan maxRetryWaitTimeOnThrottledRequests, int maxRetryAttemptsOnThrottledRequests); + } + public class IndexingPolicyDefinition + { + public IndexingPolicyDefinition(); + public T Attach(); + public IndexingPolicyDefinition WithAutomaticIndexing(bool enabled); + public CompositeIndexDefinition> WithCompositeIndex(); + public PathsDefinition> WithExcludedPaths(); + public PathsDefinition> WithIncludedPaths(); + public IndexingPolicyDefinition WithIndexingMode(IndexingMode indexingMode); + public SpatialIndexDefinition> WithSpatialIndex(); + } + public class PathsDefinition + { + public T Attach(); + public PathsDefinition Path(string path); + } + public class SpatialIndexDefinition + { + public T Attach(); + public SpatialIndexDefinition Path(string path); + public SpatialIndexDefinition Path(string path, params SpatialType[] spatialTypes); + } + public class UniqueKeyDefinition + { + public ContainerBuilder Attach(); + public UniqueKeyDefinition Path(string path); + } +} +namespace Microsoft.Azure.Cosmos.Linq +{ + public static class CosmosLinq + { + public static object InvokeUserDefinedFunction(string udfName, params object[] arguments); + } + public static class CosmosLinqExtensions + { + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> AverageAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> AverageAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> CountAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static bool IsArray(this object obj); + public static bool IsBool(this object obj); + public static bool IsDefined(this object obj); + public static bool IsNull(this object obj); + public static bool IsNumber(this object obj); + public static bool IsObject(this object obj); + public static bool IsPrimitive(this object obj); + public static bool IsString(this object obj); + public static Task> MaxAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> MinAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task>> SumAsync(this IQueryable> source, CancellationToken cancellationToken=default(CancellationToken)); + public static Task> SumAsync(this IQueryable source, CancellationToken cancellationToken=default(CancellationToken)); + public static FeedIterator ToFeedIterator(this IQueryable query); + public static QueryDefinition ToQueryDefinition(this IQueryable query); + public static FeedIterator ToStreamIterator(this IQueryable query); + } +} +namespace Microsoft.Azure.Cosmos.Scripts +{ + public abstract class Scripts + { + protected Scripts(); + public abstract Task CreateStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task CreateUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task DeleteUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task> ExecuteStoredProcedureAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, PartitionKey partitionKey, dynamic parameters, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ExecuteStoredProcedureStreamAsync(string storedProcedureId, Stream streamPayload, PartitionKey partitionKey, StoredProcedureRequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract FeedIterator GetStoredProcedureQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetStoredProcedureQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetTriggerQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(QueryDefinition queryDefinition, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract FeedIterator GetUserDefinedFunctionQueryStreamIterator(string queryText=null, string continuationToken=null, QueryRequestOptions requestOptions=null); + public abstract Task ReadStoredProcedureAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadTriggerAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReadUserDefinedFunctionAsync(string id, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceStoredProcedureAsync(StoredProcedureProperties storedProcedureProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceTriggerAsync(TriggerProperties triggerProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + public abstract Task ReplaceUserDefinedFunctionAsync(UserDefinedFunctionProperties userDefinedFunctionProperties, RequestOptions requestOptions=null, CancellationToken cancellationToken=default(CancellationToken)); + } + public class StoredProcedureExecuteResponse : Response + { + protected StoredProcedureExecuteResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override T Resource { get; } + public virtual string ScriptLog { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + } + public class StoredProcedureProperties + { + public StoredProcedureProperties(); + public StoredProcedureProperties(string id, string body); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public Nullable LastModified { get; } + public string SelfLink { get; } + } + public class StoredProcedureRequestOptions : RequestOptions + { + public StoredProcedureRequestOptions(); + public Nullable ConsistencyLevel { get; set; } + public bool EnableScriptLogging { get; set; } + public string SessionToken { get; set; } + } + public class StoredProcedureResponse : Response + { + protected StoredProcedureResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override StoredProcedureProperties Resource { get; } + public virtual string SessionToken { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator StoredProcedureProperties (StoredProcedureResponse response); + } + public enum TriggerOperation : short + { + All = (short)0, + Create = (short)1, + Delete = (short)3, + Replace = (short)4, + Update = (short)2, + } + public class TriggerProperties + { + public TriggerProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + public TriggerOperation TriggerOperation { get; set; } + public TriggerType TriggerType { get; set; } + } + public class TriggerResponse : Response + { + protected TriggerResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override TriggerProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator TriggerProperties (TriggerResponse response); + } + public enum TriggerType : byte + { + Post = (byte)1, + Pre = (byte)0, + } + public class UserDefinedFunctionProperties + { + public UserDefinedFunctionProperties(); + public string Body { get; set; } + public string ETag { get; } + public string Id { get; set; } + public string SelfLink { get; } + } + public class UserDefinedFunctionResponse : Response + { + protected UserDefinedFunctionResponse(); + public override string ActivityId { get; } + public override CosmosDiagnostics Diagnostics { get; } + public override string ETag { get; } + public override Headers Headers { get; } + public override double RequestCharge { get; } + public override UserDefinedFunctionProperties Resource { get; } + public override HttpStatusCode StatusCode { get; } + public static implicit operator UserDefinedFunctionProperties (UserDefinedFunctionResponse response); + } +} +namespace Microsoft.Azure.Cosmos.Spatial +{ + public sealed class BoundingBox : IEquatable + { + public BoundingBox(Position min, Position max); + public Position Max { get; } + public Position Min { get; } + public bool Equals(BoundingBox other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public abstract class Crs + { + protected Crs(CrsType type); + public static Crs Default { get; } + public CrsType Type { get; } + public static Crs Unspecified { get; } + public static LinkedCrs Linked(string href); + public static LinkedCrs Linked(string href, string type); + public static NamedCrs Named(string name); + } + public enum CrsType + { + Linked = 1, + Named = 0, + Unspecified = 2, + } + public abstract class Geometry + { + protected Geometry(GeometryType type, GeometryParams geometryParams); + public IDictionary AdditionalProperties { get; } + public BoundingBox BoundingBox { get; } + public Crs Crs { get; } + public GeometryType Type { get; } + public double Distance(Geometry to); + public override bool Equals(object obj); + public override int GetHashCode(); + public bool Intersects(Geometry geometry2); + public bool IsValid(); + public GeometryValidationResult IsValidDetailed(); + public bool Within(Geometry outer); + } + public class GeometryParams + { + public GeometryParams(); + public IDictionary AdditionalProperties { get; set; } + public BoundingBox BoundingBox { get; set; } + public Crs Crs { get; set; } + } + public enum GeometryShape + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public enum GeometryType + { + GeometryCollection = 6, + LineString = 2, + MultiLineString = 3, + MultiPoint = 1, + MultiPolygon = 5, + Point = 0, + Polygon = 4, + } + public class GeometryValidationResult + { + public GeometryValidationResult(); + public bool IsValid { get; } + public string Reason { get; } + } + public sealed class LinearRing : IEquatable + { + public LinearRing(IList coordinates); + public ReadOnlyCollection Positions { get; } + public bool Equals(LinearRing other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LineString : Geometry, IEquatable + { + public LineString(IList coordinates); + public LineString(IList coordinates, GeometryParams geometryParams); + public ReadOnlyCollection Positions { get; } + public bool Equals(LineString other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class LinkedCrs : Crs, IEquatable + { + public string Href { get; } + public string HrefType { get; } + public bool Equals(LinkedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class MultiPolygon : Geometry, IEquatable + { + public MultiPolygon(IList polygons); + public MultiPolygon(IList polygons, GeometryParams geometryParams); + public ReadOnlyCollection Polygons { get; } + public bool Equals(MultiPolygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class NamedCrs : Crs, IEquatable + { + public string Name { get; } + public bool Equals(NamedCrs other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Point : Geometry, IEquatable + { + public Point(Position position); + public Point(Position position, GeometryParams geometryParams); + public Point(double longitude, double latitude); + public Position Position { get; } + public bool Equals(Point other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Polygon : Geometry, IEquatable + { + public Polygon(IList rings); + public Polygon(IList rings, GeometryParams geometryParams); + public Polygon(IList externalRingPositions); + public ReadOnlyCollection Rings { get; } + public bool Equals(Polygon other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class PolygonCoordinates : IEquatable + { + public PolygonCoordinates(IList rings); + public ReadOnlyCollection Rings { get; } + public bool Equals(PolygonCoordinates other); + public override bool Equals(object obj); + public override int GetHashCode(); + } + public sealed class Position : IEquatable + { + public Position(IList coordinates); + public Position(double longitude, double latitude); + public Position(double longitude, double latitude, Nullable altitude); + public Nullable Altitude { get; } + public ReadOnlyCollection Coordinates { get; } + public double Latitude { get; } + public double Longitude { get; } + public bool Equals(Position other); + public override bool Equals(object obj); + public override int GetHashCode(); + } +} diff --git a/changelog.md b/changelog.md index 27ec98fae0..d6ca1007c1 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,6 @@ ## Recommended version -The **minimum recommended version is [3.33.0](#3.33.0) when using Direct mode and [3.35.1](#3.35.1) for Gateway mode**. +The **minimum recommended version is [3.35.4](#3.35.4)**. Make sure that your applications, when using the .NET V3 SDK, are using at least the version described here to have all the critical fixes. @@ -13,6 +13,12 @@ Preview features are treated as a separate branch and will not be included in th The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [3.35.4-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.4-preview) - 2023-09-15 +### [3.35.4](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.4) - 2023-09-15 + +#### Fixed +- [3934](https://github.com/Azure/azure-cosmos-dotnet-v3/pull/3934) Subpartitioning: Fixes bug for queries on subpartitioned containers with split physical partitions + ### [3.35.3-preview](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.3-preview) - 2023-08-10 ### [3.35.3](https://www.nuget.org/packages/Microsoft.Azure.Cosmos/3.35.3) - 2023-08-10 From 258d960ae3caa3ad989f60d5e656544c35006d0a Mon Sep 17 00:00:00 2001 From: Aditya Date: Mon, 18 Sep 2023 11:56:55 -0700 Subject: [PATCH 193/240] [Internal] Query: Fixes escaped string parsing in SqlParser (#4054) * Initial commit * Addressed comments. --- .../src/Query/Core/Parser/CstToAstVisitor.cs | 42 ++++++++++++++++++- .../BaselineTest/BaselineTests.cs | 4 +- ...onSqlParserBaselineTests.StringLiteral.xml | 38 +++++++++++++++++ .../Microsoft.Azure.Cosmos.Tests.csproj | 3 ++ .../ScalarExpressionSqlParserBaselineTests.cs | 24 +++++++++++ 5 files changed, 107 insertions(+), 4 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ScalarExpressionSqlParserBaselineTests.StringLiteral.xml diff --git a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/CstToAstVisitor.cs b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/CstToAstVisitor.cs index 7ca3a60a71..fd92b233a8 100644 --- a/Microsoft.Azure.Cosmos/src/Query/Core/Parser/CstToAstVisitor.cs +++ b/Microsoft.Azure.Cosmos/src/Query/Core/Parser/CstToAstVisitor.cs @@ -9,6 +9,7 @@ namespace Microsoft.Azure.Cosmos.Query.Core.Parser using System.Collections.Immutable; using System.Diagnostics.Contracts; using System.Globalization; + using System.Text; using Antlr4.Runtime.Misc; using Antlr4.Runtime.Tree; using Microsoft.Azure.Cosmos.SqlObjects; @@ -950,8 +951,45 @@ public UnknownSqlObjectException(SqlObject sqlObject, Exception innerException = private static string GetStringValueFromNode(IParseTree parseTree) { string text = parseTree.GetText(); - string textWithoutQuotes = text.Substring(1, text.Length - 2).Replace("\\\"", "\""); - return textWithoutQuotes; + + // 1. Remove leading and trailing (single or double) quotes. + // 2. Unescape following characters: + // \" => " + // \\ => \ + // \/ => / + // Based on the documentation, we should also escape single quote \'. + // https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/query/constants#remarks + // However that's failing in the parser (before reaching this point) and will be fixed separately (after checking server's behavior). + StringBuilder stringBuilder = new StringBuilder(text.Length); + for (int index = 1; index < text.Length - 1; index++) + { + switch (text[index]) + { + case '\\': + if ((index + 1) < (text.Length - 1)) + { + switch (text[index + 1]) + { + case '"': + case '\\': + case '/': + stringBuilder.Append(text[index + 1]); + index++; + break; + default: + stringBuilder.Append(text[index]); + break; + } + } + break; + + default: + stringBuilder.Append(text[index]); + break; + } + } + + return stringBuilder.ToString(); } private static Number64 GetNumber64ValueFromNode(IParseTree parseTree) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/BaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/BaselineTests.cs index 6e2162ee2f..419a29229b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/BaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/BaselineTests.cs @@ -135,8 +135,8 @@ public void ExecuteTestSuite(IEnumerable inputs, [CallerMemberName] stri Assert.IsTrue( matched, - $@" Baseline File {baselinePath}, - Output File {outputPath}, + $@" Baseline File {Path.GetFullPath(baselinePath)}, + Output File {Path.GetFullPath(outputPath)}, Expected: {baselineTextSuffix}, Actual: {outputTextSuffix}"); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ScalarExpressionSqlParserBaselineTests.StringLiteral.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ScalarExpressionSqlParserBaselineTests.StringLiteral.xml new file mode 100644 index 0000000000..df9e44ceda --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/BaselineTest/TestBaseline/ScalarExpressionSqlParserBaselineTests.StringLiteral.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj index 5b429468d8..88450d8984 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Microsoft.Azure.Cosmos.Tests.csproj @@ -82,6 +82,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/ScalarExpressionSqlParserBaselineTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/ScalarExpressionSqlParserBaselineTests.cs index 43377f0074..10f6fe3ee0 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/ScalarExpressionSqlParserBaselineTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Query/Parser/ScalarExpressionSqlParserBaselineTests.cs @@ -520,6 +520,30 @@ public void OrderOfOperation() this.ExecuteTestSuite(inputs); } + [TestMethod] + public void StringLiteral() + { + List inputs = new List() + { + // Single quoted string literals do not allow ' even when it's escaped. + // Parser currently fails with Antlr4.Runtime.NoViableAltException + CreateInput( + description: @"Single quoted string literals with escape seqence", + scalarExpression: @"['\""DoubleQuote', '\\ReverseSolidus', '\/solidus', '\bBackspace', '\fSeparatorFeed', '\nLineFeed', '\rCarriageReturn', '\tTab', '\u1234']"), + CreateInput( + description: @"Double quoted string literals with escape seqence", + scalarExpression: @"[""'SingleQuote"", ""\""DoubleQuote"", ""\\ReverseSolidus"", ""\/solidus"", ""\bBackspace"", ""\fSeparatorFeed"", ""\nLineFeed"", ""\rCarriageReturn"", ""\tTab"", ""\u1234""]"), + CreateInput( + description: @"Single quoted string literals special cases", + scalarExpression: @"['\""', '\""\""', '\\', '\\\\', '\/', '\/\/', '\b', '\b\b', '\f', '\f\f', '\n', '\n\n', '\r', '\r\r', '\t', '\t\t', '\u1234', '\u1234\u1234']"), + CreateInput( + description: @"Double quoted string literals special cases", + scalarExpression: @"[""\"""", ""\""\"""", ""\\"", ""\\\\"", ""\/"", ""\/\/"", ""\b"", ""\b\b"", ""\f"", ""\f\f"", ""\n"", ""\n\n"", ""\r"", ""\r\r"", ""\t"", ""\t\t"", ""\u1234"", ""\u1234\u1234""]"), + }; + + this.ExecuteTestSuite(inputs); + } + public static SqlParserBaselineTestInput CreateInput(string description, string scalarExpression) { return new SqlParserBaselineTestInput(description, $"SELECT VALUE {scalarExpression}"); From 373ab9ec9d3576bc4bac491f5fd4fead3767370e Mon Sep 17 00:00:00 2001 From: Sourabh Jain Date: Wed, 20 Sep 2023 20:32:15 +0530 Subject: [PATCH 194/240] Bechmark : Fixes benchmark runs (#4088) * pk to result container * set pk * pk value fix * update run.sh * remove changes value * remove telemetry service end point * cleanup --- .../Tools/Benchmark/BenchmarkProgress.cs | 7 ++++++- .../Tools/Benchmark/Program.cs | 12 +++++++----- .../Tools/Benchmark/README.md | 4 ++-- .../Tools/Benchmark/loop.sh | 1 - .../Tools/Benchmark/run.sh | 18 ++++++------------ 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkProgress.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkProgress.cs index 6a7650a5cd..584f9e7a29 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkProgress.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/BenchmarkProgress.cs @@ -15,13 +15,18 @@ namespace CosmosBenchmark /// public class BenchmarkProgress { - /// /// Record item id /// [JsonProperty] public string id { get; set; } + /// + /// Record item pk + /// + [JsonProperty] + public string pk { get; set; } + /// /// Machine name /// diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs index d1f8677cc6..9bbb33b9fd 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/Program.cs @@ -177,7 +177,6 @@ private async Task ExecuteAsync(BenchmarkConfig config) Utility.TeePrint("Starting Inserts with {0} tasks", taskCount); - string partitionKeyPath = containerResponse.Resource.PartitionKeyPath; int opsPerTask = config.ItemCount / taskCount; @@ -217,7 +216,6 @@ private async Task ExecuteAsync(BenchmarkConfig config) } runSummary.ConsistencyLevel = consistencyLevel; - BenchmarkProgress benchmarkProgress = await CompleteBenchmarkProgressStatus(benchmarkProgressItem, resultContainer); if (config.PublishResults) { @@ -348,11 +346,12 @@ private static async Task CreateBenchmarkProgressItem(Contain id = Environment.MachineName, MachineName = Environment.MachineName, JobStatus = "STARTED", - JobStartTime = DateTime.Now + JobStartTime = DateTime.Now, + pk = Environment.MachineName }; ItemResponse itemResponse = await resultContainer.UpsertItemAsync( - benchmarkProgress, new PartitionKey(benchmarkProgress.id)); + benchmarkProgress, new PartitionKey(benchmarkProgress.pk)); return itemResponse.Resource; } @@ -378,7 +377,10 @@ public static async Task CompleteBenchmarkProgressStatus(Benc private static async Task GetResultContainer(BenchmarkConfig config, CosmosClient cosmosClient) { Database database = cosmosClient.GetDatabase(config.ResultsDatabase ?? config.Database); - ContainerResponse containerResponse = await database.CreateContainerIfNotExistsAsync(id: config.ResultsContainer, partitionKeyPath: "/id"); + ContainerResponse containerResponse = await database + .CreateContainerIfNotExistsAsync( + id: config.ResultsContainer, + partitionKeyPath: "/pk"); return containerResponse.Container; } diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/README.md b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/README.md index 5a2bac1937..afbaf84bc6 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/README.md +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/README.md @@ -114,9 +114,9 @@ Copyright (C) 2019 CosmosBenchmark --branchname Branch name, only for publish --resultspartitionkeyvalue Partitionkey, only for publish --disablecoresdklogging Disable core SDK logging - --enabletelemetry Enable Telemetry + --enabletelemetry Enable Telemetry Feature --telemetryscheduleinsec Telemetry Schedule in Seconds - --telemetryendpoint Telemetry Endpoint + --enableDistributedTracing Enable Distributed Tracing Feature --resultsendpoint Endpoint to publish results to --resultskey Key to publish results to --resultsdatabase Database to publish results to diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/loop.sh b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/loop.sh index 845f1c0022..11ff4ebf8a 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/loop.sh +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/loop.sh @@ -7,7 +7,6 @@ export PL=18 #These must be configured export ACCOUNT_ENDPOINT= export ACCOUNT_KEY= -export TELEMETRY_ENDPOINT= #Loop forever i=0 diff --git a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh index 81cafc4a4a..71b647d72d 100644 --- a/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh +++ b/Microsoft.Azure.Cosmos.Samples/Tools/Benchmark/run.sh @@ -24,12 +24,6 @@ then exit -1 fi -if [ -z "$TELEMETRY_ENDPOINT" ] -then - echo "Missing TELEMETRY_ENDPOINT" - exit -1 -fi - if [ -z "$INCLUDE_QUERY" ] then echo "Missing INCLUDE_QUERY" @@ -47,26 +41,26 @@ echo $COMMIT_TIME echo $BRANCH_NAME # Client telemetry disabled ReadStreamExistsV3 -dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk +dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --disableClientTelemetry --disableDistributedTracing --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --partitionkeypath /pk --container testcol sleep 10 #Wait # Client telemetry enabled ReadStreamExistsV3. This is needed to see the impact of client telemetry. -dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithTelemetry --enableTelemetry --telemetryScheduleInSec 60 --telemetryEndpoint $TELEMETRY_ENDPOINT --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk +dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithTelemetry --telemetryScheduleInSec 60 --disableDistributedTracing --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --partitionkeypath /pk --container testcol sleep 10 #Wait # Open telemetry enabled ReadStreamExistsV3. This is needed to see the impact of distributed tracing (without listener) -dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithDistributedTracingWOListener --enableDistributedTracing --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk +dotnet run -c Release -- -n 2000000 -w ReadStreamExistsV3 --WorkloadName ReadStreamExistsV3WithDistributedTracingWOListener --disableClientTelemetry --tcp 10 --pl $PL -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --partitionkeypath /pk --container testcol sleep 10 #Wait #Point read operations for WORKLOAD_NAME in ReadNotExistsV3 ReadTExistsV3 ReadStreamExistsWithDiagnosticsV3 do - dotnet run -c Release -- -n 2000000 -w $WORKLOAD_NAME --pl $PL --enableTelemetry --telemetryScheduleInSec 60 --telemetryEndpoint $TELEMETRY_ENDPOINT --tcp 10 -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk + dotnet run -c Release -- -n 2000000 -w $WORKLOAD_NAME --pl $PL --telemetryScheduleInSec 60 --tcp 10 -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --partitionkeypath /pk --container testcol sleep 10 #Wait done #Insert operation -dotnet run -c Release -- -n 2000000 -w InsertV3 --pl 30 --enableTelemetry --telemetryScheduleInSec 60 --telemetryEndpoint $TELEMETRY_ENDPOINT --tcp 1 -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk +dotnet run -c Release -- -n 2000000 -w InsertV3 --pl 30 --telemetryScheduleInSec 60 --tcp 1 -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --partitionkeypath /pk --container testcol sleep 45 #Wait if [ "$INCLUDE_QUERY" = true ] @@ -76,7 +70,7 @@ then # pl is 16 because 18 was casuing a small amount of thorrtles. for WORKLOAD_NAME in ReadFeedStreamV3 QueryTSinglePkV3 QueryTSinglePkOrderByWithPaginationV3 QueryTSinglePkOrderByFullDrainV3 QueryTCrossPkV3 QueryTCrossPkOrderByWithPaginationV3 QueryTCrossPkOrderByFullDrainV3 QueryStreamSinglePkV3 QueryStreamSinglePkOrderByWithPaginationV3 QueryStreamSinglePkOrderByFullDrainV3 QueryStreamCrossPkV3 QueryStreamCrossPkOrderByWithPaginationV3 QueryStreamCrossPkOrderByFullDrainV3 do - dotnet run -c Release -- -n 200000 -w $WORKLOAD_NAME --pl 16 --enableTelemetry --telemetryScheduleInSec 60 --telemetryEndpoint $TELEMETRY_ENDPOINT --tcp 10 -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --container testcol --partitionkeypath /pk + dotnet run -c Release -- -n 200000 -w $WORKLOAD_NAME --pl 16 --telemetryScheduleInSec 60 --tcp 10 -e $ACCOUNT_ENDPOINT -k $ACCOUNT_KEY --enablelatencypercentiles --disablecoresdklogging --publishresults --resultspartitionkeyvalue $RESULTS_PK --commitid $COMMIT_ID --commitdate $COMMIT_DATE --committime $COMMIT_TIME --branchname $BRANCH_NAME --database testdb --partitionkeypath /pk --container testcol sleep 10 #Wait done fi \ No newline at end of file From 9f8d84860d3170d8a95b278a51ac2792a927a1ab Mon Sep 17 00:00:00 2001 From: leminh98 Date: Wed, 20 Sep 2023 12:00:09 -0700 Subject: [PATCH 195/240] [Internal] Query: Adds Index Metrics V2 Object Model (#4058) * making necessary ownership change * made change to ownerships * header test * Call to TryCreate instead of Create in Responsemessage * Add baseline test infra for index metric parser * update baseline files * Add parse retry logic * Update headers test * address code review * address code review * fix tests * Update csproj file * Adopt the new header * update the response to parse with text instead of base 64 * test for headers adoption of uri escape * Add URI Decode logic * Update baseline * Update with the new header name from back end * update the query parsing requirement * New Index Metrics DOM * fix build error * Code clean up * Address code review * Turn off switching to V2 * Fix test * fix test errors * Address code review comment * addressed code review * removed the empty entity * update test parse * update test --------- Co-authored-by: Minh Le --- .../src/Handler/ResponseMessage.cs | 22 +++-- .../Metrics/CompositeIndexIndexMetrics.cs | 48 +++++++++++ .../Query/Core/Metrics/IndexMetricsInfo.cs | 83 +++++++++++++++++++ .../Core/Metrics/IndexMetricsInfoEntity.cs | 43 ++++++++++ ...xMetricWriter.cs => IndexMetricsWriter.cs} | 34 ++++---- .../Core/Metrics/IndexUtilizationInfo.cs | 42 +++------- .../Core/Metrics/SingleIndexIndexMetrics.cs | 47 +++++++++++ .../DefaultDocumentQueryExecutionContext.cs | 2 +- .../src/Query/v3Query/QueryResponse.cs | 9 +- .../src/RequestOptions/QueryRequestOptions.cs | 1 + .../IndexMetricsParserBaselineTest.cs | 1 + .../Query/PopulateIndexMetricsTest.cs | 10 --- .../QueryTests.cs | 2 +- .../Metrics/IndexUtilizationInfoTests.cs | 4 +- 14 files changed, 276 insertions(+), 72 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/CompositeIndexIndexMetrics.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexMetricsInfo.cs create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/IndexMetricsInfoEntity.cs rename Microsoft.Azure.Cosmos/src/Query/Core/Metrics/{IndexMetricWriter.cs => IndexMetricsWriter.cs} (65%) create mode 100644 Microsoft.Azure.Cosmos/src/Query/Core/Metrics/SingleIndexIndexMetrics.cs diff --git a/Microsoft.Azure.Cosmos/src/Handler/ResponseMessage.cs b/Microsoft.Azure.Cosmos/src/Handler/ResponseMessage.cs index 9694a14713..60ff675172 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/ResponseMessage.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/ResponseMessage.cs @@ -251,21 +251,27 @@ private void CheckDisposed() /// Decode the Index Metrics from the response headers, if exists. ///