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

Added Change Feed #11692

Merged
Show file tree
Hide file tree
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 Apr 30, 2020
821c433
Added Chunk unit tests
seanmcc-msft Apr 30, 2020
e1e48b8
Added Shard tests
seanmcc-msft Apr 30, 2020
a838204
Added some Segment tests
seanmcc-msft May 1, 2020
2e0c2c2
changed service version back to 12-12
seanmcc-msft May 1, 2020
460887c
Added another Segment test
seanmcc-msft May 1, 2020
fb21295
Recorded tests
seanmcc-msft May 1, 2020
f728c6c
Merge branch 'feature/storage/stg73base' into feature/storage/changeFeed
seanmcc-msft May 1, 2020
f60dc32
Fixed build
seanmcc-msft May 1, 2020
6825791
Merge branch 'feature/storage/stg73base' into feature/storage/changeFeed
seanmcc-msft May 2, 2020
c629fed
Added factories to Chunk
seanmcc-msft May 6, 2020
60fc649
Added factories to Shard
seanmcc-msft May 6, 2020
39f5bc2
Most the way through adding Factories to Segment
seanmcc-msft May 6, 2020
52be7ed
Finished adding Factories to Segment
seanmcc-msft May 6, 2020
a1ec00f
Half way through adding Factories to Change Feed
seanmcc-msft May 6, 2020
265c1e8
Finshed adding Factories to Change Feed
seanmcc-msft May 7, 2020
4db0102
Moved Chunk initalization logic to ChunkFactory
seanmcc-msft May 7, 2020
68d772f
Re-recorded tests
seanmcc-msft May 7, 2020
4757ce3
Fixed CI
seanmcc-msft May 7, 2020
34e837e
PR comments
seanmcc-msft May 7, 2020
4e6cc08
Merge branch 'feature/storage/stg73base' into feature/storage/changeFeed
seanmcc-msft May 8, 2020
442c07a
Filled out readme
seanmcc-msft May 8, 2020
d50a2b7
Added samples
seanmcc-msft May 8, 2020
21bedda
PR comments
seanmcc-msft May 11, 2020
743207f
Merge branch 'feature/storage/stg73base' into feature/storage/changeFeed
seanmcc-msft May 12, 2020
e8ef59b
Merge branch 'feature/storage/stg73base' into feature/storage/changeFeed
seanmcc-msft May 26, 2020
85848d7
Merge branch 'feature/storage/stg73base' into feature/storage/changeFeed
seanmcc-msft May 27, 2020
353b928
Updated readme to pass CI
seanmcc-msft May 27, 2020
105c435
Fixed some edge cases and added tests
seanmcc-msft May 27, 2020
20d364d
fixed ending the change feed
seanmcc-msft May 27, 2020
669337b
PR comments
seanmcc-msft May 27, 2020
1a07ef1
PR comments
seanmcc-msft May 27, 2020
c942c1f
Changed default page size
seanmcc-msft May 28, 2020
83dba4d
PR comments
seanmcc-msft May 28, 2020
04431b3
PR comments
seanmcc-msft May 29, 2020
74e6e05
PR comments
seanmcc-msft Jun 1, 2020
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
1 change: 1 addition & 0 deletions eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<PackageReference Update="Azure.Storage.Files.Shares" Version="12.0.1" />
<PackageReference Update="Azure.Storage.Queues" Version="12.1.1" />
<PackageReference Update="Azure.Storage.Files.DataLake" Version="12.0.0" />
<PackageReference Update="Azure.Storage.Blobs.ChangeFeed" Version="12.0.0-preview.1" />
<PackageReference Update="BenchmarkDotNet" Version="0.11.5" />
<PackageReference Update="FsCheck.Xunit" Version="2.14.0" />
<PackageReference Update="Microsoft.Azure.Amqp" Version="[2.4.2, 3.0.0)" />
Expand Down
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.
4 changes: 4 additions & 0 deletions sdk/storage/Azure.Storage.Blobs.ChangeFeed/CHANGELOG.md
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.
20 changes: 20 additions & 0 deletions sdk/storage/Azure.Storage.Blobs.ChangeFeed/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Azure Storage Blobs Change Feed client library for .NET
Copy link
Member

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!


> Server Version: 2019-07-07
## Getting started
- TODO

## Key concepts
- TODO

## Examples
- TODO

## Troubleshooting
- TODO

## Next steps
- TODO

## Contributing
- TODO
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 sdk/storage/Azure.Storage.Blobs.ChangeFeed/samples/README.md
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
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);
}
}
}
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);
}
}
}
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 sdk/storage/Azure.Storage.Blobs.ChangeFeed/src/AssemblyInfo.cs
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")]
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>
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);
}
}
}
}
Loading