Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

CFP AVAD: Adds Container IsFeedRangePartOfAsync support for FeedRange #4566

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
178 commits
Select commit Hold shift + click to select a range
a71d474
initial checkin
philipthomas-MSFT May 16, 2024
749c7ff
feedRangeFetails added to headers as a tuple. may created a public ty…
philipthomas-MSFT May 30, 2024
158b26d
FeedRangeDetail type in place of tuple
philipthomas-MSFT May 30, 2024
5472e18
some tests but impl is incomplete
philipthomas-MSFT Jun 3, 2024
1889f0f
merge
philipthomas-MSFT Jul 2, 2024
5e3f277
merge
philipthomas-MSFT Jul 2, 2024
02b220e
revert after bad merge
philipthomas-MSFT Jul 2, 2024
ae7ea26
revert after a bad merge
philipthomas-MSFT Jul 2, 2024
003da7e
revert after a bad merge
philipthomas-MSFT Jul 2, 2024
4af2d91
changes
philipthomas-MSFT Jul 8, 2024
96262c0
more test to come
philipthomas-MSFT Jul 15, 2024
00e32d3
add a test for FeedRange on Header, Find overlapping ranges using Par…
philipthomas-MSFT Jul 16, 2024
8fc8608
removing the type FeedRangeDetails, collectionRId was not needed.
philipthomas-MSFT Jul 16, 2024
d62f05f
mark as Preview
philipthomas-MSFT Jul 16, 2024
76ee8f0
FindOverlappingRanges test. Just FeedRange.
philipthomas-MSFT Jul 17, 2024
5b2cd52
The start, not finished, test for container.FindOverlappingRangesAsync
philipthomas-MSFT Jul 17, 2024
18ce956
partition key tests
philipthomas-MSFT Jul 18, 2024
b1ed9a1
more testing. still not satisfied. will do more until the end of week.
philipthomas-MSFT Jul 18, 2024
df0eb32
more test changes.
philipthomas-MSFT Jul 22, 2024
77be0f9
add partitionkey to test
philipthomas-MSFT Jul 22, 2024
570d5ea
Merge remote-tracking branch 'origin/master' into users/philipthomas-…
philipthomas-MSFT Jul 22, 2024
e3e3f23
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
philipthomas-MSFT Jul 23, 2024
5976251
merge master
philipthomas-MSFT Jul 23, 2024
a026438
merge master
philipthomas-MSFT Jul 23, 2024
843be8f
re-run UpdateContracts.ps1
philipthomas-MSFT Jul 23, 2024
5cbb0d6
more tests alterations.
philipthomas-MSFT Jul 23, 2024
caff01e
add cancellation token to test.
philipthomas-MSFT Jul 23, 2024
4cf2fea
just some test changes
philipthomas-MSFT Jul 23, 2024
0c56179
fix issue with FeedRangeEpk
philipthomas-MSFT Jul 23, 2024
563ddb9
some test changes from meeting.
philipthomas-MSFT Jul 23, 2024
73b912a
re-run update contracts.
philipthomas-MSFT Jul 23, 2024
771c487
making it work.
philipthomas-MSFT Jul 23, 2024
6559eb0
sdd to EncryptionContainer.cs
philipthomas-MSFT Jul 23, 2024
5e2a0b6
some formatting and change to Debug for logging before Logger.LogLine…
philipthomas-MSFT Jul 23, 2024
bda2f44
test update
philipthomas-MSFT Jul 29, 2024
f5016d8
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
philipthomas-MSFT Jul 29, 2024
b02f35a
fix EncryptionContainer
philipthomas-MSFT Jul 29, 2024
b5a65c8
remove a test helper method that is no longer needed. and updated tes…
philipthomas-MSFT Jul 29, 2024
9cee550
trying to fix EncryptionContainer
philipthomas-MSFT Jul 29, 2024
1efe714
try, try again
philipthomas-MSFT Jul 29, 2024
0b0001b
hmm
philipthomas-MSFT Jul 29, 2024
8fc3537
fixing a test.
philipthomas-MSFT Jul 29, 2024
f4745af
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
philipthomas-MSFT Jul 31, 2024
9d3fb3e
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
philipthomas-MSFT Aug 1, 2024
c848800
removing other features and boiling it down to just FindOverlappingRa…
philipthomas-MSFT Aug 1, 2024
ce57c96
Merge remote-tracking branch 'origin/master' into users/philipthomas-…
philipthomas-MSFT Aug 5, 2024
490fe03
move rangeFromPartitionKey out of loop.
philipthomas-MSFT Aug 5, 2024
90a6232
Merge remote-tracking branch 'origin/master' into users/philipthomas-…
philipthomas-MSFT Aug 6, 2024
6556dc6
Merge remote-tracking branch 'origin/master' into users/philipthomas-…
philipthomas-MSFT Aug 14, 2024
e57ce18
IsSubset
philipthomas-MSFT Aug 14, 2024
cc4c4f3
Merge remote-tracking branch 'origin/master' into users/philipthomas-…
philipthomas-MSFT Aug 14, 2024
64ba764
removed from Encryption
philipthomas-MSFT Aug 14, 2024
f5fc5bb
add back GetChangeFeedProcessorBuilderWithAllVersionsAndDeletes<T>
philipthomas-MSFT Aug 14, 2024
5fe347f
reverting back to origin
philipthomas-MSFT Aug 14, 2024
df9fecd
NotImplementedException>() fix on container
philipthomas-MSFT Aug 14, 2024
78618cd
reverting sln
philipthomas-MSFT Aug 14, 2024
1378a55
hmm. these baseline files.
philipthomas-MSFT Aug 14, 2024
a9d59a2
revwer to origin
philipthomas-MSFT Aug 15, 2024
b45f34b
removed api for PartitionKey since user can call FeedRange.FromPartit…
philipthomas-MSFT Aug 15, 2024
fb05663
reworked IsSubsetAsync based on suggestions to use FeedRangeInteranl …
philipthomas-MSFT Aug 15, 2024
50185b6
Merge remote-tracking branch 'origin/master' into users/philipthomas-…
philipthomas-MSFT Aug 16, 2024
77a1897
some subset changes. and tests.
philipthomas-MSFT Aug 16, 2024
8f07db8
missing using directive
philipthomas-MSFT Aug 16, 2024
6aa9487
type Overlaps instead of dynamic type. Fix IsSubset to include equal to.
philipthomas-MSFT Aug 19, 2024
8e96a69
Overlaps list
philipthomas-MSFT Aug 19, 2024
72770f2
update logic for IsSubset
philipthomas-MSFT Aug 20, 2024
83992d8
removed Overlap type. No longer needed.
philipthomas-MSFT Aug 20, 2024
a7119a2
ArgumentException to include expect and actual type.
philipthomas-MSFT Aug 21, 2024
354dbbe
include basic code sample references in code-doc.
philipthomas-MSFT Aug 21, 2024
7026c3b
default argument for CancellationToken parameter
philipthomas-MSFT Aug 21, 2024
68e15c5
removed NoOpTrace
philipthomas-MSFT Aug 21, 2024
efc7c8c
another default argument for CancellationToken parameter
philipthomas-MSFT Aug 21, 2024
bd8f56a
discovering the smallest Min and the largest Max from an array of Doc…
philipthomas-MSFT Aug 21, 2024
36c3e5f
some refactoring. also dealing with ranges that are FeedRangePartitio…
philipthomas-MSFT Aug 22, 2024
74f7fab
removed an unnecessary getEffectoveRamgesAsync call.
philipthomas-MSFT Aug 22, 2024
8cfd9f3
Merge remote-tracking branch 'origin/master' into users/philipthomas-…
philipthomas-MSFT Aug 22, 2024
a381687
not sure why this changed.
philipthomas-MSFT Aug 22, 2024
edf36d4
hmm. add try catch back.
philipthomas-MSFT Aug 22, 2024
c3e8d64
Merge branch 'master' of https://github.com/Azure/azure-cosmos-dotnet…
philipthomas-MSFT Sep 6, 2024
bbed6d4
name refactoring. TryParse on parent and child json. DocumentClientEx…
philipthomas-MSFT Sep 6, 2024
53848de
validation and error checks with tests.
philipthomas-MSFT Sep 10, 2024
683bebb
rename refactoring
philipthomas-MSFT Sep 10, 2024
0eef412
unused using directives.
philipthomas-MSFT Sep 10, 2024
3606d62
Normalized Ranges impl
philipthomas-MSFT Sep 10, 2024
4f59d6a
more tests
philipthomas-MSFT Sep 10, 2024
976e21f
remove comment and alias. not necessary. using Last.Max to avoid reso…
philipthomas-MSFT Sep 10, 2024
0d70411
IsMinInclusive check on FeedRangeEpk. remove normalization of FeedRange
philipthomas-MSFT Sep 12, 2024
8a8f229
removed usings
philipthomas-MSFT Sep 12, 2024
5e33500
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
philipthomas-MSFT Sep 12, 2024
d5a999b
ok. should add these usings back.
philipthomas-MSFT Sep 12, 2024
c2e6d52
test updates. documentation for clarity. some refactoring.
philipthomas-MSFT Sep 12, 2024
5b60151
IsSubset tests
philipthomas-MSFT Sep 12, 2024
46db601
Add Display. a nit.
philipthomas-MSFT Sep 12, 2024
4d84158
no idea why I changed this.
philipthomas-MSFT Sep 13, 2024
fff0458
EnsureConsistentInclusivity
philipthomas-MSFT Sep 15, 2024
3463fab
various changes. PREVIEW. FeedRangeInternal check before TryParse on …
philipthomas-MSFT Sep 16, 2024
58d1122
moving test to create a single instance of Containers
philipthomas-MSFT Sep 16, 2024
c43d063
removed duplicated test data row.
philipthomas-MSFT Sep 16, 2024
b6e5e29
removal of unnecessary comments since I am describing the scenarios.
philipthomas-MSFT Sep 16, 2024
f860d12
missed a container instance
philipthomas-MSFT Sep 16, 2024
801c1a8
missed another container reference
philipthomas-MSFT Sep 16, 2024
4c84f8e
revert since new tests have new tests file
philipthomas-MSFT Sep 16, 2024
c6bff5b
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
philipthomas-MSFT Sep 16, 2024
846dfb4
add another test scenario
philipthomas-MSFT Sep 16, 2024
91708f9
fix displayname
philipthomas-MSFT Sep 16, 2024
769c8e4
more scenarios
philipthomas-MSFT Sep 16, 2024
e0319dd
move ensureConsistentInclusivity to check on effectiveRanges outside …
philipthomas-MSFT Sep 16, 2024
e7bde88
adding comments, but thinking of a better way to deal and manage this…
philipthomas-MSFT Sep 17, 2024
4b3b079
introducing Gherkin interpreter to have a discussion with Team to see…
philipthomas-MSFT Sep 17, 2024
bfa9740
remove gherkin. will follow up on dynamic building of scenarios.
philipthomas-MSFT Sep 17, 2024
003a17d
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
philipthomas-MSFT Sep 18, 2024
b82a731
reverting to master
philipthomas-MSFT Sep 18, 2024
a45b646
new tests for IsSubset with strategy for creating inclusive or exclus…
philipthomas-MSFT Sep 18, 2024
4f50db2
removed from EncryptionContainer
philipthomas-MSFT Sep 18, 2024
5e68c03
need to fix a test.
philipthomas-MSFT Sep 18, 2024
0735b65
revert test.
philipthomas-MSFT Sep 18, 2024
3783530
adding this back
philipthomas-MSFT Sep 18, 2024
3a2608c
encryption container fix
philipthomas-MSFT Sep 18, 2024
b553c72
add more comments
philipthomas-MSFT Sep 18, 2024
f2ea6c4
fix broken test
philipthomas-MSFT Sep 18, 2024
43ffba1
add impl
philipthomas-MSFT Sep 18, 2024
2a3a197
reverting
philipthomas-MSFT Sep 18, 2024
feaeb8f
virutal on Container. some things may fail.
philipthomas-MSFT Sep 18, 2024
dfe5feb
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
kirankumarkolli Sep 18, 2024
6d77041
change test for IsSubset again. Not dynamic anymore.
philipthomas-MSFT Sep 18, 2024
2cd8d75
Merge branch 'users/philipthomas-MSFT/add_feedranges_to_avad_contract…
philipthomas-MSFT Sep 18, 2024
05e87a0
update summary
philipthomas-MSFT Sep 18, 2024
0876202
removed unnecessary comment
philipthomas-MSFT Sep 18, 2024
4ffe30c
removed some scenarios
philipthomas-MSFT Sep 18, 2024
fb7b942
add PREVIEW flag
philipthomas-MSFT Sep 18, 2024
0a8e36d
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
philipthomas-MSFT Sep 18, 2024
7868ef6
updatecontracts
philipthomas-MSFT Sep 18, 2024
acbad19
include more scenarios
philipthomas-MSFT Sep 18, 2024
6140a90
add verbage
philipthomas-MSFT Sep 18, 2024
f235378
add IsFeedRangePartofAsync in ContainerCore.
philipthomas-MSFT Sep 19, 2024
a7f048a
new scenarios to illustrate my point in conversation
philipthomas-MSFT Sep 19, 2024
8497db9
add DisplayName for 2 DataRows
philipthomas-MSFT Sep 19, 2024
35acb5f
since name changed from IsSubset to IsFeedRangePartOfAsync, fixing tr…
philipthomas-MSFT Sep 19, 2024
1b17ab7
trying Diagram 2 with ContainerInternal instead of ContainerInlineCore
philipthomas-MSFT Sep 19, 2024
76940cc
fix to IsSub and test that are affected.
philipthomas-MSFT Sep 19, 2024
10898e0
overriding in ContainerInlineCore, but not using operations helper, etc.
philipthomas-MSFT Sep 20, 2024
8790e7b
fix test implementation for IsSubset. add more DataRows
philipthomas-MSFT Sep 21, 2024
3d8d306
issue with summary
philipthomas-MSFT Sep 21, 2024
b6ab81e
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
philipthomas-MSFT Sep 21, 2024
5bbad51
removed Range<string> from summary
philipthomas-MSFT Sep 21, 2024
07a294b
add more scenarios and reorganized the DataRows
philipthomas-MSFT Sep 23, 2024
5bb871b
move some documentation around
philipthomas-MSFT Sep 23, 2024
a6d4eda
wrap async method in OperationHelperAsync for consistency
philipthomas-MSFT Sep 23, 2024
de79711
add TODO about Documents.OperationType.ReadFeed on operations not rel…
philipthomas-MSFT Sep 23, 2024
e5846c9
ranges is null empty so just pull the first one. also update summary.
philipthomas-MSFT Sep 24, 2024
e4790d4
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
philipthomas-MSFT Sep 25, 2024
0169f4c
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
philipthomas-MSFT Sep 26, 2024
4e2a95b
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
philipthomas-MSFT Sep 30, 2024
6a5d8e7
add this scenario "AA", "AA", true, "", "AA", false, false
philipthomas-MSFT Sep 30, 2024
56775bb
adding scenario "AA", "AA", true, "AA", "AZ", false, true
philipthomas-MSFT Sep 30, 2024
bed52de
all recent new scenarios
philipthomas-MSFT Sep 30, 2024
c9f2763
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
kirankumarkolli Sep 30, 2024
8e008fb
made a change for isSubset to substract the max if MaxExclusive. spec…
philipthomas-MSFT Sep 30, 2024
bde2252
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
philipthomas-MSFT Sep 30, 2024
8989c7b
Merge branch 'users/philipthomas-MSFT/add_feedranges_to_avad_contract…
philipthomas-MSFT Sep 30, 2024
81e1499
renaiming parent and child to x and y, respectively, for Container.cs
philipthomas-MSFT Sep 30, 2024
9dff5c5
test to include all types of containers.
philipthomas-MSFT Oct 1, 2024
8aec5b9
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
kirankumarkolli Oct 1, 2024
fe03634
remove dead code.
philipthomas-MSFT Oct 2, 2024
09fa5d0
fix params
philipthomas-MSFT Oct 2, 2024
248b929
reverted these
philipthomas-MSFT Oct 2, 2024
ccc3009
remove named parameters because local test use parent/child parameter…
philipthomas-MSFT Oct 2, 2024
48213d0
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
philipthomas-MSFT Oct 2, 2024
77dab06
Update Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs
philipthomas-MSFT Oct 2, 2024
23bdc17
Update Microsoft.Azure.Cosmos/src/Resource/Container/ContainerCore.It…
philipthomas-MSFT Oct 2, 2024
860dbc7
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
philipthomas-MSFT Oct 2, 2024
10d6c9a
update docs
philipthomas-MSFT Oct 2, 2024
ba71dd0
Merge branch 'users/philipthomas-MSFT/add_feedranges_to_avad_contract…
philipthomas-MSFT Oct 2, 2024
4ebbad9
change parent to x, and child to y, everywhere.
philipthomas-MSFT Oct 3, 2024
2a63b12
Merge branch 'master' into users/philipthomas-MSFT/add_feedranges_to_…
philipthomas-MSFT Oct 3, 2024
0c4df8e
removed extra params
philipthomas-MSFT Oct 3, 2024
8441b34
extraa return removed
philipthomas-MSFT Oct 3, 2024
855810b
done.
philipthomas-MSFT Oct 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,19 @@ public override ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithAllV
onChangesDelegate);
}
#endif

