From d26111ea83c03c22f7523f9512b28ce9a978ef6c Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Mon, 22 Jul 2024 14:38:53 -0700
Subject: [PATCH 01/30] Update contracts
---
.../AvailabilityStrategy.cs | 7 +-
...gionParallelHedgingAvailabilityStrategy.cs | 7 +-
.../DisabledAvailabilityStrategy.cs | 7 +-
...eTest.IndexUtilizationHeaderLengthTest.xml | 56 ++++-
...rserBaselineTest.IndexUtilizationParse.xml | 121 ++++++++-
...rializerBaseline.TestMemberInitializer.xml | 48 ++++
...erBaseline.TestMemberInitializerDotNet.xml | 236 ++++++++++++++++++
...e.TestMemberInitializerMultiSerializer.xml | 236 ++++++++++++++++++
.../Contracts/DotNetPreviewSDKAPI.json | 128 ++++++++++
9 files changed, 828 insertions(+), 18 deletions(-)
create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializer.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
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
index 994449996b..7f155a5606 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
@@ -11,7 +11,12 @@ namespace Microsoft.Azure.Cosmos
///
/// Types of availability strategies supported
///
- internal abstract class AvailabilityStrategy
+#if PREVIEW
+ public
+#else
+ internal
+#endif
+ abstract class AvailabilityStrategy
{
///
/// Execute the availability strategy
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
index 696251d0d8..269028e48d 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
@@ -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.
///
- 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";
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
index defa3a61c8..ce431df25f 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
@@ -10,7 +10,12 @@ 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
+#if PREVIEW
+ public
+#else
+ internal
+#endif
+ class DisabledAvailabilityStrategy : AvailabilityStrategy
{
internal override bool Enabled()
{
diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationHeaderLengthTest.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationHeaderLengthTest.xml
index 4e2d3b1ade..09fc864403 100644
--- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationHeaderLengthTest.xml
+++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationHeaderLengthTest.xml
@@ -5,7 +5,16 @@
@@ -14,7 +23,19 @@
0 AND r.bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb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bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb > 0]]>
@@ -23,7 +44,22 @@
0]]>
@@ -32,7 +68,19 @@
0 AND r.cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc > 0]]>
\ No newline at end of file
diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationParse.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationParse.xml
index c1d041160a..64b6ebb12c 100644
--- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationParse.xml
+++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationParse.xml
@@ -7,7 +7,16 @@ FROM c
WHERE STARTSWITH(c.statement, 'The quick brown fox jumps over the lazy dog', false)]]>
@@ -18,7 +27,16 @@ FROM c
WHERE STARTSWITH(c['Η γÏήγοÏη ÎºÎ±Ï†Î Î±Î»ÎµÏ€Î¿Ï Ï€Î·Î´Î¬ÎµÎ¹ πάνω από το τεμπÎλικο ÏƑκυλί'], 's', false)]]>
@@ -27,7 +45,16 @@ WHERE STARTSWITH(c['Η γÏήγοÏη καφΠαÎ
@@ -36,7 +63,16 @@ WHERE STARTSWITH(c['Η γÏήγοÏη καφΠαÎ
@@ -45,7 +81,16 @@ WHERE STARTSWITH(c['Η γÏήγοÏη καφΠαÎ
?:"{}|ßÃŒÆ12ếàưỏốởặ'], 's', true) FROM root r]]>
@@ -54,7 +99,16 @@ WHERE STARTSWITH(c['Η γÏήγοÏη καφΠαÎ
@@ -63,7 +117,16 @@ WHERE STARTSWITH(c['Η γÏήγοÏη καφΠαÎ
@@ -72,7 +135,16 @@ WHERE STARTSWITH(c['Η γÏήγοÏη καφΠαÎ
@@ -81,7 +153,16 @@ WHERE STARTSWITH(c['Η γÏήγοÏη καφΠαÎ
@@ -90,7 +171,16 @@ WHERE STARTSWITH(c['Η γÏήγοÏη καφΠαÎ
@@ -99,7 +189,16 @@ WHERE STARTSWITH(c['Η γÏήγοÏη καφΠαÎ
\ No newline at end of file
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
new file mode 100644
index 0000000000..8763ef6866
--- /dev/null
+++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializer.xml
@@ -0,0 +1,48 @@
+
+
+
+
+ (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"}))]]>
+
+
+
+
+
+
+ (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/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"}))]]>
+
+
+
+
+
+
+ (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"}))]]>
+
+
+
+
+
+
+ (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"}))]]>
+
+
+
+
+
+
+ (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"}))]]>
+
+
+
+
+
+
+ (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.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json
index 4a4b7b08dc..5457e070d7 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,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+))]": {
+ "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": {
@@ -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+))]": {
+ "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": {
From 3028607c45f28caa169eda48992da2b8a33ccfea Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Mon, 22 Jul 2024 14:49:14 -0700
Subject: [PATCH 02/30] removed unneeded changes
---
...eTest.IndexUtilizationHeaderLengthTest.xml | 56 +----
...rserBaselineTest.IndexUtilizationParse.xml | 121 +--------
...rializerBaseline.TestMemberInitializer.xml | 48 ----
...erBaseline.TestMemberInitializerDotNet.xml | 236 ------------------
...e.TestMemberInitializerMultiSerializer.xml | 236 ------------------
5 files changed, 15 insertions(+), 682 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/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerDotNet.xml
delete mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerMultiSerializer.xml
diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationHeaderLengthTest.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationHeaderLengthTest.xml
index 09fc864403..4e2d3b1ade 100644
--- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationHeaderLengthTest.xml
+++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationHeaderLengthTest.xml
@@ -5,16 +5,7 @@
@@ -23,19 +14,7 @@ Index Utilization Information
0 AND r.bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb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bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb > 0]]>
@@ -44,22 +23,7 @@ Index Utilization Information
0]]>
@@ -68,19 +32,7 @@ Index Utilization Information
0 AND r.cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc > 0]]>
\ No newline at end of file
diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationParse.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationParse.xml
index 64b6ebb12c..c1d041160a 100644
--- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationParse.xml
+++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/IndexMetricsParserBaselineTest.IndexUtilizationParse.xml
@@ -7,16 +7,7 @@ FROM c
WHERE STARTSWITH(c.statement, 'The quick brown fox jumps over the lazy dog', false)]]>
@@ -27,16 +18,7 @@ FROM c
WHERE STARTSWITH(c['Η γÏήγοÏη ÎºÎ±Ï†Î Î±Î»ÎµÏ€Î¿Ï Ï€Î·Î´Î¬ÎµÎ¹ πάνω από το τεμπÎλικο ÏƑκυλί'], 's', false)]]>
@@ -45,16 +27,7 @@ Index Utilization Information
@@ -63,16 +36,7 @@ Index Utilization Information
@@ -81,16 +45,7 @@ Index Utilization Information
?:"{}|ßÃŒÆ12ếàưỏốởặ'], 's', true) FROM root r]]>
@@ -99,16 +54,7 @@ Index Utilization Information
@@ -117,16 +63,7 @@ Index Utilization Information
@@ -135,16 +72,7 @@ Index Utilization Information
@@ -153,16 +81,7 @@ Index Utilization Information
@@ -171,16 +90,7 @@ Index Utilization Information
@@ -189,16 +99,7 @@ Index Utilization Information
\ No newline at end of file
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"}))]]>
-
-
-
-
-
-
- (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/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerDotNet.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerDotNet.xml
deleted file mode 100644
index b381e2b651..0000000000
--- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerDotNet.xml
+++ /dev/null
@@ -1,236 +0,0 @@
-
-
-
-
- (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"}))]]>
-
-
-
-
-
-
- (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"}))]]>
-
-
-
-
-
-
- (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
deleted file mode 100644
index 704eb39807..0000000000
--- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializerMultiSerializer.xml
+++ /dev/null
@@ -1,236 +0,0 @@
-
-
-
-
- (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"}))]]>
-
-
-
-
-
-
- (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"}))]]>
-
-
-
-
-
-
- (doc == new DataObjectMultiSerializer() {NumericField = doc.NumericField, StringField = doc.StringField})).Select(b => "A")]]>
-
-
-
-
\ No newline at end of file
From e444eb2fddbeba40418d263970b4062df55bcb99 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Tue, 23 Jul 2024 13:32:10 -0700
Subject: [PATCH 03/30] made other contracts public
---
.../src/CosmosClientOptions.cs | 7 ++-
.../src/Fluent/CosmosClientBuilder.cs | 7 ++-
.../src/RequestOptions/RequestOptions.cs | 7 ++-
.../Contracts/DotNetPreviewSDKAPI.json | 61 +++++++++++++++++++
4 files changed, 79 insertions(+), 3 deletions(-)
diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
index 6bfc65a005..d35bde5886 100644
--- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
+++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
@@ -655,7 +655,12 @@ public Func HttpClientFactory
///
/// Availability Strategy to be used for periods of high latency
///
- internal AvailabilityStrategy AvailabilityStrategy { get; set; }
+#if PREVIEW
+ public
+#else
+ internal
+#endif
+ AvailabilityStrategy AvailabilityStrategy { get; set; }
///
/// Enable partition key level failover
diff --git a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs
index 43232aa422..f112d51f47 100644
--- a/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs
+++ b/Microsoft.Azure.Cosmos/src/Fluent/CosmosClientBuilder.cs
@@ -690,7 +690,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/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/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json
index 5457e070d7..049e009d84 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
@@ -444,6 +444,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.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": {
@@ -695,6 +720,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": {
@@ -783,6 +819,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": {
From a0c6bc7a5fd932823808982a5818569bb799576d Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Tue, 23 Jul 2024 16:41:07 -0700
Subject: [PATCH 04/30] update enable method
---
.../src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs | 2 +-
.../CrossRegionParallelHedgingAvailabilityStrategy.cs | 2 +-
.../AvailabilityStrategy/DisabledAvailabilityStrategy.cs | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
index 7f155a5606..69b4948410 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
@@ -32,6 +32,6 @@ public abstract Task ExecuteAvailabilityStrategyAsync(
RequestMessage requestMessage,
CancellationToken cancellationToken);
- internal abstract bool Enabled();
+ public abstract bool Enabled();
}
}
\ No newline at end of file
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
index 269028e48d..05e9c826b7 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
@@ -65,7 +65,7 @@ public CrossRegionParallelHedgingAvailabilityStrategy(
this.ThresholdStep = thresholdStep ?? TimeSpan.FromMilliseconds(-1);
}
- internal override bool Enabled()
+ public override bool Enabled()
{
return true;
}
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
index ce431df25f..fce69a8468 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
@@ -17,7 +17,7 @@ namespace Microsoft.Azure.Cosmos
#endif
class DisabledAvailabilityStrategy : AvailabilityStrategy
{
- internal override bool Enabled()
+ public override bool Enabled()
{
return false;
}
From ddfc26511a2f0599fa02ea14422404e73ffe5c87 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Tue, 23 Jul 2024 18:12:32 -0700
Subject: [PATCH 05/30] comments
---
.../src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs | 4 ++++
.../CrossRegionParallelHedgingAvailabilityStrategy.cs | 4 ++++
.../AvailabilityStrategy/DisabledAvailabilityStrategy.cs | 4 ++++
3 files changed, 12 insertions(+)
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
index 69b4948410..e4e46a1a4e 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
@@ -32,6 +32,10 @@ public abstract Task ExecuteAvailabilityStrategyAsync(
RequestMessage requestMessage,
CancellationToken cancellationToken);
+ ///
+ /// Checks to see if the strategy is enabled
+ ///
+ /// a bool representing if the strategy is enabled
public abstract bool Enabled();
}
}
\ No newline at end of file
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
index 05e9c826b7..15c5cc1a82 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
@@ -65,6 +65,10 @@ public CrossRegionParallelHedgingAvailabilityStrategy(
this.ThresholdStep = thresholdStep ?? TimeSpan.FromMilliseconds(-1);
}
+ ///
+ /// Checks to see if the strategy is enabled
+ ///
+ /// a bool representing if the strategy is enabled
public override bool Enabled()
{
return true;
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
index fce69a8468..32711588e5 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
@@ -17,6 +17,10 @@ namespace Microsoft.Azure.Cosmos
#endif
class DisabledAvailabilityStrategy : AvailabilityStrategy
{
+ ///
+ /// Checks to see if the strategy is enabled
+ ///
+ /// a bool representing if the strategy is enabled, will always be false
public override bool Enabled()
{
return false;
From 2bab5b6abe70602cc37e84a2a0a46f2b6d03b8e8 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Wed, 24 Jul 2024 16:08:04 -0700
Subject: [PATCH 06/30] contract update
---
.../Contracts/DotNetPreviewSDKAPI.json | 25 +++++++++++++++++++
1 file changed, 25 insertions(+)
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 049e009d84..5bd6d466d2 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
@@ -5,6 +5,11 @@
"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": {
+ "Boolean Enabled()": {
+ "Type": "Method",
+ "Attributes": [],
+ "MethodInfo": "Boolean Enabled();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
+ },
"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+))]": {
"Type": "Method",
"Attributes": [
@@ -47,6 +52,11 @@
"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": {
+ "Boolean Enabled()": {
+ "Type": "Method",
+ "Attributes": [],
+ "MethodInfo": "Boolean Enabled();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
+ },
"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": [],
@@ -62,6 +72,11 @@
}
},
"Members": {
+ "Boolean Enabled()": {
+ "Type": "Method",
+ "Attributes": [],
+ "MethodInfo": "Boolean Enabled();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
+ },
"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": [],
@@ -472,6 +487,11 @@
"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": {
+ "Boolean Enabled()": {
+ "Type": "Method",
+ "Attributes": [],
+ "MethodInfo": "Boolean Enabled();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
+ },
"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+))]": {
"Type": "Method",
"Attributes": [
@@ -514,6 +534,11 @@
"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": {
+ "Boolean Enabled()": {
+ "Type": "Method",
+ "Attributes": [],
+ "MethodInfo": "Boolean Enabled();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
+ },
"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": [],
From 02cc8bbf596857c98608cb1ba0bf650fe0f9a695 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Mon, 12 Aug 2024 09:18:16 -0400
Subject: [PATCH 07/30] changed eneabled to internal
---
.../AvailabilityStrategy.cs | 2 +-
...gionParallelHedgingAvailabilityStrategy.cs | 2 +-
.../DisabledAvailabilityStrategy.cs | 2 +-
.../Contracts/DotNetPreviewSDKAPI.json | 25 -------------------
4 files changed, 3 insertions(+), 28 deletions(-)
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
index e4e46a1a4e..e999c59ae9 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
@@ -36,6 +36,6 @@ public abstract Task ExecuteAvailabilityStrategyAsync(
/// Checks to see if the strategy is enabled
///
/// a bool representing if the strategy is enabled
- public abstract bool Enabled();
+ internal abstract bool Enabled();
}
}
\ No newline at end of file
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
index d2dd6a4673..1c1754fc74 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
@@ -68,7 +68,7 @@ public CrossRegionParallelHedgingAvailabilityStrategy(
/// Checks to see if the strategy is enabled
///
/// a bool representing if the strategy is enabled
- public override bool Enabled()
+ internal override bool Enabled()
{
return true;
}
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
index 32711588e5..b7e59f4816 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
@@ -21,7 +21,7 @@ class DisabledAvailabilityStrategy : AvailabilityStrategy
/// Checks to see if the strategy is enabled
///
/// a bool representing if the strategy is enabled, will always be false
- public override bool Enabled()
+ internal override bool Enabled()
{
return false;
}
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 5bd6d466d2..049e009d84 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
@@ -5,11 +5,6 @@
"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": {
- "Boolean Enabled()": {
- "Type": "Method",
- "Attributes": [],
- "MethodInfo": "Boolean Enabled();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
- },
"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+))]": {
"Type": "Method",
"Attributes": [
@@ -52,11 +47,6 @@
"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": {
- "Boolean Enabled()": {
- "Type": "Method",
- "Attributes": [],
- "MethodInfo": "Boolean Enabled();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
- },
"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": [],
@@ -72,11 +62,6 @@
}
},
"Members": {
- "Boolean Enabled()": {
- "Type": "Method",
- "Attributes": [],
- "MethodInfo": "Boolean Enabled();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
- },
"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": [],
@@ -487,11 +472,6 @@
"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": {
- "Boolean Enabled()": {
- "Type": "Method",
- "Attributes": [],
- "MethodInfo": "Boolean Enabled();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
- },
"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+))]": {
"Type": "Method",
"Attributes": [
@@ -534,11 +514,6 @@
"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": {
- "Boolean Enabled()": {
- "Type": "Method",
- "Attributes": [],
- "MethodInfo": "Boolean Enabled();IsAbstract:False;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
- },
"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": [],
From f7da9f06c4194918848585e491537962fc0ecb29 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Mon, 12 Aug 2024 11:15:01 -0400
Subject: [PATCH 08/30] fixed internal method
---
.../src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
index e999c59ae9..a5370d66ed 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
@@ -36,6 +36,9 @@ public abstract Task ExecuteAvailabilityStrategyAsync(
/// Checks to see if the strategy is enabled
///
/// a bool representing if the strategy is enabled
- internal abstract bool Enabled();
+ internal virtual bool Enabled()
+ {
+ return false;
+ }
}
}
\ No newline at end of file
From da73fa6b9bfbee8bb9f46fb2db955c69e375e564 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Mon, 12 Aug 2024 14:03:56 -0400
Subject: [PATCH 09/30] Revert "fixed internal method"
This reverts commit f7da9f06c4194918848585e491537962fc0ecb29.
---
.../src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
index a5370d66ed..e999c59ae9 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
@@ -36,9 +36,6 @@ public abstract Task ExecuteAvailabilityStrategyAsync(
/// Checks to see if the strategy is enabled
///
/// a bool representing if the strategy is enabled
- internal virtual bool Enabled()
- {
- return false;
- }
+ internal abstract bool Enabled();
}
}
\ No newline at end of file
From e9b3d932118494cb015d5158655687ab872a6c42 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Mon, 12 Aug 2024 14:05:37 -0400
Subject: [PATCH 10/30] revert + change methods to internal
---
.../src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs | 2 +-
.../CrossRegionParallelHedgingAvailabilityStrategy.cs | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
index e999c59ae9..5b09775054 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
@@ -26,7 +26,7 @@ abstract class AvailabilityStrategy
///
///
/// The response from the service after the availability strategy is executed
- public abstract Task ExecuteAvailabilityStrategyAsync(
+ internal abstract Task ExecuteAvailabilityStrategyAsync(
Func> sender,
CosmosClient client,
RequestMessage requestMessage,
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
index 1c1754fc74..cf6898c2c9 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
@@ -104,7 +104,7 @@ internal bool ShouldHedge(RequestMessage request)
///
///
/// The response after executing cross region hedging
- public override async Task ExecuteAvailabilityStrategyAsync(
+ internal override async Task ExecuteAvailabilityStrategyAsync(
Func> sender,
CosmosClient client,
RequestMessage request,
From 28addfc5be2fc125fb88750d1fd9f6616dead5e0 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Mon, 12 Aug 2024 14:59:09 -0400
Subject: [PATCH 11/30] fixed internal
---
.../CrossRegionParallelHedgingAvailabilityStrategy.cs | 5 +----
.../AvailabilityStrategy/DisabledAvailabilityStrategy.cs | 7 ++-----
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
index cf6898c2c9..e3db18e112 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
@@ -64,10 +64,7 @@ public CrossRegionParallelHedgingAvailabilityStrategy(
this.ThresholdStep = thresholdStep ?? TimeSpan.FromMilliseconds(-1);
}
- ///
- /// Checks to see if the strategy is enabled
- ///
- /// a bool representing if the strategy is enabled
+ ///
internal override bool Enabled()
{
return true;
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
index b7e59f4816..bec4fab458 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
@@ -17,10 +17,7 @@ namespace Microsoft.Azure.Cosmos
#endif
class DisabledAvailabilityStrategy : AvailabilityStrategy
{
- ///
- /// Checks to see if the strategy is enabled
- ///
- /// a bool representing if the strategy is enabled, will always be false
+ ///
internal override bool Enabled()
{
return false;
@@ -34,7 +31,7 @@ internal override bool Enabled()
///
///
/// nothing, this will throw.
- public override Task ExecuteAvailabilityStrategyAsync(
+ internal override Task ExecuteAvailabilityStrategyAsync(
Func> sender,
From 97509fc51bf75b84426b2b44ff67f910893dd276 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Tue, 13 Aug 2024 12:27:31 -0400
Subject: [PATCH 12/30] changed to factory creation
---
.../src/Handler/RequestInvokerHandler.cs | 13 +++++--
.../AvailabilityStrategy.cs | 34 +++++++++----------
.../AvailabilityStrategyInternal.cs | 33 ++++++++++++++++++
...CrossRegionHedgingAvailabilityStrategy.cs} | 11 +++---
.../DisabledAvailabilityStrategy.cs | 9 ++---
.../CosmosAvailabilityStrategyTests.cs | 10 +++---
6 files changed, 72 insertions(+), 38 deletions(-)
create mode 100644 Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategyInternal.cs
rename Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/{CrossRegionParallelHedgingAvailabilityStrategy.cs => CrossRegionHedgingAvailabilityStrategy.cs} (98%)
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/Routing/AvailabilityStrategy/AvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
index 5b09775054..3e5595da72 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
@@ -4,9 +4,6 @@
namespace Microsoft.Azure.Cosmos
{
using System;
- using System.Threading;
- using System.Threading.Tasks;
- using Microsoft.Azure.Cosmos.Handlers;
///
/// Types of availability strategies supported
@@ -19,23 +16,26 @@ namespace Microsoft.Azure.Cosmos
abstract class AvailabilityStrategy
{
///
- /// Execute the availability strategy
+ /// stuff
///
- ///
- ///
- ///
- ///
- /// The response from the service after the availability strategy is executed
- internal abstract Task ExecuteAvailabilityStrategyAsync(
- Func> sender,
- CosmosClient client,
- RequestMessage requestMessage,
- CancellationToken cancellationToken);
+ /// something
+ public static AvailabilityStrategy DisabledAvailabilityStrategy()
+ {
+ return new DisabledAvailabilityStrategy();
+ }
///
- /// Checks to see if the strategy is enabled
+ /// stuff
///
- /// a bool representing if the strategy is enabled
- internal abstract bool Enabled();
+ ///
+ ///
+ /// something
+ public static AvailabilityStrategy CrossRegionHedgingAvailabilityStrategy(TimeSpan threshold,
+ TimeSpan? thresholdStep)
+ {
+ return new CrossRegionHedgingAvailabilityStrategy(threshold, thresholdStep);
+ }
+
+ public abstract string StrategyName { get; }
}
}
\ 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 98%
rename from Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
rename to Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs
index e3db18e112..725560848f 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionParallelHedgingAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs
@@ -21,12 +21,7 @@ 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.
///
-#if PREVIEW
- public
-#else
- internal
-#endif
- class CrossRegionParallelHedgingAvailabilityStrategy : AvailabilityStrategy
+ internal class CrossRegionHedgingAvailabilityStrategy : AvailabilityStrategyInternal
{
private const string HedgeContext = "Hedge Context";
private const string ResponseRegion = "Response Region";
@@ -46,7 +41,7 @@ class CrossRegionParallelHedgingAvailabilityStrategy : AvailabilityStrategy
///
///
///
- public CrossRegionParallelHedgingAvailabilityStrategy(
+ public CrossRegionHedgingAvailabilityStrategy(
TimeSpan threshold,
TimeSpan? thresholdStep)
{
@@ -64,6 +59,8 @@ public CrossRegionParallelHedgingAvailabilityStrategy(
this.ThresholdStep = thresholdStep ?? TimeSpan.FromMilliseconds(-1);
}
+ public override string StrategyName => nameof(CrossRegionHedgingAvailabilityStrategy);
+
///
internal override bool Enabled()
{
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
index bec4fab458..5fc3447339 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
@@ -10,13 +10,10 @@ namespace Microsoft.Azure.Cosmos
///
/// A Disabled availability strategy that does not do anything. Used for overriding the default global availability strategy.
///
-#if PREVIEW
- public
-#else
- internal
-#endif
- class DisabledAvailabilityStrategy : AvailabilityStrategy
+ internal class DisabledAvailabilityStrategy : AvailabilityStrategyInternal
{
+ public override string StrategyName => nameof(DisabledAvailabilityStrategy);
+
///
internal override bool Enabled()
{
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 7994a06507..74df1f45f2 100644
--- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs
+++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs
@@ -209,7 +209,7 @@ public async Task AvailabilityStrategyNoTriggerTest()
{
ConnectionMode = ConnectionMode.Direct,
ApplicationPreferredRegions = new List() { "Central US", "North Central US" },
- AvailabilityStrategy = new CrossRegionParallelHedgingAvailabilityStrategy(
+ AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingAvailabilityStrategy(
threshold: TimeSpan.FromMilliseconds(300),
thresholdStep: TimeSpan.FromMilliseconds(50)),
Serializer = this.cosmosSystemTextJsonSerializer
@@ -283,7 +283,7 @@ public async Task AvailabilityStrategyRequestOptionsTriggerTest()
ItemRequestOptions requestOptions = new ItemRequestOptions
{
- AvailabilityStrategy = new CrossRegionParallelHedgingAvailabilityStrategy(
+ AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingAvailabilityStrategy(
threshold: TimeSpan.FromMilliseconds(100),
thresholdStep: TimeSpan.FromMilliseconds(50))
};
@@ -327,7 +327,7 @@ public async Task AvailabilityStrategyDisableOverideTest()
{
ConnectionMode = ConnectionMode.Direct,
ApplicationPreferredRegions = new List() { "Central US", "North Central US" },
- AvailabilityStrategy = new CrossRegionParallelHedgingAvailabilityStrategy(
+ AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingAvailabilityStrategy(
threshold: TimeSpan.FromMilliseconds(100),
thresholdStep: TimeSpan.FromMilliseconds(50)),
Serializer = this.cosmosSystemTextJsonSerializer
@@ -427,7 +427,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.CrossRegionHedgingAvailabilityStrategy(
threshold: TimeSpan.FromMilliseconds(100),
thresholdStep: TimeSpan.FromMilliseconds(50)),
Serializer = this.cosmosSystemTextJsonSerializer
@@ -605,7 +605,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.CrossRegionHedgingAvailabilityStrategy(
threshold: TimeSpan.FromMilliseconds(100),
thresholdStep: TimeSpan.FromMilliseconds(50)),
Serializer = this.cosmosSystemTextJsonSerializer
From 1665cdb02500f8c6db4f21b2d29eb5c92ba2234a Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Tue, 13 Aug 2024 12:30:19 -0400
Subject: [PATCH 13/30] disabledstrat fix
---
.../CosmosAvailabilityStrategyTests.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 74df1f45f2..7dbe44d23b 100644
--- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs
+++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs
@@ -343,7 +343,7 @@ public async Task AvailabilityStrategyDisableOverideTest()
responseDelay.Enable();
ItemRequestOptions requestOptions = new ItemRequestOptions
{
- AvailabilityStrategy = new DisabledAvailabilityStrategy()
+ AvailabilityStrategy = AvailabilityStrategy.DisabledAvailabilityStrategy()
};
ItemResponse ir = await container.ReadItemAsync(
From bd4f0f4b799cdd6068c0154646c74c4285a44de1 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Tue, 13 Aug 2024 12:58:48 -0400
Subject: [PATCH 14/30] fixed test + contracts
---
.../CosmosMultiRegionDiagnosticsTests.cs | 2 +-
.../Telemetry/OpenTelemetryRecorderTests.cs | 4 +---
2 files changed, 2 insertions(+), 4 deletions(-)
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 7f6768f3c8..9a7bb23d7c 100644
--- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiRegionDiagnosticsTests.cs
+++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiRegionDiagnosticsTests.cs
@@ -109,7 +109,7 @@ public async Task HedgeNestingDiagnosticsTest()
ItemRequestOptions requestOptions = new ItemRequestOptions
{
- AvailabilityStrategy = new CrossRegionParallelHedgingAvailabilityStrategy(
+ AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingAvailabilityStrategy(
threshold: TimeSpan.FromMilliseconds(100),
thresholdStep: TimeSpan.FromMilliseconds(50))
};
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
{
From 343b3eb08d808b9d47b68afc8f1791d39a4009b0 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Tue, 13 Aug 2024 13:37:14 -0400
Subject: [PATCH 15/30] xml changes
---
.../AvailabilityStrategy.cs | 16 +-
.../Contracts/DotNetPreviewSDKAPI.json | 189 ------------------
2 files changed, 11 insertions(+), 194 deletions(-)
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
index 3e5595da72..0d37de3484 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
@@ -16,19 +16,22 @@ namespace Microsoft.Azure.Cosmos
abstract class AvailabilityStrategy
{
///
- /// stuff
+ /// Used on a per request level to disable a client level AvailabilityStrategy
///
/// something
- public static AvailabilityStrategy DisabledAvailabilityStrategy()
+ public static AvailabilityStrategy DisabledStrategy()
{
return new DisabledAvailabilityStrategy();
}
///
- /// stuff
+ /// 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 CrossRegionHedgingAvailabilityStrategy(TimeSpan threshold,
TimeSpan? thresholdStep)
@@ -36,6 +39,9 @@ public static AvailabilityStrategy CrossRegionHedgingAvailabilityStrategy(TimeSp
return new CrossRegionHedgingAvailabilityStrategy(threshold, thresholdStep);
}
+ ///
+ /// Name of Availability Strategy
+ ///
public abstract string StrategyName { get; }
}
}
\ No newline at end of file
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 049e009d84..4a4b7b08dc 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,75 +1,5 @@
{
"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+))]": {
- "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": {
@@ -444,89 +374,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.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.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+))]": {
- "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": {
@@ -720,17 +567,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 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": {
@@ -819,31 +655,6 @@
},
"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": {
From 391c20ff91e504b979d13717d5b0bafab51bb125 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Tue, 13 Aug 2024 14:31:10 -0400
Subject: [PATCH 16/30] updated comments
---
.../CrossRegionHedgingAvailabilityStrategy.cs | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs
index 725560848f..4cefe05c7f 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs
@@ -16,10 +16,10 @@ 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 CrossRegionHedgingAvailabilityStrategy : AvailabilityStrategyInternal
{
@@ -37,7 +37,7 @@ internal class CrossRegionHedgingAvailabilityStrategy : AvailabilityStrategyInte
public TimeSpan ThresholdStep { get; private set; }
///
- /// Constructor for parallel hedging availability strategy
+ /// Constructor for hedging availability strategy
///
///
///
@@ -68,11 +68,11 @@ internal override bool Enabled()
}
///
- /// 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
@@ -91,7 +91,7 @@ internal bool ShouldHedge(RequestMessage request)
}
///
- /// Execute the parallel hedging availability strategy
+ /// Execute the hedging availability strategy
///
///
///
From 98bc27b83feeae51e96add9f584ea088b84c7c53 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Tue, 13 Aug 2024 14:47:36 -0400
Subject: [PATCH 17/30] Fixed Tests
---
.../CosmosAvailabilityStrategyTests.cs | 2 +-
.../Contracts/DotNetPreviewSDKAPI.json | 87 +++++++++++++++++++
2 files changed, 88 insertions(+), 1 deletion(-)
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 7dbe44d23b..ac6dc2f624 100644
--- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs
+++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs
@@ -343,7 +343,7 @@ public async Task AvailabilityStrategyDisableOverideTest()
responseDelay.Enable();
ItemRequestOptions requestOptions = new ItemRequestOptions
{
- AvailabilityStrategy = AvailabilityStrategy.DisabledAvailabilityStrategy()
+ AvailabilityStrategy = AvailabilityStrategy.DisabledStrategy()
};
ItemResponse ir = await container.ReadItemAsync(
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 4a4b7b08dc..36d0f65915 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,31 @@
{
"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 CrossRegionHedgingAvailabilityStrategy(System.TimeSpan, System.Nullable`1[System.TimeSpan])": {
+ "Type": "Method",
+ "Attributes": [],
+ "MethodInfo": "Microsoft.Azure.Cosmos.AvailabilityStrategy CrossRegionHedgingAvailabilityStrategy(System.TimeSpan, System.Nullable`1[System.TimeSpan]);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
+ },
+ "Microsoft.Azure.Cosmos.AvailabilityStrategy DisabledStrategy()": {
+ "Type": "Method",
+ "Attributes": [],
+ "MethodInfo": "Microsoft.Azure.Cosmos.AvailabilityStrategy DisabledStrategy();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
+ },
+ "System.String get_StrategyName()": {
+ "Type": "Method",
+ "Attributes": [],
+ "MethodInfo": "System.String get_StrategyName();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
+ },
+ "System.String StrategyName": {
+ "Type": "Property",
+ "Attributes": [],
+ "MethodInfo": "System.String StrategyName;CanRead:True;CanWrite:False;System.String get_StrategyName();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": {
@@ -374,6 +400,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": {
@@ -567,6 +618,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": {
@@ -655,6 +717,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": {
From 2010458aa77ef5933d3b0aac0a92227777582a7a Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Wed, 14 Aug 2024 11:08:50 -0700
Subject: [PATCH 18/30] requested changes
---
.../AvailabilityStrategy.cs | 16 +++++++++-------
.../CrossRegionHedgingAvailabilityStrategy.cs | 2 --
.../DisabledAvailabilityStrategy.cs | 2 --
.../CosmosAvailabilityStrategyTests.cs | 10 +++++-----
.../Contracts/DotNetPreviewSDKAPI.json | 19 ++-----------------
5 files changed, 16 insertions(+), 33 deletions(-)
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
index 0d37de3484..7cb155737c 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/AvailabilityStrategy.cs
@@ -15,11 +15,18 @@ namespace Microsoft.Azure.Cosmos
#endif
abstract class AvailabilityStrategy
{
+ ///
+ /// Default constructor
+ ///
+ internal AvailabilityStrategy()
+ {
+ }
+
///
/// Used on a per request level to disable a client level AvailabilityStrategy
///
/// something
- public static AvailabilityStrategy DisabledStrategy()
+ internal static AvailabilityStrategy DisabledStrategy()
{
return new DisabledAvailabilityStrategy();
}
@@ -33,15 +40,10 @@ public static AvailabilityStrategy DisabledStrategy()
/// how long before SDK begins hedging
/// Period of time between first hedge and next hedging attempts
/// something
- public static AvailabilityStrategy CrossRegionHedgingAvailabilityStrategy(TimeSpan threshold,
+ public static AvailabilityStrategy CrossRegionHedgingStrategy(TimeSpan threshold,
TimeSpan? thresholdStep)
{
return new CrossRegionHedgingAvailabilityStrategy(threshold, thresholdStep);
}
-
- ///
- /// Name of Availability Strategy
- ///
- public abstract string StrategyName { get; }
}
}
\ No newline at end of file
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs
index 4cefe05c7f..234573f52e 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs
@@ -59,8 +59,6 @@ public CrossRegionHedgingAvailabilityStrategy(
this.ThresholdStep = thresholdStep ?? TimeSpan.FromMilliseconds(-1);
}
- public override string StrategyName => nameof(CrossRegionHedgingAvailabilityStrategy);
-
///
internal override bool Enabled()
{
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
index 5fc3447339..eef9705363 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/DisabledAvailabilityStrategy.cs
@@ -12,8 +12,6 @@ namespace Microsoft.Azure.Cosmos
///
internal class DisabledAvailabilityStrategy : AvailabilityStrategyInternal
{
- public override string StrategyName => nameof(DisabledAvailabilityStrategy);
-
///
internal override bool Enabled()
{
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 ac6dc2f624..f3d47b2bca 100644
--- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs
+++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs
@@ -209,7 +209,7 @@ public async Task AvailabilityStrategyNoTriggerTest()
{
ConnectionMode = ConnectionMode.Direct,
ApplicationPreferredRegions = new List() { "Central US", "North Central US" },
- AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingAvailabilityStrategy(
+ AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingStrategy(
threshold: TimeSpan.FromMilliseconds(300),
thresholdStep: TimeSpan.FromMilliseconds(50)),
Serializer = this.cosmosSystemTextJsonSerializer
@@ -283,7 +283,7 @@ public async Task AvailabilityStrategyRequestOptionsTriggerTest()
ItemRequestOptions requestOptions = new ItemRequestOptions
{
- AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingAvailabilityStrategy(
+ AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingStrategy(
threshold: TimeSpan.FromMilliseconds(100),
thresholdStep: TimeSpan.FromMilliseconds(50))
};
@@ -327,7 +327,7 @@ public async Task AvailabilityStrategyDisableOverideTest()
{
ConnectionMode = ConnectionMode.Direct,
ApplicationPreferredRegions = new List() { "Central US", "North Central US" },
- AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingAvailabilityStrategy(
+ AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingStrategy(
threshold: TimeSpan.FromMilliseconds(100),
thresholdStep: TimeSpan.FromMilliseconds(50)),
Serializer = this.cosmosSystemTextJsonSerializer
@@ -427,7 +427,7 @@ public async Task AvailabilityStrategyAllFaultsTests(string operation, string co
{
ConnectionMode = ConnectionMode.Direct,
ApplicationPreferredRegions = new List() { "Central US", "North Central US" },
- AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingAvailabilityStrategy(
+ AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingStrategy(
threshold: TimeSpan.FromMilliseconds(100),
thresholdStep: TimeSpan.FromMilliseconds(50)),
Serializer = this.cosmosSystemTextJsonSerializer
@@ -605,7 +605,7 @@ public async Task AvailabilityStrategyStepTests(string operation, string condito
{
ConnectionMode = ConnectionMode.Direct,
ApplicationPreferredRegions = new List() { "Central US", "North Central US", "East US" },
- AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingAvailabilityStrategy(
+ AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingStrategy(
threshold: TimeSpan.FromMilliseconds(100),
thresholdStep: TimeSpan.FromMilliseconds(50)),
Serializer = this.cosmosSystemTextJsonSerializer
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 36d0f65915..bb386ee571 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
@@ -3,25 +3,10 @@
"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 CrossRegionHedgingAvailabilityStrategy(System.TimeSpan, System.Nullable`1[System.TimeSpan])": {
+ "Microsoft.Azure.Cosmos.AvailabilityStrategy CrossRegionHedgingStrategy(System.TimeSpan, System.Nullable`1[System.TimeSpan])": {
"Type": "Method",
"Attributes": [],
- "MethodInfo": "Microsoft.Azure.Cosmos.AvailabilityStrategy CrossRegionHedgingAvailabilityStrategy(System.TimeSpan, System.Nullable`1[System.TimeSpan]);IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
- },
- "Microsoft.Azure.Cosmos.AvailabilityStrategy DisabledStrategy()": {
- "Type": "Method",
- "Attributes": [],
- "MethodInfo": "Microsoft.Azure.Cosmos.AvailabilityStrategy DisabledStrategy();IsAbstract:False;IsStatic:True;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
- },
- "System.String get_StrategyName()": {
- "Type": "Method",
- "Attributes": [],
- "MethodInfo": "System.String get_StrategyName();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
- },
- "System.String StrategyName": {
- "Type": "Property",
- "Attributes": [],
- "MethodInfo": "System.String StrategyName;CanRead:True;CanWrite:False;System.String get_StrategyName();IsAbstract:True;IsStatic:False;IsVirtual:True;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
+ "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": {}
From 2ceae5402ccc0bbf4e3a1c992b75f663e20ef4aa Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Wed, 14 Aug 2024 16:00:09 -0700
Subject: [PATCH 19/30] added client options check and one region check
---
Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs | 11 ++++++++++-
.../CrossRegionHedgingAvailabilityStrategy.cs | 3 ++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
index c61a88c6fe..90976e49d1 100644
--- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
+++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
@@ -699,7 +699,16 @@ public Func HttpClientFactory
#else
internal
#endif
- AvailabilityStrategy AvailabilityStrategy { get; set; }
+ AvailabilityStrategy AvailabilityStrategy
+ {
+ get;
+ set
+ {
+ if (this.ApplicationPreferredRegions == null
+ && this.ApplicationRegion == null)
+ {
+ throw new ArgumentException($"{nameof(this.ApplicationPreferredRegions)} or {nameof(this.ApplicationRegion)} must be set to use {nameof(this.AvailabilityStrategy)}");
+ }
///
/// Enable partition key level failover
diff --git a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs
index 234573f52e..a6ed3bfea7 100644
--- a/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs
+++ b/Microsoft.Azure.Cosmos/src/Routing/AvailabilityStrategy/CrossRegionHedgingAvailabilityStrategy.cs
@@ -102,7 +102,8 @@ internal override async Task ExecuteAvailabilityStrategyAsync(
RequestMessage request,
CancellationToken cancellationToken)
{
- if (!this.ShouldHedge(request))
+ if (!this.ShouldHedge(request)
+ || client.DocumentClient.GlobalEndpointManager.ReadEndpoints.Count == 1)
{
return await sender(request, cancellationToken);
}
From 8fde5bf511170791f0f62dbb4b581b15d012f0c2 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Thu, 15 Aug 2024 10:10:31 -0700
Subject: [PATCH 20/30] fix get
---
Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
index 90976e49d1..ceb29a9648 100644
--- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
+++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
@@ -700,14 +700,16 @@ public Func HttpClientFactory
internal
#endif
AvailabilityStrategy AvailabilityStrategy
- {
- get;
+ {
+ get => this.AvailabilityStrategy;
set
{
- if (this.ApplicationPreferredRegions == null
+ if (this.ApplicationPreferredRegions == null
&& this.ApplicationRegion == null)
{
throw new ArgumentException($"{nameof(this.ApplicationPreferredRegions)} or {nameof(this.ApplicationRegion)} must be set to use {nameof(this.AvailabilityStrategy)}");
+ }
+ }
}
///
From a779ab825e6e9374a4e32bdde9d2dd0bc6a6fa96 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Thu, 15 Aug 2024 10:25:42 -0700
Subject: [PATCH 21/30] fixed test
---
.../CosmosMultiRegionDiagnosticsTests.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 9a7bb23d7c..803d47f7f4 100644
--- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiRegionDiagnosticsTests.cs
+++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiRegionDiagnosticsTests.cs
@@ -109,7 +109,7 @@ public async Task HedgeNestingDiagnosticsTest()
ItemRequestOptions requestOptions = new ItemRequestOptions
{
- AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingAvailabilityStrategy(
+ AvailabilityStrategy = AvailabilityStrategy.CrossRegionHedgingStrategy(
threshold: TimeSpan.FromMilliseconds(100),
thresholdStep: TimeSpan.FromMilliseconds(50))
};
From c9e5023078f24a80e49a06258f761e966b5a2262 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Thu, 15 Aug 2024 10:42:19 -0700
Subject: [PATCH 22/30] fixed set
---
Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
index ceb29a9648..145be23e2e 100644
--- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
+++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
@@ -709,6 +709,8 @@ AvailabilityStrategy AvailabilityStrategy
{
throw new ArgumentException($"{nameof(this.ApplicationPreferredRegions)} or {nameof(this.ApplicationRegion)} must be set to use {nameof(this.AvailabilityStrategy)}");
}
+
+ this.AvailabilityStrategy = value;
}
}
From c04624806decff2a222f098a430f6809c0788434 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Thu, 15 Aug 2024 11:11:57 -0700
Subject: [PATCH 23/30] fix client options
---
Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
index 145be23e2e..0378af544f 100644
--- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
+++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
@@ -72,7 +72,8 @@ public class CosmosClientOptions
private PortReuseMode? portReuseMode;
private IWebProxy webProxy;
private Func httpClientFactory;
- private string applicationName;
+ private string applicationName;
+ private AvailabilityStrategy availabilityStrategy;
///
/// Creates a new CosmosClientOptions
@@ -701,7 +702,7 @@ public Func HttpClientFactory
#endif
AvailabilityStrategy AvailabilityStrategy
{
- get => this.AvailabilityStrategy;
+ get => this.availabilityStrategy;
set
{
if (this.ApplicationPreferredRegions == null
@@ -710,7 +711,7 @@ AvailabilityStrategy AvailabilityStrategy
throw new ArgumentException($"{nameof(this.ApplicationPreferredRegions)} or {nameof(this.ApplicationRegion)} must be set to use {nameof(this.AvailabilityStrategy)}");
}
- this.AvailabilityStrategy = value;
+ this.availabilityStrategy = value;
}
}
From dfb0a54ebe7c6e64edb50bde5f029d824a01267c Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Thu, 15 Aug 2024 15:29:54 -0700
Subject: [PATCH 24/30] updatecontracts
---
.../Contracts/DotNetPreviewSDKAPI.json | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
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 bb386ee571..ccdbb9683c 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
@@ -393,18 +393,14 @@
"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()]": {
+ "Microsoft.Azure.Cosmos.AvailabilityStrategy get_AvailabilityStrategy()": {
"Type": "Method",
- "Attributes": [
- "CompilerGeneratedAttribute"
- ],
+ "Attributes": [],
"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()]": {
+ "Void set_AvailabilityStrategy(Microsoft.Azure.Cosmos.AvailabilityStrategy)": {
"Type": "Method",
- "Attributes": [
- "CompilerGeneratedAttribute"
- ],
+ "Attributes": [],
"MethodInfo": "Void set_AvailabilityStrategy(Microsoft.Azure.Cosmos.AvailabilityStrategy);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
}
},
From 6bb9e31d95d3ee564f4af7098c482889e607d9c2 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Fri, 16 Aug 2024 10:27:00 -0700
Subject: [PATCH 25/30] requested changes
---
.../src/CosmosClientOptions.cs | 53 +++++++++++++------
1 file changed, 36 insertions(+), 17 deletions(-)
diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
index 0378af544f..6268dd5d15 100644
--- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
+++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
@@ -72,8 +72,7 @@ public class CosmosClientOptions
private PortReuseMode? portReuseMode;
private IWebProxy webProxy;
private Func httpClientFactory;
- private string applicationName;
- private AvailabilityStrategy availabilityStrategy;
+ private string applicationName;
///
/// Creates a new CosmosClientOptions
@@ -695,25 +694,35 @@ public Func HttpClientFactory
///
/// Availability Strategy to be used for periods of high latency
///
+ /// ///
+ /// 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 => this.availabilityStrategy;
- set
- {
- if (this.ApplicationPreferredRegions == null
- && this.ApplicationRegion == null)
- {
- throw new ArgumentException($"{nameof(this.ApplicationPreferredRegions)} or {nameof(this.ApplicationRegion)} must be set to use {nameof(this.AvailabilityStrategy)}");
- }
-
- this.availabilityStrategy = value;
- }
- }
+ AvailabilityStrategy AvailabilityStrategy { get; set; }
///
/// Enable partition key level failover
@@ -906,7 +915,8 @@ internal virtual ConnectionPolicy GetConnectionPolicy(int clientId)
{
this.ValidateDirectTCPSettings();
this.ValidateLimitToEndpointSettings();
- this.ValidatePartitionLevelFailoverSettings();
+ this.ValidatePartitionLevelFailoverSettings();
+ this.ValidateAvailabilityStrategy();
ConnectionPolicy connectionPolicy = new ConnectionPolicy()
{
@@ -1083,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.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()
From 0e9c7a8f0f52a839fad3692eafdcd57c73f53b90 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Fri, 16 Aug 2024 10:45:21 -0700
Subject: [PATCH 26/30] fixed validate method
---
.../src/CosmosClientOptions.cs | 4 +-
.../Utils/MultiRegionSetupHelpers.cs | 64 +++++++++++++++++++
2 files changed, 66 insertions(+), 2 deletions(-)
create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/MultiRegionSetupHelpers.cs
diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
index 6268dd5d15..c1992baacc 100644
--- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
+++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
@@ -1097,8 +1097,8 @@ private void ValidatePartitionLevelFailoverSettings()
private void ValidateAvailabilityStrategy()
{
- if (this.ApplicationPreferredRegions == null
- && this.ApplicationRegion == null)
+ 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)}");
}
diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/MultiRegionSetupHelpers.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/MultiRegionSetupHelpers.cs
new file mode 100644
index 0000000000..168b40333d
--- /dev/null
+++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/MultiRegionSetupHelpers.cs
@@ -0,0 +1,64 @@
+//------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+//------------------------------------------------------------
+
+namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Text;
+ using System.Threading.Tasks;
+ using static Microsoft.Azure.Cosmos.SDK.EmulatorTests.CosmosAvailabilityStrategyTests;
+
+ public class MultiRegionSetupHelpers
+ {
+ private const string dbName = "availabilityStrategyTestDb";
+ private const string containerName = "availabilityStrategyTestContainer";
+ private const string changeFeedContainerName = "availabilityStrategyTestChangeFeedContainer";
+
+ public static async Task<(Database, Container, Container)> GetOrCreateMultiRegionDatabaseAndContainers(CosmosClient client)
+ {
+ Database database;
+ Container container;
+ Container changeFeedContainer;
+
+ DatabaseResponse db = await client.CreateDatabaseIfNotExistsAsync(
+ id: MultiRegionSetupHelpers.dbName,
+ throughput: 400);
+ database = db.Database;
+
+ if (db.StatusCode == HttpStatusCode.Created)
+ {
+ container = await database.CreateContainerIfNotExistsAsync(
+ id: MultiRegionSetupHelpers.containerName,
+ partitionKeyPath: "/pk",
+ throughput: 400);
+ changeFeedContainer = await database.CreateContainerIfNotExistsAsync(
+ id: MultiRegionSetupHelpers.changeFeedContainerName,
+ partitionKeyPath: "/partitionKey",
+ throughput: 400);
+
+ await container.CreateItemAsync(
+ new AvailabilityStrategyTestObject { Id = "testId", Pk = "pk" });
+ await container.CreateItemAsync(
+ new AvailabilityStrategyTestObject { Id = "testId2", Pk = "pk2" });
+ await container.CreateItemAsync(
+ new AvailabilityStrategyTestObject { Id = "testId3", Pk = "pk3" });
+ await container.CreateItemAsync(
+ new AvailabilityStrategyTestObject { Id = "testId4", Pk = "pk4" });
+
+ //Must Ensure the data is replicated to all regions
+ await Task.Delay(60000);
+
+ return (database, container, changeFeedContainer);
+ }
+
+ container = database.GetContainer(MultiRegionSetupHelpers.containerName);
+ changeFeedContainer = database.GetContainer(MultiRegionSetupHelpers.changeFeedContainerName);
+
+ return (database, container, changeFeedContainer);
+ }
+ }
+}
From 0bf56c530ca785c50c150599d5341fbe50d0efb4 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Fri, 16 Aug 2024 11:22:59 -0700
Subject: [PATCH 27/30] Delete MultiRegionSetupHelpers.cs
removed file
---
.../Utils/MultiRegionSetupHelpers.cs | 64 -------------------
1 file changed, 64 deletions(-)
delete mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/MultiRegionSetupHelpers.cs
diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/MultiRegionSetupHelpers.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/MultiRegionSetupHelpers.cs
deleted file mode 100644
index 168b40333d..0000000000
--- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Utils/MultiRegionSetupHelpers.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-//------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-//------------------------------------------------------------
-
-namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests
-{
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Net;
- using System.Text;
- using System.Threading.Tasks;
- using static Microsoft.Azure.Cosmos.SDK.EmulatorTests.CosmosAvailabilityStrategyTests;
-
- public class MultiRegionSetupHelpers
- {
- private const string dbName = "availabilityStrategyTestDb";
- private const string containerName = "availabilityStrategyTestContainer";
- private const string changeFeedContainerName = "availabilityStrategyTestChangeFeedContainer";
-
- public static async Task<(Database, Container, Container)> GetOrCreateMultiRegionDatabaseAndContainers(CosmosClient client)
- {
- Database database;
- Container container;
- Container changeFeedContainer;
-
- DatabaseResponse db = await client.CreateDatabaseIfNotExistsAsync(
- id: MultiRegionSetupHelpers.dbName,
- throughput: 400);
- database = db.Database;
-
- if (db.StatusCode == HttpStatusCode.Created)
- {
- container = await database.CreateContainerIfNotExistsAsync(
- id: MultiRegionSetupHelpers.containerName,
- partitionKeyPath: "/pk",
- throughput: 400);
- changeFeedContainer = await database.CreateContainerIfNotExistsAsync(
- id: MultiRegionSetupHelpers.changeFeedContainerName,
- partitionKeyPath: "/partitionKey",
- throughput: 400);
-
- await container.CreateItemAsync(
- new AvailabilityStrategyTestObject { Id = "testId", Pk = "pk" });
- await container.CreateItemAsync(
- new AvailabilityStrategyTestObject { Id = "testId2", Pk = "pk2" });
- await container.CreateItemAsync(
- new AvailabilityStrategyTestObject { Id = "testId3", Pk = "pk3" });
- await container.CreateItemAsync(
- new AvailabilityStrategyTestObject { Id = "testId4", Pk = "pk4" });
-
- //Must Ensure the data is replicated to all regions
- await Task.Delay(60000);
-
- return (database, container, changeFeedContainer);
- }
-
- container = database.GetContainer(MultiRegionSetupHelpers.containerName);
- changeFeedContainer = database.GetContainer(MultiRegionSetupHelpers.changeFeedContainerName);
-
- return (database, container, changeFeedContainer);
- }
- }
-}
From 1a24ebc338c38cbf4fec3c05bf6791ad8cfec7e7 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Fri, 16 Aug 2024 14:40:42 -0700
Subject: [PATCH 28/30] update contracts
---
.../Contracts/DotNetPreviewSDKAPI.json | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
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 ccdbb9683c..bb386ee571 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
@@ -393,14 +393,18 @@
"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()": {
+ "Microsoft.Azure.Cosmos.AvailabilityStrategy get_AvailabilityStrategy()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
- "Attributes": [],
+ "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)": {
+ "Void set_AvailabilityStrategy(Microsoft.Azure.Cosmos.AvailabilityStrategy)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
"Type": "Method",
- "Attributes": [],
+ "Attributes": [
+ "CompilerGeneratedAttribute"
+ ],
"MethodInfo": "Void set_AvailabilityStrategy(Microsoft.Azure.Cosmos.AvailabilityStrategy);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
}
},
From 0f9ee95a4349c5f884c97ea035ccd20477d3fc27 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Fri, 23 Aug 2024 12:07:30 -0700
Subject: [PATCH 29/30] fixed merge
---
.../CosmosAvailabilityStrategyTests.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 9b5c00ee9f..0bcf55481c 100644
--- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs
+++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosAvailabilityStrategyTests.cs
@@ -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))
};
From 8ae88139b27ed63bc59a3dce855afc7fc73ff413 Mon Sep 17 00:00:00 2001
From: Nalu Tripician <27316859+NaluTripician@users.noreply.github.com>
Date: Fri, 23 Aug 2024 13:17:38 -0700
Subject: [PATCH 30/30] fixed check
---
Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
index c1992baacc..114f1cc906 100644
--- a/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
+++ b/Microsoft.Azure.Cosmos/src/CosmosClientOptions.cs
@@ -1098,7 +1098,7 @@ private void ValidatePartitionLevelFailoverSettings()
private void ValidateAvailabilityStrategy()
{
if (this.AvailabilityStrategy != null
- && (this.ApplicationPreferredRegions == null || this.ApplicationRegion == 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)}");
}