-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Added Change Feed #11692
Merged
seanmcc-msft
merged 36 commits into
Azure:feature/storage/stg73base
from
seanmcc-msft:feature/storage/changeFeed
Jun 3, 2020
Merged
Added Change Feed #11692
Changes from 5 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
34ef0a6
Added Change Feed
seanmcc-msft 821c433
Added Chunk unit tests
seanmcc-msft e1e48b8
Added Shard tests
seanmcc-msft a838204
Added some Segment tests
seanmcc-msft 2e0c2c2
changed service version back to 12-12
seanmcc-msft 460887c
Added another Segment test
seanmcc-msft fb21295
Recorded tests
seanmcc-msft f728c6c
Merge branch 'feature/storage/stg73base' into feature/storage/changeFeed
seanmcc-msft f60dc32
Fixed build
seanmcc-msft 6825791
Merge branch 'feature/storage/stg73base' into feature/storage/changeFeed
seanmcc-msft c629fed
Added factories to Chunk
seanmcc-msft 60fc649
Added factories to Shard
seanmcc-msft 39f5bc2
Most the way through adding Factories to Segment
seanmcc-msft 52be7ed
Finished adding Factories to Segment
seanmcc-msft a1ec00f
Half way through adding Factories to Change Feed
seanmcc-msft 265c1e8
Finshed adding Factories to Change Feed
seanmcc-msft 4db0102
Moved Chunk initalization logic to ChunkFactory
seanmcc-msft 68d772f
Re-recorded tests
seanmcc-msft 4757ce3
Fixed CI
seanmcc-msft 34e837e
PR comments
seanmcc-msft 4e6cc08
Merge branch 'feature/storage/stg73base' into feature/storage/changeFeed
seanmcc-msft 442c07a
Filled out readme
seanmcc-msft d50a2b7
Added samples
seanmcc-msft 21bedda
PR comments
seanmcc-msft 743207f
Merge branch 'feature/storage/stg73base' into feature/storage/changeFeed
seanmcc-msft e8ef59b
Merge branch 'feature/storage/stg73base' into feature/storage/changeFeed
seanmcc-msft 85848d7
Merge branch 'feature/storage/stg73base' into feature/storage/changeFeed
seanmcc-msft 353b928
Updated readme to pass CI
seanmcc-msft 105c435
Fixed some edge cases and added tests
seanmcc-msft 20d364d
fixed ending the change feed
seanmcc-msft 669337b
PR comments
seanmcc-msft 1a07ef1
PR comments
seanmcc-msft c942c1f
Changed default page size
seanmcc-msft 83dba4d
PR comments
seanmcc-msft 04431b3
PR comments
seanmcc-msft 74e6e05
PR comments
seanmcc-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
sdk/storage/Azure.Storage.Blobs.ChangeFeed/BreakingChanges.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Breaking Changes | ||
================ | ||
|
||
12.0.0-preview.1 | ||
-------------------------- | ||
- New Azure.Storage.Blobs.ChangeFeed client library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Release History | ||
|
||
## 12.0.0-preview.1 | ||
This preview is the first release supporting Azure Storage Blobs Change Feed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Azure Storage Blobs Change Feed client library for .NET | ||
|
||
> Server Version: 2019-07-07 | ||
## Getting started | ||
- TODO | ||
|
||
## Key concepts | ||
- TODO | ||
|
||
## Examples | ||
- TODO | ||
|
||
## Troubleshooting | ||
- TODO | ||
|
||
## Next steps | ||
- TODO | ||
|
||
## Contributing | ||
- TODO |
31 changes: 31 additions & 0 deletions
31
...zure.Storage.Blobs.ChangeFeed/samples/Azure.Storage.Blobs.ChangeFeed.Samples.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks> | ||
<AssemblyTitle>Microsoft Azure.Storage.Blobs.ChangeFeed client library samples</AssemblyTitle> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Azure.Identity" /> | ||
<ProjectReference Include="$(MSBuildThisFileDirectory)..\src\Azure.Storage.Blobs.ChangeFeed.csproj" /> | ||
<ProjectReference Include="$(MSBuildThisFileDirectory)..\..\Azure.Storage.Common\src\Azure.Storage.Common.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildThisFileDirectory)..\..\Azure.Storage.Common\tests\Shared\**\*.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<None Include="$(MSBuildThisFileDirectory)..\..\Azure.Storage.Common\tests\Shared\*.xml"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<!-- Required Shared Source for testing --> | ||
<Compile Include="$(AzureCoreSharedSources)ArrayBufferWriter.cs" Link="Shared\Core\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureCoreSharedSources)NoBodyResponse{T}.cs" Link="Shared\Core\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureCoreSharedSources)TaskExtensions.cs" Link="Shared\Core\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureStorageSharedSources)Constants.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureStorageSharedSources)Errors.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureStorageSharedSources)StorageConnectionString.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureStorageSharedSources)SharedAccessSignatureCredentials.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureStorageSharedSources)UriExtensions.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureStorageSharedSources)UriQueryParamsCollection.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureStorageSharedSources)StorageExceptionExtensions.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
</ItemGroup> | ||
</Project> |
15 changes: 15 additions & 0 deletions
15
sdk/storage/Azure.Storage.Blobs.ChangeFeed/samples/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
page_type: sample | ||
languages: | ||
- csharp | ||
products: | ||
- azure | ||
- azure-storage | ||
name: Azure.Storage.ChangeFeed samples for .NET | ||
description: Samples for the Azure.Storage.Blobs.ChangeFeed client library | ||
--- | ||
|
||
# Azure.Storage.ChangeFeed Samples | ||
|
||
- sample 0 | ||
- sample 1 |
27 changes: 27 additions & 0 deletions
27
sdk/storage/Azure.Storage.Blobs.ChangeFeed/samples/Sample01a_HelloWorld.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Reflection.Metadata.Ecma335; | ||
using NUnit.Framework; | ||
|
||
namespace Azure.Storage.Blobs.ChangeFeed.Samples | ||
{ | ||
/// <summary> | ||
/// Basic Azure ChangeFeed Storage samples. | ||
/// </summary> | ||
public class Sample01a_HelloWorld : SampleTest | ||
{ | ||
/// <summary> | ||
/// Sample sample. | ||
/// </summary> | ||
[Test] | ||
public void SampleSample() | ||
{ | ||
Assert.AreEqual(1, 1); | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
sdk/storage/Azure.Storage.Blobs.ChangeFeed/samples/Sample01b_HelloWorldAsync.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Azure.Storage; | ||
using NUnit.Framework; | ||
|
||
namespace Azure.Storage.Blobs.ChangeFeed.Samples | ||
{ | ||
/// <summary> | ||
/// Basic Azure ChangeFeed Storage samples. | ||
/// </summary> | ||
public class Sample01b_HelloWorldAsync : SampleTest | ||
{ | ||
/// <summary> | ||
/// Sample sample. | ||
/// </summary> | ||
[Test] | ||
public async Task SampleSample() | ||
{ | ||
await Task.CompletedTask; | ||
Assert.AreEqual(1, 1); | ||
} | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
sdk/storage/Azure.Storage.Blobs.ChangeFeed/samples/Sample02_Auth.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.IO; | ||
using System.Net; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Azure.Core; | ||
using Azure.Identity; | ||
using Azure.Storage; | ||
using Azure.Storage.Sas; | ||
using NUnit.Framework; | ||
|
||
namespace Azure.Storage.Blobs.ChangeFeed.Samples | ||
{ | ||
public class Sample02_Auth : SampleTest | ||
{ | ||
[Test] | ||
public async Task SampleSample() | ||
{ | ||
await Task.CompletedTask; | ||
Assert.IsTrue(true); | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
[assembly: InternalsVisibleTo("Azure.Storage.Blobs.ChangeFeed.Tests, PublicKey=" + | ||
"0024000004800000940000000602000000240000525341310004000001000100d15ddcb2968829" + | ||
"5338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc" + | ||
"012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265" + | ||
"e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593d" + | ||
"aa7b11b4")] | ||
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] | ||
[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Storage")] |
48 changes: 48 additions & 0 deletions
48
sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/Azure.Storage.Blobs.ChangeFeed.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks>$(RequiredTargetFrameworks)</TargetFrameworks> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<AssemblyTitle>Microsoft Azure.Storage.Blobs.ChangeFeed client library</AssemblyTitle> | ||
<Version>12.0.0-preview.1</Version> | ||
<DefineConstants>ChangeFeedSDK;$(DefineConstants)</DefineConstants> | ||
<PackageTags>Microsoft Azure Change Feed;Microsoft;Azure;Storage;StorageScalable;$(PackageCommonTags)</PackageTags> | ||
<Description> | ||
This client library enables working with the Microsoft Azure Storage Change Feed feature to review and monitor changes to an Azure Storage account. | ||
For this release see notes - https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Azure.Storage.ChangeFeed/README.md and https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Azure.Storage.ChangeFeed/CHANGELOG.md | ||
in addition to the breaking changes https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Azure.Storage.ChangeFeed/BreakingChanges.txt | ||
Microsoft Azure Storage quickstarts and tutorials - TODO | ||
Microsoft Azure Storage REST API Reference - TODO | ||
</Description> | ||
<GenerateAPIListing>false</GenerateAPIListing> | ||
<EnableApiCompat>false</EnableApiCompat> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="System.Text.Json" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="$(MSBuildThisFileDirectory)..\..\Azure.Storage.Common\src\Azure.Storage.Common.csproj" /> | ||
<ProjectReference Include="..\..\Azure.Storage.Blobs\src\Azure.Storage.Blobs.csproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="$(AzureCoreSharedSources)ArrayBufferWriter.cs" Link="Shared\Core\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureCoreSharedSources)AzureResourceProviderNamespaceAttribute.cs" Link="Shared\Core\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureCoreSharedSources)ForwardsClientCallsAttribute.cs" Link="Shared\Core\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureCoreSharedSources)PageResponseEnumerator.cs" Link="Shared\Core\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureCoreSharedSources)TaskExtensions.cs" Link="Shared\Core\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="$(AzureStorageSharedSources)Constants.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureStorageSharedSources)Errors.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureStorageSharedSources)SasExtensions.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureStorageSharedSources)SasQueryParametersInternals.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureStorageSharedSources)SharedAccessSignatureCredentials.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureStorageSharedSources)StorageConnectionString.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureStorageSharedSources)StorageSharedKeyCredentialInternals.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureStorageSharedSources)UriExtensions.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(AzureStorageSharedSources)UriQueryParamsCollection.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\..\..\Azure.Storage.Internal.Avro\src\AvroParser.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\..\..\Azure.Storage.Internal.Avro\src\AvroConstants.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
<Compile Include="$(MSBuildThisFileDirectory)\..\..\Azure.Storage.Internal.Avro\src\AvroReader.cs" Link="Shared\%(RecursiveDir)\%(Filename)%(Extension)" /> | ||
</ItemGroup> | ||
</Project> |
66 changes: 66 additions & 0 deletions
66
sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/BlobChangeFeedAsyncPagable.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Text.Json; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Azure.Storage.Blobs; | ||
using Azure.Storage.Blobs.Models; | ||
using Azure.Storage.Blobs.ChangeFeed.Models; | ||
|
||
namespace Azure.Storage.Blobs.ChangeFeed | ||
{ | ||
/// <summary> | ||
/// BlobChangeFeedPagableAsync. | ||
/// </summary> | ||
public class BlobChangeFeedAsyncPagable : AsyncPageable<BlobChangeFeedEvent> | ||
{ | ||
private ChangeFeed _changeFeed; | ||
|
||
/// <summary> | ||
/// Internal constructor. | ||
/// </summary> | ||
internal BlobChangeFeedAsyncPagable( | ||
BlobServiceClient blobBerviceClient, | ||
DateTimeOffset? startTime = default, | ||
DateTimeOffset? endTime = default) | ||
{ | ||
_changeFeed = new ChangeFeed( | ||
blobBerviceClient, | ||
startTime, | ||
endTime); | ||
} | ||
|
||
internal BlobChangeFeedAsyncPagable( | ||
BlobServiceClient blobServiceClient, | ||
string continuation) | ||
{ | ||
_changeFeed = new ChangeFeed( | ||
blobServiceClient, | ||
continuation); | ||
} | ||
|
||
/// <summary> | ||
/// AsPages. | ||
/// </summary> | ||
/// <param name="continuationToken"></param> | ||
/// <param name="pageSizeHint"></param> | ||
/// <returns></returns> | ||
public override async IAsyncEnumerable<Page<BlobChangeFeedEvent>> AsPages( | ||
string continuationToken = null, | ||
int? pageSizeHint = null) | ||
{ | ||
while (_changeFeed.HasNext()) | ||
{ | ||
yield return await _changeFeed.GetPage( | ||
async: true, | ||
pageSize: pageSizeHint ?? 512).ConfigureAwait(false); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice readme. Thanks for writing it!