Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hedging: Adds Read hedging PREVIEW contracts #4598

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
d26111e
Update contracts
NaluTripician Jul 22, 2024
3028607
removed unneeded changes
NaluTripician Jul 22, 2024
e444eb2
made other contracts public
NaluTripician Jul 23, 2024
a0c6bc7
update enable method
NaluTripician Jul 23, 2024
ddfc265
comments
NaluTripician Jul 24, 2024
b3d3cc7
Merge branch 'master' into users/nalutripician/hedgingPreviewAPIs
NaluTripician Jul 24, 2024
2bab5b6
contract update
NaluTripician Jul 24, 2024
49d6150
Merge branch 'master' into users/nalutripician/hedgingPreviewAPIs
NaluTripician Jul 30, 2024
bd0a406
Merge branch 'master' into users/nalutripician/hedgingPreviewAPIs
NaluTripician Aug 2, 2024
f40e734
Merge branch 'master' into users/nalutripician/hedgingPreviewAPIs
NaluTripician Aug 9, 2024
02cc8bb
changed eneabled to internal
NaluTripician Aug 12, 2024
f7da9f0
fixed internal method
NaluTripician Aug 12, 2024
da73fa6
Revert "fixed internal method"
NaluTripician Aug 12, 2024
e9b3d93
revert + change methods to internal
NaluTripician Aug 12, 2024
28addfc
fixed internal
NaluTripician Aug 12, 2024
9340015
Merge branch 'master' into users/nalutripician/hedgingPreviewAPIs
NaluTripician Aug 12, 2024
97509fc
changed to factory creation
NaluTripician Aug 13, 2024
1665cdb
disabledstrat fix
NaluTripician Aug 13, 2024
bd4f0f4
fixed test + contracts
NaluTripician Aug 13, 2024
43713ee
Merge branch 'master' into users/nalutripician/hedgingPreviewAPIs
NaluTripician Aug 13, 2024
343b3eb
xml changes
NaluTripician Aug 13, 2024
c2f352b
Merge branch 'users/nalutripician/hedgingPreviewAPIs' of https://gith…
NaluTripician Aug 13, 2024
391c20f
updated comments
NaluTripician Aug 13, 2024
98bc27b
Fixed Tests
NaluTripician Aug 13, 2024
02b94d2
Merge branch 'master' into users/nalutripician/hedgingPreviewAPIs
NaluTripician Aug 14, 2024
2010458
requested changes
NaluTripician Aug 14, 2024
2ceae54
added client options check and one region check
NaluTripician Aug 14, 2024
8fde5bf
fix get
NaluTripician Aug 15, 2024
a779ab8
fixed test
NaluTripician Aug 15, 2024
c9e5023
fixed set
NaluTripician Aug 15, 2024
c046248
fix client options
NaluTripician Aug 15, 2024
6f04933
Merge branch 'master' into users/nalutripician/hedgingPreviewAPIs
NaluTripician Aug 15, 2024
dfb0a54
updatecontracts
NaluTripician Aug 15, 2024
6bb9e31
requested changes
NaluTripician Aug 16, 2024
0e9c7a8
fixed validate method
NaluTripician Aug 16, 2024
0bf56c5
Delete MultiRegionSetupHelpers.cs
NaluTripician Aug 16, 2024
1a24ebc
update contracts
NaluTripician Aug 16, 2024
499fa56
Merge branch 'master' into users/nalutripician/hedgingPreviewAPIs
NaluTripician Aug 21, 2024
5d3fdce
Merge branch 'master' into users/nalutripician/hedgingPreviewAPIs
NaluTripician Aug 23, 2024
0f9ee95
fixed merge
NaluTripician Aug 23, 2024
8ae8813
fixed check
NaluTripician Aug 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ namespace Microsoft.Azure.Cosmos
/// <summary>
/// Types of availability strategies supported
/// </summary>
internal abstract class AvailabilityStrategy
NaluTripician marked this conversation as resolved.
Show resolved Hide resolved
#if PREVIEW
public
#else
internal
#endif
abstract class AvailabilityStrategy
NaluTripician marked this conversation as resolved.
Show resolved Hide resolved
{
/// <summary>
/// Execute the availability strategy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ namespace Microsoft.Azure.Cosmos
/// 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.
/// </summary>
internal class CrossRegionParallelHedgingAvailabilityStrategy : AvailabilityStrategy
#if PREVIEW
public
#else
internal
#endif
class CrossRegionParallelHedgingAvailabilityStrategy : AvailabilityStrategy
{
private const string HedgeRegions = "Hedge Regions";
private const string HedgeContext = "Hedge Context";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ namespace Microsoft.Azure.Cosmos
/// <summary>
/// A Disabled availability strategy that does not do anything. Used for overriding the default global availability strategy.
/// </summary>
internal class DisabledAvailabilityStrategy : AvailabilityStrategy
#if PREVIEW
public
#else
internal
#endif
class DisabledAvailabilityStrategy : AvailabilityStrategy
{
internal override bool Enabled()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,75 @@
{
"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": {
"Microsoft.Azure.Cosmos.CrossRegionParallelHedgingAvailabilityStrategy;Microsoft.Azure.Cosmos.AvailabilityStrategy;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": {
"Subclasses": {},
"Members": {
"System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage] ExecuteAvailabilityStrategyAsync(System.Func`3[Microsoft.Azure.Cosmos.RequestMessage,System.Threading.CancellationToken,System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage]], Microsoft.Azure.Cosmos.CosmosClient, Microsoft.Azure.Cosmos.RequestMessage, System.Threading.CancellationToken)[System.Runtime.CompilerServices.AsyncStateMachineAttribute(typeof(Microsoft.Azure.Cosmos.CrossRegionParallelHedgingAvailabilityStrategy+<ExecuteAvailabilityStrategyAsync>))]": {
"Type": "Method",
"Attributes": [
"AsyncStateMachineAttribute"
],
"MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage] ExecuteAvailabilityStrategyAsync(System.Func`3[Microsoft.Azure.Cosmos.RequestMessage,System.Threading.CancellationToken,System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage]], Microsoft.Azure.Cosmos.CosmosClient, Microsoft.Azure.Cosmos.RequestMessage, System.Threading.CancellationToken);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.TimeSpan get_Threshold()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
"Attributes": [
"CompilerGeneratedAttribute"
],
"MethodInfo": "System.TimeSpan get_Threshold();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.TimeSpan get_ThresholdStep()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
"Attributes": [
"CompilerGeneratedAttribute"
],
"MethodInfo": "System.TimeSpan get_ThresholdStep();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.TimeSpan Threshold": {
"Type": "Property",
"Attributes": [],
"MethodInfo": "System.TimeSpan Threshold;CanRead:True;CanWrite:True;System.TimeSpan get_Threshold();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.TimeSpan ThresholdStep": {
"Type": "Property",
"Attributes": [],
"MethodInfo": "System.TimeSpan ThresholdStep;CanRead:True;CanWrite:True;System.TimeSpan get_ThresholdStep();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"Void .ctor(System.TimeSpan, System.Nullable`1[System.TimeSpan])": {
"Type": "Constructor",
"Attributes": [],
"MethodInfo": "[Void .ctor(System.TimeSpan, System.Nullable`1[System.TimeSpan]), Void .ctor(System.TimeSpan, System.Nullable`1[System.TimeSpan])]"
}
},
"NestedTypes": {}
},
"Microsoft.Azure.Cosmos.DisabledAvailabilityStrategy;Microsoft.Azure.Cosmos.AvailabilityStrategy;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": {
"Subclasses": {},
"Members": {
"System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage] ExecuteAvailabilityStrategyAsync(System.Func`3[Microsoft.Azure.Cosmos.RequestMessage,System.Threading.CancellationToken,System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage]], Microsoft.Azure.Cosmos.CosmosClient, Microsoft.Azure.Cosmos.RequestMessage, System.Threading.CancellationToken)": {
"Type": "Method",
"Attributes": [],
"MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage] ExecuteAvailabilityStrategyAsync(System.Func`3[Microsoft.Azure.Cosmos.RequestMessage,System.Threading.CancellationToken,System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage]], Microsoft.Azure.Cosmos.CosmosClient, Microsoft.Azure.Cosmos.RequestMessage, System.Threading.CancellationToken);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"Void .ctor()": {
"Type": "Constructor",
"Attributes": [],
"MethodInfo": "[Void .ctor(), Void .ctor()]"
}
},
"NestedTypes": {}
}
},
"Members": {
"System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage] ExecuteAvailabilityStrategyAsync(System.Func`3[Microsoft.Azure.Cosmos.RequestMessage,System.Threading.CancellationToken,System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage]], Microsoft.Azure.Cosmos.CosmosClient, Microsoft.Azure.Cosmos.RequestMessage, System.Threading.CancellationToken)": {
"Type": "Method",
"Attributes": [],
"MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage] ExecuteAvailabilityStrategyAsync(System.Func`3[Microsoft.Azure.Cosmos.RequestMessage,System.Threading.CancellationToken,System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage]], Microsoft.Azure.Cosmos.CosmosClient, Microsoft.Azure.Cosmos.RequestMessage, System.Threading.CancellationToken);IsAbstract:True;IsStatic:False;IsVirtual:True;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": {
Expand Down Expand Up @@ -374,6 +444,64 @@
},
"NestedTypes": {}
},
"Microsoft.Azure.Cosmos.CrossRegionParallelHedgingAvailabilityStrategy;Microsoft.Azure.Cosmos.AvailabilityStrategy;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": {
"Subclasses": {},
"Members": {
"System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage] ExecuteAvailabilityStrategyAsync(System.Func`3[Microsoft.Azure.Cosmos.RequestMessage,System.Threading.CancellationToken,System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage]], Microsoft.Azure.Cosmos.CosmosClient, Microsoft.Azure.Cosmos.RequestMessage, System.Threading.CancellationToken)[System.Runtime.CompilerServices.AsyncStateMachineAttribute(typeof(Microsoft.Azure.Cosmos.CrossRegionParallelHedgingAvailabilityStrategy+<ExecuteAvailabilityStrategyAsync>))]": {
"Type": "Method",
"Attributes": [
"AsyncStateMachineAttribute"
],
"MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage] ExecuteAvailabilityStrategyAsync(System.Func`3[Microsoft.Azure.Cosmos.RequestMessage,System.Threading.CancellationToken,System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage]], Microsoft.Azure.Cosmos.CosmosClient, Microsoft.Azure.Cosmos.RequestMessage, System.Threading.CancellationToken);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.TimeSpan get_Threshold()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
"Attributes": [
"CompilerGeneratedAttribute"
],
"MethodInfo": "System.TimeSpan get_Threshold();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.TimeSpan get_ThresholdStep()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
"Attributes": [
"CompilerGeneratedAttribute"
],
"MethodInfo": "System.TimeSpan get_ThresholdStep();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.TimeSpan Threshold": {
"Type": "Property",
"Attributes": [],
"MethodInfo": "System.TimeSpan Threshold;CanRead:True;CanWrite:True;System.TimeSpan get_Threshold();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"System.TimeSpan ThresholdStep": {
"Type": "Property",
"Attributes": [],
"MethodInfo": "System.TimeSpan ThresholdStep;CanRead:True;CanWrite:True;System.TimeSpan get_ThresholdStep();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"Void .ctor(System.TimeSpan, System.Nullable`1[System.TimeSpan])": {
"Type": "Constructor",
"Attributes": [],
"MethodInfo": "[Void .ctor(System.TimeSpan, System.Nullable`1[System.TimeSpan]), Void .ctor(System.TimeSpan, System.Nullable`1[System.TimeSpan])]"
}
},
"NestedTypes": {}
},
"Microsoft.Azure.Cosmos.DisabledAvailabilityStrategy;Microsoft.Azure.Cosmos.AvailabilityStrategy;IsAbstract:False;IsSealed:False;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": {
"Subclasses": {},
"Members": {
"System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage] ExecuteAvailabilityStrategyAsync(System.Func`3[Microsoft.Azure.Cosmos.RequestMessage,System.Threading.CancellationToken,System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage]], Microsoft.Azure.Cosmos.CosmosClient, Microsoft.Azure.Cosmos.RequestMessage, System.Threading.CancellationToken)": {
"Type": "Method",
"Attributes": [],
"MethodInfo": "System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage] ExecuteAvailabilityStrategyAsync(System.Func`3[Microsoft.Azure.Cosmos.RequestMessage,System.Threading.CancellationToken,System.Threading.Tasks.Task`1[Microsoft.Azure.Cosmos.ResponseMessage]], Microsoft.Azure.Cosmos.CosmosClient, Microsoft.Azure.Cosmos.RequestMessage, System.Threading.CancellationToken);IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
},
"Void .ctor()": {
"Type": "Constructor",
"Attributes": [],
"MethodInfo": "[Void .ctor(), Void .ctor()]"
}
},
"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": {
Expand Down
Loading