diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs index 35dae71952..114f1cc906 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs @@ -694,7 +694,35 @@ public Func HttpClientFactory /// /// Availability Strategy to be used for periods of high latency /// - internal AvailabilityStrategy AvailabilityStrategy { get; set; } + /// /// + /// An example on how to set an availability strategy custom serializer. + /// + /// { "East US", "Central US", "West US" } ) + /// .WithAvailabilityStrategy( + /// AvailabilityStrategy.CrossRegionHedgingStrategy( + /// threshold: TimeSpan.FromMilliseconds(500), + /// thresholdStep: TimeSpan.FromMilliseconds(100) + /// )) + /// .Build(); + /// ]]> + /// + /// + /// + /// The availability strategy in the example is a Cross Region Hedging Strategy. + /// These strategies take two values, a threshold and a threshold step.When a request that is sent + /// out takes longer than the threshold time, the SDK will hedge to the second region in the application preferred regions list. + /// If a response from either the primary request or the first hedged request is not received + /// after the threshold step time, the SDK will hedge to the third region and so on. + /// +#if PREVIEW + public +#else + internal +#endif + AvailabilityStrategy AvailabilityStrategy { get; set; } /// /// Enable partition key level failover @@ -887,7 +915,8 @@ internal virtual ConnectionPolicy GetConnectionPolicy(int clientId) { this.ValidateDirectTCPSettings(); this.ValidateLimitToEndpointSettings(); - this.ValidatePartitionLevelFailoverSettings(); + this.ValidatePartitionLevelFailoverSettings(); + this.ValidateAvailabilityStrategy(); ConnectionPolicy connectionPolicy = new ConnectionPolicy() { @@ -1064,6 +1093,15 @@ private void ValidatePartitionLevelFailoverSettings() { throw new ArgumentException($"{nameof(this.ApplicationPreferredRegions)} is required when {nameof(this.EnablePartitionLevelFailover)} is enabled."); } + } + + private void ValidateAvailabilityStrategy() + { + if (this.AvailabilityStrategy != null + && this.ApplicationPreferredRegions == null && this.ApplicationRegion == null) + { + throw new ArgumentException($"{nameof(this.ApplicationPreferredRegions)} or {nameof(this.ApplicationRegion)} must be set to use {nameof(this.AvailabilityStrategy)}"); + } } private void ValidateDirectTCPSettings() diff --git a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs index c614068fae..8459bf0710 100644 --- a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs +++ b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs @@ -705,7 +705,12 @@ internal CosmosClientBuilder WithApiType(ApiType apiType) /// /// /// The CosmosClientBuilder - internal CosmosClientBuilder WithAvailibilityStrategy(AvailabilityStrategy strategy) +#if PREVIEW + public +#else + internal +#endif + CosmosClientBuilder WithAvailibilityStrategy(AvailabilityStrategy strategy) { this.clientOptions.AvailabilityStrategy = strategy; return this; diff --git a/Microsoft.Azure.Cosmos/src/Handler/RequestInvokerHandler.cs b/Microsoft.Azure.Cosmos/src/Handler/RequestInvokerHandler.cs index c1f59cd466..f903906902 100644 --- a/Microsoft.Azure.Cosmos/src/Handler/RequestInvokerHandler.cs +++ b/Microsoft.Azure.Cosmos/src/Handler/RequestInvokerHandler.cs @@ -79,7 +79,7 @@ public override async Task SendAsync( await request.AssertPartitioningDetailsAsync(this.client, cancellationToken, request.Trace); this.FillMultiMasterContext(request); - AvailabilityStrategy strategy = this.AvailabilityStrategy(request); + AvailabilityStrategyInternal strategy = this.AvailabilityStrategy(request); ResponseMessage response = strategy != null && strategy.Enabled() ? await strategy.ExecuteAvailabilityStrategyAsync( @@ -103,10 +103,17 @@ public override async Task SendAsync( /// /// /// whether the request should be a parallel hedging request. - public AvailabilityStrategy AvailabilityStrategy(RequestMessage request) + public AvailabilityStrategyInternal AvailabilityStrategy(RequestMessage request) { - return request.RequestOptions?.AvailabilityStrategy + AvailabilityStrategy strategy = request.RequestOptions?.AvailabilityStrategy ?? this.client.ClientOptions.AvailabilityStrategy; + + if (strategy == null) + { + return null; + } + + return strategy as AvailabilityStrategyInternal; } public virtual async Task BaseSendAsync( diff --git a/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs b/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs index 14b6c812d0..7555c6b78d 100644 --- a/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs +++ b/Microsoft.Azure.Cosmos/src/RequestOptions/RequestOptions.cs @@ -76,7 +76,12 @@ public class RequestOptions /// reduce latency and increase availability. Currently there is one type of availability strategy, parallel request hedging. /// If there is a globally enabled availability strategy, setting one in the request options will override the global one. /// - internal AvailabilityStrategy AvailabilityStrategy { get; set; } +#if PREVIEW + public +#else + internal +#endif + AvailabilityStrategy AvailabilityStrategy { 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/AvailabilityStrategy/AvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs index 994449996b..7cb155737c 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs @@ -4,29 +4,46 @@ namespace Microsoft.Azure.Cosmos { using System; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.Azure.Cosmos.Handlers; /// /// Types of availability strategies supported /// - internal abstract class AvailabilityStrategy +#if PREVIEW + public +#else + internal +#endif + abstract class AvailabilityStrategy { /// - /// Execute the availability strategy + /// Default constructor /// - /// - /// - /// - /// - /// The response from the service after the availability strategy is executed - public abstract Task ExecuteAvailabilityStrategyAsync( - Func> sender, - CosmosClient client, - RequestMessage requestMessage, - CancellationToken cancellationToken); + internal AvailabilityStrategy() + { + } - internal abstract bool Enabled(); + /// + /// Used on a per request level to disable a client level AvailabilityStrategy + /// + /// something + internal static AvailabilityStrategy DisabledStrategy() + { + return new DisabledAvailabilityStrategy(); + } + + /// + /// After a request's duration passes a threshold, this strategy will send out + /// hedged request to other regions. The first hedge request will be sent after the threshold. + /// After that, the strategy will send out a request every thresholdStep + /// until the request is completed or regions are exausted + /// + /// how long before SDK begins hedging + /// Period of time between first hedge and next hedging attempts + /// something + public static AvailabilityStrategy CrossRegionHedgingStrategy(TimeSpan threshold, + TimeSpan? thresholdStep) + { + return new CrossRegionHedgingAvailabilityStrategy(threshold, thresholdStep); + } } } \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategyInternal.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategyInternal.cs new file mode 100644 index 0000000000..500a638de2 --- /dev/null +++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategyInternal.cs @@ -0,0 +1,33 @@ +// ------------------------------------------------------------ +// Copyright (c) Microsoft Corporation. All rights reserved. +// ------------------------------------------------------------ + +namespace Microsoft.Azure.Cosmos +{ + using System; + using System.Threading; + using System.Threading.Tasks; + + internal abstract class AvailabilityStrategyInternal : AvailabilityStrategy + { + /// + /// Execute the availability strategy + /// + /// + /// + /// + /// + /// The response from the service after the availability strategy is executed + internal abstract Task ExecuteAvailabilityStrategyAsync( + Func> sender, + CosmosClient client, + RequestMessage requestMessage, + CancellationToken cancellationToken); + + /// + /// Checks to see if the strategy is enabled + /// + /// a bool representing if the strategy is enabled + internal abstract bool Enabled(); + } +} diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs similarity index 94% rename from Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs rename to Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs index 418bbc36e8..a6ed3bfea7 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs @@ -16,12 +16,12 @@ namespace Microsoft.Azure.Cosmos using Microsoft.Azure.Documents; /// - /// Parallel hedging availability strategy. Once threshold time is reached, + /// Hedging availability strategy. Once threshold time is reached, /// the SDK will send out an additional request to a remote region in parallel - /// if the first parallel request or the original has not returned after the step time, - /// additional parallel requests will be sent out there is a response or all regions are exausted. + /// if the first hedging request or the original has not returned after the step time, + /// additional hedged requests will be sent out there is a response or all regions are exausted. /// - internal class CrossRegionParallelHedgingAvailabilityStrategy : AvailabilityStrategy + internal class CrossRegionHedgingAvailabilityStrategy : AvailabilityStrategyInternal { private const string HedgeContext = "Hedge Context"; private const string ResponseRegion = "Response Region"; @@ -37,11 +37,11 @@ internal class CrossRegionParallelHedgingAvailabilityStrategy : AvailabilityStra public TimeSpan ThresholdStep { get; private set; } /// - /// Constructor for parallel hedging availability strategy + /// Constructor for hedging availability strategy /// /// /// - public CrossRegionParallelHedgingAvailabilityStrategy( + public CrossRegionHedgingAvailabilityStrategy( TimeSpan threshold, TimeSpan? thresholdStep) { @@ -59,17 +59,18 @@ public CrossRegionParallelHedgingAvailabilityStrategy( this.ThresholdStep = thresholdStep ?? TimeSpan.FromMilliseconds(-1); } + /// internal override bool Enabled() { return true; } /// - /// This method determines if the request should be sent with a parallel hedging availability strategy. + /// This method determines if the request should be sent with a hedging availability strategy. /// This availability strategy can only be used if the request is a read-only request on a document request. /// /// - /// whether the request should be a parallel hedging request. + /// whether the request should be a hedging request. internal bool ShouldHedge(RequestMessage request) { //Only use availability strategy for document point operations @@ -88,20 +89,21 @@ internal bool ShouldHedge(RequestMessage request) } /// - /// Execute the parallel hedging availability strategy + /// Execute the hedging availability strategy /// /// /// /// /// /// The response after executing cross region hedging - public override async Task ExecuteAvailabilityStrategyAsync( + internal override async Task ExecuteAvailabilityStrategyAsync( Func> sender, CosmosClient client, RequestMessage request, CancellationToken cancellationToken) { - if (!this.ShouldHedge(request)) + if (!this.ShouldHedge(request) + || client.DocumentClient.GlobalEndpointManager.ReadEndpoints.Count == 1) { return await sender(request, cancellationToken); } diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs index defa3a61c8..eef9705363 100644 --- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs +++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs @@ -10,8 +10,9 @@ namespace Microsoft.Azure.Cosmos /// /// A Disabled availability strategy that does not do anything. Used for overriding the default global availability strategy. /// - internal class DisabledAvailabilityStrategy : AvailabilityStrategy + internal class DisabledAvailabilityStrategy : AvailabilityStrategyInternal { + /// internal override bool Enabled() { return false; @@ -25,7 +26,7 @@ internal override bool Enabled() /// /// /// nothing, this will throw. - public override Task ExecuteAvailabilityStrategyAsync( + internal override Task ExecuteAvailabilityStrategyAsync( Func> sender, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs index cd211c7437..0bcf55481c 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs @@ -198,7 +198,7 @@ public async Task AvailabilityStrategyNoTriggerTest() { ConnectionMode = ConnectionMode.Direct, ApplicationPreferredRegions = new List() { "Central US", "North Central US" }, - AvailabilityStrategy = new CrossRegionParallelHedgingAvailabilityStrategy( + AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingStrategy( threshold: TimeSpan.FromMilliseconds(300), thresholdStep: TimeSpan.FromMilliseconds(50)), Serializer = this.cosmosSystemTextJsonSerializer @@ -272,7 +272,7 @@ public async Task AvailabilityStrategyRequestOptionsTriggerTest() ItemRequestOptions requestOptions = new ItemRequestOptions { - AvailabilityStrategy = new CrossRegionParallelHedgingAvailabilityStrategy( + AvailabilityStrategy = new CrossRegionHedgingAvailabilityStrategy( threshold: TimeSpan.FromMilliseconds(100), thresholdStep: TimeSpan.FromMilliseconds(50)) }; @@ -317,7 +317,7 @@ public async Task AvailabilityStrategyDisableOverideTest() { ConnectionMode = ConnectionMode.Direct, ApplicationPreferredRegions = new List() { "Central US", "North Central US" }, - AvailabilityStrategy = new CrossRegionParallelHedgingAvailabilityStrategy( + AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingStrategy( threshold: TimeSpan.FromMilliseconds(100), thresholdStep: TimeSpan.FromMilliseconds(50)), Serializer = this.cosmosSystemTextJsonSerializer @@ -416,7 +416,7 @@ public async Task AvailabilityStrategyAllFaultsTests(string operation, string co { ConnectionMode = ConnectionMode.Direct, ApplicationPreferredRegions = new List() { "Central US", "North Central US" }, - AvailabilityStrategy = new CrossRegionParallelHedgingAvailabilityStrategy( + AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingStrategy( threshold: TimeSpan.FromMilliseconds(100), thresholdStep: TimeSpan.FromMilliseconds(50)), Serializer = this.cosmosSystemTextJsonSerializer @@ -597,7 +597,7 @@ public async Task AvailabilityStrategyStepTests(string operation, string condito { ConnectionMode = ConnectionMode.Direct, ApplicationPreferredRegions = new List() { "Central US", "North Central US", "East US" }, - AvailabilityStrategy = new CrossRegionParallelHedgingAvailabilityStrategy( + AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingStrategy( threshold: TimeSpan.FromMilliseconds(100), thresholdStep: TimeSpan.FromMilliseconds(50)), Serializer = this.cosmosSystemTextJsonSerializer diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiRegionDiagnosticsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiRegionDiagnosticsTests.cs index e10c095b1c..67859724c6 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiRegionDiagnosticsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiRegionDiagnosticsTests.cs @@ -105,7 +105,7 @@ public async Task HedgeNestingDiagnosticsTest() ItemRequestOptions requestOptions = new ItemRequestOptions { - AvailabilityStrategy = new CrossRegionParallelHedgingAvailabilityStrategy( + AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingStrategy( threshold: TimeSpan.FromMilliseconds(100), thresholdStep: TimeSpan.FromMilliseconds(50)) }; 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 8c46a28c20..c1ae276ee7 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 @@ -1,5 +1,16 @@ { "Subclasses": { + "Microsoft.Azure.Cosmos.AvailabilityStrategy;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.AvailabilityStrategy CrossRegionHedgingStrategy(System.TimeSpan, System.Nullable`1[System.TimeSpan])": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.AvailabilityStrategy CrossRegionHedgingStrategy(System.TimeSpan, System.Nullable`1[System.TimeSpan]);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.ChangeFeedItem`1;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:True;IsSerializable:False": { "Subclasses": {}, "Members": { @@ -377,6 +388,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": { + "Microsoft.Azure.Cosmos.AvailabilityStrategy AvailabilityStrategy": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.AvailabilityStrategy AvailabilityStrategy;CanRead:True;CanWrite:True;Microsoft.Azure.Cosmos.AvailabilityStrategy get_AvailabilityStrategy();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_AvailabilityStrategy(Microsoft.Azure.Cosmos.AvailabilityStrategy);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.AvailabilityStrategy get_AvailabilityStrategy()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Microsoft.Azure.Cosmos.AvailabilityStrategy get_AvailabilityStrategy();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_AvailabilityStrategy(Microsoft.Azure.Cosmos.AvailabilityStrategy)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_AvailabilityStrategy(Microsoft.Azure.Cosmos.AvailabilityStrategy);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.DistanceFunction;System.Enum;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:True;IsClass:False;IsValueType:True;IsNested:False;IsGenericType:False;IsSerializable:True": { "Subclasses": {}, "Members": { @@ -570,6 +606,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 WithAvailibilityStrategy(Microsoft.Azure.Cosmos.AvailabilityStrategy)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.Fluent.CosmosClientBuilder WithAvailibilityStrategy(Microsoft.Azure.Cosmos.AvailabilityStrategy);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.Fluent.IndexingPolicyDefinition`1;System.Object;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:True;IsSerializable:False": { "Subclasses": {}, "Members": { @@ -658,6 +705,31 @@ }, "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": { + "Microsoft.Azure.Cosmos.AvailabilityStrategy AvailabilityStrategy": { + "Type": "Property", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.AvailabilityStrategy AvailabilityStrategy;CanRead:True;CanWrite:True;Microsoft.Azure.Cosmos.AvailabilityStrategy get_AvailabilityStrategy();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_AvailabilityStrategy(Microsoft.Azure.Cosmos.AvailabilityStrategy);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.AvailabilityStrategy get_AvailabilityStrategy()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Microsoft.Azure.Cosmos.AvailabilityStrategy get_AvailabilityStrategy();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void set_AvailabilityStrategy(Microsoft.Azure.Cosmos.AvailabilityStrategy)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { + "Type": "Method", + "Attributes": [ + "CompilerGeneratedAttribute" + ], + "MethodInfo": "Void set_AvailabilityStrategy(Microsoft.Azure.Cosmos.AvailabilityStrategy);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.VectorDataType;System.Enum;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:True;IsClass:False;IsValueType:True;IsNested:False;IsGenericType:False;IsSerializable:True": { "Subclasses": {}, "Members": { 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 fa6dcf693d..d3d89a1664 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 @@ -7,7 +7,6 @@ namespace Microsoft.Azure.Cosmos.Tests.Telemetry using System; using System.Collections.Generic; using System.Collections.ObjectModel; - using System.Diagnostics; using System.Linq; using System.Net; using System.Reflection; @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Cosmos.Tests.Telemetry using Microsoft.Azure.Cosmos.Tracing; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; - using static Microsoft.Azure.Cosmos.CrossRegionParallelHedgingAvailabilityStrategy; [TestClass] public class OpenTelemetryRecorderTests @@ -173,7 +171,7 @@ public async Task CheckResponseCompatibility() Assert.AreEqual( "HedgingResponse", hedgingResponse, - "HedgingResponse is only used internally in the CrossRegionParallelHedgingAvailabilityStrategy and is never returned. No support Needed."); + "HedgingResponse is only used internally in the CrossRegionHedgingAvailabilityStrategy and is never returned. No support Needed."); } else {