philipthomas-MSFT marked this conversation as resolved.
Show resolved Hide resolved
#if SDKPROJECTREF
public override Task<bool> IsFeedRangePartOfAsync(
Cosmos.FeedRange x,
Cosmos.FeedRange y,
CancellationToken cancellationToken = default)
{
return this.container.IsFeedRangePartOfAsync(
x,
y,
cancellationToken);
}
#endif
private async Task<ResponseMessage> ReadManyItemsHelperAsync(
IReadOnlyList<(string id, PartitionKey partitionKey)> items,
ReadManyRequestOptions readManyRequestOptions = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,14 @@ public override ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithAllV
{
throw new NotImplementedException();
}

public override Task<bool> IsFeedRangePartOfAsync(
Cosmos.FeedRange x,
Cosmos.FeedRange y,
CancellationToken cancellationToken = default)
{
throw new NotImplementedException();
philipthomas-MSFT marked this conversation as resolved.
Show resolved Hide resolved
}
#endif
/// <summary>
/// This function handles the scenario where a container is deleted(say from different Client) and recreated with same Id but with different client encryption policy.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ internal sealed class FeedRangeEpk : FeedRangeInternal

public FeedRangeEpk(Documents.Routing.Range<string> range)
{
if (!range.IsMinInclusive)
philipthomas-MSFT marked this conversation as resolved.
Show resolved Hide resolved
{
throw new ArgumentOutOfRangeException(paramName: nameof(range), message: $"{nameof(range.IsMinInclusive)} must be true.");
}

this.Range = range ?? throw new ArgumentNullException(nameof(range));
}

Expand Down
43 changes: 38 additions & 5 deletions Microsoft.Azure.Cosmos/src/Resource/Container/Container.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1677,9 +1677,9 @@ public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilder(
/// <returns>An instance of <see cref="ChangeFeedProcessorBuilder"/></returns>
public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithManualCheckpoint(
string processorName,
ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate);

#if PREVIEW
ChangeFeedStreamHandlerWithManualCheckpoint onChangesDelegate);
#if PREVIEW
philipthomas-MSFT marked this conversation as resolved.
Show resolved Hide resolved
/// <summary>
/// Deletes all items in the Container with the specified <see cref="PartitionKey"/> value.
/// Starts an asynchronous Cosmos DB background operation which deletes all items in the Container with the specified value.
Expand Down Expand Up @@ -1781,7 +1781,40 @@ public abstract Task<IEnumerable<string>> GetPartitionKeyRangesAsync(
/// <returns>An instance of <see cref="ChangeFeedProcessorBuilder"/></returns>
public abstract ChangeFeedProcessorBuilder GetChangeFeedProcessorBuilderWithAllVersionsAndDeletes<T>(
string processorName,
ChangeFeedHandler<ChangeFeedItem<T>> onChangesDelegate);
#endif
ChangeFeedHandler<ChangeFeedItem<T>> onChangesDelegate);

/// <summary>
/// Determines whether the given y feed range is a part of the specified x feed range.
/// </summary>
/// <param name="x">The feed range representing the x range.</param>
/// <param name="y">The feed range representing the y range.</param>
/// <param name="cancellationToken">A token to cancel the operation if needed.</param>
/// <example>
/// <code language="csharp">
/// <![CDATA[
/// CancellationToken cancellationToken = ...;
/// CosmosClientBuilder cosmosClientBuilder = new CosmosClientBuilder("your-connection-string");
/// CosmosClient cosmosClient = cosmosClientBuilder.Build();
/// Database cosmosDatabase = cosmosClient.GetDatabase("your-database-id");
/// Container container = cosmosDatabase.GetContainer("your-container-id");
/// FeedRange x = ...; // Define the feed range for x
/// FeedRange y = ...; // Define the feed range for y
///
/// bool isFeedRangePartOfAsync = await container.IsFeedRangePartOfAsync(
/// x,
/// y,
/// cancellationToken);
/// ]]>
/// </code>
/// </example>
/// <returns>Returns a boolean indicating whether the y feed range is fully contained within the x feed range.</returns>
public virtual Task<bool> IsFeedRangePartOfAsync(
philipthomas-MSFT marked this conversation as resolved.
Show resolved Hide resolved
Cosmos.FeedRange x,
Cosmos.FeedRange y,
CancellationToken cancellationToken = default)
{
throw new NotImplementedException();
}
#endif
}
}
Loading
Loading